blob: 1923b143204fefdd64cb267112f2bb8ee6811d77 [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
Matteo Scandoloda9cbe22019-08-19 16:05:10 -070079 onuId := 1
Matteo Scandolo4747d292019-08-05 11:50:18 -070080 for i := 0; i < pon; i++ {
81 p := PonPort{
82 NumOnu: olt.NumOnuPerPon,
83 ID: uint32(i),
Matteo Scandolo4747d292019-08-05 11:50:18 -070084 Type: "pon",
85 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070086 p.OperState = getOperStateFSM(func(e *fsm.Event) {
87 oltLogger.WithFields(log.Fields{
88 "ID": p.ID,
89 }).Debugf("Changing PON Port OperState from %s to %s", e.Src, e.Dst)
90 })
Matteo Scandolo4747d292019-08-05 11:50:18 -070091
92 // create ONU devices
93 for j := 0; j < onuPerPon; j++ {
Matteo Scandoloda9cbe22019-08-19 16:05:10 -070094 o := CreateONU(olt, p, uint32(onuId))
Matteo Scandolo4747d292019-08-05 11:50:18 -070095 p.Onus = append(p.Onus, o)
Matteo Scandoloda9cbe22019-08-19 16:05:10 -070096 onuId = onuId + 1
Matteo Scandolo4747d292019-08-05 11:50:18 -070097 }
98
99 olt.Pons = append(olt.Pons, p)
100 }
101
102 wg := sync.WaitGroup{}
103
104 wg.Add(1)
105 go newOltServer(olt)
106 wg.Wait()
107 return olt
108}
109
110func newOltServer(o OltDevice) error {
111 // TODO make configurable
112 address := "0.0.0.0:50060"
Matteo Scandolo4747d292019-08-05 11:50:18 -0700113 lis, err := net.Listen("tcp", address)
114 if err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700115 oltLogger.Fatalf("OLT failed to listen: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700116 }
117 grpcServer := grpc.NewServer()
118 openolt.RegisterOpenoltServer(grpcServer, o)
119
120 go grpcServer.Serve(lis)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700121 oltLogger.Debugf("OLT Listening on: %v", address)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700122
123 return nil
124}
125
126// Device Methods
127
128func (o OltDevice) Enable (stream openolt.Openolt_EnableIndicationServer) error {
129
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700130 oltLogger.Debug("Enable OLT called")
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700131
Matteo Scandolo4747d292019-08-05 11:50:18 -0700132 wg := sync.WaitGroup{}
133 wg.Add(1)
134
135 // create a channel for all the OLT events
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700136 go o.processOltMessages(stream)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700137
138 // enable the OLT
139 olt_msg := Message{
140 Type: OltIndication,
141 Data: OltIndicationMessage{
142 OperState: UP,
143 },
144 }
145 o.channel <- olt_msg
146
147 // send NNI Port Indications
148 for _, nni := range o.Nnis {
149 msg := Message{
150 Type: NniIndication,
151 Data: NniIndicationMessage{
152 OperState: UP,
153 NniPortID: nni.ID,
154 },
155 }
156 o.channel <- msg
157 }
158
159 // send PON Port indications
160 for _, pon := range o.Pons {
161 msg := Message{
162 Type: PonIndication,
163 Data: PonIndicationMessage{
164 OperState: UP,
165 PonPortID: pon.ID,
166 },
167 }
168 o.channel <- msg
169
170 for _, onu := range pon.Onus {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700171 go onu.processOnuMessages(stream)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700172 msg := Message{
173 Type: OnuDiscIndication,
174 Data: OnuDiscIndicationMessage{
175 Onu: onu,
176 OperState: UP,
177 },
178 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700179 onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700180 }
181 }
182
183 wg.Wait()
184 return nil
185}
186
187// Helpers method
188
189func (o OltDevice) getPonById(id uint32) (*PonPort, error) {
190 for _, pon := range o.Pons {
191 if pon.ID == id {
192 return &pon, nil
193 }
194 }
195 return nil, errors.New(fmt.Sprintf("Cannot find PonPort with id %d in OLT %d", id, o.ID))
196}
197
198func (o OltDevice) getNniById(id uint32) (*NniPort, error) {
199 for _, nni := range o.Nnis {
200 if nni.ID == id {
201 return &nni, nil
202 }
203 }
204 return nil, errors.New(fmt.Sprintf("Cannot find NniPort with id %d in OLT %d", id, o.ID))
205}
206
Matteo Scandolo4747d292019-08-05 11:50:18 -0700207func (o OltDevice) sendOltIndication(msg OltIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
208 data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: msg.OperState.String()}}
209 if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700210 oltLogger.Error("Failed to send Indication_OltInd: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700211 }
212
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700213 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700214 "OperState": msg.OperState,
215 }).Debug("Sent Indication_OltInd")
216}
217
218func (o OltDevice) sendNniIndication(msg NniIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
219 nni, _ := o.getNniById(msg.NniPortID)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700220 nni.OperState.Event("enable")
221 // NOTE Operstate may need to be an integer
Matteo Scandolo4747d292019-08-05 11:50:18 -0700222 operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
223 Type: nni.Type,
224 IntfId: nni.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700225 OperState: nni.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700226 }}
227
228 if err := stream.Send(&openolt.Indication{Data: operData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700229 oltLogger.Error("Failed to send Indication_IntfOperInd for NNI: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700230 }
231
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700232 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700233 "Type": nni.Type,
234 "IntfId": nni.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700235 "OperState": nni.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700236 }).Debug("Sent Indication_IntfOperInd for NNI")
237}
238
239func (o OltDevice) sendPonIndication(msg PonIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
240 pon, _ := o.getPonById(msg.PonPortID)
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700241 pon.OperState.Event("enable")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700242 discoverData := &openolt.Indication_IntfInd{IntfInd: &openolt.IntfIndication{
243 IntfId: pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700244 OperState: pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700245 }}
246
247 if err := stream.Send(&openolt.Indication{Data: discoverData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700248 oltLogger.Error("Failed to send Indication_IntfInd: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700249 }
250
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700251 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700252 "IntfId": pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700253 "OperState": pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700254 }).Debug("Sent Indication_IntfInd")
255
256 operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
257 Type: pon.Type,
258 IntfId: pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700259 OperState: pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700260 }}
261
262 if err := stream.Send(&openolt.Indication{Data: operData}); err != nil {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700263 oltLogger.Error("Failed to send Indication_IntfOperInd for PON: %v", err)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700264 }
265
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700266 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700267 "Type": pon.Type,
268 "IntfId": pon.ID,
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700269 "OperState": pon.OperState.Current(),
Matteo Scandolo4747d292019-08-05 11:50:18 -0700270 }).Debug("Sent Indication_IntfOperInd for PON")
271}
272
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700273func (o OltDevice) processOltMessages(stream openolt.Openolt_EnableIndicationServer) {
274 oltLogger.Debug("Started OLT Indication Channel")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700275 for message := range o.channel {
276
Matteo Scandolo4747d292019-08-05 11:50:18 -0700277
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700278 oltLogger.WithFields(log.Fields{
279 "oltId": o.ID,
280 "messageType": message.Type,
281 }).Trace("Received message")
282
283 switch message.Type {
284 case OltIndication:
285 msg, _ := message.Data.(OltIndicationMessage)
286 if msg.OperState == UP {
Matteo Scandolo4747d292019-08-05 11:50:18 -0700287 o.InternalState.Event("enable")
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700288 o.OperState.Event("enable")
289 } else if msg.OperState == DOWN {
290 o.InternalState.Event("disable")
291 o.OperState.Event("disable")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700292 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700293 o.sendOltIndication(msg, stream)
294 case NniIndication:
295 msg, _ := message.Data.(NniIndicationMessage)
296 o.sendNniIndication(msg, stream)
297 case PonIndication:
298 msg, _ := message.Data.(PonIndicationMessage)
299 o.sendPonIndication(msg, stream)
300 default:
301 oltLogger.Warnf("Received unknown message data %v for type %v in OLT channel", message.Data, message.Type)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700302 }
303
304 }
305}
306
307// GRPC Endpoints
308
309func (o OltDevice) ActivateOnu(context context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700310 oltLogger.WithFields(log.Fields{
Matteo Scandolo4747d292019-08-05 11:50:18 -0700311 "onuSerialNumber": onu.SerialNumber,
312 }).Info("Received ActivateOnu call from VOLTHA")
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700313
314 pon, _ := o.getPonById(onu.IntfId)
315 _onu, _ := pon.getOnuBySn(onu.SerialNumber)
316
317 // NOTE we need to immediately activate the ONU or the OMCI state machine won't start
Matteo Scandolo4747d292019-08-05 11:50:18 -0700318 msg := Message{
319 Type: OnuIndication,
320 Data: OnuIndicationMessage{
321 OnuSN: onu.SerialNumber,
322 PonPortID: onu.IntfId,
323 OperState: UP,
324 },
325 }
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700326 _onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700327 return new(openolt.Empty) , nil
328}
329
330func (o OltDevice) DeactivateOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700331 oltLogger.Error("DeactivateOnu not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700332 return new(openolt.Empty) , nil
333}
334
335func (o OltDevice) DeleteOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700336 oltLogger.Error("DeleteOnu not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700337 return new(openolt.Empty) , nil
338}
339
340func (o OltDevice) DisableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700341 // NOTE when we disable the OLT should we disable NNI, PONs and ONUs altogether?
342 olt_msg := Message{
343 Type: OltIndication,
344 Data: OltIndicationMessage{
345 OperState: DOWN,
346 },
347 }
348 o.channel <- olt_msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700349 return new(openolt.Empty) , nil
350}
351
352func (o OltDevice) DisablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700353 oltLogger.Error("DisablePonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700354 return new(openolt.Empty) , nil
355}
356
357func (o OltDevice) EnableIndication(_ *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700358 oltLogger.WithField("oltId", o.ID).Info("OLT receives EnableIndication call from VOLTHA")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700359 o.Enable(stream)
360 return nil
361}
362
363func (o OltDevice) EnablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700364 oltLogger.Error("EnablePonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700365 return new(openolt.Empty) , nil
366}
367
368func (o OltDevice) FlowAdd(context.Context, *openolt.Flow) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700369 oltLogger.Error("FlowAdd not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700370 return new(openolt.Empty) , nil
371}
372
373func (o OltDevice) FlowRemove(context.Context, *openolt.Flow) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700374 oltLogger.Error("FlowRemove not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700375 return new(openolt.Empty) , nil
376}
377
378func (o OltDevice) HeartbeatCheck(context.Context, *openolt.Empty) (*openolt.Heartbeat, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700379 oltLogger.Error("HeartbeatCheck not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700380 return new(openolt.Heartbeat) , nil
381}
382
383func (o OltDevice) GetDeviceInfo(context.Context, *openolt.Empty) (*openolt.DeviceInfo, error) {
384
Matteo Scandoloda9cbe22019-08-19 16:05:10 -0700385 oltLogger.WithFields(log.Fields{
386 "oltId": o.ID,
387 "PonPorts": o.NumPon,
388 }).Info("OLT receives GetDeviceInfo call from VOLTHA")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700389 devinfo := new(openolt.DeviceInfo)
390 devinfo.Vendor = "BBSim"
391 devinfo.Model = "asfvolt16"
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700392 devinfo.HardwareVersion = "emulated"
Matteo Scandolo4747d292019-08-05 11:50:18 -0700393 devinfo.FirmwareVersion = ""
394 devinfo.Technology = "xgspon"
Matteo Scandoloda9cbe22019-08-19 16:05:10 -0700395 devinfo.PonPorts = uint32(o.NumPon)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700396 devinfo.OnuIdStart = 1
397 devinfo.OnuIdEnd = 255
398 devinfo.AllocIdStart = 1024
399 devinfo.AllocIdEnd = 16383
400 devinfo.GemportIdStart = 1024
401 devinfo.GemportIdEnd = 65535
402 devinfo.FlowIdStart = 1
403 devinfo.FlowIdEnd = 16383
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700404 devinfo.DeviceSerialNumber = fmt.Sprintf("BBSIM_OLT_%d", o.ID)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700405
406 return devinfo, nil
407}
408
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700409func (o OltDevice) OmciMsgOut(ctx context.Context, omci_msg *openolt.OmciMsg) (*openolt.Empty, error) {
410 oltLogger.Debugf("Recevied OmciMsgOut - IntfId: %d OnuId: %d", omci_msg.IntfId, omci_msg.OnuId)
411 pon, _ := o.getPonById(omci_msg.IntfId)
412 onu, _ := pon.getOnuById(omci_msg.OnuId)
413 msg := Message{
414 Type: OMCI,
415 Data: OmciMessage{
416 OnuSN: onu.SerialNumber,
417 OnuId: onu.ID,
418 msg: omci_msg,
419 },
420 }
421 onu.channel <- msg
Matteo Scandolo4747d292019-08-05 11:50:18 -0700422 return new(openolt.Empty) , nil
423}
424
425func (o OltDevice) OnuPacketOut(context.Context, *openolt.OnuPacket) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700426 oltLogger.Error("OnuPacketOut not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700427 return new(openolt.Empty) , nil
428}
429
430func (o OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700431 oltLogger.Info("Shutting Down, hope you're running in K8s...")
432 os.Exit(0)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700433 return new(openolt.Empty) , nil
434}
435
436func (o OltDevice) ReenableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700437 oltLogger.Error("ReenableOlt not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700438 return new(openolt.Empty) , nil
439}
440
441func (o OltDevice) UplinkPacketOut(context context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700442 oltLogger.Error("UplinkPacketOut not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700443 return new(openolt.Empty) , nil
444}
445
446func (o OltDevice) CollectStatistics(context.Context, *openolt.Empty) (*openolt.Empty, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700447 oltLogger.Error("CollectStatistics not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700448 return new(openolt.Empty) , nil
449}
450
Matteo Scandolo4747d292019-08-05 11:50:18 -0700451func (o OltDevice) GetOnuInfo(context context.Context, packet *openolt.Onu) (*openolt.OnuIndication, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700452 oltLogger.Error("GetOnuInfo not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700453 return new(openolt.OnuIndication) , nil
454}
455
456func (o OltDevice) GetPonIf(context context.Context, packet *openolt.Interface) (*openolt.IntfIndication, error) {
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700457 oltLogger.Error("GetPonIf not implemented")
Matteo Scandolo4747d292019-08-05 11:50:18 -0700458 return new(openolt.IntfIndication) , nil
Matteo Scandolod54283a2019-08-13 16:22:31 -0700459}
460
461func (s OltDevice) CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error) {
462 oltLogger.Error("CreateTrafficQueues not implemented")
463 return new(openolt.Empty), nil
464}
465
466func (s OltDevice) RemoveTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error) {
467 oltLogger.Error("RemoveTrafficQueues not implemented")
468 return new(openolt.Empty), nil
469}
470
471func (s OltDevice) CreateTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*openolt.Empty, error) {
472 oltLogger.Error("CreateTrafficSchedulers not implemented")
473 return new(openolt.Empty), nil
474}
475
476func (s OltDevice) RemoveTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*openolt.Empty, error) {
477 oltLogger.Error("RemoveTrafficSchedulers not implemented")
478 return new(openolt.Empty), nil
Matteo Scandolo4747d292019-08-05 11:50:18 -0700479}