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 <nikolay@cumulusnetworks.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Nikolay Aleksandrov 2019-03-12 18:41:26 +02:00 committed by David Ahern
parent be029b3a58
commit 8ff3d1d3a3
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}