ofp-print: Print every flow on a new line for NXST_FLOW replies too.
authorBen Pfaff <blp@nicira.com>
Thu, 9 Dec 2010 20:31:31 +0000 (12:31 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 9 Dec 2010 20:31:31 +0000 (12:31 -0800)
This makes NXST_FLOW formatting consistent with OFPST_FLOW.

Suggested-by: Justin Pettit <jpettit@nicira.com>
lib/ofp-print.c
tests/ofproto.at

index a49c385..5370c9a 100644 (file)
@@ -1221,6 +1221,8 @@ ofp_print_nxst_flow_reply(struct ds *string, const struct ofp_header *oh)
         int match_len;
         int error;
 
+        ds_put_char(string, '\n');
+
         fs = ofpbuf_try_pull(&b, sizeof *fs);
         if (!fs) {
             ds_put_format(string, " ***%td leftover bytes at end***", b.size);
@@ -1276,7 +1278,6 @@ ofp_print_nxst_flow_reply(struct ds *string, const struct ofp_header *oh)
         ds_put_char(string, ' ');
         ofp_print_actions(string, (const struct ofp_action_header *) actions,
                           n_actions * sizeof *actions);
-        ds_put_char(string, '\n');
      }
 }
 
index 9777e16..907ac13 100644 (file)
@@ -66,7 +66,8 @@ AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS], [0], [NXST_FLOW reply:
 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=0])
 AT_CHECK([ovs-ofctl add-flow br0 in_port=0,actions=1])
 AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], [dnl
-NXST_FLOW reply: cookie=0x0, duration=?s, table_id=0, priority=32768, n_packets=0, n_bytes=0, in_port=1 actions=output:0
+NXST_FLOW reply:
+ cookie=0x0, duration=?s, table_id=0, priority=32768, n_packets=0, n_bytes=0, in_port=1 actions=output:0
  cookie=0x0, duration=?s, table_id=0, priority=32768, n_packets=0, n_bytes=0, in_port=65534 actions=output:1
 ])
 AT_CHECK([ovs-ofctl del-flows br0])