blob: e4b6bce8d2a540138a5d68fd0b62111b04511447 [file] [log] [blame]
Naveen Sampath04696f72022-06-13 15:19:14 +05301/*
2* Copyright 2022-present Open Networking Foundation
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14 */
15
16package intf
17
18import (
19 "context"
Tinoj Joseph429b9d92022-11-16 18:51:05 +053020 "time"
Naveen Sampath04696f72022-06-13 15:19:14 +053021
22 "voltha-go-controller/internal/pkg/holder"
23
24 ofp "github.com/opencord/voltha-protos/v5/go/openflow_13"
25)
26
27// VPClientCfg structure
28type VPClientCfg struct {
vinokuma926cb3e2023-03-29 11:41:06 +053029 VolthaClient *holder.VolthaServiceClientHolder
30 PacketOutChannel chan *ofp.PacketOut
31 TimeStamp time.Time
Naveen Sampath04696f72022-06-13 15:19:14 +053032 DeviceID string
33 SerialNum string
34 SouthBoundID string
Tinoj Joseph429b9d92022-11-16 18:51:05 +053035 MfrDesc string
36 HwDesc string
37 SwDesc string
Naveen Sampath04696f72022-06-13 15:19:14 +053038}
39
40// DiscoveryType type
41type DiscoveryType uint8
42
43const (
44 // DeviceDisc constant
45 DeviceDisc DiscoveryType = 0
46 // DeviceReDisc constant
47 DeviceReDisc DiscoveryType = 1
48)
49
50// IVPClient interface
51type IVPClient interface {
52 ChangeEvent(*ofp.ChangeEvent) error
Tinoj Joseph07cc5372022-07-18 22:53:51 +053053 PacketIn(context.Context, *ofp.PacketIn)
Naveen Sampath04696f72022-06-13 15:19:14 +053054 ConnectInd(cxt context.Context, DiscType DiscoveryType)
55 Stop()
56}
57
58// VPAgent interface
59type VPAgent interface {
60 receiveOltRebootNoti(ctx context.Context)
61 handleOltRebootNoti(ctx context.Context)
62}
63
64// IVPClientAgent interface
65type IVPClientAgent interface {
66 AddNewDevice(cfg *VPClientCfg)
Tinoj Joseph07cc5372022-07-18 22:53:51 +053067 DelDevice(cntx context.Context, id string)
Naveen Sampath04696f72022-06-13 15:19:14 +053068 IsRebootInProgressForDevice(device string) bool
69 // RebootInd(string, string, string)
70 IsBlockedDevice(string) bool
71 AddBlockedDevices(string)
72 DelBlockedDevices(string)
73}