[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170803155515.99226-17-julien@cumulusnetworks.com>
Date: Thu, 3 Aug 2017 17:55:04 +0200
From: Julien Fortin <julien@...ulusnetworks.com>
To: netdev@...r.kernel.org
Cc: roopa@...ulusnetworks.com, nikolay@...ulusnetworks.com,
dsa@...ulusnetworks.com, Julien Fortin <julien@...ulusnetworks.com>
Subject: [PATCH 16/27] ip: iplink_vrf.c: add json output support
From: Julien Fortin <julien@...ulusnetworks.com>
Schema:
{
"table": {
"type": "uint",
"attr": "IFLA_VRF_TABLE"
}
}
Signed-off-by: Julien Fortin <julien@...ulusnetworks.com>
---
ip/iplink_vrf.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/ip/iplink_vrf.c b/ip/iplink_vrf.c
index 917630e8..f13b1d24 100644
--- a/ip/iplink_vrf.c
+++ b/ip/iplink_vrf.c
@@ -62,7 +62,10 @@ static void vrf_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
return;
if (tb[IFLA_VRF_TABLE])
- fprintf(f, "table %u ", rta_getattr_u32(tb[IFLA_VRF_TABLE]));
+ print_uint(PRINT_ANY,
+ "table",
+ "table %u ",
+ rta_getattr_u32(tb[IFLA_VRF_TABLE]));
}
static void vrf_slave_print_opt(struct link_util *lu, FILE *f,
@@ -72,13 +75,15 @@ static void vrf_slave_print_opt(struct link_util *lu, FILE *f,
return;
if (tb[IFLA_VRF_PORT_TABLE]) {
- fprintf(f, "table %u ",
- rta_getattr_u32(tb[IFLA_VRF_PORT_TABLE]));
+ print_uint(PRINT_ANY,
+ "table",
+ "table %u ",
+ rta_getattr_u32(tb[IFLA_VRF_PORT_TABLE]));
}
}
static void vrf_print_help(struct link_util *lu, int argc, char **argv,
- FILE *f)
+ FILE *f)
{
vrf_explain(f);
}
--
2.13.3
Powered by blists - more mailing lists