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 a49c3854c23a5224f528037a41ffdb2d549a525e..5370c9aaf5d7fb44e11785f6cdab052efc620bff 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 9777e1613ad1625e33bd9d1b77ee7f9cb75203a0..907ac13bc9c351d2a4533b69c7cd603d4cf84062 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])