VOL-1878 : Support for LLDP trap flow
Implemenetation of addLLDP flow in Openolt adapter require change
in flow decomposer to decompose the flow with respect to nni trap.
Fixed sca issues.
Change-Id: Ie9464a320ae92058c4433a7f4d63ed192b244739
(cherry picked from commit 4ff89015c8a0f612ade41837cb731e5d7143a46f)
diff --git a/rw_core/flow_decomposition/flow_decomposer.go b/rw_core/flow_decomposition/flow_decomposer.go
index 09b29e8..d4058bc 100644
--- a/rw_core/flow_decomposition/flow_decomposer.go
+++ b/rw_core/flow_decomposition/flow_decomposer.go
@@ -111,10 +111,23 @@
egressHop := route[1]
fg := fu.NewFlowsAndGroups()
+
+ //case of packet_in from NNI port rule
if agent.GetDeviceGraph().IsRootPort(inPortNo) {
+ // Trap flow for NNI port
log.Debug("trap-nni")
- // no decomposition required - it is already an OLT flow from NNI
- fg.AddFlow(flow)
+
+ var fa *fu.FlowArgs
+ fa = &fu.FlowArgs{
+ KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie},
+ MatchFields: []*ofp.OfpOxmOfbField{
+ fu.InPort(egressHop.Egress),
+ },
+ Actions: fu.GetActions(flow),
+ }
+ // Augment the matchfields with the ofpfields from the flow
+ fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...)
+ fg.AddFlow(fu.MkFlowStat(fa))
} else {
// Trap flow for UNI port
log.Debug("trap-uni")