VOL-1180: Enable ponsim to send packet-outs on NNI port.
This required adding the out_port metatdata to the message that
VOLTHA uses to send packets to ponsim, so that VOLTHA can tell
ponsim which port to send the packet out.
Also refactored packet-outs in ponsim so that they don't get run
through the forwarding pipeline, they just get sent out the port.
This is what happens in a normal openflow device.
Change-Id: Ic40ea730f061d82d2ecee33fb1a1f371d0ba73ef
diff --git a/ponsim/v2/grpc/nbi/ponsim_handler.go b/ponsim/v2/grpc/nbi/ponsim_handler.go
index 49fd71a..ec64d5c 100644
--- a/ponsim/v2/grpc/nbi/ponsim_handler.go
+++ b/ponsim/v2/grpc/nbi/ponsim_handler.go
@@ -52,10 +52,11 @@
common.Logger().WithFields(logrus.Fields{
"handler": handler,
+ "out_port": int(data.OutPort),
"frame": frame.Dump(),
}).Info("Constructed frame")
- handler.device.Forward(context.Background(), 2, frame)
+ handler.device.SendOut(int(data.OutPort), frame)
out := new(empty.Empty)
return out, nil
@@ -145,7 +146,7 @@
},
)
}
- out.NniPort = 0
+ out.NniPort = 2
} else {
common.Logger().WithFields(logrus.Fields{
"handler": handler,