From: Stephen Hemminger Date: Tue, 12 Mar 2024 22:42:16 +0000 (-0700) Subject: simple: support json output X-Git-Tag: v6.9.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69d55c213da8650b6ac8b54777475874673b0cdd;p=thirdparty%2Fiproute2.git simple: support json output Last action that never got JSON support. Signed-off-by: Stephen Hemminger --- diff --git a/tc/m_simple.c b/tc/m_simple.c index 9715955e..55f34441 100644 --- a/tc/m_simple.c +++ b/tc/m_simple.c @@ -179,9 +179,11 @@ static int print_simple(const struct action_util *au, FILE *f, struct rtattr *ar simpdata = RTA_DATA(tb[TCA_DEF_DATA]); - fprintf(f, "Simple <%s>\n", simpdata); - fprintf(f, "\t index %u ref %d bind %d", sel->index, - sel->refcnt, sel->bindcnt); + print_string(PRINT_ANY, "simple", "Simple <%s>", simpdata); + print_nl(); + print_uint(PRINT_ANY, "index", "\t index %u ", sel->index); + print_int(PRINT_ANY, "ref", "ref %d ", sel->refcnt); + print_int(PRINT_ANY, "bind","bind %d", sel->bindcnt); if (show_stats) { if (tb[TCA_DEF_TM]) {