openflow: Move enums for "packet_out" and "flow_mod" to common header.
authorBen Pfaff <blp@nicira.com>
Thu, 28 Jun 2012 05:48:01 +0000 (22:48 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 28 Jun 2012 05:48:01 +0000 (22:48 -0700)
Reviewed-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
include/openflow/openflow-1.0.h
include/openflow/openflow-1.1.h
include/openflow/openflow-common.h
lib/ofp-util.c

index 831f6a95956583f237cde296aaa97ae0f75b7b83..2ee356df84b158f0a0b7c7925a712253033c187e 100644 (file)
@@ -47,9 +47,7 @@ enum ofp_port {
  * types. */
 enum ofp10_type {
     /* Controller command messages. */
-    OFPT10_PACKET_OUT = 13,     /* Controller/switch message */
-    OFPT10_FLOW_MOD,            /* Controller/switch message */
-    OFPT10_PORT_MOD,            /* Controller/switch message */
+    OFPT10_PORT_MOD = 15,       /* Controller/switch message */
 
     /* Statistics messages. */
     OFPT10_STATS_REQUEST,       /* Controller/switch message */
index 8461dad2b92ba4c6c164f5a3b06d34a3c035462e..f0c063bce40182e3d3e5ac938c4f2bf5396a03f9 100644 (file)
@@ -74,9 +74,7 @@
  * types. */
 enum ofp11_type {
     /* Controller command messages. */
-    OFPT11_PACKET_OUT = 13,     /* Controller/switch message */
-    OFPT11_FLOW_MOD,            /* Controller/switch message */
-    OFPT11_GROUP_MOD,           /* Controller/switch message */
+    OFPT11_GROUP_MOD = 15,      /* Controller/switch message */
     OFPT11_PORT_MOD,            /* Controller/switch message */
     OFPT11_TABLE_MOD,           /* Controller/switch message */
 
index 3dc76cc25ec67b30ed78550411cb011cc7e22598..9788af100a2561706d79b51fbc896b669361ec62 100644 (file)
@@ -103,6 +103,10 @@ enum ofp_type {
     OFPT_PACKET_IN,           /* Async message */
     OFPT_FLOW_REMOVED,        /* Async message */
     OFPT_PORT_STATUS,         /* Async message */
+
+    /* Controller command messages. */
+    OFPT_PACKET_OUT,          /* Controller/switch message */
+    OFPT_FLOW_MOD,            /* Controller/switch message */
 };
 
 /* Header on all OpenFlow packets. */
index 0ad23c7de6d760d3d8cbba1f42f074c6593c279b..60d0cfd4d105e105fbc9385a6d09b749ac8eecba 100644 (file)
@@ -1006,11 +1006,11 @@ ofputil_decode_msg_type__(const struct ofp_header *oh, size_t length,
           sizeof(struct ofp_port_status) + sizeof(struct ofp11_port), 0 },
 
         { OFPUTIL_OFPT_PACKET_OUT, OFP10_VERSION,
-          OFPT10_PACKET_OUT, "OFPT_PACKET_OUT",
+          OFPT_PACKET_OUT, "OFPT_PACKET_OUT",
           sizeof(struct ofp_packet_out), 1 },
 
         { OFPUTIL_OFPT_FLOW_MOD, OFP10_VERSION,
-          OFPT10_FLOW_MOD, "OFPT_FLOW_MOD",
+          OFPT_FLOW_MOD, "OFPT_FLOW_MOD",
           sizeof(struct ofp_flow_mod), 1 },
 
         { OFPUTIL_OFPT_PORT_MOD, OFP10_VERSION,
@@ -1759,7 +1759,7 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm,
     case OFPUTIL_P_OF10:
     case OFPUTIL_P_OF10_TID:
         msg = ofpbuf_new(sizeof *ofm + actions_len);
-        ofm = put_openflow(sizeof *ofm, OFPT10_FLOW_MOD, msg);
+        ofm = put_openflow(sizeof *ofm, OFPT_FLOW_MOD, msg);
         ofputil_cls_rule_to_ofp10_match(&fm->cr, &ofm->match);
         ofm->cookie = fm->new_cookie;
         ofm->command = htons(command);
@@ -3081,7 +3081,7 @@ ofputil_encode_packet_out(const struct ofputil_packet_out *po)
     }
 
     msg = ofpbuf_new(size);
-    opo = put_openflow(sizeof *opo, OFPT10_PACKET_OUT, msg);
+    opo = put_openflow(sizeof *opo, OFPT_PACKET_OUT, msg);
     opo->buffer_id = htonl(po->buffer_id);
     opo->in_port = htons(po->in_port);
     opo->actions_len = htons(actions_len);
@@ -3403,7 +3403,7 @@ make_flow_mod(uint16_t command, const struct cls_rule *rule,
     struct ofpbuf *out = ofpbuf_new(size);
     ofm = ofpbuf_put_zeros(out, sizeof *ofm);
     ofm->header.version = OFP10_VERSION;
-    ofm->header.type = OFPT10_FLOW_MOD;
+    ofm->header.type = OFPT_FLOW_MOD;
     ofm->header.length = htons(size);
     ofm->cookie = 0;
     ofm->priority = htons(MIN(rule->priority, UINT16_MAX));