]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
simple: support json output
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 12 Mar 2024 22:42:16 +0000 (15:42 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 13 Mar 2024 17:07:33 +0000 (10:07 -0700)
Last action that never got JSON support.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/m_simple.c

index 9715955e01879e3025ed27fd29273efa962b4fd8..55f3444176ad734065a7be761962113f0d90a4f1 100644 (file)
@@ -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]) {