ofp-util: Update Capabilities for Open Flow 1.2
[sliver-openvswitch.git] / lib / ofp-print.c
index d1cab7b..e8a928e 100644 (file)
@@ -442,6 +442,7 @@ ofputil_capabilities_to_name(uint32_t bit)
     case OFPUTIL_C_ARP_MATCH_IP: return "ARP_MATCH_IP";
     case OFPUTIL_C_STP:          return "STP";
     case OFPUTIL_C_GROUP_STATS:  return "GROUP_STATS";
+    case OFPUTIL_C_PORT_BLOCKED: return "PORT_BLOCKED";
     }
 
     return NULL;
@@ -507,10 +508,19 @@ ofp_print_switch_features(struct ds *string, const struct ofp_header *oh)
                         ofputil_capabilities_to_name, ' ');
     ds_put_char(string, '\n');
 
-    ds_put_cstr(string, "actions: ");
-    ofp_print_bit_names(string, features.actions,
-                        ofputil_action_bitmap_to_name, ' ');
-    ds_put_char(string, '\n');
+    switch ((enum ofp_version)oh->version) {
+    case OFP10_VERSION:
+        ds_put_cstr(string, "actions: ");
+        ofp_print_bit_names(string, features.actions,
+                            ofputil_action_bitmap_to_name, ' ');
+        ds_put_char(string, '\n');
+        break;
+    case OFP11_VERSION:
+    case OFP12_VERSION:
+        break;
+    default:
+        NOT_REACHED();
+    }
 
     ofp_print_phy_ports(string, oh->version, &b);
 }
@@ -711,7 +721,7 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, int verbosity)
     ds_put_char(s, ' ');
     ofpraw_decode(&raw, oh);
     if (verbosity >= 3 && raw == OFPRAW_OFPT10_FLOW_MOD) {
-        const struct ofp_flow_mod *ofm = ofpmsg_body(oh);
+        const struct ofp10_flow_mod *ofm = ofpmsg_body(oh);
         ofp10_match_print(s, &ofm->match, verbosity);
 
         /* ofp_print_match() doesn't print priority. */
@@ -770,11 +780,11 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, int verbosity)
         if (flags & OFPFF_CHECK_OVERLAP) {
             ds_put_cstr(s, "check_overlap ");
         }
-        if (flags & OFPFF_EMERG) {
+        if (flags & OFPFF10_EMERG) {
             ds_put_cstr(s, "emerg ");
         }
 
-        flags &= ~(OFPFF_SEND_FLOW_REM | OFPFF_CHECK_OVERLAP | OFPFF_EMERG);
+        flags &= ~(OFPFF_SEND_FLOW_REM | OFPFF_CHECK_OVERLAP | OFPFF10_EMERG);
         if (flags) {
             ds_put_format(s, "flags:0x%"PRIx16" ", flags);
         }
@@ -1073,7 +1083,7 @@ static void print_port_stat(struct ds *string, const char *leader,
 static void
 ofp_print_ofpst_port_request(struct ds *string, const struct ofp_header *oh)
 {
-    const struct ofp_port_stats_request *psr = ofpmsg_body(oh);
+    const struct ofp10_port_stats_request *psr = ofpmsg_body(oh);
     ds_put_format(string, " port_no=%"PRIu16, ntohs(psr->port_no));
 }
 
@@ -1081,7 +1091,7 @@ static void
 ofp_print_ofpst_port_reply(struct ds *string, const struct ofp_header *oh,
                            int verbosity)
 {
-    struct ofp_port_stats *ps;
+    struct ofp10_port_stats *ps;
     struct ofpbuf b;
     size_t n;
 
@@ -1124,7 +1134,7 @@ static void
 ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh,
                             int verbosity)
 {
-    struct ofp_table_stats *ts;
+    struct ofp10_table_stats *ts;
     struct ofpbuf b;
     size_t n;
 
@@ -1172,7 +1182,7 @@ ofp_print_queue_name(struct ds *string, uint32_t queue_id)
 static void
 ofp_print_ofpst_queue_request(struct ds *string, const struct ofp_header *oh)
 {
-    const struct ofp_queue_stats_request *qsr = ofpmsg_body(oh);
+    const struct ofp10_queue_stats_request *qsr = ofpmsg_body(oh);
 
     ds_put_cstr(string, "port=");
     ofputil_format_port(ntohs(qsr->port_no), string);
@@ -1185,7 +1195,7 @@ static void
 ofp_print_ofpst_queue_reply(struct ds *string, const struct ofp_header *oh,
                             int verbosity)
 {
-    struct ofp_queue_stats *qs;
+    struct ofp10_queue_stats *qs;
     struct ofpbuf b;
     size_t n;