ofp-print: Print OFPUTIL_NXT_STATUS_REQUEST and OFPUTIL_NXT_STATUS_REPLY.
authorBen Pfaff <blp@nicira.com>
Tue, 7 Dec 2010 22:41:19 +0000 (14:41 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 9 Dec 2010 18:27:08 +0000 (10:27 -0800)
lib/ofp-print.c

index 2a6528afd0348bb95365555abfdec6de836ec9c5..740dbe963e491111b3ea4b9db3b5ee8097d78c8e 100644 (file)
@@ -1455,6 +1455,18 @@ ofp_print_echo(struct ds *string, const struct ofp_header *oh, int verbosity)
     }
 }
 
+static void
+ofp_print_nxt_status_message(struct ds *string, const struct ofp_header *oh)
+{
+    struct ofpbuf b;
+
+    ofpbuf_use_const(&b, oh, ntohs(oh->length));
+    ofpbuf_pull(&b, sizeof *oh);
+    ds_put_char(string, '"');
+    ds_put_printable(string, b.data, b.size);
+    ds_put_char(string, '"');
+}
+
 static void
 ofp_print_nxt_tun_id_from_cookie(struct ds *string,
                                  const struct nxt_tun_id_cookie *ntic)
@@ -1630,7 +1642,7 @@ ofp_to_string__(const struct ofp_header *oh,
 
     case OFPUTIL_NXT_STATUS_REQUEST:
     case OFPUTIL_NXT_STATUS_REPLY:
-        /* XXX */
+        ofp_print_nxt_status_message(string, oh);
         break;
 
     case OFPUTIL_NXT_TUN_ID_FROM_COOKIE: