blob: dbf3418f7c9447c63c56e49fa6adeb815fc23a05 [file] [log] [blame]
kdarapu283d1542019-07-31 17:21:11 +05301/*
2 * Copyright 2018-present Open Networking Foundation
3
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package adapterif
18
19import (
20 "context"
21
serkant.uluderya2ae470f2020-01-21 11:13:09 -080022 "github.com/opencord/voltha-protos/v3/go/voltha"
kdarapu283d1542019-07-31 17:21:11 +053023)
24
25// CoreProxy interface for voltha-go coreproxy.
26type CoreProxy interface {
27 UpdateCoreReference(deviceID string, coreReference string)
28 DeleteCoreReference(deviceID string)
29 // getCoreTopic(deviceID string) kafka.Topic
30 //GetAdapterTopic(args ...string) kafka.Topic
31 // getAdapterTopic(args ...string) kafka.Topic
32 RegisterAdapter(ctx context.Context, adapter *voltha.Adapter, deviceTypes *voltha.DeviceTypes) error
33 DeviceUpdate(ctx context.Context, device *voltha.Device) error
34 PortCreated(ctx context.Context, deviceID string, port *voltha.Port) error
serkant.uluderya2ae470f2020-01-21 11:13:09 -080035 PortsStateUpdate(ctx context.Context, deviceID string, operStatus voltha.OperStatus_Types) error
kdarapu283d1542019-07-31 17:21:11 +053036 DeleteAllPorts(ctx context.Context, deviceID string) error
37 DeviceStateUpdate(ctx context.Context, deviceID string,
serkant.uluderya2ae470f2020-01-21 11:13:09 -080038 connStatus voltha.ConnectStatus_Types, operStatus voltha.OperStatus_Types) error
kdarapu283d1542019-07-31 17:21:11 +053039
Naga Manjunathe0217352019-11-01 15:55:40 +053040 DevicePMConfigUpdate(ctx context.Context, pmConfigs *voltha.PmConfigs) error
kdarapu283d1542019-07-31 17:21:11 +053041 ChildDeviceDetected(ctx context.Context, parentDeviceID string, parentPortNo int,
42 childDeviceType string, channelID int, vendorID string, serialNumber string, onuID int64) (*voltha.Device, error)
43
44 ChildDevicesLost(ctx context.Context, parentDeviceID string) error
45 ChildDevicesDetected(ctx context.Context, parentDeviceID string) error
46 GetDevice(ctx context.Context, parentDeviceID string, deviceID string) (*voltha.Device, error)
47 GetChildDevice(ctx context.Context, parentDeviceID string, kwargs map[string]interface{}) (*voltha.Device, error)
48 GetChildDevices(ctx context.Context, parentDeviceID string) (*voltha.Devices, error)
49 SendPacketIn(ctx context.Context, deviceID string, port uint32, pktPayload []byte) error
Mahir Gunyelfdee9212019-10-16 16:52:21 -070050 DeviceReasonUpdate(ctx context.Context, deviceID string, deviceReason string) error
serkant.uluderya2ae470f2020-01-21 11:13:09 -080051 PortStateUpdate(ctx context.Context, deviceID string, pType voltha.Port_PortType, portNo uint32,
52 operStatus voltha.OperStatus_Types) error
kdarapu283d1542019-07-31 17:21:11 +053053}