From: Nikolay Aleksandrov Date: Tue, 12 Mar 2019 16:41:26 +0000 (+0200) Subject: ip: xstats: add json output support X-Git-Tag: v5.1.0~27^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ff3d1d3a33537088fa184a9c74bb8eb063720b2;p=thirdparty%2Fiproute2.git ip: xstats: add json output support This adds only initial object support if json argument is specified. Later patches convert the current xstats users to json. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David Ahern --- diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c index 908d92283..c64e68856 100644 --- a/ip/iplink_xstats.c +++ b/ip/iplink_xstats.c @@ -70,10 +70,13 @@ int iplink_ifla_xstats(int argc, char **argv) return -1; } + new_json_obj(json); if (rtnl_dump_filter(&rth, lu->print_ifla_xstats, stdout) < 0) { + delete_json_obj(); fprintf(stderr, "Dump terminated\n"); return -1; } + delete_json_obj(); return 0; }