OpenFlow: Move stats message enums into "common".
authorJustin Pettit <jpettit@nicira.com>
Wed, 2 May 2012 23:35:49 +0000 (16:35 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 8 May 2012 04:22:25 +0000 (21:22 -0700)
We will be adding some OpenFlow 1.3 stats (aka multipart request)
messages to our OpenFlow 1.0 implementation.  As such, move the
definition of those message numbers to the common location.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
include/openflow/openflow-1.0.h
include/openflow/openflow-common.h

index 802e80d..890676c 100644 (file)
@@ -514,42 +514,6 @@ struct ofp_error_msg {
 };
 OFP_ASSERT(sizeof(struct ofp_error_msg) == 12);
 
-enum ofp_stats_types {
-    /* Description of this OpenFlow switch.
-     * The request is struct ofp_stats_msg.
-     * The reply is struct ofp_desc_stats. */
-    OFPST_DESC,
-
-    /* Individual flow statistics.
-     * The request is struct ofp_flow_stats_request.
-     * The reply body is an array of struct ofp_flow_stats. */
-    OFPST_FLOW,
-
-    /* Aggregate flow statistics.
-     * The request is struct ofp_flow_stats_request.
-     * The reply is struct ofp_aggregate_stats_reply. */
-    OFPST_AGGREGATE,
-
-    /* Flow table statistics.
-     * The request is struct ofp_stats_msg.
-     * The reply body is an array of struct ofp_table_stats. */
-    OFPST_TABLE,
-
-    /* Physical port statistics.
-     * The request is struct ofp_port_stats_request.
-     * The reply body is an array of struct ofp_port_stats. */
-    OFPST_PORT,
-
-    /* Queue statistics for a port.
-     * The request body is struct ofp_queue_stats_request.
-     * The reply body is an array of struct ofp_queue_stats. */
-    OFPST_QUEUE,
-
-    /* Vendor extension.
-     * The request and reply begin with "struct ofp_vendor_stats". */
-    OFPST_VENDOR = 0xffff
-};
-
 /* Statistics request or reply message. */
 struct ofp_stats_msg {
     struct ofp_header header;
index 57b7d51..c3cf275 100644 (file)
@@ -242,6 +242,42 @@ struct ofp_port_status {
 };
 OFP_ASSERT(sizeof(struct ofp_port_status) == 16);
 
+enum ofp_stats_types {
+    /* Description of this OpenFlow switch. (OFPMP_DESC)
+     * The OF1.0 request is struct ofp_stats_msg.
+     * The OF1.0 reply is struct ofp_desc_stats. */
+    OFPST_DESC = 0,
+
+    /* Individual flow statistics. (OFPMP_FLOW)
+     * The OF1.0 request is struct ofp_flow_stats_request.
+     * The OF1.0 reply body is an array of struct ofp_flow_stats. */
+    OFPST_FLOW = 1,
+
+    /* Aggregate flow statistics. (OFPMP_AGGREGATE)
+     * The OF1.0 request is struct ofp_flow_stats_request.
+     * The OF1.0 reply is struct ofp_aggregate_stats_reply. */
+    OFPST_AGGREGATE = 2,
+
+    /* Flow table statistics. (OFPMP_TABLE)
+     * The OF1.0 request is struct ofp_stats_msg.
+     * The OF1.0 reply body is an array of struct ofp_table_stats. */
+    OFPST_TABLE = 3,
+
+    /* Physical port statistics. (OFPMP_PORT_STATS)
+     * The OF1.0 request is struct ofp_port_stats_request.
+     * The OF1.0 reply body is an array of struct ofp_port_stats. */
+    OFPST_PORT = 4,
+
+    /* Queue statistics for a port. (OFPMP_QUEUE)
+     * The OF1.0 request is struct ofp_stats_msg.
+     * The OF1.0 reply body is an array of struct ofp_queue_stats. */
+    OFPST_QUEUE = 5,
+
+    /* Vendor extension.
+     * The OF1.0 request and reply begin with struct ofp_vendor_stats. */
+    OFPST_VENDOR = 0xffff
+};
+
 /* The match type indicates the match structure (set of fields that compose the
  * match) in use. The match type is placed in the type field at the beginning
  * of all match structures. The "OpenFlow Extensible Match" type corresponds