Signed-off-by: Simon Horman <ho...@verge.net.au>

---

v7
* Manual Rebase

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* Correct title: this patch relates to Packet Out not Packet In
* Correct decoding of buffer_id, it is 32bits wide not 16bits wide
* Add decoding of stats reply messages

v2
* No change
---
 lib/ofp-util.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index b7211c6..a4b2f94 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -3069,7 +3069,20 @@ ofputil_encode_packet_out(const struct 
ofputil_packet_out *po,
         size = po->packet_len;
     }
 
-    if (ofp_version == OFP10_VERSION) {
+    if (ofp_version == OFP11_VERSION || ofp_version == OFP12_VERSION) {
+        struct ofp11_packet_out *opo;
+        size_t actions_ofs;
+
+        msg = ofpraw_alloc(OFPRAW_OFPT11_PACKET_OUT, ofp_version, size);
+        ofpbuf_put_zeros(msg, sizeof *opo);
+        actions_ofs = msg->size;
+        ofpacts_put_openflow11_actions(po->ofpacts, po->ofpacts_len, msg);
+
+        opo = msg->l3;
+        opo->buffer_id = htonl(po->buffer_id);
+        opo->in_port = ofputil_port_to_ofp11(po->in_port);
+        opo->actions_len = htons(msg->size - actions_ofs);
+    } else if (ofp_version == OFP10_VERSION) {
         struct ofp_packet_out *opo;
         size_t actions_ofs;
 
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to