Signed-off-by: Simon Horman <[email protected]>

---

v2
* No change
---
 lib/learning-switch.c |  1 +
 lib/ofp-print.c       |  1 +
 lib/ofp-util.c        | 24 +++++++++++++++++++++++-
 lib/ofp-util.h        |  1 +
 ofproto/ofproto.c     |  1 +
 5 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index 883dde2..063b934 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -267,6 +267,7 @@ lswitch_process_packet(struct lswitch *sw, struct rconn 
*rconn,
     case OFPUTIL_OFPT_SET_CONFIG:
     case OFPUTIL_OFPT_PORT_STATUS:
     case OFPUTIL_OFPT10_PACKET_OUT:
+    case OFPUTIL_OFPT11_PACKET_OUT:
     case OFPUTIL_OFPT10_FLOW_MOD:
     case OFPUTIL_OFPT11_FLOW_MOD:
     case OFPUTIL_OFPT_PORT_MOD:
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 21ba0fb..e9bed16 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1440,6 +1440,7 @@ ofp_to_string__(const struct ofp_header *oh,
         break;
 
     case OFPUTIL_OFPT10_PACKET_OUT:
+    case OFPUTIL_OFPT11_PACKET_OUT:
         ofp_print_packet_out(string, msg, verbosity);
         break;
 
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 822505d..3dee3c2 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -804,6 +804,8 @@ static const struct ofputil_msg_type ofputil_msg_types[] = {
            sizeof(struct ofp_switch_features), sizeof(struct ofp11_port)),
     OFPT11(OFPT_PORT_STATUS,    OFPT_PORT_STATUS,
            sizeof(struct ofp_port_status) + sizeof(struct ofp11_port), 0),
+    OFPT11(OFPT11_PACKET_OUT,   OFPT11_PACKET_OUT,
+           sizeof(struct ofp11_packet_out), 1),
     OFPT11(OFPT11_FLOW_MOD,     OFPT11_FLOW_MOD,
            sizeof(struct ofp11_flow_mod), 1),
     OFPT11(OFPT_PORT_MOD,       OFPT11_PORT_MOD,
@@ -820,6 +822,8 @@ static const struct ofputil_msg_type ofputil_msg_types[] = {
     }
     OFPT12(OFPT_FEATURES_REPLY, OFPT_FEATURES_REPLY,
            sizeof(struct ofp_switch_features), sizeof(struct ofp11_port)),
+    OFPT12(OFPT11_PACKET_OUT,   OFPT11_PACKET_OUT,
+           sizeof(struct ofp11_packet_out), 1),
     OFPT12(OFPT11_FLOW_MOD,     OFPT11_FLOW_MOD,
            sizeof(struct ofp11_flow_mod), 1),
     OFPT12(OFPT_PORT_MOD,       OFPT11_PORT_MOD,
@@ -2676,7 +2680,25 @@ ofputil_decode_packet_out(struct ofputil_packet_out *po,
 
     ofpbuf_use_const(&b, oh, ntohs(oh->length));
 
-    if (code == OFPUTIL_OFPT10_PACKET_OUT) {
+    if (code == OFPUTIL_OFPT11_PACKET_OUT) {
+        const struct ofp11_packet_out *opo = (const struct ofp11_packet_out *) 
oh;
+        enum ofperr error;
+
+        ofpbuf_pull(&b, sizeof *opo);
+
+        po->buffer_id = ntohl(opo->buffer_id);
+        error = ofputil_port_from_ofp11(opo->in_port, &po->in_port);
+        if (error) {
+            return OFPERR_OFPBMC_BAD_VALUE;
+        }
+
+        error = ofpacts_pull_openflow11_instructions(&b,
+                                                     ntohs(opo->actions_len),
+                                                     ofpacts);
+        if (error) {
+            return error;
+        }
+    } else if (code == OFPUTIL_OFPT10_PACKET_OUT) {
         const struct ofp_packet_out *opo = (const struct ofp_packet_out *) oh;
         enum ofperr error;
 
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index 1ae41fb..67b3730 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -49,6 +49,7 @@ enum ofputil_msg_code {
     OFPUTIL_OFPT_FLOW_REMOVED,
     OFPUTIL_OFPT_PORT_STATUS,
     OFPUTIL_OFPT10_PACKET_OUT,
+    OFPUTIL_OFPT11_PACKET_OUT,
     OFPUTIL_OFPT10_FLOW_MOD,
     OFPUTIL_OFPT11_FLOW_MOD,
     OFPUTIL_OFPT_PORT_MOD,
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 1db7072..d821287 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3311,6 +3311,7 @@ handle_openflow__(struct ofconn *ofconn, const struct 
ofpbuf *msg)
         return handle_set_config(ofconn, msg->data);
 
     case OFPUTIL_OFPT10_PACKET_OUT:
+    case OFPUTIL_OFPT11_PACKET_OUT:
         return handle_packet_out(ofconn, msg->data);
 
     case OFPUTIL_OFPT_PORT_MOD:
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to