From: Ben Pfaff Date: Tue, 10 Mar 2009 22:15:06 +0000 (-0700) Subject: ofp-print: Make flow statistics and actions slightly easier to read. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ef87deb11f91ea3d08ee00242e1ae3d788eedbb;p=openvswitch ofp-print: Make flow statistics and actions slightly easier to read. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 00d95260..1883049d 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -417,6 +417,9 @@ ofp_print_actions(struct ds *string, const struct ofp_action_header *action, int len = 0; ds_put_cstr(string, "actions="); + if (!actions_len) { + ds_put_cstr(string, "drop"); + } while (actions_len > 0) { if (len) { ds_put_cstr(string, ","); @@ -989,10 +992,14 @@ ofp_flow_stats_reply(struct ds *string, const void *body_, size_t len, ds_put_format(string, "n_packets=%"PRIu64", ", ntohll(fs->packet_count)); ds_put_format(string, "n_bytes=%"PRIu64", ", ntohll(fs->byte_count)); - ds_put_format(string, "idle_timeout=%"PRIu16",", - ntohs(fs->idle_timeout)); - ds_put_format(string, "hard_timeout=%"PRIu16",", - ntohs(fs->hard_timeout)); + if (fs->idle_timeout != htons(OFP_FLOW_PERMANENT)) { + ds_put_format(string, "idle_timeout=%"PRIu16",", + ntohs(fs->idle_timeout)); + } + if (fs->hard_timeout != htons(OFP_FLOW_PERMANENT)) { + ds_put_format(string, "hard_timeout=%"PRIu16",", + ntohs(fs->hard_timeout)); + } ofp_print_match(string, &fs->match, verbosity); ofp_print_actions(string, fs->actions, length - sizeof *fs); ds_put_char(string, '\n');