[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240312225456.87937-5-stephen@networkplumber.org>
Date: Tue, 12 Mar 2024 15:53:31 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 4/5] simple: support json output
Last action that never got JSON support.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
tc/m_simple.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tc/m_simple.c b/tc/m_simple.c
index fe2bca21ae46..6eb60bd8a924 100644
--- a/tc/m_simple.c
+++ b/tc/m_simple.c
@@ -179,9 +179,11 @@ static int print_simple(struct action_util *au, FILE *f, struct rtattr *arg)
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]) {
--
2.43.0
Powered by blists - more mailing lists