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 | |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 27 | conf "github.com/opencord/voltha-lib-go/v4/pkg/config" |
| 28 | |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 29 | "github.com/golang/protobuf/ptypes" |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 30 | "github.com/opencord/voltha-lib-go/v4/pkg/adapters/adapterif" |
| 31 | "github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore" |
| 32 | "github.com/opencord/voltha-lib-go/v4/pkg/kafka" |
| 33 | "github.com/opencord/voltha-lib-go/v4/pkg/log" |
| 34 | ic "github.com/opencord/voltha-protos/v4/go/inter_container" |
| 35 | "github.com/opencord/voltha-protos/v4/go/openflow_13" |
| 36 | oop "github.com/opencord/voltha-protos/v4/go/openolt" |
| 37 | "github.com/opencord/voltha-protos/v4/go/voltha" |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 38 | |
Matteo Scandolo | 761f751 | 2020-11-23 15:52:40 -0800 | [diff] [blame] | 39 | "github.com/opencord/voltha-openonu-adapter-go/internal/pkg/config" |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 40 | ) |
| 41 | |
| 42 | //OpenONUAC structure holds the ONU core information |
| 43 | type OpenONUAC struct { |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 44 | deviceHandlers map[string]*deviceHandler |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 45 | deviceHandlersCreateChan map[string]chan bool //channels for deviceHandler create events |
Holger Hildebrandt | 61b24d0 | 2020-11-16 13:36:40 +0000 | [diff] [blame] | 46 | lockDeviceHandlersMap sync.RWMutex |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 47 | coreProxy adapterif.CoreProxy |
| 48 | adapterProxy adapterif.AdapterProxy |
| 49 | eventProxy adapterif.EventProxy |
| 50 | kafkaICProxy kafka.InterContainerProxy |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 51 | kvClient kvstore.Client |
Matteo Scandolo | f1f39a7 | 2020-11-24 12:08:11 -0800 | [diff] [blame] | 52 | cm *conf.ConfigManager |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 53 | config *config.AdapterFlags |
| 54 | numOnus int |
| 55 | KVStoreHost string |
| 56 | KVStorePort int |
| 57 | KVStoreType string |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 58 | KVStoreTimeout time.Duration |
Holger Hildebrandt | 61b24d0 | 2020-11-16 13:36:40 +0000 | [diff] [blame] | 59 | mibTemplatesGenerated map[string]bool |
| 60 | lockMibTemplateGenerated sync.RWMutex |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 61 | exitChannel chan int |
| 62 | HeartbeatCheckInterval time.Duration |
| 63 | HeartbeatFailReportInterval time.Duration |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 64 | AcceptIncrementalEvto bool |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 65 | //GrpcTimeoutInterval time.Duration |
Himani Chawla | d96df18 | 2020-09-28 11:12:02 +0530 | [diff] [blame] | 66 | pSupportedFsms *OmciDeviceFsms |
| 67 | maxTimeoutInterAdapterComm time.Duration |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | //NewOpenONUAC returns a new instance of OpenONU_AC |
| 71 | func NewOpenONUAC(ctx context.Context, kafkaICProxy kafka.InterContainerProxy, |
| 72 | coreProxy adapterif.CoreProxy, adapterProxy adapterif.AdapterProxy, |
Matteo Scandolo | f1f39a7 | 2020-11-24 12:08:11 -0800 | [diff] [blame] | 73 | eventProxy adapterif.EventProxy, kvClient kvstore.Client, cfg *config.AdapterFlags, cm *conf.ConfigManager) *OpenONUAC { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 74 | var openOnuAc OpenONUAC |
| 75 | openOnuAc.exitChannel = make(chan int, 1) |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 76 | openOnuAc.deviceHandlers = make(map[string]*deviceHandler) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 77 | openOnuAc.deviceHandlersCreateChan = make(map[string]chan bool) |
Holger Hildebrandt | 61b24d0 | 2020-11-16 13:36:40 +0000 | [diff] [blame] | 78 | openOnuAc.lockDeviceHandlersMap = sync.RWMutex{} |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 79 | openOnuAc.kafkaICProxy = kafkaICProxy |
| 80 | openOnuAc.config = cfg |
Matteo Scandolo | f1f39a7 | 2020-11-24 12:08:11 -0800 | [diff] [blame] | 81 | openOnuAc.cm = cm |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 82 | openOnuAc.numOnus = cfg.OnuNumber |
| 83 | openOnuAc.coreProxy = coreProxy |
| 84 | openOnuAc.adapterProxy = adapterProxy |
| 85 | openOnuAc.eventProxy = eventProxy |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 86 | openOnuAc.kvClient = kvClient |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 87 | openOnuAc.KVStoreHost = cfg.KVStoreHost |
| 88 | openOnuAc.KVStorePort = cfg.KVStorePort |
| 89 | openOnuAc.KVStoreType = cfg.KVStoreType |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 90 | openOnuAc.KVStoreTimeout = cfg.KVStoreTimeout |
Holger Hildebrandt | 61b24d0 | 2020-11-16 13:36:40 +0000 | [diff] [blame] | 91 | openOnuAc.mibTemplatesGenerated = make(map[string]bool) |
| 92 | openOnuAc.lockMibTemplateGenerated = sync.RWMutex{} |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 93 | openOnuAc.HeartbeatCheckInterval = cfg.HeartbeatCheckInterval |
| 94 | openOnuAc.HeartbeatFailReportInterval = cfg.HeartbeatFailReportInterval |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 95 | openOnuAc.AcceptIncrementalEvto = cfg.AccIncrEvto |
Himani Chawla | d96df18 | 2020-09-28 11:12:02 +0530 | [diff] [blame] | 96 | openOnuAc.maxTimeoutInterAdapterComm = cfg.MaxTimeoutInterAdapterComm |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 97 | //openOnuAc.GrpcTimeoutInterval = cfg.GrpcTimeoutInterval |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 98 | |
| 99 | openOnuAc.pSupportedFsms = &OmciDeviceFsms{ |
| 100 | "mib-synchronizer": { |
| 101 | //mibSyncFsm, // Implements the MIB synchronization state machine |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 102 | mibDbVolatileDictImpl, // Implements volatile ME MIB database |
Himani Chawla | 4d90833 | 2020-08-31 12:30:20 +0530 | [diff] [blame] | 103 | //true, // Advertise events on OpenOMCI event bus |
| 104 | cMibAuditDelayImpl, // Time to wait between MIB audits. 0 to disable audits. |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 105 | // map[string]func() error{ |
| 106 | // "mib-upload": onuDeviceEntry.MibUploadTask, |
| 107 | // "mib-template": onuDeviceEntry.MibTemplateTask, |
| 108 | // "get-mds": onuDeviceEntry.GetMdsTask, |
| 109 | // "mib-audit": onuDeviceEntry.GetMdsTask, |
| 110 | // "mib-resync": onuDeviceEntry.MibResyncTask, |
| 111 | // "mib-reconcile": onuDeviceEntry.MibReconcileTask, |
| 112 | // }, |
| 113 | }, |
| 114 | } |
| 115 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 116 | return &openOnuAc |
| 117 | } |
| 118 | |
| 119 | //Start starts (logs) the adapter |
| 120 | func (oo *OpenONUAC) Start(ctx context.Context) error { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 121 | logger.Info(ctx, "starting-openonu-adapter") |
| 122 | logger.Info(ctx, "openonu-adapter-started") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 123 | return nil |
| 124 | } |
| 125 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 126 | /* |
| 127 | //stop terminates the session |
| 128 | func (oo *OpenONUAC) stop(ctx context.Context) error { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 129 | logger.Info(ctx,"stopping-device-manager") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 130 | oo.exitChannel <- 1 |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 131 | logger.Info(ctx,"device-manager-stopped") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 132 | return nil |
| 133 | } |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 134 | */ |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 135 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 136 | func (oo *OpenONUAC) addDeviceHandlerToMap(ctx context.Context, agent *deviceHandler) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 137 | oo.lockDeviceHandlersMap.Lock() |
| 138 | defer oo.lockDeviceHandlersMap.Unlock() |
| 139 | if _, exist := oo.deviceHandlers[agent.deviceID]; !exist { |
| 140 | oo.deviceHandlers[agent.deviceID] = agent |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 141 | oo.deviceHandlers[agent.deviceID].start(ctx) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 142 | if _, exist := oo.deviceHandlersCreateChan[agent.deviceID]; exist { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 143 | logger.Debugw(ctx, "deviceHandler created - trigger processing of pending ONU_IND_REQUEST", log.Fields{"device-id": agent.deviceID}) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 144 | oo.deviceHandlersCreateChan[agent.deviceID] <- true |
| 145 | } |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 146 | } |
| 147 | } |
| 148 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 149 | func (oo *OpenONUAC) deleteDeviceHandlerToMap(agent *deviceHandler) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 150 | oo.lockDeviceHandlersMap.Lock() |
| 151 | defer oo.lockDeviceHandlersMap.Unlock() |
| 152 | delete(oo.deviceHandlers, agent.deviceID) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 153 | delete(oo.deviceHandlersCreateChan, agent.deviceID) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 154 | } |
| 155 | |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 156 | //getDeviceHandler gets the ONU deviceHandler and may wait until it is created |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 157 | func (oo *OpenONUAC) getDeviceHandler(ctx context.Context, deviceID string, aWait bool) *deviceHandler { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 158 | oo.lockDeviceHandlersMap.Lock() |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 159 | agent, ok := oo.deviceHandlers[deviceID] |
| 160 | if aWait && !ok { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 161 | logger.Infow(ctx, "Race condition: deviceHandler not present - wait for creation or timeout", |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 162 | log.Fields{"device-id": deviceID}) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 163 | if _, exist := oo.deviceHandlersCreateChan[deviceID]; !exist { |
| 164 | oo.deviceHandlersCreateChan[deviceID] = make(chan bool, 1) |
| 165 | } |
Girish Gowdra | 7407a4d | 2020-11-12 12:44:53 -0800 | [diff] [blame] | 166 | deviceCreateChan := oo.deviceHandlersCreateChan[deviceID] |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 167 | //keep the read sema short to allow for subsequent write |
| 168 | oo.lockDeviceHandlersMap.Unlock() |
| 169 | // based on concurrent processing the deviceHandler creation may not yet be finished at his point |
| 170 | // so it might be needed to wait here for that event with some timeout |
| 171 | select { |
| 172 | case <-time.After(1 * time.Second): //timer may be discussed ... |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 173 | logger.Warnw(ctx, "No valid deviceHandler created after max WaitTime", log.Fields{"device-id": deviceID}) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 174 | return nil |
Girish Gowdra | 7407a4d | 2020-11-12 12:44:53 -0800 | [diff] [blame] | 175 | case <-deviceCreateChan: |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 176 | logger.Debugw(ctx, "deviceHandler is ready now - continue", log.Fields{"device-id": deviceID}) |
Girish Gowdra | 7407a4d | 2020-11-12 12:44:53 -0800 | [diff] [blame] | 177 | oo.lockDeviceHandlersMap.RLock() |
| 178 | defer oo.lockDeviceHandlersMap.RUnlock() |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 179 | return oo.deviceHandlers[deviceID] |
| 180 | } |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 181 | } |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 182 | oo.lockDeviceHandlersMap.Unlock() |
| 183 | return agent |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 184 | } |
| 185 | |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 186 | func (oo *OpenONUAC) processInterAdapterONUIndReqMessage(ctx context.Context, msg *ic.InterAdapterMessage) error { |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 187 | msgBody := msg.GetBody() |
| 188 | onuIndication := &oop.OnuIndication{} |
| 189 | if err := ptypes.UnmarshalAny(msgBody, onuIndication); err != nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 190 | logger.Warnw(ctx, "onu-ind-request-cannot-unmarshal-msg-body", log.Fields{"error": err}) |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 191 | return err |
| 192 | } |
| 193 | //ToDeviceId should address a DeviceHandler instance |
| 194 | targetDevice := msg.Header.ToDeviceId |
| 195 | |
| 196 | onuOperstate := onuIndication.GetOperState() |
| 197 | waitForDhInstPresent := false |
| 198 | if onuOperstate == "up" { |
| 199 | //Race condition (relevant in BBSIM-environment only): Due to unsynchronized processing of olt-adapter and rw_core, |
| 200 | //ONU_IND_REQUEST msg by olt-adapter could arrive a little bit earlier than rw_core was able to announce the corresponding |
| 201 | //ONU by RPC of Adopt_device(). Therefore it could be necessary to wait with processing of ONU_IND_REQUEST until call of |
| 202 | //Adopt_device() arrived and DeviceHandler instance was created |
| 203 | waitForDhInstPresent = true |
| 204 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 205 | if handler := oo.getDeviceHandler(ctx, targetDevice, waitForDhInstPresent); handler != nil { |
| 206 | logger.Infow(ctx, "onu-ind-request", log.Fields{"device-id": targetDevice, |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 207 | "OnuId": onuIndication.GetOnuId(), |
| 208 | "AdminState": onuIndication.GetAdminState(), "OperState": onuOperstate, |
| 209 | "SNR": onuIndication.GetSerialNumber()}) |
| 210 | |
| 211 | if onuOperstate == "up" { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 212 | return handler.createInterface(ctx, onuIndication) |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 213 | } else if (onuOperstate == "down") || (onuOperstate == "unreachable") { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 214 | return handler.updateInterface(ctx, onuIndication) |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 215 | } else { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 216 | logger.Errorw(ctx, "unknown-onu-ind-request operState", log.Fields{"OnuId": onuIndication.GetOnuId()}) |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 217 | return fmt.Errorf("invalidOperState: %s, %s", onuOperstate, targetDevice) |
| 218 | } |
| 219 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 220 | logger.Warnw(ctx, "no handler found for received onu-ind-request", log.Fields{ |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 221 | "msgToDeviceId": targetDevice}) |
| 222 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", targetDevice)) |
| 223 | } |
| 224 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 225 | // Adapter interface required methods ############## begin ######### |
| 226 | // ################################################################# |
| 227 | |
| 228 | // for original content compare: (needs according deviceHandler methods) |
| 229 | // /voltha-openolt-adapter/adaptercore/openolt.go |
| 230 | |
| 231 | // Adopt_device creates a new device handler if not present already and then adopts the device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 232 | func (oo *OpenONUAC) Adopt_device(ctx context.Context, device *voltha.Device) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 233 | if device == nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 234 | logger.Warn(ctx, "voltha-device-is-nil") |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 235 | return errors.New("nil-device") |
| 236 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 237 | logger.Infow(ctx, "adopt-device", log.Fields{"device-id": device.Id}) |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 238 | var handler *deviceHandler |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 239 | if handler = oo.getDeviceHandler(ctx, device.Id, false); handler == nil { |
| 240 | handler := newDeviceHandler(ctx, oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 241 | oo.addDeviceHandlerToMap(ctx, handler) |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 242 | go handler.adoptOrReconcileDevice(ctx, device) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 243 | // Launch the creation of the device topic |
| 244 | // go oo.createDeviceTopic(device) |
| 245 | } |
| 246 | return nil |
| 247 | } |
| 248 | |
| 249 | //Get_ofp_device_info returns OFP information for the given device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 250 | func (oo *OpenONUAC) Get_ofp_device_info(ctx context.Context, device *voltha.Device) (*ic.SwitchCapability, error) { |
| 251 | logger.Errorw(ctx, "device-handler-not-set", log.Fields{"device-id": device.Id}) |
Andrea Campanella | 6515c58 | 2020-10-05 11:25:00 +0200 | [diff] [blame] | 252 | return nil, fmt.Errorf("device-handler-not-set %s", device.Id) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | //Get_ofp_port_info returns OFP port information for the given device |
mpagenko | af80163 | 2020-07-03 10:00:42 +0000 | [diff] [blame] | 256 | //200630: method removed as per [VOL-3202]: OF port info is now to be delivered within UniPort create |
| 257 | // cmp changes in onu_uni_port.go::CreateVolthaPort() |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 258 | |
| 259 | //Process_inter_adapter_message sends messages to a target device (between adapters) |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 260 | func (oo *OpenONUAC) Process_inter_adapter_message(ctx context.Context, msg *ic.InterAdapterMessage) error { |
| 261 | logger.Debugw(ctx, "Process_inter_adapter_message", log.Fields{"msgId": msg.Header.Id, |
Holger Hildebrandt | 80129db | 2020-11-23 10:49:32 +0000 | [diff] [blame] | 262 | "msgProxyDeviceId": msg.Header.ProxyDeviceId, "msgToDeviceId": msg.Header.ToDeviceId, "Type": msg.Header.Type}) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 263 | |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 264 | if msg.Header.Type == ic.InterAdapterMessageType_ONU_IND_REQUEST { |
| 265 | // we have to handle ONU_IND_REQUEST already here - see comments in processInterAdapterONUIndReqMessage() |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 266 | return oo.processInterAdapterONUIndReqMessage(ctx, msg) |
Holger Hildebrandt | 6c1fb0a | 2020-11-25 15:41:01 +0000 | [diff] [blame] | 267 | } |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 268 | //ToDeviceId should address a DeviceHandler instance |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 269 | targetDevice := msg.Header.ToDeviceId |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 270 | if handler := oo.getDeviceHandler(ctx, targetDevice, false); handler != nil { |
mpagenko | 1cc3cb4 | 2020-07-27 15:24:38 +0000 | [diff] [blame] | 271 | /* 200724: modification towards synchronous implementation - possible errors within processing shall be |
| 272 | * in the accordingly delayed response, some timing effect might result in Techprofile processing for multiple UNI's |
| 273 | */ |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 274 | return handler.processInterAdapterMessage(ctx, msg) |
mpagenko | 1cc3cb4 | 2020-07-27 15:24:38 +0000 | [diff] [blame] | 275 | /* 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] | 276 | go handler.ProcessInterAdapterMessage(msg) |
| 277 | // error treatment might be more sophisticated |
| 278 | // by now let's just accept the message on 'communication layer' |
| 279 | // message content problems have to be evaluated then in the handler |
| 280 | // and are by now not reported to the calling party (to force what reaction there?) |
| 281 | return nil |
mpagenko | 1cc3cb4 | 2020-07-27 15:24:38 +0000 | [diff] [blame] | 282 | */ |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 283 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 284 | logger.Warnw(ctx, "no handler found for received Inter-Proxy-message", log.Fields{ |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 285 | "msgToDeviceId": targetDevice}) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 286 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", targetDevice)) |
| 287 | } |
| 288 | |
| 289 | //Adapter_descriptor not implemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 290 | func (oo *OpenONUAC) Adapter_descriptor(ctx context.Context) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 291 | return errors.New("unImplemented") |
| 292 | } |
| 293 | |
| 294 | //Device_types unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 295 | func (oo *OpenONUAC) Device_types(ctx context.Context) (*voltha.DeviceTypes, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 296 | return nil, errors.New("unImplemented") |
| 297 | } |
| 298 | |
| 299 | //Health returns unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 300 | func (oo *OpenONUAC) Health(ctx context.Context) (*voltha.HealthStatus, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 301 | return nil, errors.New("unImplemented") |
| 302 | } |
| 303 | |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 304 | //Reconcile_device is called once when the adapter needs to re-create device - usually on core restart |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 305 | func (oo *OpenONUAC) Reconcile_device(ctx context.Context, device *voltha.Device) error { |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 306 | if device == nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 307 | logger.Warn(ctx, "reconcile-device-voltha-device-is-nil") |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 308 | return errors.New("nil-device") |
| 309 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 310 | logger.Infow(ctx, "reconcile-device", log.Fields{"device-id": device.Id}) |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 311 | var handler *deviceHandler |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 312 | if handler = oo.getDeviceHandler(ctx, device.Id, false); handler == nil { |
| 313 | handler := newDeviceHandler(ctx, oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo) |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 314 | oo.addDeviceHandlerToMap(ctx, handler) |
| 315 | handler.device = device |
| 316 | handler.reconciling = true |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 317 | go handler.adoptOrReconcileDevice(ctx, handler.device) |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 318 | // reconcilement will be continued after onu-device entry is added |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 319 | } else { |
Holger Hildebrandt | f41a160 | 2020-08-19 09:52:50 +0000 | [diff] [blame] | 320 | 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] | 321 | } |
| 322 | return nil |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | //Abandon_device unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 326 | func (oo *OpenONUAC) Abandon_device(ctx context.Context, device *voltha.Device) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 327 | return errors.New("unImplemented") |
| 328 | } |
| 329 | |
| 330 | //Disable_device disables the given device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 331 | func (oo *OpenONUAC) Disable_device(ctx context.Context, device *voltha.Device) error { |
| 332 | logger.Infow(ctx, "disable-device", log.Fields{"device-id": device.Id}) |
| 333 | if handler := oo.getDeviceHandler(ctx, device.Id, false); handler != nil { |
| 334 | go handler.disableDevice(ctx, device) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 335 | return nil |
| 336 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 337 | logger.Warnw(ctx, "no handler found for device-disable", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 338 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 339 | } |
| 340 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 341 | //Reenable_device enables the onu device after disable |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 342 | func (oo *OpenONUAC) Reenable_device(ctx context.Context, device *voltha.Device) error { |
| 343 | logger.Infow(ctx, "reenable-device", log.Fields{"device-id": device.Id}) |
| 344 | if handler := oo.getDeviceHandler(ctx, device.Id, false); handler != nil { |
| 345 | go handler.reEnableDevice(ctx, device) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 346 | return nil |
| 347 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 348 | logger.Warnw(ctx, "no handler found for device-reenable", log.Fields{"device-id": device.Id}) |
ozgecanetsia | fce57b1 | 2020-05-25 14:39:35 +0300 | [diff] [blame] | 349 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | //Reboot_device reboots the given device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 353 | func (oo *OpenONUAC) Reboot_device(ctx context.Context, device *voltha.Device) error { |
| 354 | logger.Infow(ctx, "reboot-device", log.Fields{"device-id": device.Id}) |
| 355 | if handler := oo.getDeviceHandler(ctx, device.Id, false); handler != nil { |
| 356 | go handler.rebootDevice(ctx, device) |
ozgecanetsia | e11479f | 2020-07-06 09:44:47 +0300 | [diff] [blame] | 357 | return nil |
| 358 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 359 | logger.Warnw(ctx, "no handler found for device-reboot", log.Fields{"device-id": device.Id}) |
ozgecanetsia | e11479f | 2020-07-06 09:44:47 +0300 | [diff] [blame] | 360 | return fmt.Errorf(fmt.Sprintf("handler-not-found-#{device.Id}")) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 361 | } |
| 362 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 363 | //Self_test_device unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 364 | func (oo *OpenONUAC) Self_test_device(ctx context.Context, device *voltha.Device) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 365 | return errors.New("unImplemented") |
| 366 | } |
| 367 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 368 | // Delete_device deletes the given device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 369 | func (oo *OpenONUAC) Delete_device(ctx context.Context, device *voltha.Device) error { |
| 370 | logger.Infow(ctx, "delete-device", log.Fields{"device-id": device.Id, "SerialNumber": device.SerialNumber}) |
| 371 | if handler := oo.getDeviceHandler(ctx, device.Id, false); handler != nil { |
| 372 | err := handler.deleteDevicePersistencyData(ctx) |
Holger Hildebrandt | f07b44a | 2020-11-10 13:07:54 +0000 | [diff] [blame] | 373 | //don't leave any garbage - even in error case |
| 374 | oo.deleteDeviceHandlerToMap(handler) |
mpagenko | 2418ab0 | 2020-11-12 12:58:06 +0000 | [diff] [blame] | 375 | return err |
Holger Hildebrandt | 9ca8b13 | 2020-08-07 14:45:03 +0000 | [diff] [blame] | 376 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 377 | logger.Warnw(ctx, "no handler found for device-deletion", log.Fields{"device-id": device.Id}) |
mpagenko | 2418ab0 | 2020-11-12 12:58:06 +0000 | [diff] [blame] | 378 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | //Get_device_details unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 382 | func (oo *OpenONUAC) Get_device_details(ctx context.Context, device *voltha.Device) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 383 | return errors.New("unImplemented") |
| 384 | } |
| 385 | |
| 386 | //Update_flows_bulk returns |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 387 | func (oo *OpenONUAC) Update_flows_bulk(ctx context.Context, device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 388 | return errors.New("unImplemented") |
| 389 | } |
| 390 | |
| 391 | //Update_flows_incrementally updates (add/remove) the flows on a given device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 392 | func (oo *OpenONUAC) Update_flows_incrementally(ctx context.Context, device *voltha.Device, |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 393 | flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error { |
mpagenko | fc4f56e | 2020-11-04 17:17:49 +0000 | [diff] [blame] | 394 | |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 395 | logger.Infow(ctx, "update-flows-incrementally", log.Fields{"device-id": device.Id}) |
mpagenko | fc4f56e | 2020-11-04 17:17:49 +0000 | [diff] [blame] | 396 | //flow config is relayed to handler even if the device might be in some 'inactive' state |
| 397 | // let the handler or related FSM's decide, what to do with the modified flow state info |
| 398 | // at least the flow-remove must be done in respect to internal data, while OMCI activity might not be needed here |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 399 | |
| 400 | // For now, there is no support for group changes (as in the actual Py-adapter code) |
mpagenko | fc4f56e | 2020-11-04 17:17:49 +0000 | [diff] [blame] | 401 | // but processing is continued for flowUpdate possibly also set in the request |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 402 | if groups.ToAdd != nil && groups.ToAdd.Items != nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 403 | logger.Warnw(ctx, "Update-flow-incr: group add not supported (ignored)", log.Fields{"device-id": device.Id}) |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 404 | } |
| 405 | if groups.ToRemove != nil && groups.ToRemove.Items != nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 406 | logger.Warnw(ctx, "Update-flow-incr: group remove not supported (ignored)", log.Fields{"device-id": device.Id}) |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 407 | } |
| 408 | if groups.ToUpdate != nil && groups.ToUpdate.Items != nil { |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 409 | logger.Warnw(ctx, "Update-flow-incr: group update not supported (ignored)", log.Fields{"device-id": device.Id}) |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 410 | } |
| 411 | |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 412 | if handler := oo.getDeviceHandler(ctx, device.Id, false); handler != nil { |
| 413 | err := handler.FlowUpdateIncremental(ctx, flows, groups, flowMetadata) |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 414 | return err |
| 415 | } |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 416 | logger.Warnw(ctx, "no handler found for incremental flow update", log.Fields{"device-id": device.Id}) |
mpagenko | dff5dda | 2020-08-28 11:52:01 +0000 | [diff] [blame] | 417 | return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id)) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | //Update_pm_config returns PmConfigs nil or error |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 421 | func (oo *OpenONUAC) Update_pm_config(ctx context.Context, device *voltha.Device, pmConfigs *voltha.PmConfigs) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 422 | return errors.New("unImplemented") |
| 423 | } |
| 424 | |
| 425 | //Receive_packet_out sends packet out to the device |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 426 | func (oo *OpenONUAC) Receive_packet_out(ctx context.Context, deviceID string, egressPortNo int, packet *openflow_13.OfpPacketOut) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 427 | return errors.New("unImplemented") |
| 428 | } |
| 429 | |
| 430 | //Suppress_event unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 431 | func (oo *OpenONUAC) Suppress_event(ctx context.Context, filter *voltha.EventFilter) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 432 | return errors.New("unImplemented") |
| 433 | } |
| 434 | |
| 435 | //Unsuppress_event unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 436 | func (oo *OpenONUAC) Unsuppress_event(ctx context.Context, filter *voltha.EventFilter) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 437 | return errors.New("unImplemented") |
| 438 | } |
| 439 | |
| 440 | //Download_image unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 441 | func (oo *OpenONUAC) Download_image(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 442 | return nil, errors.New("unImplemented") |
| 443 | } |
| 444 | |
| 445 | //Get_image_download_status unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 446 | func (oo *OpenONUAC) Get_image_download_status(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 447 | return nil, errors.New("unImplemented") |
| 448 | } |
| 449 | |
| 450 | //Cancel_image_download unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 451 | func (oo *OpenONUAC) Cancel_image_download(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 452 | return nil, errors.New("unImplemented") |
| 453 | } |
| 454 | |
| 455 | //Activate_image_update unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 456 | func (oo *OpenONUAC) Activate_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 457 | return nil, errors.New("unImplemented") |
| 458 | } |
| 459 | |
| 460 | //Revert_image_update unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 461 | func (oo *OpenONUAC) Revert_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 462 | return nil, errors.New("unImplemented") |
| 463 | } |
| 464 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 465 | // Enable_port to Enable PON/NNI interface - seems not to be used/required according to python code |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 466 | func (oo *OpenONUAC) Enable_port(ctx context.Context, deviceID string, port *voltha.Port) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 467 | return errors.New("unImplemented") |
| 468 | } |
| 469 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 470 | // Disable_port to Disable pon/nni interface - seems not to be used/required according to python code |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 471 | func (oo *OpenONUAC) Disable_port(ctx context.Context, deviceID string, port *voltha.Port) error { |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 472 | return errors.New("unImplemented") |
| 473 | } |
| 474 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 475 | //Child_device_lost - unimplemented |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 476 | //needed for if update >= 3.1.x |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 477 | func (oo *OpenONUAC) Child_device_lost(ctx context.Context, deviceID string, pPortNo uint32, onuID uint32) error { |
Matteo Scandolo | 2e6f1e3 | 2020-04-15 11:28:45 -0700 | [diff] [blame] | 478 | return errors.New("unImplemented") |
| 479 | } |
| 480 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 481 | // Start_omci_test unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 482 | func (oo *OpenONUAC) Start_omci_test(ctx context.Context, device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error) { |
Matteo Scandolo | 2e6f1e3 | 2020-04-15 11:28:45 -0700 | [diff] [blame] | 483 | return nil, errors.New("unImplemented") |
| 484 | } |
| 485 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 486 | // Get_ext_value - unimplemented |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 487 | func (oo *OpenONUAC) Get_ext_value(ctx context.Context, deviceID string, device *voltha.Device, valueparam voltha.ValueType_Type) (*voltha.ReturnValues, error) { |
Matteo Scandolo | d132c0e | 2020-04-24 17:06:25 -0700 | [diff] [blame] | 488 | return nil, errors.New("unImplemented") |
| 489 | } |
| 490 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 491 | // Adapter interface required methods ################ end ######### |
| 492 | // ################################################################# |