Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 1 | /* |
| 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 Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 17 | //Package adaptercoreonu provides the utility for onu devices, flows and statistics |
| 18 | package adaptercoreonu |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 19 | |
| 20 | import ( |
| 21 | "context" |
| 22 | "errors" |
| 23 | "fmt" |
| 24 | "sync" |
| 25 | "time" |
| 26 | |
| 27 | "github.com/opencord/voltha-lib-go/v3/pkg/adapters/adapterif" |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 28 | "github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore" |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 29 | "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 Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 35 | "test.internal/openadapter/internal/pkg/config" |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | //OpenONUAC structure holds the ONU core information |
| 39 | type OpenONUAC struct { |
| 40 | deviceHandlers map[string]*DeviceHandler |
| 41 | coreProxy adapterif.CoreProxy |
| 42 | adapterProxy adapterif.AdapterProxy |
| 43 | eventProxy adapterif.EventProxy |
| 44 | kafkaICProxy kafka.InterContainerProxy |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 45 | kvClient kvstore.Client |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 46 | config *config.AdapterFlags |
| 47 | numOnus int |
| 48 | KVStoreHost string |
| 49 | KVStorePort int |
| 50 | KVStoreType string |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 51 | KVStoreTimeout time.Duration |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 52 | exitChannel chan int |
| 53 | HeartbeatCheckInterval time.Duration |
| 54 | HeartbeatFailReportInterval time.Duration |
| 55 | //GrpcTimeoutInterval time.Duration |
| 56 | lockDeviceHandlersMap sync.RWMutex |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 57 | pSupportedFsms *OmciDeviceFsms |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | //NewOpenONUAC returns a new instance of OpenONU_AC |
| 61 | func NewOpenONUAC(ctx context.Context, kafkaICProxy kafka.InterContainerProxy, |
| 62 | coreProxy adapterif.CoreProxy, adapterProxy adapterif.AdapterProxy, |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 63 | eventProxy adapterif.EventProxy, kvClient kvstore.Client, cfg *config.AdapterFlags) *OpenONUAC { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 64 | var openOnuAc OpenONUAC |
| 65 | openOnuAc.exitChannel = make(chan int, 1) |
| 66 | openOnuAc.deviceHandlers = make(map[string]*DeviceHandler) |
| 67 | openOnuAc.kafkaICProxy = kafkaICProxy |
| 68 | openOnuAc.config = cfg |
| 69 | openOnuAc.numOnus = cfg.OnuNumber |
| 70 | openOnuAc.coreProxy = coreProxy |
| 71 | openOnuAc.adapterProxy = adapterProxy |
| 72 | openOnuAc.eventProxy = eventProxy |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 73 | openOnuAc.kvClient = kvClient |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 74 | openOnuAc.KVStoreHost = cfg.KVStoreHost |
| 75 | openOnuAc.KVStorePort = cfg.KVStorePort |
| 76 | openOnuAc.KVStoreType = cfg.KVStoreType |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 77 | openOnuAc.KVStoreTimeout = cfg.KVStoreTimeout |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 78 | openOnuAc.HeartbeatCheckInterval = cfg.HeartbeatCheckInterval |
| 79 | openOnuAc.HeartbeatFailReportInterval = cfg.HeartbeatFailReportInterval |
| 80 | //openOnuAc.GrpcTimeoutInterval = cfg.GrpcTimeoutInterval |
| 81 | openOnuAc.lockDeviceHandlersMap = sync.RWMutex{} |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 82 | |
| 83 | openOnuAc.pSupportedFsms = &OmciDeviceFsms{ |
| 84 | "mib-synchronizer": { |
| 85 | //mibSyncFsm, // Implements the MIB synchronization state machine |
| 86 | MibDbVolatileDictImpl, // Implements volatile ME MIB database |
| 87 | true, // Advertise events on OpenOMCI event bus |
| 88 | cMibAuditDelayImpl, // Time to wait between MIB audits. 0 to disable audits. |
| 89 | // map[string]func() error{ |
| 90 | // "mib-upload": onuDeviceEntry.MibUploadTask, |
| 91 | // "mib-template": onuDeviceEntry.MibTemplateTask, |
| 92 | // "get-mds": onuDeviceEntry.GetMdsTask, |
| 93 | // "mib-audit": onuDeviceEntry.GetMdsTask, |
| 94 | // "mib-resync": onuDeviceEntry.MibResyncTask, |
| 95 | // "mib-reconcile": onuDeviceEntry.MibReconcileTask, |
| 96 | // }, |
| 97 | }, |
| 98 | } |
| 99 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 100 | return &openOnuAc |
| 101 | } |
| 102 | |
| 103 | //Start starts (logs) the adapter |
| 104 | func (oo *OpenONUAC) Start(ctx context.Context) error { |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 105 | logger.Info("starting-openonu-adapter") |
| 106 | logger.Info("openonu-adapter-started") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 107 | return nil |
| 108 | } |
| 109 | |
| 110 | //Stop terminates the session |
| 111 | func (oo *OpenONUAC) Stop(ctx context.Context) error { |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 112 | logger.Info("stopping-device-manager") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 113 | oo.exitChannel <- 1 |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 114 | logger.Info("device-manager-stopped") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 115 | return nil |
| 116 | } |
| 117 | |
| 118 | func (oo *OpenONUAC) addDeviceHandlerToMap(ctx context.Context, agent *DeviceHandler) { |
| 119 | oo.lockDeviceHandlersMap.Lock() |
| 120 | defer oo.lockDeviceHandlersMap.Unlock() |
| 121 | if _, exist := oo.deviceHandlers[agent.deviceID]; !exist { |
| 122 | oo.deviceHandlers[agent.deviceID] = agent |
| 123 | oo.deviceHandlers[agent.deviceID].Start(ctx) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | func (oo *OpenONUAC) deleteDeviceHandlerToMap(agent *DeviceHandler) { |
| 128 | oo.lockDeviceHandlersMap.Lock() |
| 129 | defer oo.lockDeviceHandlersMap.Unlock() |
| 130 | delete(oo.deviceHandlers, agent.deviceID) |
| 131 | } |
| 132 | |
| 133 | func (oo *OpenONUAC) getDeviceHandler(deviceID string) *DeviceHandler { |
| 134 | oo.lockDeviceHandlersMap.Lock() |
| 135 | defer oo.lockDeviceHandlersMap.Unlock() |
| 136 | if agent, ok := oo.deviceHandlers[deviceID]; ok { |
| 137 | return agent |
| 138 | } |
| 139 | return nil |
| 140 | } |
| 141 | |
| 142 | // Adapter interface required methods ############## begin ######### |
| 143 | // ################################################################# |
| 144 | |
| 145 | // for original content compare: (needs according deviceHandler methods) |
| 146 | // /voltha-openolt-adapter/adaptercore/openolt.go |
| 147 | |
| 148 | // Adopt_device creates a new device handler if not present already and then adopts the device |
| 149 | func (oo *OpenONUAC) Adopt_device(device *voltha.Device) error { |
| 150 | if device == nil { |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 151 | logger.Warn("voltha-device-is-nil") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 152 | return errors.New("nil-device") |
| 153 | } |
| 154 | ctx := context.Background() |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 155 | logger.Infow("adopt-device", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 156 | var handler *DeviceHandler |
| 157 | if handler = oo.getDeviceHandler(device.Id); handler == nil { |
| 158 | handler := NewDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo) |
| 159 | oo.addDeviceHandlerToMap(ctx, handler) |
| 160 | go handler.AdoptDevice(ctx, device) |
| 161 | // Launch the creation of the device topic |
| 162 | // go oo.createDeviceTopic(device) |
| 163 | } |
| 164 | return nil |
| 165 | } |
| 166 | |
| 167 | //Get_ofp_device_info returns OFP information for the given device |
| 168 | func (oo *OpenONUAC) Get_ofp_device_info(device *voltha.Device) (*ic.SwitchCapability, error) { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 169 | logger.Errorw("device-handler-not-set", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 170 | return nil, errors.New("device-handler-not-set") |
| 171 | } |
| 172 | |
| 173 | //Get_ofp_port_info returns OFP port information for the given device |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 174 | //200630: method removed as per [VOL-3202]: OF port info is now to be delivered within UniPort create |
| 175 | // cmp changes in onu_uni_port.go::CreateVolthaPort() |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 176 | |
| 177 | //Process_inter_adapter_message sends messages to a target device (between adapters) |
| 178 | func (oo *OpenONUAC) Process_inter_adapter_message(msg *ic.InterAdapterMessage) error { |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 179 | logger.Debugw("Process_inter_adapter_message", log.Fields{"msgId": msg.Header.Id, |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 180 | "msgProxyDeviceId": msg.Header.ProxyDeviceId, "msgToDeviceId": msg.Header.ToDeviceId}) |
| 181 | |
| 182 | targetDevice := msg.Header.ToDeviceId |
| 183 | //ToDeviceId should address an DeviceHandler instance |
| 184 | if handler := oo.getDeviceHandler(targetDevice); handler != nil { |
mpagenko | 1cc3cb4 | 2020-07-27 15:24:38 +0000 | [diff] [blame] | 185 | /* 200724: modification towards synchronous implementation - possible errors within processing shall be |
| 186 | * in the accordingly delayed response, some timing effect might result in Techprofile processing for multiple UNI's |
| 187 | */ |
| 188 | return handler.ProcessInterAdapterMessage(msg) |
| 189 | /* so far the processing has been in background with according commented error treatment restrictions: |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 190 | go handler.ProcessInterAdapterMessage(msg) |
| 191 | // error treatment might be more sophisticated |
| 192 | // by now let's just accept the message on 'communication layer' |
| 193 | // message content problems have to be evaluated then in the handler |
| 194 | // and are by now not reported to the calling party (to force what reaction there?) |
| 195 | return nil |
mpagenko | 1cc3cb4 | 2020-07-27 15:24:38 +0000 | [diff] [blame] | 196 | */ |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 197 | } |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 198 | logger.Warnw("no handler found for received Inter-Proxy-message", log.Fields{ |
| 199 | "msgToDeviceId": targetDevice}) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 200 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", targetDevice)) |
| 201 | } |
| 202 | |
| 203 | //Adapter_descriptor not implemented |
| 204 | func (oo *OpenONUAC) Adapter_descriptor() error { |
| 205 | return errors.New("unImplemented") |
| 206 | } |
| 207 | |
| 208 | //Device_types unimplemented |
| 209 | func (oo *OpenONUAC) Device_types() (*voltha.DeviceTypes, error) { |
| 210 | return nil, errors.New("unImplemented") |
| 211 | } |
| 212 | |
| 213 | //Health returns unimplemented |
| 214 | func (oo *OpenONUAC) Health() (*voltha.HealthStatus, error) { |
| 215 | return nil, errors.New("unImplemented") |
| 216 | } |
| 217 | |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 218 | //Reconcile_device is called once when the adapter needs to re-create device - usually on core restart |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 219 | func (oo *OpenONUAC) Reconcile_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 220 | logger.Debugw("Reconcile_device", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 221 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 222 | if err := handler.ReconcileDevice(device); err != nil { |
| 223 | return err |
| 224 | } |
| 225 | } else { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 226 | logger.Warnw("no handler found for device-reconcilement", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 227 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
| 228 | } |
| 229 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | //Abandon_device unimplemented |
| 233 | func (oo *OpenONUAC) Abandon_device(device *voltha.Device) error { |
| 234 | return errors.New("unImplemented") |
| 235 | } |
| 236 | |
| 237 | //Disable_device disables the given device |
| 238 | func (oo *OpenONUAC) Disable_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 239 | logger.Debugw("Disable_device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 240 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 241 | go handler.DisableDevice(device) |
| 242 | return nil |
| 243 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 244 | logger.Warnw("no handler found for device-disable", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 245 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 248 | //Reenable_device enables the onu device after disable |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 249 | func (oo *OpenONUAC) Reenable_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 250 | logger.Debugw("Reenable_device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 251 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 252 | go handler.ReenableDevice(device) |
| 253 | return nil |
| 254 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 255 | logger.Warnw("no handler found for device-reenable", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 256 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | //Reboot_device reboots the given device |
| 260 | func (oo *OpenONUAC) Reboot_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 261 | logger.Debugw("Reboot-device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | e11479f | 2020-07-06 09:44:47 +0300 | [diff] [blame] | 262 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 263 | go handler.RebootDevice(device) |
| 264 | return nil |
| 265 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 266 | logger.Warnw("no handler found for device-reboot", log.Fields{"device-id": device.Id}) |
ozgecanetsia | e11479f | 2020-07-06 09:44:47 +0300 | [diff] [blame] | 267 | return fmt.Errorf(fmt.Sprintf("handler-not-found-#{device.Id}")) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 268 | } |
| 269 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 270 | //Self_test_device unimplemented |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 271 | func (oo *OpenONUAC) Self_test_device(device *voltha.Device) error { |
| 272 | return errors.New("unImplemented") |
| 273 | } |
| 274 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 275 | func (oo *OpenONUAC) Delete_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 276 | logger.Debugw("Delete_device", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 277 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 278 | if err := handler.DeleteDevice(device); err != nil { |
| 279 | return err |
| 280 | } |
| 281 | } else { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame^] | 282 | logger.Warnw("no handler found for device-reconcilement", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 283 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
| 284 | } |
| 285 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | //Get_device_details unimplemented |
| 289 | func (oo *OpenONUAC) Get_device_details(device *voltha.Device) error { |
| 290 | return errors.New("unImplemented") |
| 291 | } |
| 292 | |
| 293 | //Update_flows_bulk returns |
| 294 | func (oo *OpenONUAC) Update_flows_bulk(device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error { |
| 295 | return errors.New("unImplemented") |
| 296 | } |
| 297 | |
| 298 | //Update_flows_incrementally updates (add/remove) the flows on a given device |
| 299 | func (oo *OpenONUAC) Update_flows_incrementally(device *voltha.Device, flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error { |
mpagenko | 3dbcdd2 | 2020-07-22 07:38:45 +0000 | [diff] [blame] | 300 | // return errors.New("unImplemented") |
| 301 | // testwise: just acknowledge to see, if that avoids ongoing TechProfile config sequences ... |
| 302 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | //Update_pm_config returns PmConfigs nil or error |
| 306 | func (oo *OpenONUAC) Update_pm_config(device *voltha.Device, pmConfigs *voltha.PmConfigs) error { |
| 307 | return errors.New("unImplemented") |
| 308 | } |
| 309 | |
| 310 | //Receive_packet_out sends packet out to the device |
| 311 | func (oo *OpenONUAC) Receive_packet_out(deviceID string, egressPortNo int, packet *openflow_13.OfpPacketOut) error { |
| 312 | return errors.New("unImplemented") |
| 313 | } |
| 314 | |
| 315 | //Suppress_event unimplemented |
| 316 | func (oo *OpenONUAC) Suppress_event(filter *voltha.EventFilter) error { |
| 317 | return errors.New("unImplemented") |
| 318 | } |
| 319 | |
| 320 | //Unsuppress_event unimplemented |
| 321 | func (oo *OpenONUAC) Unsuppress_event(filter *voltha.EventFilter) error { |
| 322 | return errors.New("unImplemented") |
| 323 | } |
| 324 | |
| 325 | //Download_image unimplemented |
| 326 | func (oo *OpenONUAC) Download_image(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 327 | return nil, errors.New("unImplemented") |
| 328 | } |
| 329 | |
| 330 | //Get_image_download_status unimplemented |
| 331 | func (oo *OpenONUAC) Get_image_download_status(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 332 | return nil, errors.New("unImplemented") |
| 333 | } |
| 334 | |
| 335 | //Cancel_image_download unimplemented |
| 336 | func (oo *OpenONUAC) Cancel_image_download(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 337 | return nil, errors.New("unImplemented") |
| 338 | } |
| 339 | |
| 340 | //Activate_image_update unimplemented |
| 341 | func (oo *OpenONUAC) Activate_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 342 | return nil, errors.New("unImplemented") |
| 343 | } |
| 344 | |
| 345 | //Revert_image_update unimplemented |
| 346 | func (oo *OpenONUAC) Revert_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 347 | return nil, errors.New("unImplemented") |
| 348 | } |
| 349 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 350 | // Enable_port to Enable PON/NNI interface - seems not to be used/required according to python code |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 351 | func (oo *OpenONUAC) Enable_port(deviceID string, port *voltha.Port) error { |
| 352 | return errors.New("unImplemented") |
| 353 | } |
| 354 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 355 | // Disable_port to Disable pon/nni interface - seems not to be used/required according to python code |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 356 | func (oo *OpenONUAC) Disable_port(deviceID string, port *voltha.Port) error { |
| 357 | return errors.New("unImplemented") |
| 358 | } |
| 359 | |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 360 | //needed for if update >= 3.1.x |
Matteo Scandolo | 2e6f1e3 | 2020-04-15 11:28:45 -0700 | [diff] [blame] | 361 | func (oo *OpenONUAC) Child_device_lost(deviceID string, pPortNo uint32, onuID uint32) error { |
| 362 | return errors.New("unImplemented") |
| 363 | } |
| 364 | |
| 365 | func (oo *OpenONUAC) Start_omci_test(device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error) { |
| 366 | return nil, errors.New("unImplemented") |
| 367 | } |
| 368 | |
Matteo Scandolo | d132c0e | 2020-04-24 17:06:25 -0700 | [diff] [blame] | 369 | func (oo *OpenONUAC) Get_ext_value(deviceID string, device *voltha.Device, valueparam voltha.ValueType_Type) (*voltha.ReturnValues, error) { |
| 370 | return nil, errors.New("unImplemented") |
| 371 | } |
| 372 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 373 | // Adapter interface required methods ################ end ######### |
| 374 | // ################################################################# |