VOL-3121 - Separated out logical ports from logical agent.
Similar to flows/groups/meters.
Also modified device_route tests to generate unique port IDs (`.OfpPort.PortNo`s) across all UNI ports withing each test, i.e. within an OLT.
Also replaced logicalPortsNo map & associated NNI vs UNI logic with root device checks.
Change-Id: Ib0cecbf7d4f8d509ce7c989b9ccf697c8b0d17d6
diff --git a/rw_core/core/device/event/event.go b/rw_core/core/device/event/event.go
index c205564..16cd08b 100644
--- a/rw_core/core/device/event/event.go
+++ b/rw_core/core/device/event/event.go
@@ -18,11 +18,12 @@
import (
"encoding/hex"
+ "sync"
+
"github.com/golang/protobuf/ptypes/empty"
"github.com/opencord/voltha-lib-go/v3/pkg/log"
"github.com/opencord/voltha-protos/v3/go/openflow_13"
"github.com/opencord/voltha-protos/v3/go/voltha"
- "sync"
)
type Manager struct {
@@ -123,13 +124,17 @@
return nil
}
-func (q *Manager) SendChangeEvent(deviceID string, portStatus *openflow_13.OfpPortStatus) {
- // TODO: validate the type of portStatus parameter
- //if _, ok := portStatus.(*openflow_13.OfpPortStatus); ok {
- //}
- event := openflow_13.ChangeEvent{Id: deviceID, Event: &openflow_13.ChangeEvent_PortStatus{PortStatus: portStatus}}
- logger.Debugw("SendChangeEvent", log.Fields{"event": event})
- q.changeEventQueue <- event
+func (q *Manager) SendChangeEvent(deviceID string, reason openflow_13.OfpPortReason, desc *openflow_13.OfpPort) {
+ logger.Debugw("SendChangeEvent", log.Fields{"device-id": deviceID, "reason": reason, "desc": desc})
+ q.changeEventQueue <- openflow_13.ChangeEvent{
+ Id: deviceID,
+ Event: &openflow_13.ChangeEvent_PortStatus{
+ PortStatus: &openflow_13.OfpPortStatus{
+ Reason: reason,
+ Desc: desc,
+ },
+ },
+ }
}
// ReceiveChangeEvents receives change in events