From 455ecd775d46f96fed8f307f44958a2a07ebcfff Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 14 Oct 2013 14:08:20 -0700 Subject: [PATCH] ofp-actions: Make ofpacts_format() caller add "actions=" if it wants it. An upcoming caller doesn't want it. Signed-off-by: Ben Pfaff --- lib/ofp-actions.c | 1 - lib/ofp-print.c | 6 +++++- ofproto/ofproto-dpif.c | 2 +- ofproto/ofproto.c | 1 + utilities/ovs-ofctl.c | 5 ++++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 65430f315..1d0321ae6 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -2459,7 +2459,6 @@ void ofpacts_format(const struct ofpact *ofpacts, size_t ofpacts_len, struct ds *string) { - ds_put_cstr(string, "actions="); if (!ofpacts_len) { ds_put_cstr(string, "drop"); } else { diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 6fe1cee08..a31de9d5e 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -185,7 +185,7 @@ ofp_print_packet_out(struct ds *string, const struct ofp_header *oh, ds_put_cstr(string, " in_port="); ofputil_format_port(po.in_port, string); - ds_put_char(string, ' '); + ds_put_cstr(string, " actions="); ofpacts_format(po.ofpacts, po.ofpacts_len, string); if (po.buffer_id == UINT32_MAX) { @@ -850,6 +850,7 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, int verbosity) } ofp_print_flow_flags(s, fm.flags); + ds_put_cstr(s, "actions="); ofpacts_format(fm.ofpacts, fm.ofpacts_len, s); ofpbuf_uninit(&ofpacts); } @@ -1382,6 +1383,7 @@ ofp_print_flow_stats(struct ds *string, struct ofputil_flow_stats *fs) ds_put_char(string, ' '); } + ds_put_cstr(string, "actions="); ofpacts_format(fs->ofpacts, fs->ofpacts_len, string); } @@ -2141,6 +2143,7 @@ ofp_print_nxst_flow_monitor_reply(struct ds *string, if (string->string[string->length - 1] != ' ') { ds_put_char(string, ' '); } + ds_put_cstr(string, "actions="); ofpacts_format(update.ofpacts, update.ofpacts_len, string); } } @@ -2210,6 +2213,7 @@ ofp_print_group(struct ds *s, uint32_t group_id, uint8_t type, ds_put_format(s, "watch_group:%"PRIu32",", bucket->watch_group); } + ds_put_cstr(s, "actions="); ofpacts_format(bucket->ofpacts, bucket->ofpacts_len, s); } } diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 69625cf6e..e53bb25da 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5055,7 +5055,7 @@ trace_format_rule(struct ds *result, int level, const struct rule_dpif *rule) actions = rule_dpif_get_actions(rule); ds_put_char_multiple(result, '\t', level); - ds_put_cstr(result, "OpenFlow "); + ds_put_cstr(result, "OpenFlow actions="); ofpacts_format(actions->ofpacts, actions->ofpacts_len, result); ds_put_char(result, '\n'); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index b1c93fb17..fe004b598 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3555,6 +3555,7 @@ flow_stats_ds(struct rule *rule, struct ds *results) cls_rule_format(&rule->cr, results); ds_put_char(results, ','); + ds_put_cstr(results, "actions="); ofpacts_format(actions->ofpacts, actions->ofpacts_len, results); ds_put_cstr(results, "\n"); diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 1cd23e6a9..2b897557b 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -2113,7 +2113,7 @@ fte_version_format(const struct fte *fte, int index, struct ds *s) ds_put_format(s, " hard_timeout=%"PRIu16, version->hard_timeout); } - ds_put_char(s, ' '); + ds_put_cstr(s, " actions="); ofpacts_format(version->ofpacts, version->ofpacts_len, s); ds_put_char(s, '\n'); @@ -2795,6 +2795,7 @@ ofctl_parse_ofp10_actions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) /* Print cls_rule. */ ds_init(&s); + ds_put_cstr(&s, "actions="); ofpacts_format(ofpacts.data, ofpacts.size, &s); puts(ds_cstr(&s)); ds_destroy(&s); @@ -2981,6 +2982,7 @@ ofctl_parse_ofp11_actions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) /* Print cls_rule. */ ds_init(&s); + ds_put_cstr(&s, "actions="); ofpacts_format(ofpacts.data, ofpacts.size, &s); puts(ds_cstr(&s)); ds_destroy(&s); @@ -3056,6 +3058,7 @@ ofctl_parse_ofp11_instructions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) /* Print cls_rule. */ ds_init(&s); + ds_put_cstr(&s, "actions="); ofpacts_format(ofpacts.data, ofpacts.size, &s); puts(ds_cstr(&s)); ds_destroy(&s); -- 2.47.0