blob: af9092119b398a8c11b93630aa458dca09b75180 [file] [log] [blame]
Matteo Scandolo4747d292019-08-05 11:50:18 -07001package devices
2
3import (
4 "context"
5 "errors"
6 "fmt"
Matteo Scandolod54283a2019-08-13 16:22:31 -07007 "github.com/opencord/voltha-protos/go/openolt"
Matteo Scandolo4747d292019-08-05 11:50:18 -07008 "github.com/looplab/fsm"
Matteo Scandolod54283a2019-08-13 16:22:31 -07009 "github.com/opencord/voltha-protos/go/tech_profile"
Matteo Scandolo4747d292019-08-05 11:50:18 -070010 log "github.com/sirupsen/logrus"
11 "google.golang.org/grpc"
12 "net"
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070013 "os"
Matteo Scandolo4747d292019-08-05 11:50:18 -070014 "sync"
15)
16
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070017var oltLogger = log.WithFields(log.Fields{
Matteo Scandolo84f7d482019-08-08 19:00:47 -070018 "module": "OLT",
19})
20
Matteo Scandolo4747d292019-08-05 11:50:18 -070021func init() {
22 //log.SetReportCaller(true)
23 log.SetLevel(log.DebugLevel)
24}
25
Matteo Scandolo84f7d482019-08-08 19:00:47 -070026var olt = OltDevice{}
27
28func GetOLT() OltDevice {
29 return olt
30}
31
Matteo Scandolo4747d292019-08-05 11:50:18 -070032func CreateOLT(seq int, nni int, pon int, onuPerPon int) OltDevice {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070033 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -070034 "ID": seq,
35 "NumNni":nni,
36 "NumPon":pon,
37 "NumOnuPerPon":onuPerPon,
38 }).Debug("CreateOLT")
39
Matteo Scandolo84f7d482019-08-08 19:00:47 -070040 olt = OltDevice{
Matteo Scandolo4747d292019-08-05 11:50:18 -070041 ID: seq,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070042 OperState: getOperStateFSM(func(e *fsm.Event) {
43 oltLogger.Debugf("Changing OLT OperState from %s to %s", e.Src, e.Dst)
44 }),
Matteo Scandolo4747d292019-08-05 11:50:18 -070045 NumNni:nni,
46 NumPon:pon,
47 NumOnuPerPon:onuPerPon,
48 Pons: []PonPort{},
49 Nnis: []NniPort{},
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070050 channel: make(chan Message),
Matteo Scandolo4747d292019-08-05 11:50:18 -070051 }
52
53 // OLT State machine
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070054 // NOTE do we need 2 state machines for the OLT? (InternalState and OperState)
Matteo Scandolo4747d292019-08-05 11:50:18 -070055 olt.InternalState = fsm.NewFSM(
56 "created",
57 fsm.Events{
58 {Name: "enable", Src: []string{"created"}, Dst: "enabled"},
59 {Name: "disable", Src: []string{"enabled"}, Dst: "disabled"},
60 },
61 fsm.Callbacks{
62 "enter_state": func(e *fsm.Event) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070063 oltLogger.Debugf("Changing OLT InternalState from %s to %s", e.Src, e.Dst)
Matteo Scandolo4747d292019-08-05 11:50:18 -070064 },
65 },
66 )
67
68 // create NNI Port
69 nniPort := NniPort{
70 ID: uint32(0),
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070071 OperState: getOperStateFSM(func(e *fsm.Event) {
72 oltLogger.Debugf("Changing NNI OperState from %s to %s", e.Src, e.Dst)
73 }),
Matteo Scandolo4747d292019-08-05 11:50:18 -070074 Type: "nni",
75 }
76 olt.Nnis = append(olt.Nnis, nniPort)
77
78 // create PON ports
79 for i := 0; i < pon; i++ {
80 p := PonPort{
81 NumOnu: olt.NumOnuPerPon,
82 ID: uint32(i),
Matteo Scandolo4747d292019-08-05 11:50:18 -070083 Type: "pon",
84 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070085 p.OperState = getOperStateFSM(func(e *fsm.Event) {
86 oltLogger.WithFields(log.Fields{
87 "ID": p.ID,
88 }).Debugf("Changing PON Port OperState from %s to %s", e.Src, e.Dst)
89 })
Matteo Scandolo4747d292019-08-05 11:50:18 -070090
91 // create ONU devices
92 for j := 0; j < onuPerPon; j++ {
93 o := CreateONU(olt, p, uint32(j + 1))
94 p.Onus = append(p.Onus, o)
95 }
96
97 olt.Pons = append(olt.Pons, p)
98 }
99
100 wg := sync.WaitGroup{}
101
102 wg.Add(1)
103 go newOltServer(olt)
104 wg.Wait()
105 return olt
106}
107
108func newOltServer(o OltDevice) error {
109 // TODO make configurable
110 address := "0.0.0.0:50060"
Matteo Scandolo4747d292019-08-05 11:50:18 -0700111 lis, err := net.Listen("tcp", address)
112 if err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700113 oltLogger.Fatalf("OLT failed to listen: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700114 }
115 grpcServer := grpc.NewServer()
116 openolt.RegisterOpenoltServer(grpcServer, o)
117
118 go grpcServer.Serve(lis)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700119 oltLogger.Debugf("OLT Listening on: %v", address)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700120
121 return nil
122}
123
124// Device Methods
125
126func (o OltDevice) Enable (stream openolt.Openolt_EnableIndicationServer) error {
127
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700128 oltLogger.Debug("Enable OLT called")
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700129
Matteo Scandolo4747d292019-08-05 11:50:18 -0700130 wg := sync.WaitGroup{}
131 wg.Add(1)
132
133 // create a channel for all the OLT events
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700134 go o.processOltMessages(stream)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700135
136 // enable the OLT
137 olt_msg := Message{
138 Type: OltIndication,
139 Data: OltIndicationMessage{
140 OperState: UP,
141 },
142 }
143 o.channel <- olt_msg
144
145 // send NNI Port Indications
146 for _, nni := range o.Nnis {
147 msg := Message{
148 Type: NniIndication,
149 Data: NniIndicationMessage{
150 OperState: UP,
151 NniPortID: nni.ID,
152 },
153 }
154 o.channel <- msg
155 }
156
157 // send PON Port indications
158 for _, pon := range o.Pons {
159 msg := Message{
160 Type: PonIndication,
161 Data: PonIndicationMessage{
162 OperState: UP,
163 PonPortID: pon.ID,
164 },
165 }
166 o.channel <- msg
167
168 for _, onu := range pon.Onus {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700169 go onu.processOnuMessages(stream)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700170 msg := Message{
171 Type: OnuDiscIndication,
172 Data: OnuDiscIndicationMessage{
173 Onu: onu,
174 OperState: UP,
175 },
176 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700177 onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700178 }
179 }
180
181 wg.Wait()
182 return nil
183}
184
185// Helpers method
186
187func (o OltDevice) getPonById(id uint32) (*PonPort, error) {
188 for _, pon := range o.Pons {
189 if pon.ID == id {
190 return &pon, nil
191 }
192 }
193 return nil, errors.New(fmt.Sprintf("Cannot find PonPort with id %d in OLT %d", id, o.ID))
194}
195
196func (o OltDevice) getNniById(id uint32) (*NniPort, error) {
197 for _, nni := range o.Nnis {
198 if nni.ID == id {
199 return &nni, nil
200 }
201 }
202 return nil, errors.New(fmt.Sprintf("Cannot find NniPort with id %d in OLT %d", id, o.ID))
203}
204
Matteo Scandolo4747d292019-08-05 11:50:18 -0700205func (o OltDevice) sendOltIndication(msg OltIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
206 data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: msg.OperState.String()}}
207 if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700208 oltLogger.Error("Failed to send Indication_OltInd: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700209 }
210
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700211 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700212 "OperState": msg.OperState,
213 }).Debug("Sent Indication_OltInd")
214}
215
216func (o OltDevice) sendNniIndication(msg NniIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
217 nni, _ := o.getNniById(msg.NniPortID)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700218 nni.OperState.Event("enable")
219 // NOTE Operstate may need to be an integer
Matteo Scandolo4747d292019-08-05 11:50:18 -0700220 operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
221 Type: nni.Type,
222 IntfId: nni.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700223 OperState: nni.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700224 }}
225
226 if err := stream.Send(&openolt.Indication{Data: operData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700227 oltLogger.Error("Failed to send Indication_IntfOperInd for NNI: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700228 }
229
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700230 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700231 "Type": nni.Type,
232 "IntfId": nni.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700233 "OperState": nni.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700234 }).Debug("Sent Indication_IntfOperInd for NNI")
235}
236
237func (o OltDevice) sendPonIndication(msg PonIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
238 pon, _ := o.getPonById(msg.PonPortID)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700239 pon.OperState.Event("enable")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700240 discoverData := &openolt.Indication_IntfInd{IntfInd: &openolt.IntfIndication{
241 IntfId: pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700242 OperState: pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700243 }}
244
245 if err := stream.Send(&openolt.Indication{Data: discoverData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700246 oltLogger.Error("Failed to send Indication_IntfInd: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700247 }
248
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700249 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700250 "IntfId": pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700251 "OperState": pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700252 }).Debug("Sent Indication_IntfInd")
253
254 operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
255 Type: pon.Type,
256 IntfId: pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700257 OperState: pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700258 }}
259
260 if err := stream.Send(&openolt.Indication{Data: operData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700261 oltLogger.Error("Failed to send Indication_IntfOperInd for PON: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700262 }
263
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700264 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700265 "Type": pon.Type,
266 "IntfId": pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700267 "OperState": pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700268 }).Debug("Sent Indication_IntfOperInd for PON")
269}
270
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700271func (o OltDevice) processOltMessages(stream openolt.Openolt_EnableIndicationServer) {
272 oltLogger.Debug("Started OLT Indication Channel")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700273 for message := range o.channel {
274
Matteo Scandolo4747d292019-08-05 11:50:18 -0700275
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700276 oltLogger.WithFields(log.Fields{
277 "oltId": o.ID,
278 "messageType": message.Type,
279 }).Trace("Received message")
280
281 switch message.Type {
282 case OltIndication:
283 msg, _ := message.Data.(OltIndicationMessage)
284 if msg.OperState == UP {
Matteo Scandolo4747d292019-08-05 11:50:18 -0700285 o.InternalState.Event("enable")
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700286 o.OperState.Event("enable")
287 } else if msg.OperState == DOWN {
288 o.InternalState.Event("disable")
289 o.OperState.Event("disable")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700290 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700291 o.sendOltIndication(msg, stream)
292 case NniIndication:
293 msg, _ := message.Data.(NniIndicationMessage)
294 o.sendNniIndication(msg, stream)
295 case PonIndication:
296 msg, _ := message.Data.(PonIndicationMessage)
297 o.sendPonIndication(msg, stream)
298 default:
299 oltLogger.Warnf("Received unknown message data %v for type %v in OLT channel", message.Data, message.Type)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700300 }
301
302 }
303}
304
305// GRPC Endpoints
306
307func (o OltDevice) ActivateOnu(context context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700308 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700309 "onuSerialNumber": onu.SerialNumber,
310 }).Info("Received ActivateOnu call from VOLTHA")
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700311
312 pon, _ := o.getPonById(onu.IntfId)
313 _onu, _ := pon.getOnuBySn(onu.SerialNumber)
314
315 // NOTE we need to immediately activate the ONU or the OMCI state machine won't start
Matteo Scandolo4747d292019-08-05 11:50:18 -0700316 msg := Message{
317 Type: OnuIndication,
318 Data: OnuIndicationMessage{
319 OnuSN: onu.SerialNumber,
320 PonPortID: onu.IntfId,
321 OperState: UP,
322 },
323 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700324 _onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700325 return new(openolt.Empty) , nil
326}
327
328func (o OltDevice) DeactivateOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700329 oltLogger.Error("DeactivateOnu not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700330 return new(openolt.Empty) , nil
331}
332
333func (o OltDevice) DeleteOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700334 oltLogger.Error("DeleteOnu not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700335 return new(openolt.Empty) , nil
336}
337
338func (o OltDevice) DisableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700339 // NOTE when we disable the OLT should we disable NNI, PONs and ONUs altogether?
340 olt_msg := Message{
341 Type: OltIndication,
342 Data: OltIndicationMessage{
343 OperState: DOWN,
344 },
345 }
346 o.channel <- olt_msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700347 return new(openolt.Empty) , nil
348}
349
350func (o OltDevice) DisablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700351 oltLogger.Error("DisablePonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700352 return new(openolt.Empty) , nil
353}
354
355func (o OltDevice) EnableIndication(_ *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700356 oltLogger.WithField("oltId", o.ID).Info("OLT receives EnableIndication call from VOLTHA")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700357 o.Enable(stream)
358 return nil
359}
360
361func (o OltDevice) EnablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700362 oltLogger.Error("EnablePonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700363 return new(openolt.Empty) , nil
364}
365
366func (o OltDevice) FlowAdd(context.Context, *openolt.Flow) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700367 oltLogger.Error("FlowAdd not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700368 return new(openolt.Empty) , nil
369}
370
371func (o OltDevice) FlowRemove(context.Context, *openolt.Flow) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700372 oltLogger.Error("FlowRemove not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700373 return new(openolt.Empty) , nil
374}
375
376func (o OltDevice) HeartbeatCheck(context.Context, *openolt.Empty) (*openolt.Heartbeat, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700377 oltLogger.Error("HeartbeatCheck not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700378 return new(openolt.Heartbeat) , nil
379}
380
381func (o OltDevice) GetDeviceInfo(context.Context, *openolt.Empty) (*openolt.DeviceInfo, error) {
382
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700383 oltLogger.WithField("oltId", o.ID).Info("OLT receives GetDeviceInfo call from VOLTHA")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700384 devinfo := new(openolt.DeviceInfo)
385 devinfo.Vendor = "BBSim"
386 devinfo.Model = "asfvolt16"
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700387 devinfo.HardwareVersion = "emulated"
Matteo Scandolo4747d292019-08-05 11:50:18 -0700388 devinfo.FirmwareVersion = ""
389 devinfo.Technology = "xgspon"
390 devinfo.PonPorts = 1
391 devinfo.OnuIdStart = 1
392 devinfo.OnuIdEnd = 255
393 devinfo.AllocIdStart = 1024
394 devinfo.AllocIdEnd = 16383
395 devinfo.GemportIdStart = 1024
396 devinfo.GemportIdEnd = 65535
397 devinfo.FlowIdStart = 1
398 devinfo.FlowIdEnd = 16383
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700399 devinfo.DeviceSerialNumber = fmt.Sprintf("BBSIM_OLT_%d", o.ID)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700400
401 return devinfo, nil
402}
403
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700404func (o OltDevice) OmciMsgOut(ctx context.Context, omci_msg *openolt.OmciMsg) (*openolt.Empty, error) {
405 oltLogger.Debugf("Recevied OmciMsgOut - IntfId: %d OnuId: %d", omci_msg.IntfId, omci_msg.OnuId)
406 pon, _ := o.getPonById(omci_msg.IntfId)
407 onu, _ := pon.getOnuById(omci_msg.OnuId)
408 msg := Message{
409 Type: OMCI,
410 Data: OmciMessage{
411 OnuSN: onu.SerialNumber,
412 OnuId: onu.ID,
413 msg: omci_msg,
414 },
415 }
416 onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700417 return new(openolt.Empty) , nil
418}
419
420func (o OltDevice) OnuPacketOut(context.Context, *openolt.OnuPacket) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700421 oltLogger.Error("OnuPacketOut not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700422 return new(openolt.Empty) , nil
423}
424
425func (o OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700426 oltLogger.Info("Shutting Down, hope you're running in K8s...")
427 os.Exit(0)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700428 return new(openolt.Empty) , nil
429}
430
431func (o OltDevice) ReenableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700432 oltLogger.Error("ReenableOlt not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700433 return new(openolt.Empty) , nil
434}
435
436func (o OltDevice) UplinkPacketOut(context context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700437 oltLogger.Error("UplinkPacketOut not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700438 return new(openolt.Empty) , nil
439}
440
441func (o OltDevice) CollectStatistics(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700442 oltLogger.Error("CollectStatistics not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700443 return new(openolt.Empty) , nil
444}
445
Matteo Scandolo4747d292019-08-05 11:50:18 -0700446func (o OltDevice) GetOnuInfo(context context.Context, packet *openolt.Onu) (*openolt.OnuIndication, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700447 oltLogger.Error("GetOnuInfo not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700448 return new(openolt.OnuIndication) , nil
449}
450
451func (o OltDevice) GetPonIf(context context.Context, packet *openolt.Interface) (*openolt.IntfIndication, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700452 oltLogger.Error("GetPonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700453 return new(openolt.IntfIndication) , nil
Matteo Scandolod54283a2019-08-13 16:22:31 -0700454}
455
456func (s OltDevice) CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error) {
457 oltLogger.Error("CreateTrafficQueues not implemented")
458 return new(openolt.Empty), nil
459}
460
461func (s OltDevice) RemoveTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error) {
462 oltLogger.Error("RemoveTrafficQueues not implemented")
463 return new(openolt.Empty), nil
464}
465
466func (s OltDevice) CreateTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*openolt.Empty, error) {
467 oltLogger.Error("CreateTrafficSchedulers not implemented")
468 return new(openolt.Empty), nil
469}
470
471func (s OltDevice) RemoveTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*openolt.Empty, error) {
472 oltLogger.Error("RemoveTrafficSchedulers not implemented")
473 return new(openolt.Empty), nil
Matteo Scandolo4747d292019-08-05 11:50:18 -0700474}