A work in progress.  Doesn't build.

I'm not really sure I want separate OFPUTIL_ constants for OF1.0 and OF1.1
versions of each message.  It's something I'm trying out as I write the
code.

Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 include/openflow/openflow-1.1.h    |   17 ++--
 include/openflow/openflow-common.h |   10 ++
 lib/learning-switch.c              |   15 ++-
 lib/ofp-errors.h                   |    3 +
 lib/ofp-print.c                    |   50 +++-------
 lib/ofp-util.c                     |  187 +++++++++++++++++++++++++-----------
 lib/ofp-util.h                     |   17 +++-
 ofproto/ofproto.c                  |   15 ++-
 8 files changed, 196 insertions(+), 118 deletions(-)

diff --git a/include/openflow/openflow-1.1.h b/include/openflow/openflow-1.1.h
index 0b526a8..77fcf94 100644
--- a/include/openflow/openflow-1.1.h
+++ b/include/openflow/openflow-1.1.h
@@ -493,8 +493,8 @@ struct ofp11_flow_mod {
                                     indicates no restriction. */
     ovs_be16 flags;              /* One of OFPFF_*. */
     uint8_t pad[2];
-    /* Open Flow version specific match */
-    /* struct ofp_instruction instructions[0];  Instruction set */
+    /* Followed by an ofp11_match structure. */
+    /* Followed by an instruction set. */
 };
 OFP_ASSERT(sizeof(struct ofp11_flow_mod) == 48);
 
@@ -555,7 +555,7 @@ struct ofp11_stats_msg {
     ovs_be16 type;              /* One of the OFPST_* constants. */
     ovs_be16 flags;             /* OFPSF_REQ_* flags (none yet defined). */
     uint8_t pad[4];
-    /* uint8_t body[0];             Body of the request. */
+    /* Followed by the body of the request. */
 };
 OFP_ASSERT(sizeof(struct ofp11_stats_msg) == 16);
 
@@ -587,9 +587,9 @@ struct ofp11_flow_stats_request {
     ovs_be64 cookie_mask;     /* Mask used to restrict the cookie bits that
                                  must match. A value of 0 indicates
                                  no restriction. */
-    struct ofp11_match match; /* Fields to match. */
+    /* Followed by an ofp11_match structure. */
 };
