blob: ec47cd0a5c2f5e2445bdb70b1d09cfb2e4a173ae [file] [log] [blame]
Girish Gowdru0c588b22019-04-23 23:24:56 -04001/*
Joey Armstrong11f5a572024-01-12 19:11:32 -05002 * Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
Girish Gowdru0c588b22019-04-23 23:24:56 -04003
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 */
Girish Gowdru6a80bbd2019-07-02 07:36:09 -070016
praneeth nalmas55616d62023-02-06 09:19:18 +053017// Package core provides the utility for olt devices, flows and statistics
Scott Bakerdbd960e2020-02-28 08:57:51 -080018package core
Girish Gowdru0c588b22019-04-23 23:24:56 -040019
20import (
21 "context"
khenaidooefff76e2021-12-15 16:51:30 -050022 "fmt"
Akash Sonif49299a2024-04-25 12:06:37 +053023 "sync"
24 "time"
25
khenaidoo106c61a2021-08-11 18:05:46 -040026 "github.com/golang/protobuf/ptypes/empty"
27 conf "github.com/opencord/voltha-lib-go/v7/pkg/config"
28 "github.com/opencord/voltha-lib-go/v7/pkg/events/eventif"
29 vgrpc "github.com/opencord/voltha-lib-go/v7/pkg/grpc"
30 "github.com/opencord/voltha-lib-go/v7/pkg/log"
Scott Bakerdbd960e2020-02-28 08:57:51 -080031 "github.com/opencord/voltha-openolt-adapter/internal/pkg/config"
Thomas Lee S94109f12020-03-03 16:39:29 +053032 "github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
khenaidooefff76e2021-12-15 16:51:30 -050033 "github.com/opencord/voltha-protos/v5/go/adapter_service"
khenaidoo106c61a2021-08-11 18:05:46 -040034 "github.com/opencord/voltha-protos/v5/go/common"
khenaidoodc2116e2021-10-19 17:33:19 -040035 ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
khenaidoo106c61a2021-08-11 18:05:46 -040036 "github.com/opencord/voltha-protos/v5/go/extension"
khenaidoodc2116e2021-10-19 17:33:19 -040037 "github.com/opencord/voltha-protos/v5/go/health"
38 ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
39 "github.com/opencord/voltha-protos/v5/go/omci"
khenaidoo106c61a2021-08-11 18:05:46 -040040 "github.com/opencord/voltha-protos/v5/go/voltha"
nikesh.krishnan4d644532023-12-16 00:21:07 +053041 "google.golang.org/grpc/codes"
42 "google.golang.org/grpc/status"
Girish Gowdru0c588b22019-04-23 23:24:56 -040043)
44
praneeth nalmas55616d62023-02-06 09:19:18 +053045// OpenOLT structure holds the OLT information
Girish Gowdru0c588b22019-04-23 23:24:56 -040046type OpenOLT struct {
Abhilash Laxmeshward0f58cf2022-06-01 12:15:19 +053047 configManager *conf.ConfigManager
48 deviceHandlers map[string]*DeviceHandler
49 coreClient *vgrpc.Client
50 eventProxy eventif.EventProxy
51 config *config.AdapterFlags
52 numOnus int
53 KVStoreAddress string
54 KVStoreType string
55 exitChannel chan struct{}
56 HeartbeatCheckInterval time.Duration
57 HeartbeatFailReportInterval time.Duration
58 GrpcTimeoutInterval time.Duration
59 lockDeviceHandlersMap sync.RWMutex
60 enableONUStats bool
61 enableGemStats bool
62 rpcTimeout time.Duration
63 CheckOnuDevExistenceAtOnuDiscovery bool
Girish Gowdru0c588b22019-04-23 23:24:56 -040064}
65
praneeth nalmas55616d62023-02-06 09:19:18 +053066// NewOpenOLT returns a new instance of OpenOLT
khenaidoo106c61a2021-08-11 18:05:46 -040067func NewOpenOLT(ctx context.Context,
68 coreClient *vgrpc.Client,
Himani Chawlacd407802020-12-10 12:08:59 +053069 eventProxy eventif.EventProxy, cfg *config.AdapterFlags, cm *conf.ConfigManager) *OpenOLT {
Girish Gowdru0c588b22019-04-23 23:24:56 -040070 var openOLT OpenOLT
khenaidooefff76e2021-12-15 16:51:30 -050071 openOLT.exitChannel = make(chan struct{})
Girish Gowdru0c588b22019-04-23 23:24:56 -040072 openOLT.deviceHandlers = make(map[string]*DeviceHandler)
Abhilash Laxmeshwarf9942e92020-01-07 15:32:44 +053073 openOLT.config = cfg
74 openOLT.numOnus = cfg.OnuNumber
khenaidoo106c61a2021-08-11 18:05:46 -040075 openOLT.coreClient = coreClient
Devmalya Paulfb990a52019-07-09 10:01:49 -040076 openOLT.eventProxy = eventProxy
Neha Sharma3f221ae2020-04-29 19:02:12 +000077 openOLT.KVStoreAddress = cfg.KVStoreAddress
Abhilash Laxmeshwarf9942e92020-01-07 15:32:44 +053078 openOLT.KVStoreType = cfg.KVStoreType
79 openOLT.HeartbeatCheckInterval = cfg.HeartbeatCheckInterval
80 openOLT.HeartbeatFailReportInterval = cfg.HeartbeatFailReportInterval
81 openOLT.GrpcTimeoutInterval = cfg.GrpcTimeoutInterval
Girish Gowdru0c588b22019-04-23 23:24:56 -040082 openOLT.lockDeviceHandlersMap = sync.RWMutex{}
Matteo Scandolodfa7a972020-11-06 13:03:40 -080083 openOLT.configManager = cm
Gamze Abakafcbd6e72020-12-17 13:25:16 +000084 openOLT.enableONUStats = cfg.EnableONUStats
85 openOLT.enableGemStats = cfg.EnableGEMStats
khenaidoo106c61a2021-08-11 18:05:46 -040086 openOLT.rpcTimeout = cfg.RPCTimeout
Abhilash Laxmeshward0f58cf2022-06-01 12:15:19 +053087 openOLT.CheckOnuDevExistenceAtOnuDiscovery = cfg.CheckOnuDevExistenceAtOnuDiscovery
Girish Gowdru0c588b22019-04-23 23:24:56 -040088 return &openOLT
89}
90
praneeth nalmas55616d62023-02-06 09:19:18 +053091// Start starts (logs) the device manager
Girish Gowdru0c588b22019-04-23 23:24:56 -040092func (oo *OpenOLT) Start(ctx context.Context) error {
Neha Sharma96b7bf22020-06-15 10:37:32 +000093 logger.Info(ctx, "starting-device-manager")
94 logger.Info(ctx, "device-manager-started")
Girish Gowdru0c588b22019-04-23 23:24:56 -040095 return nil
96}
97
praneeth nalmas55616d62023-02-06 09:19:18 +053098// Stop terminates the session
Girish Gowdru0c588b22019-04-23 23:24:56 -040099func (oo *OpenOLT) Stop(ctx context.Context) error {
Neha Sharma96b7bf22020-06-15 10:37:32 +0000100 logger.Info(ctx, "stopping-device-manager")
khenaidooefff76e2021-12-15 16:51:30 -0500101 close(oo.exitChannel)
102 // Stop the device handlers
103 oo.stopAllDeviceHandlers(ctx)
104
105 // Stop the core grpc client connection
106 if oo.coreClient != nil {
107 oo.coreClient.Stop(ctx)
108 }
109
Neha Sharma96b7bf22020-06-15 10:37:32 +0000110 logger.Info(ctx, "device-manager-stopped")
Girish Gowdru0c588b22019-04-23 23:24:56 -0400111 return nil
112}
113
Girish Gowdru0c588b22019-04-23 23:24:56 -0400114func (oo *OpenOLT) addDeviceHandlerToMap(agent *DeviceHandler) {
115 oo.lockDeviceHandlersMap.Lock()
116 defer oo.lockDeviceHandlersMap.Unlock()
Thomas Lee S985938d2020-05-04 11:40:41 +0530117 if _, exist := oo.deviceHandlers[agent.device.Id]; !exist {
118 oo.deviceHandlers[agent.device.Id] = agent
Girish Gowdru0c588b22019-04-23 23:24:56 -0400119 }
120}
121
122func (oo *OpenOLT) deleteDeviceHandlerToMap(agent *DeviceHandler) {
123 oo.lockDeviceHandlersMap.Lock()
124 defer oo.lockDeviceHandlersMap.Unlock()
Thomas Lee S985938d2020-05-04 11:40:41 +0530125 delete(oo.deviceHandlers, agent.device.Id)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400126}
127
Girish Gowdru6a80bbd2019-07-02 07:36:09 -0700128func (oo *OpenOLT) getDeviceHandler(deviceID string) *DeviceHandler {
Girish Gowdru0c588b22019-04-23 23:24:56 -0400129 oo.lockDeviceHandlersMap.Lock()
130 defer oo.lockDeviceHandlersMap.Unlock()
Girish Gowdru6a80bbd2019-07-02 07:36:09 -0700131 if agent, ok := oo.deviceHandlers[deviceID]; ok {
Girish Gowdru0c588b22019-04-23 23:24:56 -0400132 return agent
133 }
134 return nil
135}
136
khenaidooefff76e2021-12-15 16:51:30 -0500137func (oo *OpenOLT) stopAllDeviceHandlers(ctx context.Context) {
138 oo.lockDeviceHandlersMap.Lock()
139 defer oo.lockDeviceHandlersMap.Unlock()
140 for _, handler := range oo.deviceHandlers {
141 handler.Stop(ctx)
142 }
khenaidoo106c61a2021-08-11 18:05:46 -0400143}
144
145// AdoptDevice creates a new device handler if not present already and then adopts the device
146func (oo *OpenOLT) AdoptDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
Girish Gowdru0c588b22019-04-23 23:24:56 -0400147 if device == nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400148 return nil, olterrors.NewErrInvalidValue(log.Fields{"device": nil}, nil).Log()
Girish Gowdru0c588b22019-04-23 23:24:56 -0400149 }
divyadesai3af43e12020-08-18 07:10:54 +0000150 logger.Infow(ctx, "adopt-device", log.Fields{"device-id": device.Id})
Girish Gowdru0c588b22019-04-23 23:24:56 -0400151 var handler *DeviceHandler
152 if handler = oo.getDeviceHandler(device.Id); handler == nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400153 handler := NewDeviceHandler(oo.coreClient, oo.eventProxy, device, oo, oo.configManager, oo.config)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400154 oo.addDeviceHandlerToMap(handler)
khenaidoo106c61a2021-08-11 18:05:46 -0400155 go handler.AdoptDevice(log.WithSpanFromContext(context.Background(), ctx), device)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400156 }
khenaidoo106c61a2021-08-11 18:05:46 -0400157 return &empty.Empty{}, nil
Girish Gowdru0c588b22019-04-23 23:24:56 -0400158}
159
praneeth nalmas55616d62023-02-06 09:19:18 +0530160// GetOfpDeviceInfo returns OFP information for the given device
khenaidoodc2116e2021-10-19 17:33:19 -0400161func (oo *OpenOLT) GetOfpDeviceInfo(ctx context.Context, device *voltha.Device) (*ca.SwitchCapability, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400162 logger.Infow(ctx, "get_ofp_device_info", log.Fields{"device-id": device.Id})
Girish Gowdru0c588b22019-04-23 23:24:56 -0400163 if handler := oo.getDeviceHandler(device.Id); handler != nil {
164 return handler.GetOfpDeviceInfo(device)
165 }
Girish Kumarf26e4882020-03-05 06:49:10 +0000166 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": device.Id}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400167}
168
praneeth nalmas55616d62023-02-06 09:19:18 +0530169// ReconcileDevice unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400170func (oo *OpenOLT) ReconcileDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
Abhilash Laxmeshwarab0bd522019-10-21 15:05:15 +0530171 if device == nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400172 return nil, olterrors.NewErrInvalidValue(log.Fields{"device": nil}, nil)
Abhilash Laxmeshwarab0bd522019-10-21 15:05:15 +0530173 }
divyadesai3af43e12020-08-18 07:10:54 +0000174 logger.Infow(ctx, "reconcile-device", log.Fields{"device-id": device.Id})
Abhilash Laxmeshwarab0bd522019-10-21 15:05:15 +0530175 var handler *DeviceHandler
176 if handler = oo.getDeviceHandler(device.Id); handler == nil {
Manindere49938d2021-03-19 00:23:24 +0530177 //Setting state to RECONCILING
Nandita Biradar1b590f12024-09-27 10:56:28 +0530178 // Fetch previous state
179 //here we are fetching the previous operation states of the device,so to check which operation state it was previously for proper transition and proper clean up of the resources.
180 PrevOperStatus := device.OperStatus
181
182 // Log previous state
183 logger.Infow(ctx, "previous-device-state", log.Fields{
184 "device-id": device.Id,
185 "previous-operStatus": PrevOperStatus,
186 "Device-connStatus": device.ConnectStatus,
187 })
khenaidoo106c61a2021-08-11 18:05:46 -0400188 cgClient, err := oo.coreClient.GetCoreServiceClient()
Manindere49938d2021-03-19 00:23:24 +0530189 if err != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400190 return nil, err
Manindere49938d2021-03-19 00:23:24 +0530191 }
khenaidoo106c61a2021-08-11 18:05:46 -0400192 subCtx, cancel := context.WithTimeout(log.WithSpanFromContext(context.Background(), ctx), oo.rpcTimeout)
193 defer cancel()
Nandita Biradar1b590f12024-09-27 10:56:28 +0530194 // Create DeviceStateFilter with new state
195 deviceStateFilter := &ca.DeviceStateFilter{
196 DeviceId: device.Id,
197 OperStatus: voltha.OperStatus_RECONCILING,
198 ConnStatus: device.ConnectStatus,
199 }
200
201 // Log the new state being set
202 logger.Infow(ctx, "setting-new-device-state", log.Fields{
203 "device-id": deviceStateFilter.DeviceId,
204 "new-operStatus": deviceStateFilter.OperStatus,
205 "new-connStatus": deviceStateFilter.ConnStatus,
206 })
khenaidoodc2116e2021-10-19 17:33:19 -0400207 if _, err := cgClient.DeviceStateUpdate(subCtx, &ca.DeviceStateFilter{
khenaidoo106c61a2021-08-11 18:05:46 -0400208 DeviceId: device.Id,
209 OperStatus: voltha.OperStatus_RECONCILING,
Akash Sonif49299a2024-04-25 12:06:37 +0530210 ConnStatus: voltha.ConnectStatus_UNREACHABLE,
khenaidoo106c61a2021-08-11 18:05:46 -0400211 }); err != nil {
212 return nil, olterrors.NewErrAdapter("device-update-failed", log.Fields{"device-id": device.Id}, err)
213 }
214
Akash Sonif49299a2024-04-25 12:06:37 +0530215 // The OperState and connection state of the device is set to RECONCILING and UNREACHABLE in the previous section. This also needs to be set on the
Girish Gowdra0fb24a32021-10-27 15:15:27 -0700216 // locally cached copy of the device struct.
217 device.OperStatus = voltha.OperStatus_RECONCILING
Akash Sonif49299a2024-04-25 12:06:37 +0530218 device.ConnectStatus = voltha.ConnectStatus_UNREACHABLE
Girish Gowdra0fb24a32021-10-27 15:15:27 -0700219 handler := NewDeviceHandler(oo.coreClient, oo.eventProxy, device, oo, oo.configManager, oo.config)
220 handler.adapterPreviouslyConnected = true
Nandita Biradar1b590f12024-09-27 10:56:28 +0530221 handler.prevOperStatus = PrevOperStatus
Girish Gowdra0fb24a32021-10-27 15:15:27 -0700222 oo.addDeviceHandlerToMap(handler)
223 handler.transitionMap = NewTransitionMap(handler)
224
Nandita Biradar1b590f12024-09-27 10:56:28 +0530225 go handler.transitionMap.Handle(log.WithSpanFromContext(context.Background(), ctx), DeviceInit)
nikesh.krishnan4d644532023-12-16 00:21:07 +0530226 } else {
227 logger.Warnf(ctx, "device-already-reconciled-or-active", log.Fields{"device-id": device.Id})
228 return &empty.Empty{}, status.Errorf(codes.AlreadyExists, "handler exists: %s", device.Id)
Abhilash Laxmeshwarab0bd522019-10-21 15:05:15 +0530229 }
khenaidoo106c61a2021-08-11 18:05:46 -0400230 return &empty.Empty{}, nil
Girish Gowdru0c588b22019-04-23 23:24:56 -0400231}
232
praneeth nalmas55616d62023-02-06 09:19:18 +0530233// DisableDevice disables the given device
khenaidoo106c61a2021-08-11 18:05:46 -0400234func (oo *OpenOLT) DisableDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
divyadesai3af43e12020-08-18 07:10:54 +0000235 logger.Infow(ctx, "disable-device", log.Fields{"device-id": device.Id})
Girish Gowdru5ba46c92019-04-25 05:00:05 -0400236 if handler := oo.getDeviceHandler(device.Id); handler != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400237 if err := handler.DisableDevice(log.WithSpanFromContext(context.Background(), ctx), device); err != nil {
238 return nil, err
239 }
240 return &empty.Empty{}, nil
Girish Gowdru5ba46c92019-04-25 05:00:05 -0400241 }
khenaidoo106c61a2021-08-11 18:05:46 -0400242 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": device.Id}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400243}
244
praneeth nalmas55616d62023-02-06 09:19:18 +0530245// ReEnableDevice enables the olt device after disable
khenaidoo106c61a2021-08-11 18:05:46 -0400246func (oo *OpenOLT) ReEnableDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
divyadesai3af43e12020-08-18 07:10:54 +0000247 logger.Infow(ctx, "reenable-device", log.Fields{"device-id": device.Id})
Girish Gowdru5ba46c92019-04-25 05:00:05 -0400248 if handler := oo.getDeviceHandler(device.Id); handler != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400249 if err := handler.ReenableDevice(log.WithSpanFromContext(context.Background(), ctx), device); err != nil {
250 return nil, err
251 }
252 return &empty.Empty{}, nil
Girish Gowdru5ba46c92019-04-25 05:00:05 -0400253 }
khenaidoo106c61a2021-08-11 18:05:46 -0400254 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": device.Id}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400255}
256
praneeth nalmas55616d62023-02-06 09:19:18 +0530257// RebootDevice reboots the given device
khenaidoo106c61a2021-08-11 18:05:46 -0400258func (oo *OpenOLT) RebootDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
divyadesai3af43e12020-08-18 07:10:54 +0000259 logger.Infow(ctx, "reboot-device", log.Fields{"device-id": device.Id})
Girish Gowdru0fe5f7e2019-05-28 05:12:27 -0400260 if handler := oo.getDeviceHandler(device.Id); handler != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400261 if err := handler.RebootDevice(log.WithSpanFromContext(context.Background(), ctx), device); err != nil {
262 return nil, err
263 }
264 return &empty.Empty{}, nil
Girish Gowdru0fe5f7e2019-05-28 05:12:27 -0400265 }
khenaidoo106c61a2021-08-11 18:05:46 -0400266 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": device.Id}, nil)
267
Girish Gowdru0c588b22019-04-23 23:24:56 -0400268}
269
praneeth nalmas55616d62023-02-06 09:19:18 +0530270// DeleteDevice deletes a device
khenaidoo106c61a2021-08-11 18:05:46 -0400271func (oo *OpenOLT) DeleteDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
divyadesai3af43e12020-08-18 07:10:54 +0000272 logger.Infow(ctx, "delete-device", log.Fields{"device-id": device.Id})
Devmalya Paul495b94a2019-08-27 19:42:00 -0400273 if handler := oo.getDeviceHandler(device.Id); handler != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400274 if err := handler.DeleteDevice(log.WithSpanFromContext(context.Background(), ctx), device); err != nil {
Gustavo Silva41af9122022-10-11 11:05:13 -0300275 return nil, err
Devmalya Paul495b94a2019-08-27 19:42:00 -0400276 }
Akash Soni5c76e272024-01-15 04:09:24 +0530277 // Initialize a ticker with a 2-second interval to periodically check the states
278 ticker := time.NewTicker(2 * time.Second)
279 defer ticker.Stop()
280
281 // Set a maximum timeout duration of 30 seconds for the loop
282 timeout := time.After(30 * time.Second)
283
284 for {
285 select {
286 case <-ticker.C:
287 // Check if all processes have stopped
288 if !handler.isHeartbeatCheckActive && !handler.isCollectorActive && !handler.isReadIndicationRoutineActive {
289 logger.Debugf(ctx, "delete-device-handler")
290 oo.deleteDeviceHandlerToMap(handler)
291 return &empty.Empty{}, nil
292 }
293 case <-timeout:
294 // Timeout exceeded
295 logger.Warnw(ctx, "delete-device-handler timeout exceeded", log.Fields{"device-id": device.Id})
296 oo.deleteDeviceHandlerToMap(handler) // Clean up anyway
297 return &empty.Empty{}, nil
298 }
299 }
Devmalya Paul495b94a2019-08-27 19:42:00 -0400300 }
khenaidoo106c61a2021-08-11 18:05:46 -0400301 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": device.Id}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400302}
303
praneeth nalmas55616d62023-02-06 09:19:18 +0530304// UpdateFlowsIncrementally updates (add/remove) the flows on a given device
khenaidoodc2116e2021-10-19 17:33:19 -0400305func (oo *OpenOLT) UpdateFlowsIncrementally(ctx context.Context, incrFlows *ca.IncrementalFlows) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400306 logger.Infow(ctx, "update_flows_incrementally", log.Fields{"device-id": incrFlows.Device.Id, "flows": incrFlows.Flows, "flowMetadata": incrFlows.FlowMetadata})
307 if handler := oo.getDeviceHandler(incrFlows.Device.Id); handler != nil {
308 if err := handler.UpdateFlowsIncrementally(log.WithSpanFromContext(context.Background(), ctx), incrFlows.Device, incrFlows.Flows, incrFlows.Groups, incrFlows.FlowMetadata); err != nil {
309 return nil, err
310 }
311 return &empty.Empty{}, nil
Girish Gowdru0c588b22019-04-23 23:24:56 -0400312 }
khenaidoo106c61a2021-08-11 18:05:46 -0400313 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": incrFlows.Device.Id}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400314}
315
praneeth nalmas55616d62023-02-06 09:19:18 +0530316// UpdatePmConfig returns PmConfigs nil or error
khenaidoodc2116e2021-10-19 17:33:19 -0400317func (oo *OpenOLT) UpdatePmConfig(ctx context.Context, configs *ca.PmConfigsInfo) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400318 logger.Debugw(ctx, "update_pm_config", log.Fields{"device-id": configs.DeviceId, "pm-configs": configs.PmConfigs})
319 if handler := oo.getDeviceHandler(configs.DeviceId); handler != nil {
320 handler.UpdatePmConfig(log.WithSpanFromContext(context.Background(), ctx), configs.PmConfigs)
321 return &empty.Empty{}, nil
Rohan Agrawalda5e0b22020-05-20 11:10:26 +0000322 }
khenaidoo106c61a2021-08-11 18:05:46 -0400323 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": configs.DeviceId}, nil)
Girish Gowdru0c588b22019-04-23 23:24:56 -0400324}
325
praneeth nalmas55616d62023-02-06 09:19:18 +0530326// SendPacketOut sends packet out to the device
khenaidoodc2116e2021-10-19 17:33:19 -0400327func (oo *OpenOLT) SendPacketOut(ctx context.Context, packet *ca.PacketOut) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400328 logger.Debugw(ctx, "send_packet_out", log.Fields{"device-id": packet.DeviceId, "egress_port_no": packet.EgressPortNo, "pkt": packet.Packet})
329 if handler := oo.getDeviceHandler(packet.DeviceId); handler != nil {
330 if err := handler.PacketOut(log.WithSpanFromContext(context.Background(), ctx), packet.EgressPortNo, packet.Packet); err != nil {
331 return nil, err
332 }
333 return &empty.Empty{}, nil
manikkaraj k9eb6cac2019-05-09 12:32:03 -0400334 }
khenaidoo106c61a2021-08-11 18:05:46 -0400335 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"device-id": packet.DeviceId}, nil)
336
Girish Gowdru0c588b22019-04-23 23:24:56 -0400337}
338
khenaidoo106c61a2021-08-11 18:05:46 -0400339// EnablePort to Enable PON/NNI interface
340func (oo *OpenOLT) EnablePort(ctx context.Context, port *voltha.Port) (*empty.Empty, error) {
341 logger.Infow(ctx, "enable_port", log.Fields{"device-id": port.DeviceId, "port": port})
342 if err := oo.enableDisablePort(log.WithSpanFromContext(context.Background(), ctx), port.DeviceId, port, true); err != nil {
343 return nil, err
344 }
345 return &empty.Empty{}, nil
Girish Gowdru0c588b22019-04-23 23:24:56 -0400346}
347
khenaidoo106c61a2021-08-11 18:05:46 -0400348// DisablePort to Disable pon/nni interface
349func (oo *OpenOLT) DisablePort(ctx context.Context, port *voltha.Port) (*empty.Empty, error) {
350 logger.Infow(ctx, "disable_port", log.Fields{"device-id": port.DeviceId, "port": port})
351 if err := oo.enableDisablePort(log.WithSpanFromContext(context.Background(), ctx), port.DeviceId, port, false); err != nil {
352 return nil, err
353 }
354 return &empty.Empty{}, nil
kesavand39e0aa32020-01-28 20:58:50 -0500355}
356
357// enableDisablePort to Disable pon or Enable PON interface
Neha Sharma96b7bf22020-06-15 10:37:32 +0000358func (oo *OpenOLT) enableDisablePort(ctx context.Context, deviceID string, port *voltha.Port, enablePort bool) error {
divyadesai3af43e12020-08-18 07:10:54 +0000359 logger.Infow(ctx, "enableDisablePort", log.Fields{"device-id": deviceID, "port": port})
kesavand39e0aa32020-01-28 20:58:50 -0500360 if port == nil {
Thomas Lee S94109f12020-03-03 16:39:29 +0530361 return olterrors.NewErrInvalidValue(log.Fields{
David K. Bainbridge794735f2020-02-11 21:01:37 -0800362 "reason": "port cannot be nil",
363 "device-id": deviceID,
Girish Kumarf26e4882020-03-05 06:49:10 +0000364 "port": nil}, nil)
kesavand39e0aa32020-01-28 20:58:50 -0500365 }
366 if handler := oo.getDeviceHandler(deviceID); handler != nil {
divyadesai3af43e12020-08-18 07:10:54 +0000367 logger.Debugw(ctx, "Enable_Disable_Port", log.Fields{"device-id": deviceID, "port": port})
kesavand39e0aa32020-01-28 20:58:50 -0500368 if enablePort {
Neha Sharma96b7bf22020-06-15 10:37:32 +0000369 if err := handler.EnablePort(ctx, port); err != nil {
divyadesai3af43e12020-08-18 07:10:54 +0000370 return olterrors.NewErrAdapter("error-occurred-during-enable-port", log.Fields{"device-id": deviceID, "port": port}, err)
kesavand39e0aa32020-01-28 20:58:50 -0500371 }
372 } else {
Neha Sharma96b7bf22020-06-15 10:37:32 +0000373 if err := handler.DisablePort(ctx, port); err != nil {
divyadesai3af43e12020-08-18 07:10:54 +0000374 return olterrors.NewErrAdapter("error-occurred-during-disable-port", log.Fields{"device-id": deviceID, "port": port}, err)
kesavand39e0aa32020-01-28 20:58:50 -0500375 }
376 }
377 }
378 return nil
379}
Chaitrashree G S1a55b882020-02-04 17:35:35 -0500380
praneeth nalmas55616d62023-02-06 09:19:18 +0530381// ChildDeviceLost deletes the ONU and its references from PONResources
khenaidoo106c61a2021-08-11 18:05:46 -0400382func (oo *OpenOLT) ChildDeviceLost(ctx context.Context, childDevice *voltha.Device) (*empty.Empty, error) {
Girish Gowdraa0870562021-03-11 14:30:14 -0800383 logger.Infow(ctx, "Child-device-lost", log.Fields{"parent-device-id": childDevice.ParentId, "child-device-id": childDevice.Id})
384 if handler := oo.getDeviceHandler(childDevice.ParentId); handler != nil {
khenaidoo106c61a2021-08-11 18:05:46 -0400385 if err := handler.ChildDeviceLost(log.WithSpanFromContext(context.Background(), ctx), childDevice.ParentPortNo, childDevice.ProxyAddress.OnuId, childDevice.SerialNumber); err != nil {
386 return nil, err
387 }
388 return &empty.Empty{}, nil
Chaitrashree G S1a55b882020-02-04 17:35:35 -0500389 }
khenaidoo106c61a2021-08-11 18:05:46 -0400390 return nil, olterrors.NewErrNotFound("device-handler", log.Fields{"parent-device-id": childDevice.ParentId}, nil).Log()
Chaitrashree G S1a55b882020-02-04 17:35:35 -0500391}
Scott Baker24f83e22020-03-30 16:14:28 -0700392
khenaidoo106c61a2021-08-11 18:05:46 -0400393// GetExtValue retrieves a value on a particular ONU
khenaidoodc2116e2021-10-19 17:33:19 -0400394func (oo *OpenOLT) GetExtValue(ctx context.Context, extInfo *ca.GetExtValueMessage) (*extension.ReturnValues, error) {
Dinesh Belwalkardb587af2020-02-27 15:37:16 -0800395 var err error
khenaidoodc2116e2021-10-19 17:33:19 -0400396 resp := new(extension.ReturnValues)
khenaidoo106c61a2021-08-11 18:05:46 -0400397 logger.Infow(ctx, "get_ext_value", log.Fields{"parent-device-id": extInfo.ParentDevice.Id, "onu-id": extInfo.ChildDevice.Id})
398 if handler := oo.getDeviceHandler(extInfo.ParentDevice.Id); handler != nil {
399 if resp, err = handler.getExtValue(ctx, extInfo.ChildDevice, extInfo.ValueType); err != nil {
400 logger.Errorw(ctx, "error-occurred-during-get-ext-value",
401 log.Fields{"parent-device-id": extInfo.ParentDevice.Id, "onu-id": extInfo.ChildDevice.Id, "error": err})
Dinesh Belwalkardb587af2020-02-27 15:37:16 -0800402 return nil, err
403 }
404 }
405 return resp, nil
406}
kesavand62126212021-01-12 04:56:06 -0500407
praneeth nalmas55616d62023-02-06 09:19:18 +0530408// GetSingleValue handles get uni status on ONU and ondemand metric on OLT
khenaidoo106c61a2021-08-11 18:05:46 -0400409func (oo *OpenOLT) GetSingleValue(ctx context.Context, request *extension.SingleGetValueRequest) (*extension.SingleGetValueResponse, error) {
410 logger.Infow(ctx, "single_get_value_request", log.Fields{"request": request})
kesavand62126212021-01-12 04:56:06 -0500411
412 errResp := func(status extension.GetValueResponse_Status,
413 reason extension.GetValueResponse_ErrorReason) *extension.SingleGetValueResponse {
414 return &extension.SingleGetValueResponse{
415 Response: &extension.GetValueResponse{
416 Status: status,
417 ErrReason: reason,
418 },
419 }
420 }
421 if handler := oo.getDeviceHandler(request.TargetId); handler != nil {
422 switch reqType := request.GetRequest().GetRequest().(type) {
423 case *extension.GetValueRequest_OltPortInfo:
424 return handler.getOltPortCounters(ctx, reqType.OltPortInfo), nil
Himani Chawla2c8ae0f2021-05-18 23:27:00 +0530425 case *extension.GetValueRequest_OnuPonInfo:
426 return handler.getOnuPonCounters(ctx, reqType.OnuPonInfo), nil
Gamze Abaka85e9a142021-05-26 13:41:39 +0000427 case *extension.GetValueRequest_RxPower:
428 return handler.getRxPower(ctx, reqType.RxPower), nil
praneeth nalmas55616d62023-02-06 09:19:18 +0530429 case *extension.GetValueRequest_OltRxPower:
430 return handler.getPONRxPower(ctx, reqType.OltRxPower), nil
Akash Soni3bcf5e02024-12-03 08:01:48 +0530431 case *extension.GetValueRequest_OffloadedAppsStats:
432 return handler.getOltOffloadStats(ctx, reqType.OffloadedAppsStats), nil
kesavand62126212021-01-12 04:56:06 -0500433 default:
434 return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_UNSUPPORTED), nil
435 }
436 }
437
438 logger.Infow(ctx, "Single_get_value_request failed ", log.Fields{"request": request})
439 return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_INVALID_DEVICE_ID), nil
440}
khenaidoo106c61a2021-08-11 18:05:46 -0400441
Akash Soni3bcf5e02024-12-03 08:01:48 +0530442// SetSingleValue is implemented
443func (oo *OpenOLT) SetSingleValue(ctx context.Context, request *extension.SingleSetValueRequest) (*extension.SingleSetValueResponse, error) {
444 logger.Infow(ctx, "single_set_value_request", log.Fields{"request": request})
445
446 errResp := func(status extension.SetValueResponse_Status,
447 reason extension.SetValueResponse_ErrorReason) *extension.SingleSetValueResponse {
448 return &extension.SingleSetValueResponse{
449 Response: &extension.SetValueResponse{
450 Status: status,
451 ErrReason: reason,
452 },
453 }
454 }
455 if handler := oo.getDeviceHandler(request.TargetId); handler != nil {
456 switch reqType := request.GetRequest().GetRequest().(type) {
457 case *extension.SetValueRequest_AppOffloadConfig:
458 return handler.setOltOffloadStats(ctx, reqType.AppOffloadConfig), nil
459 default:
460 return errResp(extension.SetValueResponse_ERROR, extension.SetValueResponse_UNSUPPORTED), nil
461 }
462 }
463
464 logger.Infow(ctx, "Single_set_value_request failed ", log.Fields{"request": request})
465 return errResp(extension.SetValueResponse_ERROR, extension.SetValueResponse_INVALID_DEVICE_ID), nil
466}
467
khenaidoo106c61a2021-08-11 18:05:46 -0400468/*
469 * OLT Inter-adapter service
470 */
471
kesavandb9f54fd2021-11-25 20:08:04 +0530472// ProxyOmciRequests proxies an onu sw download OMCI request from the child adapter
473func (oo *OpenOLT) ProxyOmciRequests(ctx context.Context, request *ia.OmciMessages) (*empty.Empty, error) {
474 if handler := oo.getDeviceHandler(request.ParentDeviceId); handler != nil {
475 if err := handler.ProxyOmciRequests(ctx, request); err != nil {
Abhilash Laxmeshwar092e6ca2022-12-08 19:51:27 +0530476 return nil, err
kesavandb9f54fd2021-11-25 20:08:04 +0530477 }
478 return &empty.Empty{}, nil
479 }
480 return nil, olterrors.NewErrNotFound("no-device-handler", log.Fields{"parent-device-id": request.ParentDeviceId, "child-device-id": request.ChildDeviceId}, nil).Log()
481}
482
khenaidoo106c61a2021-08-11 18:05:46 -0400483// ProxyOmciRequest proxies an OMCI request from the child adapter
khenaidoodc2116e2021-10-19 17:33:19 -0400484func (oo *OpenOLT) ProxyOmciRequest(ctx context.Context, request *ia.OmciMessage) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400485 logger.Debugw(ctx, "proxy-omci-request", log.Fields{"request": request})
486
487 if handler := oo.getDeviceHandler(request.ParentDeviceId); handler != nil {
488 if err := handler.ProxyOmciMessage(ctx, request); err != nil {
Abhilash Laxmeshwar092e6ca2022-12-08 19:51:27 +0530489 return nil, err
khenaidoo106c61a2021-08-11 18:05:46 -0400490 }
491 return &empty.Empty{}, nil
492 }
493 return nil, olterrors.NewErrNotFound("no-device-handler", log.Fields{"parent-device-id": request.ParentDeviceId, "child-device-id": request.ChildDeviceId}, nil).Log()
494}
495
496// GetTechProfileInstance returns an instance of a tech profile
khenaidoodc2116e2021-10-19 17:33:19 -0400497func (oo *OpenOLT) GetTechProfileInstance(ctx context.Context, request *ia.TechProfileInstanceRequestMessage) (*ia.TechProfileDownloadMessage, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400498 logger.Debugw(ctx, "getting-tech-profile-request", log.Fields{"request": request})
499
500 targetDeviceID := request.ParentDeviceId
501 if targetDeviceID == "" {
502 return nil, olterrors.NewErrNotFound("parent-id-empty", log.Fields{"parent-device-id": request.ParentDeviceId, "child-device-id": request.DeviceId}, nil).Log()
503 }
504 if handler := oo.getDeviceHandler(targetDeviceID); handler != nil {
505 return handler.GetTechProfileDownloadMessage(ctx, request)
506 }
507 return nil, olterrors.NewErrNotFound("no-device-handler", log.Fields{"parent-device-id": request.ParentDeviceId, "child-device-id": request.DeviceId}, nil).Log()
508
509}
510
khenaidooefff76e2021-12-15 16:51:30 -0500511// GetHealthStatus is used by a OltAdapterService client to detect a connection
512// lost with the gRPC server hosting the OltAdapterService service
513func (oo *OpenOLT) GetHealthStatus(stream adapter_service.AdapterService_GetHealthStatusServer) error {
514 ctx := context.Background()
515 logger.Debugw(ctx, "receive-stream-connection", log.Fields{"stream": stream})
516
517 if stream == nil {
518 return fmt.Errorf("conn-is-nil %v", stream)
519 }
520 initialRequestTime := time.Now()
521 var remoteClient *common.Connection
522 var tempClient *common.Connection
523 var err error
524loop:
525 for {
526 tempClient, err = stream.Recv()
527 if err != nil {
528 logger.Warnw(ctx, "received-stream-error", log.Fields{"remote-client": remoteClient, "error": err})
529 break loop
530 }
531 // Send a response back
532 err = stream.Send(&health.HealthStatus{State: health.HealthStatus_HEALTHY})
533 if err != nil {
534 logger.Warnw(ctx, "sending-stream-error", log.Fields{"remote-client": remoteClient, "error": err})
535 break loop
536 }
537
538 remoteClient = tempClient
539 logger.Debugw(ctx, "received-keep-alive", log.Fields{"remote-client": remoteClient})
540
541 select {
542 case <-stream.Context().Done():
543 logger.Infow(ctx, "stream-keep-alive-context-done", log.Fields{"remote-client": remoteClient, "error": stream.Context().Err()})
544 break loop
545 case <-oo.exitChannel:
546 logger.Warnw(ctx, "received-stop", log.Fields{"remote-client": remoteClient, "initial-conn-time": initialRequestTime})
547 break loop
548 default:
549 }
550 }
551 logger.Errorw(ctx, "connection-down", log.Fields{"remote-client": remoteClient, "error": err, "initial-conn-time": initialRequestTime})
552 return err
553}
554
khenaidoo106c61a2021-08-11 18:05:46 -0400555/*
556 *
557 * Unimplemented APIs
558 *
559 */
560
praneeth nalmas55616d62023-02-06 09:19:18 +0530561// SimulateAlarm is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400562func (oo *OpenOLT) SimulateAlarm(context.Context, *ca.SimulateAlarmMessage) (*voltha.OperationResp, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400563 return nil, olterrors.ErrNotImplemented
564}
565
praneeth nalmas55616d62023-02-06 09:19:18 +0530566// SetExtValue is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400567func (oo *OpenOLT) SetExtValue(context.Context, *ca.SetExtValueMessage) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400568 return nil, olterrors.ErrNotImplemented
569}
570
praneeth nalmas55616d62023-02-06 09:19:18 +0530571// StartOmciTest not implemented
khenaidoodc2116e2021-10-19 17:33:19 -0400572func (oo *OpenOLT) StartOmciTest(ctx context.Context, test *ca.OMCITest) (*omci.TestResponse, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400573 return nil, olterrors.ErrNotImplemented
574}
575
praneeth nalmas55616d62023-02-06 09:19:18 +0530576// SuppressEvent unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400577func (oo *OpenOLT) SuppressEvent(ctx context.Context, filter *voltha.EventFilter) (*empty.Empty, error) {
578 return nil, olterrors.ErrNotImplemented
579}
580
praneeth nalmas55616d62023-02-06 09:19:18 +0530581// UnSuppressEvent unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400582func (oo *OpenOLT) UnSuppressEvent(ctx context.Context, filter *voltha.EventFilter) (*empty.Empty, error) {
583 return nil, olterrors.ErrNotImplemented
584}
585
praneeth nalmas55616d62023-02-06 09:19:18 +0530586// DownloadImage is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400587func (oo *OpenOLT) DownloadImage(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400588 return nil, olterrors.ErrNotImplemented
589}
590
praneeth nalmas55616d62023-02-06 09:19:18 +0530591// GetImageDownloadStatus is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400592func (oo *OpenOLT) GetImageDownloadStatus(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400593 return nil, olterrors.ErrNotImplemented
594}
595
praneeth nalmas55616d62023-02-06 09:19:18 +0530596// CancelImageDownload is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400597func (oo *OpenOLT) CancelImageDownload(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400598 return nil, olterrors.ErrNotImplemented
599}
600
praneeth nalmas55616d62023-02-06 09:19:18 +0530601// ActivateImageUpdate is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400602func (oo *OpenOLT) ActivateImageUpdate(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400603 return nil, olterrors.ErrNotImplemented
604}
605
praneeth nalmas55616d62023-02-06 09:19:18 +0530606// RevertImageUpdate is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400607func (oo *OpenOLT) RevertImageUpdate(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400608 return nil, olterrors.ErrNotImplemented
609}
610
praneeth nalmas55616d62023-02-06 09:19:18 +0530611// DownloadOnuImage unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400612func (oo *OpenOLT) DownloadOnuImage(ctx context.Context, request *voltha.DeviceImageDownloadRequest) (*voltha.DeviceImageResponse, error) {
613 return nil, olterrors.ErrNotImplemented
614}
615
praneeth nalmas55616d62023-02-06 09:19:18 +0530616// GetOnuImageStatus unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400617func (oo *OpenOLT) GetOnuImageStatus(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
618 return nil, olterrors.ErrNotImplemented
619}
620
praneeth nalmas55616d62023-02-06 09:19:18 +0530621// AbortOnuImageUpgrade unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400622func (oo *OpenOLT) AbortOnuImageUpgrade(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
623 return nil, olterrors.ErrNotImplemented
624}
625
praneeth nalmas55616d62023-02-06 09:19:18 +0530626// GetOnuImages unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400627func (oo *OpenOLT) GetOnuImages(ctx context.Context, deviceID *common.ID) (*voltha.OnuImages, error) {
628 return nil, olterrors.ErrNotImplemented
629}
630
praneeth nalmas55616d62023-02-06 09:19:18 +0530631// ActivateOnuImage unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400632func (oo *OpenOLT) ActivateOnuImage(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
633 return nil, olterrors.ErrNotImplemented
634}
635
praneeth nalmas55616d62023-02-06 09:19:18 +0530636// CommitOnuImage unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400637func (oo *OpenOLT) CommitOnuImage(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
638 return nil, olterrors.ErrNotImplemented
639}
640
641// UpdateFlowsBulk is unimplemented
khenaidoodc2116e2021-10-19 17:33:19 -0400642func (oo *OpenOLT) UpdateFlowsBulk(ctx context.Context, flows *ca.BulkFlows) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -0400643 return nil, olterrors.ErrNotImplemented
644}
645
praneeth nalmas55616d62023-02-06 09:19:18 +0530646// SelfTestDevice unimplemented
khenaidoo106c61a2021-08-11 18:05:46 -0400647func (oo *OpenOLT) SelfTestDevice(ctx context.Context, device *voltha.Device) (*empty.Empty, error) {
648 return nil, olterrors.ErrNotImplemented
649}