Add printing of all supported action types.
authorJustin Pettit <jpettit@nicira.com>
Sat, 14 Jun 2008 02:12:51 +0000 (19:12 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 24 Jun 2008 23:48:55 +0000 (16:48 -0700)
lib/ofp-print.c

index e2b9f6d7398badba4acf6a04f49448578eb2d684..48ea86de67047877e42202619fabca058541da35 100644 (file)
@@ -221,13 +221,49 @@ ofp_print_action(struct ds *string, const struct ofp_action *a)
         ds_put_cstr(string, "output(");
         ofp_print_port_name(string, ntohs(a->arg.output.port));
         if (a->arg.output.port == htons(OFPP_CONTROLLER)) {
-            ds_put_format(string, ", max %"PRIu16" bytes", ntohs(a->arg.output.max_len));
+            ds_put_format(string, ", max %"PRIu16" bytes", 
+                    ntohs(a->arg.output.max_len));
         }
         ds_put_cstr(string, ")");
         break;
 
+    case OFPAT_SET_DL_VLAN:
+        if (ntohs(a->arg.vlan_id) == OFP_VLAN_NONE) {
+            ds_put_cstr(string, "strip vlan");
+        } else {
+            ds_put_format(string, "mod vlan(%"PRIu16")", ntohs(a->arg.vlan_id));
+        }
+        break;
+
+    case OFPAT_SET_DL_SRC:
+        ds_put_format(string, "mod dl src("ETH_ADDR_FMT")", 
+                ETH_ADDR_ARGS(a->arg.dl_addr));
+        break;
+
+    case OFPAT_SET_DL_DST:
+        ds_put_format(string, "mod dl dst("ETH_ADDR_FMT")", 
+                ETH_ADDR_ARGS(a->arg.dl_addr));
+        break;
+
+    case OFPAT_SET_NW_SRC:
+        ds_put_format(string, "mod nw src("IP_FMT")", IP_ARGS(a->arg.nw_addr));
+        break;
+
+    case OFPAT_SET_NW_DST:
+        ds_put_format(string, "mod nw dst("IP_FMT")", IP_ARGS(a->arg.nw_addr));
+        break;
+
+    case OFPAT_SET_TP_SRC:
+        ds_put_format(string, "mod tp src(%d)", ntohs(a->arg.tp));
+        break;
+
+    case OFPAT_SET_TP_DST:
+        ds_put_format(string, "mod tp dst(%d)", ntohs(a->arg.tp));
+        break;
+
     default:
-        ds_put_format(string, "(decoder %"PRIu16" not implemented)", ntohs(a->type));
+        ds_put_format(string, "(decoder %"PRIu16" not implemented)", 
+                ntohs(a->type));
         break;
     }
 }