-OFP_ASSERT(sizeof(struct ofp11_flow_stats_request) == 120);
+OFP_ASSERT(sizeof(struct ofp11_flow_stats_request) == 32);
 
 /* Body of reply to OFPST_FLOW request. */
 struct ofp11_flow_stats {
@@ -710,11 +710,10 @@ OFP_ASSERT(sizeof(struct ofp11_group_stats) == 32);
 
 /* Used in group stats replies. */
 struct ofp11_bucket_counter {
-    struct ofp11_stats_msg osm;
     ovs_be64 packet_count;   /* Number of packets processed by bucket. */
     ovs_be64 byte_count;     /* Number of bytes processed by bucket. */
 };
-OFP_ASSERT(sizeof(struct ofp11_bucket_counter) == 32);
+OFP_ASSERT(sizeof(struct ofp11_bucket_counter) == 16);
 
 /* Body of reply to OFPST11_GROUP_DESC request. */
 struct ofp11_group_desc_stats {
@@ -774,8 +773,8 @@ struct ofp11_flow_removed {
     uint8_t pad2[2];          /* Align to 64-bits. */
     ovs_be64 packet_count;
     ovs_be64 byte_count;
-    struct ofp11_match match; /* Description of fields. */
+    /* Followed by an ofp11_match structure. */
 };
-OFP_ASSERT(sizeof(struct ofp11_flow_removed) == 136);
+OFP_ASSERT(sizeof(struct ofp11_flow_removed) == 48);
 
 #endif /* openflow/openflow-1.1.h */
diff --git a/include/openflow/openflow-common.h 
b/include/openflow/openflow-common.h
index 1a73cd6..4ea67f9 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -392,4 +392,14 @@ enum ofp_match_type {
     OFPMT_OXM = 1,              /* OpenFlow Extensible Match */
 };
 
+/* Group numbering. Groups can use any number up to OFPG_MAX. */
+enum ofp_group {
+    /* Last usable group number. */
+    OFPG_MAX        = 0xffffff00,
+
+    /* Fake groups. */
+    OFPG_ALL        = 0xfffffffc,  /* All groups, for group delete commands. */
+    OFPG_ANY        = 0xffffffff   /* Wildcard, for flow stats requests. */
+};
+
 #endif /* openflow/openflow-common.h */
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index 916abf3..9fad356 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -267,25 +267,30 @@ lswitch_process_packet(struct lswitch *sw, struct rconn 
*rconn,
     case OFPUTIL_OFPT_SET_CONFIG:
     case OFPUTIL_OFPT_PORT_STATUS:
     case OFPUTIL_OFPT_PACKET_OUT:
-    case OFPUTIL_OFPT_FLOW_MOD:
+    case OFPUTIL_OFPT10_FLOW_MOD:
+    case OFPUTIL_OFPT11_FLOW_MOD:
     case OFPUTIL_OFPT_PORT_MOD:
     case OFPUTIL_OFPT_BARRIER_REQUEST:
     case OFPUTIL_OFPT_BARRIER_REPLY:
     case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REQUEST:
     case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REPLY:
     case OFPUTIL_OFPST_DESC_REQUEST:
-    case OFPUTIL_OFPST_FLOW_REQUEST:
-    case OFPUTIL_OFPST_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST10_FLOW_REQUEST:
+    case OFPUTIL_OFPST11_FLOW_REQUEST:
+    case OFPUTIL_OFPST10_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST11_AGGREGATE_REQUEST:
     case OFPUTIL_OFPST_TABLE_REQUEST:
     case OFPUTIL_OFPST_PORT_REQUEST:
     case OFPUTIL_OFPST_QUEUE_REQUEST:
     case OFPUTIL_OFPST_PORT_DESC_REQUEST:
     case OFPUTIL_OFPST_DESC_REPLY:
-    case OFPUTIL_OFPST_FLOW_REPLY:
+    case OFPUTIL_OFPST10_FLOW_REPLY:
+    case OFPUTIL_OFPST11_FLOW_REPLY:
     case OFPUTIL_OFPST_QUEUE_REPLY:
     case OFPUTIL_OFPST_PORT_REPLY:
     case OFPUTIL_OFPST_TABLE_REPLY:
-    case OFPUTIL_OFPST_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST10_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST11_AGGREGATE_REPLY:
     case OFPUTIL_OFPST_PORT_DESC_REPLY:
     case OFPUTIL_NXT_ROLE_REQUEST:
     case OFPUTIL_NXT_ROLE_REPLY:
diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h
index 61cef41..1a5ecd6 100644
--- a/lib/ofp-errors.h
+++ b/lib/ofp-errors.h
@@ -324,6 +324,9 @@ enum ofperr {
      * extension is enabled. */
     OFPERR_NXFMFC_BAD_TABLE_ID,
 
+    /* NX1.0+(3,258).  'out_group' specified but groups not yet supported. */
+    OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED,
+
 /* ## ---------------------- ## */
 /* ## OFPET_GROUP_MOD_FAILED ## */
 /* ## ---------------------- ## */
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index a041a4f..c40a0b5 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -666,12 +666,10 @@ ofp10_match_to_string(const struct ofp10_match *om, int 
verbosity)
 }
 
 static void
-ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh,
-                   enum ofputil_msg_code code, int verbosity)
+ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh)
 {
     struct ofputil_flow_mod fm;
     struct ofpbuf ofpacts;
-    bool need_priority;
     enum ofperr error;
 
     ofpbuf_init(&ofpacts, 64);
@@ -707,29 +705,7 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header 
*oh,
     }
 
     ds_put_char(s, ' ');
-    if (verbosity >= 3 && code == OFPUTIL_OFPT_FLOW_MOD) {
-        const struct ofp_flow_mod *ofm = (const struct ofp_flow_mod *) oh;
-        ofp10_match_print(s, &ofm->match, verbosity);
-
-        /* ofp_print_match() doesn't print priority. */
-        need_priority = true;
-    } else if (verbosity >= 3 && code == OFPUTIL_NXT_FLOW_MOD) {
-        const struct nx_flow_mod *nfm = (const struct nx_flow_mod *) oh;
-        const void *nxm = nfm + 1;
-        char *nxm_s;
-
-        nxm_s = nx_match_to_string(nxm, ntohs(nfm->match_len));
-        ds_put_cstr(s, nxm_s);
-        free(nxm_s);
-
-        /* nx_match_to_string() doesn't print priority. */
-        need_priority = true;
-    } else {
-        cls_rule_format(&fm.cr, s);
-
-        /* cls_rule_format() does print priority. */
-        need_priority = false;
-    }
+    cls_rule_format(&fm.cr, s);
 
     if (ds_last(s) != ' ') {
         ds_put_char(s, ' ');
@@ -747,9 +723,6 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header 
*oh,
     if (fm.hard_timeout != OFP_FLOW_PERMANENT) {
         ds_put_format(s, "hard:%"PRIu16" ", fm.hard_timeout);
     }
-    if (fm.cr.priority != OFP_DEFAULT_PRIORITY && need_priority) {
-        ds_put_format(s, "pri:%"PRIu16" ", fm.cr.priority);
-    }
     if (fm.buffer_id != UINT32_MAX) {
         ds_put_format(s, "buf:0x%"PRIx32" ", fm.buffer_id);
     }
@@ -1463,9 +1436,10 @@ ofp_to_string__(const struct ofp_header *oh,
         ofp_print_packet_out(string, msg, verbosity);
         break;
 
-    case OFPUTIL_OFPT_FLOW_MOD:
+    case OFPUTIL_OFPT10_FLOW_MOD:
+    case OFPUTIL_OFPT11_FLOW_MOD:
     case OFPUTIL_NXT_FLOW_MOD:
-        ofp_print_flow_mod(string, msg, code, verbosity);
+        ofp_print_flow_mod(string, msg);
         break;
 
     case OFPUTIL_OFPT_PORT_MOD:
@@ -1486,12 +1460,14 @@ ofp_to_string__(const struct ofp_header *oh,
         ofp_print_stats_request(string, oh);
         break;
 
-    case OFPUTIL_OFPST_FLOW_REQUEST:
+    case OFPUTIL_OFPST10_FLOW_REQUEST:
+    case OFPUTIL_OFPST11_FLOW_REQUEST:
     case OFPUTIL_NXST_FLOW_REQUEST:
-    case OFPUTIL_OFPST_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST10_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST11_AGGREGATE_REQUEST:
     case OFPUTIL_NXST_AGGREGATE_REQUEST:
         ofp_print_stats_request(string, oh);
-        ofp_print_flow_stats_request(string, msg);
+        ofp_print_flow_stats_request(string, oh);
         break;
 
     case OFPUTIL_OFPST_TABLE_REQUEST:
@@ -1513,7 +1489,8 @@ ofp_to_string__(const struct ofp_header *oh,
         ofp_print_ofpst_desc_reply(string, msg);
         break;
 
-    case OFPUTIL_OFPST_FLOW_REPLY:
+    case OFPUTIL_OFPST10_FLOW_REPLY:
+    case OFPUTIL_OFPST11_FLOW_REPLY:
     case OFPUTIL_NXST_FLOW_REPLY:
         ofp_print_stats_reply(string, oh);
         ofp_print_flow_stats_reply(string, oh);
@@ -1534,7 +1511,8 @@ ofp_to_string__(const struct ofp_header *oh,
         ofp_print_ofpst_table_reply(string, oh, verbosity);
         break;
 
-    case OFPUTIL_OFPST_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST10_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST11_AGGREGATE_REPLY:
         ofp_print_stats_reply(string, oh);
         ofp_print_ofpst_aggregate_reply(string, msg);
         break;
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index f8ad6e4..542538f 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -263,6 +263,31 @@ ofputil_cls_rule_to_ofp10_match(const struct cls_rule 
*rule,
     memset(match->pad2, '\0', sizeof match->pad2);
 }
 
+enum ofperr
+ofputil_pull_ofp11_match(struct ofpbuf *buf, unsigned int priority,
+                         struct cls_rule *rule)
+{
+    struct ofp11_match_header *omh;
+    struct ofp11_match *om;
+
+    if (buf->size < sizeof(struct ofp11_match_header)) {
+        return OFPERR_OFPBMC_BAD_LEN;
+    }
+
+    omh = buf->data;
+    switch (ntohs(omh->type)) {
+    case OFPMT_STANDARD:
+        if (omh->length != htons(sizeof *om) || buf->size < sizeof *om) {
+            return OFPERR_OFPBMC_BAD_LEN;
+        }
+        om = ofpbuf_pull(buf, sizeof *om);
+        return ofputil_cls_rule_from_ofp11_match(om, priority, rule);
+
+    default:
+        return OFPERR_OFPBMC_BAD_TYPE;
+    }
+}
+
 /* Converts the ofp11_match in 'match' into a cls_rule in 'rule', with the
  * given 'priority'.  Returns 0 if successful, otherwise an OFPERR_* value. */
 enum ofperr
@@ -746,6 +771,8 @@ static const struct ofputil_msg_type ofputil_msg_types[] = {
            sizeof(struct ofp_switch_features), sizeof(struct ofp11_port)),
     OFPT11(PORT_STATUS,    OFPT_PORT_STATUS,
            sizeof(struct ofp_port_status) + sizeof(struct ofp11_port), 0),
+    OFPT11(FLOW_MOD,           OFPT11_FLOW_MOD,
+           sizeof(struct ofp11_flow_mod), 1),
     OFPT11(PORT_MOD,       OFPT11_PORT_MOD,
            sizeof(struct ofp11_port_mod), 0),
 #undef OPFT11
@@ -1504,87 +1531,131 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
     ofpbuf_use_const(&b, oh, ntohs(oh->length));
 
     ofputil_decode_msg_type(oh, &type);
-    if (ofputil_msg_type_code(type) == OFPUTIL_OFPT_FLOW_MOD) {
-        /* Standard OpenFlow flow_mod. */
-        const struct ofp_flow_mod *ofm;
-        uint16_t priority;
+    if (ofputil_msg_type_code(type) == OFPUTIL_OFPT11_FLOW_MOD) {
+        /* Standard OpenFlow 1.1 flow_mod. */
+        const struct ofp11_flow_mod *ofm;
         enum ofperr error;
 
-        /* Get the ofp_flow_mod. */
         ofm = ofpbuf_pull(&b, sizeof *ofm);
 
-        /* Set priority based on original wildcards.  Normally we'd allow
-         * ofputil_cls_rule_from_match() to do this for us, but
-         * ofputil_normalize_rule() can put wildcards where the original flow
-         * didn't have them. */
-        priority = ntohs(ofm->priority);
-        if (!(ofm->match.wildcards & htonl(OFPFW10_ALL))) {
-            priority = UINT16_MAX;
+        error = ofputil_pull_ofp11_match(&b, ntohs(ofm->priority), &fm->cr);
+        if (error) {
+            return error;
         }
 
-        /* Translate the rule. */
-        ofputil_cls_rule_from_ofp10_match(&ofm->match, priority, &fm->cr);
-        ofputil_normalize_rule(&fm->cr);
-
-        /* Now get the actions. */
-        error = ofpacts_pull_openflow10(&b, b.size, ofpacts);
+        error = ofpacts_pull_openflow11_instructions(&b, b.size, ofpacts);
         if (error) {
             return error;
         }
 
         /* Translate the message. */
-        command = ntohs(ofm->command);
-        fm->cookie = htonll(0);
-        fm->cookie_mask = htonll(0);
-        fm->new_cookie = ofm->cookie;
+        if (ofm->command == OFPFC_ADD) {
+            fm->cookie = htonll(0);
+            fm->cookie_mask = htonll(0);
+            fm->new_cookie = ofm->cookie;
+        } else {
+            /* XXX */
+            fm->cookie = ofm->cookie;
+            fm->cookie_mask = ofm->cookie_mask;
+            fm->new_cookie = htonll(UINT64_MAX);
+        }
+        fm->command = ofm->command;
+        fm->table_id = ofm->table_id;
         fm->idle_timeout = ntohs(ofm->idle_timeout);
         fm->hard_timeout = ntohs(ofm->hard_timeout);
         fm->buffer_id = ntohl(ofm->buffer_id);
-        fm->out_port = ntohs(ofm->out_port);
-        fm->flags = ntohs(ofm->flags);
-    } else if (ofputil_msg_type_code(type) == OFPUTIL_NXT_FLOW_MOD) {
-        /* Nicira extended flow_mod. */
-        const struct nx_flow_mod *nfm;
-        enum ofperr error;
-
-        /* Dissect the message. */
-        nfm = ofpbuf_pull(&b, sizeof *nfm);
-        error = nx_pull_match(&b, ntohs(nfm->match_len), ntohs(nfm->priority),
-                              &fm->cr, &fm->cookie, &fm->cookie_mask);
+        error = ofputil_port_from_ofp11(ofm->out_port, &fm->out_port);
         if (error) {
             return error;
         }
-        error = ofpacts_pull_openflow10(&b, b.size, ofpacts);
-        if (error) {
-            return error;
+        if (ofm->out_group != htonl(OFPG_ANY)) {
+            return OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED;
         }
-
-        /* Translate the message. */
-        command = ntohs(nfm->command);
-        if ((command & 0xff) == OFPFC_ADD && fm->cookie_mask) {
-            /* Flow additions may only set a new cookie, not match an
-             * existing cookie. */
-            return OFPERR_NXBRC_NXM_INVALID;
-        }
-        fm->new_cookie = nfm->cookie;
-        fm->idle_timeout = ntohs(nfm->idle_timeout);
-        fm->hard_timeout = ntohs(nfm->hard_timeout);
-        fm->buffer_id = ntohl(nfm->buffer_id);
-        fm->out_port = ntohs(nfm->out_port);
-        fm->flags = ntohs(nfm->flags);
+        fm->flags = ntohs(ofm->flags);
     } else {
-        NOT_REACHED();
+        if (ofputil_msg_type_code(type) == OFPUTIL_OFPT10_FLOW_MOD) {
+            /* Standard OpenFlow 1.0 flow_mod. */
+            const struct ofp10_flow_mod *ofm;
+            uint16_t priority;
+            enum ofperr error;
+
+            /* Get the ofp10_flow_mod. */
+            ofm = ofpbuf_pull(&b, sizeof *ofm);
+
+            /* Set priority based on original wildcards.  Normally we'd allow
+             * ofputil_cls_rule_from_match() to do this for us, but
+             * ofputil_normalize_rule() can put wildcards where the original 
flow
+             * didn't have them. */
+            priority = ntohs(ofm->priority);
+            if (!(ofm->match.wildcards & htonl(OFPFW10_ALL))) {
+                priority = UINT16_MAX;
+            }
+
+            /* Translate the rule. */
+            ofputil_cls_rule_from_ofp10_match(&ofm->match, priority, &fm->cr);
+            ofputil_normalize_rule(&fm->cr);
+
+            /* Now get the actions. */
+            error = ofpacts_pull_openflow10(&b, b.size, ofpacts);
+            if (error) {
+                return error;
+            }
+
+            /* Translate the message. */
+            command = ntohs(ofm->command);
+            fm->cookie = htonll(0);
+            fm->cookie_mask = htonll(0);
+            fm->new_cookie = ofm->cookie;
+            fm->idle_timeout = ntohs(ofm->idle_timeout);
+            fm->hard_timeout = ntohs(ofm->hard_timeout);
+            fm->buffer_id = ntohl(ofm->buffer_id);
+            fm->out_port = ntohs(ofm->out_port);
+            fm->flags = ntohs(ofm->flags);
+        } else if (ofputil_msg_type_code(type) == OFPUTIL_NXT_FLOW_MOD) {
+            /* Nicira extended flow_mod. */
+            const struct nx_flow_mod *nfm;
+            enum ofperr error;
+
+            /* Dissect the message. */
+            nfm = ofpbuf_pull(&b, sizeof *nfm);
+            error = nx_pull_match(&b, ntohs(nfm->match_len), 
ntohs(nfm->priority),
+                                  &fm->cr, &fm->cookie, &fm->cookie_mask);
+            if (error) {
+                return error;
+            }
+            error = ofpacts_pull_openflow10(&b, b.size, ofpacts);
+            if (error) {
+                return error;
+            }
+
+            /* Translate the message. */
+            command = ntohs(nfm->command);
+            if ((command & 0xff) == OFPFC_ADD && fm->cookie_mask) {
+                /* Flow additions may only set a new cookie, not match an
+                 * existing cookie. */
+                return OFPERR_NXBRC_NXM_INVALID;
+            }
+            fm->new_cookie = nfm->cookie;
+            fm->idle_timeout = ntohs(nfm->idle_timeout);
+            fm->hard_timeout = ntohs(nfm->hard_timeout);
+            fm->buffer_id = ntohl(nfm->buffer_id);
+            fm->out_port = ntohs(nfm->out_port);
+            fm->flags = ntohs(nfm->flags);
+        } else {
+            NOT_REACHED();
+        }
+
+        if (protocol & OFPUTIL_P_TID) {
+            fm->command = command & 0xff;
+            fm->table_id = command >> 8;
+        } else {
+            fm->command = command;
+            fm->table_id = 0xff;
+        }
     }
 
     fm->ofpacts = ofpacts->data;
     fm->ofpacts_len = ofpacts->size;
-    if (protocol & OFPUTIL_P_TID) {
-        fm->command = command & 0xff;
-        fm->table_id = command >> 8;
-    } else {
-        fm->command = command;
-        fm->table_id = 0xff;
-    }
 
     return 0;
 }
@@ -1737,7 +1808,7 @@ ofputil_decode_flow_stats_request(struct 
ofputil_flow_stats_request *fsr,
     ofputil_decode_msg_type(oh, &type);
     code = ofputil_msg_type_code(type);
     switch (code) {
-    case OFPUTIL_OFPST_FLOW_REQUEST:
+    case OFPUTIL_OFPST10_FLOW_REQUEST:
         return ofputil_decode_ofpst_flow_request(fsr, b.data, false);
 
     case OFPUTIL_OFPST_AGGREGATE_REQUEST:
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index 3395a38..277f058 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -49,7 +49,8 @@ enum ofputil_msg_code {
     OFPUTIL_OFPT_FLOW_REMOVED,
     OFPUTIL_OFPT_PORT_STATUS,
     OFPUTIL_OFPT_PACKET_OUT,
-    OFPUTIL_OFPT_FLOW_MOD,
+    OFPUTIL_OFPT10_FLOW_MOD,
+    OFPUTIL_OFPT11_FLOW_MOD,
     OFPUTIL_OFPT_PORT_MOD,
     OFPUTIL_OFPT_BARRIER_REQUEST,
     OFPUTIL_OFPT_BARRIER_REPLY,
@@ -58,8 +59,10 @@ enum ofputil_msg_code {
 
     /* OFPST_* stat requests. */
     OFPUTIL_OFPST_DESC_REQUEST,
-    OFPUTIL_OFPST_FLOW_REQUEST,
-    OFPUTIL_OFPST_AGGREGATE_REQUEST,
+    OFPUTIL_OFPST10_FLOW_REQUEST,
+    OFPUTIL_OFPST11_FLOW_REQUEST,
+    OFPUTIL_OFPST10_AGGREGATE_REQUEST,
+    OFPUTIL_OFPST11_AGGREGATE_REQUEST,
     OFPUTIL_OFPST_TABLE_REQUEST,
     OFPUTIL_OFPST_PORT_REQUEST,
     OFPUTIL_OFPST_QUEUE_REQUEST,
@@ -67,11 +70,13 @@ enum ofputil_msg_code {
 
     /* OFPST_* stat replies. */
     OFPUTIL_OFPST_DESC_REPLY,
-    OFPUTIL_OFPST_FLOW_REPLY,
+    OFPUTIL_OFPST10_FLOW_REPLY,
+    OFPUTIL_OFPST11_FLOW_REPLY,
     OFPUTIL_OFPST_QUEUE_REPLY,
     OFPUTIL_OFPST_PORT_REPLY,
     OFPUTIL_OFPST_TABLE_REPLY,
-    OFPUTIL_OFPST_AGGREGATE_REPLY,
+    OFPUTIL_OFPST10_AGGREGATE_REPLY,
+    OFPUTIL_OFPST11_AGGREGATE_REPLY,
     OFPUTIL_OFPST_PORT_DESC_REPLY,
 
     /* NXT_* messages. */
@@ -188,6 +193,8 @@ void ofputil_cls_rule_to_ofp10_match(const struct cls_rule 
*,
                                      struct ofp10_match *);
 
 /* Work with ofp11_match. */
+enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, unsigned int priority,
+                                     struct cls_rule *);
 enum ofperr ofputil_cls_rule_from_ofp11_match(const struct ofp11_match *,
                                               unsigned int priority,
                                               struct cls_rule *);
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 0d1617c..f2d3dee 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3391,7 +3391,8 @@ handle_openflow__(struct ofconn *ofconn, const struct 
ofpbuf *msg)
     case OFPUTIL_OFPT_PORT_MOD:
         return handle_port_mod(ofconn, oh);
 
-    case OFPUTIL_OFPT_FLOW_MOD:
+    case OFPUTIL_OFPT10_FLOW_MOD:
+    case OFPUTIL_OFPT11_FLOW_MOD:
         return handle_flow_mod(ofconn, oh);
 
     case OFPUTIL_OFPT_BARRIER_REQUEST:
@@ -3431,11 +3432,13 @@ handle_openflow__(struct ofconn *ofconn, const struct 
ofpbuf *msg)
     case OFPUTIL_OFPST_DESC_REQUEST:
         return handle_desc_stats_request(ofconn, msg->data);
 
-    case OFPUTIL_OFPST_FLOW_REQUEST:
+    case OFPUTIL_OFPST10_FLOW_REQUEST:
+    case OFPUTIL_OFPST11_FLOW_REQUEST:
     case OFPUTIL_NXST_FLOW_REQUEST:
         return handle_flow_stats_request(ofconn, msg->data);
 
-    case OFPUTIL_OFPST_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST10_AGGREGATE_REQUEST:
+    case OFPUTIL_OFPST11_AGGREGATE_REQUEST:
     case OFPUTIL_NXST_AGGREGATE_REQUEST:
         return handle_aggregate_stats_request(ofconn, msg->data);
 
@@ -3463,11 +3466,13 @@ handle_openflow__(struct ofconn *ofconn, const struct 
ofpbuf *msg)
     case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REQUEST:
     case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REPLY:
     case OFPUTIL_OFPST_DESC_REPLY:
-    case OFPUTIL_OFPST_FLOW_REPLY:
+    case OFPUTIL_OFPST10_FLOW_REPLY:
+    case OFPUTIL_OFPST11_FLOW_REPLY:
     case OFPUTIL_OFPST_QUEUE_REPLY:
     case OFPUTIL_OFPST_PORT_REPLY:
     case OFPUTIL_OFPST_TABLE_REPLY:
-    case OFPUTIL_OFPST_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST10_AGGREGATE_REPLY:
+    case OFPUTIL_OFPST11_AGGREGATE_REPLY:
     case OFPUTIL_OFPST_PORT_DESC_REPLY:
     case OFPUTIL_NXT_ROLE_REPLY:
     case OFPUTIL_NXT_FLOW_REMOVED:
-- 
1.7.2.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to