blob: 61b52f308cb44a0241b3a44af56cd7c8fe84eb19 [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
2 * Copyright 2020-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
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +000017//Package adaptercoreonu provides the utility for onu devices, flows and statistics
18package adaptercoreonu
Holger Hildebrandtfa074992020-03-27 15:42:06 +000019
20import (
21 "context"
22 "errors"
23 "fmt"
24 "sync"
25 "time"
26
27 "github.com/opencord/voltha-lib-go/v3/pkg/adapters/adapterif"
mpagenkoaf801632020-07-03 10:00:42 +000028 "github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore"
Holger Hildebrandtfa074992020-03-27 15:42:06 +000029 "github.com/opencord/voltha-lib-go/v3/pkg/kafka"
30 "github.com/opencord/voltha-lib-go/v3/pkg/log"
31 ic "github.com/opencord/voltha-protos/v3/go/inter_container"
32 "github.com/opencord/voltha-protos/v3/go/openflow_13"
33 "github.com/opencord/voltha-protos/v3/go/voltha"
34
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +000035 "test.internal/openadapter/internal/pkg/config"
Holger Hildebrandtfa074992020-03-27 15:42:06 +000036)
37
38//OpenONUAC structure holds the ONU core information
39type OpenONUAC struct {
Himani Chawla6d2ae152020-09-02 13:11:20 +053040 deviceHandlers map[string]*deviceHandler
Holger Hildebrandtfa074992020-03-27 15:42:06 +000041 coreProxy adapterif.CoreProxy
42 adapterProxy adapterif.AdapterProxy
43 eventProxy adapterif.EventProxy
44 kafkaICProxy kafka.InterContainerProxy
mpagenkoaf801632020-07-03 10:00:42 +000045 kvClient kvstore.Client
Holger Hildebrandtfa074992020-03-27 15:42:06 +000046 config *config.AdapterFlags
47 numOnus int
48 KVStoreHost string
49 KVStorePort int
50 KVStoreType string
mpagenkoaf801632020-07-03 10:00:42 +000051 KVStoreTimeout time.Duration
Holger Hildebrandtfa074992020-03-27 15:42:06 +000052 exitChannel chan int
53 HeartbeatCheckInterval time.Duration
54 HeartbeatFailReportInterval time.Duration
mpagenkodff5dda2020-08-28 11:52:01 +000055 AcceptIncrementalEvto bool
Holger Hildebrandtfa074992020-03-27 15:42:06 +000056 //GrpcTimeoutInterval time.Duration
57 lockDeviceHandlersMap sync.RWMutex
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +000058 pSupportedFsms *OmciDeviceFsms
Holger Hildebrandtfa074992020-03-27 15:42:06 +000059}
60
61//NewOpenONUAC returns a new instance of OpenONU_AC
62func NewOpenONUAC(ctx context.Context, kafkaICProxy kafka.InterContainerProxy,
63 coreProxy adapterif.CoreProxy, adapterProxy adapterif.AdapterProxy,
mpagenkoaf801632020-07-03 10:00:42 +000064 eventProxy adapterif.EventProxy, kvClient kvstore.Client, cfg *config.AdapterFlags) *OpenONUAC {
Holger Hildebrandtfa074992020-03-27 15:42:06 +000065 var openOnuAc OpenONUAC
66 openOnuAc.exitChannel = make(chan int, 1)
Himani Chawla6d2ae152020-09-02 13:11:20 +053067 openOnuAc.deviceHandlers = make(map[string]*deviceHandler)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000068 openOnuAc.kafkaICProxy = kafkaICProxy
69 openOnuAc.config = cfg
70 openOnuAc.numOnus = cfg.OnuNumber
71 openOnuAc.coreProxy = coreProxy
72 openOnuAc.adapterProxy = adapterProxy
73 openOnuAc.eventProxy = eventProxy
mpagenkoaf801632020-07-03 10:00:42 +000074 openOnuAc.kvClient = kvClient
Holger Hildebrandtfa074992020-03-27 15:42:06 +000075 openOnuAc.KVStoreHost = cfg.KVStoreHost
76 openOnuAc.KVStorePort = cfg.KVStorePort
77 openOnuAc.KVStoreType = cfg.KVStoreType
mpagenkoaf801632020-07-03 10:00:42 +000078 openOnuAc.KVStoreTimeout = cfg.KVStoreTimeout
Holger Hildebrandtfa074992020-03-27 15:42:06 +000079 openOnuAc.HeartbeatCheckInterval = cfg.HeartbeatCheckInterval
80 openOnuAc.HeartbeatFailReportInterval = cfg.HeartbeatFailReportInterval
mpagenkodff5dda2020-08-28 11:52:01 +000081 openOnuAc.AcceptIncrementalEvto = cfg.AccIncrEvto
Holger Hildebrandtfa074992020-03-27 15:42:06 +000082 //openOnuAc.GrpcTimeoutInterval = cfg.GrpcTimeoutInterval
83 openOnuAc.lockDeviceHandlersMap = sync.RWMutex{}
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +000084
85 openOnuAc.pSupportedFsms = &OmciDeviceFsms{
86 "mib-synchronizer": {
87 //mibSyncFsm, // Implements the MIB synchronization state machine
Himani Chawla6d2ae152020-09-02 13:11:20 +053088 mibDbVolatileDictImpl, // Implements volatile ME MIB database
Himani Chawla4d908332020-08-31 12:30:20 +053089 //true, // Advertise events on OpenOMCI event bus
90 cMibAuditDelayImpl, // Time to wait between MIB audits. 0 to disable audits.
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +000091 // map[string]func() error{
92 // "mib-upload": onuDeviceEntry.MibUploadTask,
93 // "mib-template": onuDeviceEntry.MibTemplateTask,
94 // "get-mds": onuDeviceEntry.GetMdsTask,
95 // "mib-audit": onuDeviceEntry.GetMdsTask,
96 // "mib-resync": onuDeviceEntry.MibResyncTask,
97 // "mib-reconcile": onuDeviceEntry.MibReconcileTask,
98 // },
99 },
100 }
101
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000102 return &openOnuAc
103}
104
105//Start starts (logs) the adapter
106func (oo *OpenONUAC) Start(ctx context.Context) error {
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000107 logger.Info("starting-openonu-adapter")
108 logger.Info("openonu-adapter-started")
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000109 return nil
110}
111
Himani Chawla6d2ae152020-09-02 13:11:20 +0530112/*
113//stop terminates the session
114func (oo *OpenONUAC) stop(ctx context.Context) error {
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000115 logger.Info("stopping-device-manager")
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000116 oo.exitChannel <- 1
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000117 logger.Info("device-manager-stopped")
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000118 return nil
119}
Himani Chawla6d2ae152020-09-02 13:11:20 +0530120*/
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000121
Himani Chawla6d2ae152020-09-02 13:11:20 +0530122func (oo *OpenONUAC) addDeviceHandlerToMap(ctx context.Context, agent *deviceHandler) {
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000123 oo.lockDeviceHandlersMap.Lock()
124 defer oo.lockDeviceHandlersMap.Unlock()
125 if _, exist := oo.deviceHandlers[agent.deviceID]; !exist {
126 oo.deviceHandlers[agent.deviceID] = agent
Himani Chawla6d2ae152020-09-02 13:11:20 +0530127 oo.deviceHandlers[agent.deviceID].start(ctx)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000128 }
129}
130
Himani Chawla4d908332020-08-31 12:30:20 +0530131/*
Himani Chawla6d2ae152020-09-02 13:11:20 +0530132func (oo *OpenONUAC) deleteDeviceHandlerToMap(agent *deviceHandler) {
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000133 oo.lockDeviceHandlersMap.Lock()
134 defer oo.lockDeviceHandlersMap.Unlock()
135 delete(oo.deviceHandlers, agent.deviceID)
136}
Himani Chawla4d908332020-08-31 12:30:20 +0530137*/
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000138
Himani Chawla6d2ae152020-09-02 13:11:20 +0530139func (oo *OpenONUAC) getDeviceHandler(deviceID string) *deviceHandler {
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000140 oo.lockDeviceHandlersMap.Lock()
141 defer oo.lockDeviceHandlersMap.Unlock()
142 if agent, ok := oo.deviceHandlers[deviceID]; ok {
143 return agent
144 }
145 return nil
146}
147
148// Adapter interface required methods ############## begin #########
149// #################################################################
150
151// for original content compare: (needs according deviceHandler methods)
152// /voltha-openolt-adapter/adaptercore/openolt.go
153
154// Adopt_device creates a new device handler if not present already and then adopts the device
155func (oo *OpenONUAC) Adopt_device(device *voltha.Device) error {
156 if device == nil {
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000157 logger.Warn("voltha-device-is-nil")
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000158 return errors.New("nil-device")
159 }
160 ctx := context.Background()
divyadesai4d299552020-08-18 07:13:49 +0000161 logger.Infow("adopt-device", log.Fields{"device-id": device.Id})
Himani Chawla6d2ae152020-09-02 13:11:20 +0530162 var handler *deviceHandler
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000163 if handler = oo.getDeviceHandler(device.Id); handler == nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530164 handler := newDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000165 oo.addDeviceHandlerToMap(ctx, handler)
Himani Chawla6d2ae152020-09-02 13:11:20 +0530166 go handler.adoptOrReconcileDevice(ctx, device)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000167 // Launch the creation of the device topic
168 // go oo.createDeviceTopic(device)
169 }
170 return nil
171}
172
173//Get_ofp_device_info returns OFP information for the given device
174func (oo *OpenONUAC) Get_ofp_device_info(device *voltha.Device) (*ic.SwitchCapability, error) {
divyadesai4d299552020-08-18 07:13:49 +0000175 logger.Errorw("device-handler-not-set", log.Fields{"device-id": device.Id})
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000176 return nil, errors.New("device-handler-not-set")
177}
178
179//Get_ofp_port_info returns OFP port information for the given device
mpagenkoaf801632020-07-03 10:00:42 +0000180//200630: method removed as per [VOL-3202]: OF port info is now to be delivered within UniPort create
181// cmp changes in onu_uni_port.go::CreateVolthaPort()
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000182
183//Process_inter_adapter_message sends messages to a target device (between adapters)
184func (oo *OpenONUAC) Process_inter_adapter_message(msg *ic.InterAdapterMessage) error {
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000185 logger.Debugw("Process_inter_adapter_message", log.Fields{"msgId": msg.Header.Id,
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000186 "msgProxyDeviceId": msg.Header.ProxyDeviceId, "msgToDeviceId": msg.Header.ToDeviceId})
187
188 targetDevice := msg.Header.ToDeviceId
189 //ToDeviceId should address an DeviceHandler instance
190 if handler := oo.getDeviceHandler(targetDevice); handler != nil {
mpagenko1cc3cb42020-07-27 15:24:38 +0000191 /* 200724: modification towards synchronous implementation - possible errors within processing shall be
192 * in the accordingly delayed response, some timing effect might result in Techprofile processing for multiple UNI's
193 */
Himani Chawla6d2ae152020-09-02 13:11:20 +0530194 return handler.processInterAdapterMessage(msg)
mpagenko1cc3cb42020-07-27 15:24:38 +0000195 /* so far the processing has been in background with according commented error treatment restrictions:
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000196 go handler.ProcessInterAdapterMessage(msg)
197 // error treatment might be more sophisticated
198 // by now let's just accept the message on 'communication layer'
199 // message content problems have to be evaluated then in the handler
200 // and are by now not reported to the calling party (to force what reaction there?)
201 return nil
mpagenko1cc3cb42020-07-27 15:24:38 +0000202 */
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000203 }
Holger Hildebrandtccd390c2020-05-29 13:49:04 +0000204 logger.Warnw("no handler found for received Inter-Proxy-message", log.Fields{
205 "msgToDeviceId": targetDevice})
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000206 return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", targetDevice))
207}
208
209//Adapter_descriptor not implemented
210func (oo *OpenONUAC) Adapter_descriptor() error {
211 return errors.New("unImplemented")
212}
213
214//Device_types unimplemented
215func (oo *OpenONUAC) Device_types() (*voltha.DeviceTypes, error) {
216 return nil, errors.New("unImplemented")
217}
218
219//Health returns unimplemented
220func (oo *OpenONUAC) Health() (*voltha.HealthStatus, error) {
221 return nil, errors.New("unImplemented")
222}
223
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000224//Reconcile_device is called once when the adapter needs to re-create device - usually on core restart
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000225func (oo *OpenONUAC) Reconcile_device(device *voltha.Device) error {
Holger Hildebrandtf41a1602020-08-19 09:52:50 +0000226 if device == nil {
227 logger.Warn("voltha-device-is-nil")
228 return errors.New("nil-device")
229 }
230 ctx := context.Background()
231 logger.Infow("Reconcile_device", log.Fields{"device-id": device.Id})
Himani Chawla6d2ae152020-09-02 13:11:20 +0530232 var handler *deviceHandler
Holger Hildebrandtf41a1602020-08-19 09:52:50 +0000233 if handler = oo.getDeviceHandler(device.Id); handler == nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530234 handler := newDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo)
Holger Hildebrandtf41a1602020-08-19 09:52:50 +0000235 oo.addDeviceHandlerToMap(ctx, handler)
236 handler.device = device
237 handler.reconciling = true
Himani Chawla6d2ae152020-09-02 13:11:20 +0530238 go handler.adoptOrReconcileDevice(ctx, handler.device)
Holger Hildebrandtf41a1602020-08-19 09:52:50 +0000239 // reconcilement will be continued after onu-device entry is added
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000240 } else {
Holger Hildebrandtf41a1602020-08-19 09:52:50 +0000241 return fmt.Errorf(fmt.Sprintf("device-already-reconciled-or-active-%s", device.Id))
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000242 }
243 return nil
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000244}
245
246//Abandon_device unimplemented
247func (oo *OpenONUAC) Abandon_device(device *voltha.Device) error {
248 return errors.New("unImplemented")
249}
250
251//Disable_device disables the given device
252func (oo *OpenONUAC) Disable_device(device *voltha.Device) error {
divyadesai4d299552020-08-18 07:13:49 +0000253 logger.Debugw("Disable_device", log.Fields{"device-id": device.Id})
ozgecanetsiafce57b12020-05-25 14:39:35 +0300254 if handler := oo.getDeviceHandler(device.Id); handler != nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530255 go handler.disableDevice(device)
ozgecanetsiafce57b12020-05-25 14:39:35 +0300256 return nil
257 }
divyadesai4d299552020-08-18 07:13:49 +0000258 logger.Warnw("no handler found for device-disable", log.Fields{"device-id": device.Id})
ozgecanetsiafce57b12020-05-25 14:39:35 +0300259 return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000260}
261
Holger Hildebrandtccd390c2020-05-29 13:49:04 +0000262//Reenable_device enables the onu device after disable
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000263func (oo *OpenONUAC) Reenable_device(device *voltha.Device) error {
divyadesai4d299552020-08-18 07:13:49 +0000264 logger.Debugw("Reenable_device", log.Fields{"device-id": device.Id})
ozgecanetsiafce57b12020-05-25 14:39:35 +0300265 if handler := oo.getDeviceHandler(device.Id); handler != nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530266 go handler.reEnableDevice(device)
ozgecanetsiafce57b12020-05-25 14:39:35 +0300267 return nil
268 }
divyadesai4d299552020-08-18 07:13:49 +0000269 logger.Warnw("no handler found for device-reenable", log.Fields{"device-id": device.Id})
ozgecanetsiafce57b12020-05-25 14:39:35 +0300270 return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000271}
272
273//Reboot_device reboots the given device
274func (oo *OpenONUAC) Reboot_device(device *voltha.Device) error {
divyadesai4d299552020-08-18 07:13:49 +0000275 logger.Debugw("Reboot-device", log.Fields{"device-id": device.Id})
ozgecanetsiae11479f2020-07-06 09:44:47 +0300276 if handler := oo.getDeviceHandler(device.Id); handler != nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530277 go handler.rebootDevice(device)
ozgecanetsiae11479f2020-07-06 09:44:47 +0300278 return nil
279 }
divyadesai4d299552020-08-18 07:13:49 +0000280 logger.Warnw("no handler found for device-reboot", log.Fields{"device-id": device.Id})
ozgecanetsiae11479f2020-07-06 09:44:47 +0300281 return fmt.Errorf(fmt.Sprintf("handler-not-found-#{device.Id}"))
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000282}
283
Holger Hildebrandtccd390c2020-05-29 13:49:04 +0000284//Self_test_device unimplemented
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000285func (oo *OpenONUAC) Self_test_device(device *voltha.Device) error {
286 return errors.New("unImplemented")
287}
288
Himani Chawla6d2ae152020-09-02 13:11:20 +0530289// Delete_device deletes the given device
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000290func (oo *OpenONUAC) Delete_device(device *voltha.Device) error {
divyadesai4d299552020-08-18 07:13:49 +0000291 logger.Debugw("Delete_device", log.Fields{"device-id": device.Id})
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000292 if handler := oo.getDeviceHandler(device.Id); handler != nil {
Himani Chawla6d2ae152020-09-02 13:11:20 +0530293 if err := handler.deleteDevice(device); err != nil {
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000294 return err
295 }
296 } else {
divyadesai4d299552020-08-18 07:13:49 +0000297 logger.Warnw("no handler found for device-reconcilement", log.Fields{"device-id": device.Id})
Holger Hildebrandt9ca8b132020-08-07 14:45:03 +0000298 return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
299 }
300 return nil
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000301}
302
303//Get_device_details unimplemented
304func (oo *OpenONUAC) Get_device_details(device *voltha.Device) error {
305 return errors.New("unImplemented")
306}
307
308//Update_flows_bulk returns
309func (oo *OpenONUAC) Update_flows_bulk(device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error {
310 return errors.New("unImplemented")
311}
312
313//Update_flows_incrementally updates (add/remove) the flows on a given device
mpagenkodff5dda2020-08-28 11:52:01 +0000314func (oo *OpenONUAC) Update_flows_incrementally(device *voltha.Device,
315 flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error {
316 // no point in pushing omci flows if the device isn't reachable
317 if device.ConnectStatus != voltha.ConnectStatus_REACHABLE ||
318 device.AdminState != voltha.AdminState_ENABLED {
319 logger.Warnw("device disabled or offline - skipping flow-update", log.Fields{"deviceId": device.Id})
320 return errors.New("non-matching device state")
321 }
322
323 // For now, there is no support for group changes (as in the actual Py-adapter code)
324 if groups.ToAdd != nil && groups.ToAdd.Items != nil {
325 logger.Debugw("Update-flow-incr: group add not supported (ignored)", log.Fields{"deviceId": device.Id})
326 }
327 if groups.ToRemove != nil && groups.ToRemove.Items != nil {
328 logger.Debugw("Update-flow-incr: group remove not supported (ignored)", log.Fields{"deviceId": device.Id})
329 }
330 if groups.ToUpdate != nil && groups.ToUpdate.Items != nil {
331 logger.Debugw("Update-flow-incr: group update not supported (ignored)", log.Fields{"deviceId": device.Id})
332 }
333
334 if handler := oo.getDeviceHandler(device.Id); handler != nil {
335 err := handler.FlowUpdateIncremental(flows, groups, flowMetadata)
336 return err
337 }
338 logger.Warnw("no handler found for incremental flow update", log.Fields{"deviceId": device.Id})
339 return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000340}
341
342//Update_pm_config returns PmConfigs nil or error
343func (oo *OpenONUAC) Update_pm_config(device *voltha.Device, pmConfigs *voltha.PmConfigs) error {
344 return errors.New("unImplemented")
345}
346
347//Receive_packet_out sends packet out to the device
348func (oo *OpenONUAC) Receive_packet_out(deviceID string, egressPortNo int, packet *openflow_13.OfpPacketOut) error {
349 return errors.New("unImplemented")
350}
351
352//Suppress_event unimplemented
353func (oo *OpenONUAC) Suppress_event(filter *voltha.EventFilter) error {
354 return errors.New("unImplemented")
355}
356
357//Unsuppress_event unimplemented
358func (oo *OpenONUAC) Unsuppress_event(filter *voltha.EventFilter) error {
359 return errors.New("unImplemented")
360}
361
362//Download_image unimplemented
363func (oo *OpenONUAC) Download_image(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) {
364 return nil, errors.New("unImplemented")
365}
366
367//Get_image_download_status unimplemented
368func (oo *OpenONUAC) Get_image_download_status(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) {
369 return nil, errors.New("unImplemented")
370}
371
372//Cancel_image_download unimplemented
373func (oo *OpenONUAC) Cancel_image_download(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) {
374 return nil, errors.New("unImplemented")
375}
376
377//Activate_image_update unimplemented
378func (oo *OpenONUAC) Activate_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) {
379 return nil, errors.New("unImplemented")
380}
381
382//Revert_image_update unimplemented
383func (oo *OpenONUAC) Revert_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) {
384 return nil, errors.New("unImplemented")
385}
386
Holger Hildebrandtccd390c2020-05-29 13:49:04 +0000387// Enable_port to Enable PON/NNI interface - seems not to be used/required according to python code
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000388func (oo *OpenONUAC) Enable_port(deviceID string, port *voltha.Port) error {
389 return errors.New("unImplemented")
390}
391
Holger Hildebrandtccd390c2020-05-29 13:49:04 +0000392// Disable_port to Disable pon/nni interface - seems not to be used/required according to python code
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000393func (oo *OpenONUAC) Disable_port(deviceID string, port *voltha.Port) error {
394 return errors.New("unImplemented")
395}
396
Himani Chawla6d2ae152020-09-02 13:11:20 +0530397//Child_device_lost - unimplemented
Holger Hildebrandt0f9b88d2020-04-20 13:33:25 +0000398//needed for if update >= 3.1.x
Matteo Scandolo2e6f1e32020-04-15 11:28:45 -0700399func (oo *OpenONUAC) Child_device_lost(deviceID string, pPortNo uint32, onuID uint32) error {
400 return errors.New("unImplemented")
401}
402
Himani Chawla6d2ae152020-09-02 13:11:20 +0530403// Start_omci_test unimplemented
Matteo Scandolo2e6f1e32020-04-15 11:28:45 -0700404func (oo *OpenONUAC) Start_omci_test(device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error) {
405 return nil, errors.New("unImplemented")
406}
407
Himani Chawla6d2ae152020-09-02 13:11:20 +0530408// Get_ext_value - unimplemented
Matteo Scandolod132c0e2020-04-24 17:06:25 -0700409func (oo *OpenONUAC) Get_ext_value(deviceID string, device *voltha.Device, valueparam voltha.ValueType_Type) (*voltha.ReturnValues, error) {
410 return nil, errors.New("unImplemented")
411}
412
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000413// Adapter interface required methods ################ end #########
414// #################################################################