ofp-print: Support printing NXAST_RESUBMIT Nicira action.
authorBen Pfaff <blp@nicira.com>
Tue, 10 Mar 2009 22:12:05 +0000 (15:12 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 10 Mar 2009 22:12:05 +0000 (15:12 -0700)
lib/ofp-print.c

index a036db5d9cd2d8bf358fcb58c238c81df1ce4637..00d95260ef9b397729c41bf445b2e73715baa27a 100644 (file)
@@ -203,8 +203,8 @@ static void ofp_print_port_name(struct ds *string, uint16_t port)
 static void
 ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
 {
-
-    if (nah->subtype == htonl(NXAST_SNAT)) {
+    switch (ntohs(nah->subtype)) {
+    case NXAST_SNAT: {
         const struct nx_action_snat *nas = (struct nx_action_snat *)nah;
         uint16_t port = ntohs(nas->port);
 
@@ -213,8 +213,18 @@ ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
         } else {
             ds_put_format(string, "nat:%"PRIu16" (invalid port)", port);
         }
-    } else {
-        ds_put_format(string, "***unknown Nicira action:%d***\n", 
+        break;
+    }
+
+    case NXAST_RESUBMIT: {
+        const struct nx_action_resubmit *nar = (struct nx_action_resubmit *)nah;
+        ds_put_format(string, "resubmit:");
+        ofp_print_port_name(string, ntohs(nar->in_port));
+        break;
+    }
+
+    default:
+        ds_put_format(string, "***unknown Nicira action:%d***\n",
                       ntohs(nah->subtype));
     }
 }