diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2024-03-12 15:42:16 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2024-03-13 10:07:33 -0700 |
commit | 69d55c213da8650b6ac8b54777475874673b0cdd (patch) | |
tree | 67af9fc3f47464afaec556e318826e25a85b16f8 | |
parent | af0ddbfa51f92fcf53c56b5ab82093cf8eb13f6b (diff) | |
download | iproute2-69d55c213da8650b6ac8b54777475874673b0cdd.tar.gz |
simple: support json output
Last action that never got JSON support.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r-- | tc/m_simple.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tc/m_simple.c b/tc/m_simple.c index 9715955e0..55f344417 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]) { |