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) |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 160 | go handler.AdoptOrReconcileDevice(ctx, device) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 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 { |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 220 | if device == nil { |
| 221 | logger.Warn("voltha-device-is-nil") |
| 222 | return errors.New("nil-device") |
| 223 | } |
| 224 | ctx := context.Background() |
| 225 | logger.Infow("Reconcile_device", log.Fields{"device-id": device.Id}) |
| 226 | var handler *DeviceHandler |
| 227 | if handler = oo.getDeviceHandler(device.Id); handler == nil { |
| 228 | handler := NewDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo) |
| 229 | oo.addDeviceHandlerToMap(ctx, handler) |
| 230 | handler.device = device |
| 231 | handler.reconciling = true |
| 232 | go handler.AdoptOrReconcileDevice(ctx, handler.device) |
| 233 | // reconcilement will be continued after onu-device entry is added |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 234 | } else { |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 235 | return fmt.Errorf(fmt.Sprintf("device-already-reconciled-or-active-%s", device.Id)) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 236 | } |
| 237 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | //Abandon_device unimplemented |
| 241 | func (oo *OpenONUAC) Abandon_device(device *voltha.Device) error { |
| 242 | return errors.New("unImplemented") |
| 243 | } |
| 244 | |
| 245 | //Disable_device disables the given device |
| 246 | func (oo *OpenONUAC) Disable_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 247 | logger.Debugw("Disable_device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 248 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 249 | go handler.DisableDevice(device) |
| 250 | return nil |
| 251 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 252 | 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] | 253 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 254 | } |
| 255 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 256 | //Reenable_device enables the onu device after disable |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 257 | func (oo *OpenONUAC) Reenable_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 258 | logger.Debugw("Reenable_device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 259 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 260 | go handler.ReenableDevice(device) |
| 261 | return nil |
| 262 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 263 | 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] | 264 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | //Reboot_device reboots the given device |
| 268 | func (oo *OpenONUAC) Reboot_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 269 | logger.Debugw("Reboot-device", log.Fields{"device-id": device.Id}) |
ozgecanetsia | e11479f | 2020-07-06 09:44:47 +0300 | [diff] [blame] | 270 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 271 | go handler.RebootDevice(device) |
| 272 | return nil |
| 273 | } |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 274 | 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] | 275 | return fmt.Errorf(fmt.Sprintf("handler-not-found-#{device.Id}")) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 278 | //Self_test_device unimplemented |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 279 | func (oo *OpenONUAC) Self_test_device(device *voltha.Device) error { |
| 280 | return errors.New("unImplemented") |
| 281 | } |
| 282 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 283 | func (oo *OpenONUAC) Delete_device(device *voltha.Device) error { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 284 | logger.Debugw("Delete_device", log.Fields{"device-id": device.Id}) |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 285 | if handler := oo.getDeviceHandler(device.Id); handler != nil { |
| 286 | if err := handler.DeleteDevice(device); err != nil { |
| 287 | return err |
| 288 | } |
| 289 | } else { |
divyadesai | 4d29955 | 2020-08-18 07:13:49 +0000 | [diff] [blame] | 290 | 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] | 291 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
| 292 | } |
| 293 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | //Get_device_details unimplemented |
| 297 | func (oo *OpenONUAC) Get_device_details(device *voltha.Device) error { |
| 298 | return errors.New("unImplemented") |
| 299 | } |
| 300 | |
| 301 | //Update_flows_bulk returns |
| 302 | func (oo *OpenONUAC) Update_flows_bulk(device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error { |
| 303 | return errors.New("unImplemented") |
| 304 | } |
| 305 | |
| 306 | //Update_flows_incrementally updates (add/remove) the flows on a given device |
| 307 | 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] | 308 | // return errors.New("unImplemented") |
| 309 | // testwise: just acknowledge to see, if that avoids ongoing TechProfile config sequences ... |
| 310 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | //Update_pm_config returns PmConfigs nil or error |
| 314 | func (oo *OpenONUAC) Update_pm_config(device *voltha.Device, pmConfigs *voltha.PmConfigs) error { |
| 315 | return errors.New("unImplemented") |
| 316 | } |
| 317 | |
| 318 | //Receive_packet_out sends packet out to the device |
| 319 | func (oo *OpenONUAC) Receive_packet_out(deviceID string, egressPortNo int, packet *openflow_13.OfpPacketOut) error { |
| 320 | return errors.New("unImplemented") |
| 321 | } |
| 322 | |
| 323 | //Suppress_event unimplemented |
| 324 | func (oo *OpenONUAC) Suppress_event(filter *voltha.EventFilter) error { |
| 325 | return errors.New("unImplemented") |
| 326 | } |
| 327 | |
| 328 | //Unsuppress_event unimplemented |
| 329 | func (oo *OpenONUAC) Unsuppress_event(filter *voltha.EventFilter) error { |
| 330 | return errors.New("unImplemented") |
| 331 | } |
| 332 | |
| 333 | //Download_image unimplemented |
| 334 | func (oo *OpenONUAC) Download_image(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 335 | return nil, errors.New("unImplemented") |
| 336 | } |
| 337 | |
| 338 | //Get_image_download_status unimplemented |
| 339 | func (oo *OpenONUAC) Get_image_download_status(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 340 | return nil, errors.New("unImplemented") |
| 341 | } |
| 342 | |
| 343 | //Cancel_image_download unimplemented |
| 344 | func (oo *OpenONUAC) Cancel_image_download(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 345 | return nil, errors.New("unImplemented") |
| 346 | } |
| 347 | |
| 348 | //Activate_image_update unimplemented |
| 349 | func (oo *OpenONUAC) Activate_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 350 | return nil, errors.New("unImplemented") |
| 351 | } |
| 352 | |
| 353 | //Revert_image_update unimplemented |
| 354 | func (oo *OpenONUAC) Revert_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
| 355 | return nil, errors.New("unImplemented") |
| 356 | } |
| 357 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 358 | // 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] | 359 | func (oo *OpenONUAC) Enable_port(deviceID string, port *voltha.Port) error { |
| 360 | return errors.New("unImplemented") |
| 361 | } |
| 362 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 363 | // 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] | 364 | func (oo *OpenONUAC) Disable_port(deviceID string, port *voltha.Port) error { |
| 365 | return errors.New("unImplemented") |
| 366 | } |
| 367 | |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 368 | //needed for if update >= 3.1.x |
Matteo Scandolo | 2e6f1e3 | 2020-04-15 11:28:45 -0700 | [diff] [blame] | 369 | func (oo *OpenONUAC) Child_device_lost(deviceID string, pPortNo uint32, onuID uint32) error { |
| 370 | return errors.New("unImplemented") |
| 371 | } |
| 372 | |
| 373 | func (oo *OpenONUAC) Start_omci_test(device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error) { |
| 374 | return nil, errors.New("unImplemented") |
| 375 | } |
| 376 | |
Matteo Scandolo | d132c0e | 2020-04-24 17:06:25 -0700 | [diff] [blame] | 377 | func (oo *OpenONUAC) Get_ext_value(deviceID string, device *voltha.Device, valueparam voltha.ValueType_Type) (*voltha.ReturnValues, error) { |
| 378 | return nil, errors.New("unImplemented") |
| 379 | } |
| 380 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 381 | // Adapter interface required methods ################ end ######### |
| 382 | // ################################################################# |