ofp-util: Allow encoding of Open Flow 1.1 and 1.2 Packet Out Messages
authorSimon Horman <horms@verge.net.au>
Tue, 7 Aug 2012 21:49:43 +0000 (06:49 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 8 Aug 2012 23:32:59 +0000 (16:32 -0700)
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-util.c

index 910e63a14a49e7a7c4ebdf5b141329fa5e0c3149..463248255da42d2c1e0b0c9f4c17b887e3f2c23d 100644 (file)
@@ -3073,7 +3073,21 @@ ofputil_encode_packet_out(const struct ofputil_packet_out *po,
     }
 
     case OFP11_VERSION:
-    case OFP12_VERSION:
+    case OFP12_VERSION: {
+        struct ofp11_packet_out *opo;
+        size_t len;
+
+        msg = ofpraw_alloc(OFPRAW_OFPT11_PACKET_OUT, ofp_version, size);
+        ofpbuf_put_zeros(msg, sizeof *opo);
+        len = 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(len);
+        break;
+    }
+
     default:
         NOT_REACHED();
     }