summaryrefslogtreecommitdiff
path: root/lib/bundle.c
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@6wind.com>2016-03-02 15:56:20 +0100
committerBen Pfaff <blp@ovn.org>2016-03-18 14:02:51 -0700
commitb1c5bf1f39d32ed4c6dc5b752d17e0cd12b924e8 (patch)
tree032f901265380045cc5a169649a0538c41f1e9ca /lib/bundle.c
parent0deec6d26106c881e265e90a301d7975ffc06eab (diff)
downloadopenvswitch-b1c5bf1f39d32ed4c6dc5b752d17e0cd12b924e8.tar.gz
ofp-actions: Color output of flow actions for ovs-ofctl dump-flows.
Add color output for flow actions for ovs-ofctl dump-flows command utility, by inserting color markers in the functions responsible for printing those actions. Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/bundle.c')
-rw-r--r--lib/bundle.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/bundle.c b/lib/bundle.c
index 1451e928f..601eb1b60 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -20,6 +20,7 @@
#include <arpa/inet.h>
#include <inttypes.h>
+#include "colors.h"
#include "dynamic-string.h"
#include "multipath.h"
#include "meta-flow.h"
@@ -300,22 +301,22 @@ bundle_format(const struct ofpact_bundle *bundle, struct ds *s)
action = bundle->dst.field ? "bundle_load" : "bundle";
- ds_put_format(s, "%s(%s,%"PRIu16",%s,%s,", action, fields,
- bundle->basis, algorithm, "ofport");
+ ds_put_format(s, "%s%s(%s%s,%"PRIu16",%s,%s,", colors.paren, action,
+ colors.end, fields, bundle->basis, algorithm, "ofport");
if (bundle->dst.field) {
mf_format_subfield(&bundle->dst, s);
- ds_put_cstr(s, ",");
+ ds_put_char(s, ',');
}
- ds_put_cstr(s, "slaves:");
+ ds_put_format(s, "%sslaves:%s", colors.param, colors.end);
for (i = 0; i < bundle->n_slaves; i++) {
if (i) {
- ds_put_cstr(s, ",");
+ ds_put_char(s, ',');
}
ofputil_format_port(bundle->slaves[i], s);
}
- ds_put_cstr(s, ")");
+ ds_put_format(s, "%s)%s", colors.paren, colors.end);
}