From b1c5bf1f39d32ed4c6dc5b752d17e0cd12b924e8 Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Wed, 2 Mar 2016 15:56:20 +0100 Subject: 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 Signed-off-by: Ben Pfaff --- lib/bundle.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/bundle.c') 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 #include +#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); } -- cgit v1.2.1