ofp-print: Print each flow at the start of a line.
authorBen Pfaff <blp@nicira.com>
Wed, 8 Dec 2010 20:05:20 +0000 (12:05 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 8 Dec 2010 21:32:54 +0000 (13:32 -0800)
Before this commit, the first flow in "ovs-ofctl dump-flows" output was
printed on the same line as the OpenFlow message type name and the xid.
With this commit, that flow is put on a line of its own, like all of the
other flows in the output.

Requested-by: Paul Ingram <paul@nicira.com>
CC: Paul Ingram <paul@nicira.com>
lib/ofp-print.c

index e199ac9fd0f067c1c26d9abccf3324ad1363b43e..4141b9f9b0e0a50d70b6e2e419ddcfa95efc571a 100644 (file)
@@ -1069,6 +1069,8 @@ ofp_print_ofpst_flow_reply(struct ds *string, const struct ofp_header *oh,
         ptrdiff_t bytes_left = body + len - pos;
         size_t length;
 
+        ds_put_char(string, '\n');
+
         if (bytes_left < sizeof *fs) {
             if (bytes_left != 0) {
                 ds_put_format(string, " ***%td leftover bytes at end***",
@@ -1118,7 +1120,6 @@ ofp_print_ofpst_flow_reply(struct ds *string, const struct ofp_header *oh,
         }
         ofp_print_match(string, &fs->match, verbosity);
         ofp_print_actions(string, fs->actions, length - sizeof *fs);
-        ds_put_char(string, '\n');
 
         pos += length;
      }