--- openflow-2013-05-29.h	2015-07-23 09:54:17.320479369 -0700
+++ openflow-2013-01-18-2.h	2015-07-23 09:54:17.324479369 -0700
@@ -138,10 +138,6 @@
     OFPT_BARRIER_REQUEST    = 20, /* Controller/switch message */
     OFPT_BARRIER_REPLY      = 21, /* Controller/switch message */
 
-    /* Queue Configuration messages. */
-    OFPT_QUEUE_GET_CONFIG_REQUEST = 22,  /* Controller/switch message */
-    OFPT_QUEUE_GET_CONFIG_REPLY   = 23,  /* Controller/switch message */
-
     /* Controller role change request messages. */
     OFPT_ROLE_REQUEST       = 24, /* Controller/switch message */
     OFPT_ROLE_REPLY         = 25, /* Controller/switch message */
@@ -1121,6 +1117,14 @@
 };
 OFP_ASSERT(sizeof(struct ofp_action_pop_mpls) == 8);
 
+/* Action structure for OFPAT_SET_QUEUE. */
+struct ofp_action_set_queue {
+    uint16_t type;            /* OFPAT_SET_QUEUE. */
+    uint16_t len;             /* Len is 8. */
+    uint32_t queue_id;        /* Queue id for the packets. */
+};
+OFP_ASSERT(sizeof(struct ofp_action_set_queue) == 8);
+
 /* Action structure for OFPAT_GROUP. */
 struct ofp_action_group {
     uint16_t type;                  /* OFPAT_GROUP. */
@@ -1837,7 +1841,7 @@
     /* 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 */
-    OFPMP_QUEUE = 5,
+    OFPMP_QUEUE_STATS = 5,
 
     /* Group counter statistics.
      * The request body is struct ofp_group_stats_request.
@@ -1887,6 +1891,11 @@
      * The reply body is an array of struct ofp_table_desc. */
     OFPMP_TABLE_DESC = 14,
 
+    /* Queue description.
+     * The request body is struct ofp_queue_desc_request.
+     * The reply body is an array of struct ofp_queue_desc. */
+    OFPMP_QUEUE_DESC = 15,
+
     /* Experimenter extension.
      * The request and reply bodies begin with
      * struct ofp_experimenter_multipart_header.
@@ -2367,26 +2376,6 @@
 };
 OFP_ASSERT(sizeof(struct ofp_meter_features) == 16);
 
-/* Body for ofp_multipart_request/reply of type OFPMP_EXPERIMENTER. */
-struct ofp_experimenter_multipart_header {
-    uint32_t experimenter;    /* Experimenter ID which takes the same form
-                                 as in struct ofp_experimenter_header. */
-    uint32_t exp_type;        /* Experimenter defined. */
-    /* Experimenter-defined arbitrary additional data. */
-};
-OFP_ASSERT(sizeof(struct ofp_experimenter_multipart_header) == 8);
-
-/* Experimenter extension. */
-struct ofp_experimenter_header {
-    struct ofp_header header;   /* Type OFPT_EXPERIMENTER. */
-    uint32_t experimenter;      /* Experimenter ID:
-                                 * - MSB 0: low-order bytes are IEEE OUI.
-                                 * - MSB != 0: defined by ONF. */
-    uint32_t exp_type;          /* Experimenter defined. */
-    /* Experimenter-defined arbitrary additional data. */
-};
-OFP_ASSERT(sizeof(struct ofp_experimenter_header) == 16);
-
 /* All ones is used to indicate all queues in a port (for stats retrieval). */
 #define OFPQ_ALL      0xffffffff
 
@@ -2396,91 +2385,106 @@
 /* Max rate > 1000 means not configured. */
 #define OFPQ_MAX_RATE_UNCFG      0xffff
 
-enum ofp_queue_properties {
-    OFPQT_MIN_RATE      = 1,      /* Minimum datarate guaranteed. */
-    OFPQT_MAX_RATE      = 2,      /* Maximum datarate. */
-    OFPQT_EXPERIMENTER  = 0xffff  /* Experimenter defined property. */
+enum ofp_queue_desc_prop_type {
+    OFPQDPT_MIN_RATE      = 1,      /* Minimum datarate guaranteed. */
+    OFPQDPT_MAX_RATE      = 2,      /* Maximum datarate. */
+    OFPQDPT_EXPERIMENTER  = 0xffff  /* Experimenter defined property. */
 };
 
-/* Common description for a queue. */
-struct ofp_queue_prop_header {
-    uint16_t property;    /* One of OFPQT_. */
-    uint16_t len;         /* Length of property, including this header. */
-    uint8_t pad[4];       /* 64-bit alignemnt. */
+/* Common header for all queue properties */
+struct ofp_queue_desc_prop_header {
+    uint16_t         type;    /* One of OFPQDPT_*. */
+    uint16_t         length;  /* Length in bytes of this property. */
 };
-OFP_ASSERT(sizeof(struct ofp_queue_prop_header) == 8);
+OFP_ASSERT(sizeof(struct ofp_queue_desc_prop_header) == 4);
 
 /* Min-Rate queue property description. */
-struct ofp_queue_prop_min_rate {
-    struct ofp_queue_prop_header prop_header; /* prop: OFPQT_MIN, len: 16. */
+struct ofp_queue_desc_prop_min_rate {
+    uint16_t         type;    /* OFPQDPT_MIN_RATE. */
+    uint16_t         length;  /* Length is 8. */
     uint16_t rate;        /* In 1/10 of a percent; >1000 -> disabled. */
-    uint8_t pad[6];       /* 64-bit alignment */
+    uint8_t pad[2];       /* 64-bit alignment */
 };
-OFP_ASSERT(sizeof(struct ofp_queue_prop_min_rate) == 16);
+OFP_ASSERT(sizeof(struct ofp_queue_desc_prop_min_rate) == 8);
 
 /* Max-Rate queue property description. */
-struct ofp_queue_prop_max_rate {
-    struct ofp_queue_prop_header prop_header; /* prop: OFPQT_MAX, len: 16. */
+struct ofp_queue_desc_prop_max_rate {
+    uint16_t         type;    /* OFPQDPT_MAX_RATE. */
+    uint16_t         length;  /* Length is 8. */
     uint16_t rate;        /* In 1/10 of a percent; >1000 -> disabled. */
-    uint8_t pad[6];       /* 64-bit alignment */
+    uint8_t pad[2];       /* 64-bit alignment */
 };
-OFP_ASSERT(sizeof(struct ofp_queue_prop_max_rate) == 16);
+OFP_ASSERT(sizeof(struct ofp_queue_desc_prop_max_rate) == 8);
 
 /* Experimenter queue property description. */
-struct ofp_queue_prop_experimenter {
-    struct ofp_queue_prop_header prop_header; /* prop: OFPQT_EXPERIMENTER, len: 16. */
-    uint32_t experimenter;          /* Experimenter ID which takes the same
+struct ofp_queue_desc_prop_experimenter {
+    uint16_t         type;    /* OFPQDPT_EXPERIMENTER. */
+    uint16_t         length;  /* Length in bytes of this property. */
+    uint32_t         experimenter;  /* Experimenter ID which takes the same
                                        form as in struct
                                        ofp_experimenter_header. */
-    uint8_t pad[4];       /* 64-bit alignment */
-    uint8_t data[0];      /* Experimenter defined data. */
+    uint32_t         exp_type;      /* Experimenter defined. */
+    /* Followed by:
+     *   - Exactly (length - 12) bytes containing the experimenter data, then
+     *   - Exactly (length + 7)/8*8 - (length) (between 0 and 7)
+     *     bytes of all-zero bytes */
+    uint32_t         experimenter_data[0];
 };
-OFP_ASSERT(sizeof(struct ofp_queue_prop_experimenter) == 16);
+OFP_ASSERT(sizeof(struct ofp_queue_desc_prop_experimenter) == 12);
 
-/* Full description for a queue. */
-struct ofp_packet_queue {
+/* Body for ofp_multipart_request of type OFPMP_QUEUE_DESC. */
+struct ofp_queue_desc_request {
+    uint32_t port_no;        /* All ports if OFPP_ANY. */
+    uint32_t queue_id;       /* All queues if OFPQ_ALL. */
+};
+OFP_ASSERT(sizeof(struct ofp_queue_desc_request) == 8);
+
+/* Body of reply to OFPMP_QUEUE_DESC request. */
+struct ofp_queue_desc {
+    uint32_t port_no;      /* Port this queue is attached to. */
     uint32_t queue_id;     /* id for the specific queue. */
-    uint32_t port;         /* Port this queue is attached to. */
     uint16_t len;          /* Length in bytes of this queue desc. */
     uint8_t pad[6];        /* 64-bit alignment. */
-    struct ofp_queue_prop_header properties[0]; /* List of properties. */
+
+    struct ofp_queue_desc_prop_header properties[0]; /* List of properties. */
 };
-OFP_ASSERT(sizeof(struct ofp_packet_queue) == 16);
+OFP_ASSERT(sizeof(struct ofp_queue_desc) == 16);
 
-/* Query for port queue configuration. */
-struct ofp_queue_get_config_request {
-    struct ofp_header header;
-    uint32_t port;         /* Port to be queried. Should refer
-                              to a valid physical port (i.e. < OFPP_MAX),
-                              or OFPP_ANY to request all configured
-                              queues.*/
-    uint8_t pad[4];
+/* Body for ofp_multipart_request of type OFPMP_QUEUE_STATS. */
+struct ofp_queue_stats_request {
+    uint32_t port_no;        /* All ports if OFPP_ANY. */
+    uint32_t queue_id;       /* All queues if OFPQ_ALL. */
 };
-OFP_ASSERT(sizeof(struct ofp_queue_get_config_request) == 16);
+OFP_ASSERT(sizeof(struct ofp_queue_stats_request) == 8);
 
-/* Queue configuration for a given port. */
-struct ofp_queue_get_config_reply {
-    struct ofp_header header;
-    uint32_t port;
-    uint8_t pad[4];
-    struct ofp_packet_queue queues[0]; /* List of configured queues. */
+enum ofp_queue_stats_prop_type {
+    OFPQSPT_EXPERIMENTER  = 0xffff  /* Experimenter defined property. */
 };
-OFP_ASSERT(sizeof(struct ofp_queue_get_config_reply) == 16);
 
-/* OFPAT_SET_QUEUE action struct: send packets to given queue on port. */
-struct ofp_action_set_queue {
-    uint16_t type;            /* OFPAT_SET_QUEUE. */
-    uint16_t len;             /* Len is 8. */
-    uint32_t queue_id;        /* Queue id for the packets. */
+/* Common header for all queue properties */
+struct ofp_queue_stats_prop_header {
+    uint16_t         type;    /* One of OFPQSPT_*. */
+    uint16_t         length;  /* Length in bytes of this property. */
 };
-OFP_ASSERT(sizeof(struct ofp_action_set_queue) == 8);
+OFP_ASSERT(sizeof(struct ofp_queue_stats_prop_header) == 4);
 
-struct ofp_queue_stats_request {
-    uint32_t port_no;        /* All ports if OFPP_ANY. */
-    uint32_t queue_id;       /* All queues if OFPQ_ALL. */
+/* Experimenter queue property description. */
+struct ofp_queue_stats_prop_experimenter {
+    uint16_t         type;    /* OFPQSPT_EXPERIMENTER. */
+    uint16_t         length;  /* Length in bytes of this property. */
+    uint32_t         experimenter;  /* Experimenter ID which takes the same
+                                       form as in struct
+                                       ofp_experimenter_header. */
+    uint32_t         exp_type;      /* Experimenter defined. */
+    /* Followed by:
+     *   - Exactly (length - 12) bytes containing the experimenter data, then
+     *   - Exactly (length + 7)/8*8 - (length) (between 0 and 7)
+     *     bytes of all-zero bytes */
+    uint32_t         experimenter_data[0];
 };
-OFP_ASSERT(sizeof(struct ofp_queue_stats_request) == 8);
+OFP_ASSERT(sizeof(struct ofp_queue_stats_prop_experimenter) == 12);
 
+/* Body of reply to OFPMP_QUEUE_STATS request. */
 struct ofp_queue_stats {
     uint32_t port_no;
     uint32_t queue_id;       /* Queue i.d */
@@ -2490,9 +2494,31 @@
     uint32_t duration_sec;   /* Time queue has been alive in seconds. */
     uint32_t duration_nsec;  /* Time queue has been alive in nanoseconds beyond
                                 duration_sec. */
+
+    struct ofp_queue_stats_prop_header properties[0]; /* List of properties. */
 };
 OFP_ASSERT(sizeof(struct ofp_queue_stats) == 40);
 
+/* Body for ofp_multipart_request/reply of type OFPMP_EXPERIMENTER. */
+struct ofp_experimenter_multipart_header {
+    uint32_t experimenter;    /* Experimenter ID which takes the same form
+                                 as in struct ofp_experimenter_header. */
+    uint32_t exp_type;        /* Experimenter defined. */
+    /* Experimenter-defined arbitrary additional data. */
+};
+OFP_ASSERT(sizeof(struct ofp_experimenter_multipart_header) == 8);
+
+/* Experimenter extension. */
+struct ofp_experimenter_header {
+    struct ofp_header header;   /* Type OFPT_EXPERIMENTER. */
+    uint32_t experimenter;      /* Experimenter ID:
+                                 * - MSB 0: low-order bytes are IEEE OUI.
+                                 * - MSB != 0: defined by ONF. */
+    uint32_t exp_type;          /* Experimenter defined. */
+    /* Experimenter-defined arbitrary additional data. */
+};
+OFP_ASSERT(sizeof(struct ofp_experimenter_header) == 16);
+
 /* Configures the "role" of the sending controller.  The default role is:
  *
  *    - Equal (OFPCR_ROLE_EQUAL), which allows the controller access to all
