bridge: Report lacp_slave_is_current() in the database.
[openvswitch] / lib / ofp-print.c
index 1cd946260ff2b8cfcbf3a3b20458f3da84a5770c..30f6d37423d498e07cda18a094bcbab84bec1cf6 100644 (file)
@@ -219,6 +219,7 @@ nx_action_len(enum nx_action_subtype subtype)
     case NXAST_NOTE: return -1;
     case NXAST_SET_TUNNEL64: return sizeof(struct nx_action_set_tunnel64);
     case NXAST_MULTIPATH: return sizeof(struct nx_action_multipath);
+    case NXAST_AUTOPATH: return sizeof (struct nx_action_autopath);
     default: return -1;
     }
 }
@@ -226,7 +227,7 @@ nx_action_len(enum nx_action_subtype subtype)
 static void
 ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
 {
-    uint16_t subtype = ntohs(nah->subtype);
+    int subtype = ntohs(nah->subtype);
     int required_len = nx_action_len(subtype);
     int len = ntohs(nah->len);
 
@@ -244,6 +245,7 @@ ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
         const struct nx_action_reg_move *move;
         const struct nx_action_reg_load *load;
         const struct nx_action_multipath *nam;
+        const struct nx_action_autopath *naa;
 
         switch ((enum nx_action_subtype) subtype) {
         case NXAST_RESUBMIT:
@@ -295,13 +297,22 @@ ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
             multipath_format(nam, string);
             return;
 
+        case NXAST_AUTOPATH:
+            naa = (const struct nx_action_autopath *)nah;
+            ds_put_format(string, "autopath(%u,", ntohl(naa->id));
+            nxm_format_field_bits(string, ntohl(naa->dst),
+                                  nxm_decode_ofs(naa->ofs_nbits),
+                                  nxm_decode_n_bits(naa->ofs_nbits));
+            ds_put_char(string, ')');
+            return;
+
         case NXAST_SNAT__OBSOLETE:
         default:
             break;
         }
     }
 
-    ds_put_format(string, "***unknown Nicira action:%"PRIu16"***", subtype);
+    ds_put_format(string, "***unknown Nicira action:%d***", subtype);
 }
 
 static int
@@ -603,7 +614,7 @@ ofp_print_phy_port(struct ds *string, const struct ofp_phy_port *port)
 
     memcpy(name, port->name, sizeof name);
     for (j = 0; j < sizeof name - 1; j++) {
-        if (!isprint(name[j])) {
+        if (!isprint((unsigned char) name[j])) {
             break;
         }
     }