From: Roman Mashak Date: Tue, 3 Apr 2018 13:09:55 +0000 (-0400) Subject: tc: jsonify connmark action X-Git-Tag: v4.18.0~24^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d3c91a7c49d2795c3e57a7bb114d81ba10e0eeb;p=thirdparty%2Fiproute2.git tc: jsonify connmark action Signed-off-by: Roman Mashak Signed-off-by: David Ahern --- diff --git a/tc/m_connmark.c b/tc/m_connmark.c index bcce41391..45e2d05f1 100644 --- a/tc/m_connmark.c +++ b/tc/m_connmark.c @@ -114,16 +114,20 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg) parse_rtattr_nested(tb, TCA_CONNMARK_MAX, arg); if (tb[TCA_CONNMARK_PARMS] == NULL) { - fprintf(f, "[NULL connmark parameters]"); + print_string(PRINT_FP, NULL, "%s", "[NULL connmark parameters]"); return -1; } ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]); - fprintf(f, " connmark zone %d", ci->zone); - print_action_control(f, " ", ci->action, "\n"); - fprintf(f, "\t index %u ref %d bind %d", ci->index, - ci->refcnt, ci->bindcnt); + print_string(PRINT_ANY, "kind", "%s ", "connmark"); + print_uint(PRINT_ANY, "zone", "zone %u", ci->zone); + print_action_control(f, " ", ci->action, ""); + + print_string(PRINT_FP, NULL, "%s", _SL_); + print_uint(PRINT_ANY, "index", "\t index %u", ci->index); + print_int(PRINT_ANY, "ref", " ref %d", ci->refcnt); + print_int(PRINT_ANY, "bind", " bind %d", ci->bindcnt); if (show_stats) { if (tb[TCA_CONNMARK_TM]) { @@ -132,7 +136,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg) print_tm(f, tm); } } - fprintf(f, "\n"); + print_string(PRINT_FP, NULL, "%s", _SL_); return 0; }