Skip to content

JSON (and color) support for iproute

Stephen Hemminger netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4json: make pretty printing optionalinclude/json_print.h ip/ip.c lib/json_print.c +1 more+10 -10 replies
2/4man: add documentation for json and pretty flagsip/ip.c man/man8/ip.8 man/man8/tc.8+18 -70 replies
3/4json: fix newline at end of arraylib/json_print.c lib/json_writer.c+5 -20 replies
4/4iproute: implement JSON and color outputinclude/utils.h ip/iproute.c ip/iproute_lwtunnel.c+348 -1620 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH iproute2-next 0/4] JSON (and color) support for iproute

From: Stephen Hemminger <[email protected]>

This set of patches adds JSON output to route printing. Tested for the simple cases, but there are many variations and there such as lw tunnels which have not be tested.

The color formatting may need some additional tweaks. It looks like for some tags the tag is also showing up in color. This should be fixed in print_color_string rather than having to do special case handling in so many places.

This patchset also changes the default JSON output to be compressed (since the purpose of JSON is to make output machine readable); but do optional pretty print formatting with -p flag.

Stephen Hemminger (4):
json: make pretty printing optional
man: add documentation for json and pretty flags
json: fix newline at end of array
iproute: implement JSON and color output

 include/json_print.h  |   2 +
 include/utils.h       |   5 +
 ip/ip.c               |   7 +-
 ip/iproute.c          | 376 +++++++++++++++++++++++++++++++++++---------------
 ip/iproute_lwtunnel.c | 129 ++++++++++-------
 lib/json_print.c      |   5 +-
 lib/json_writer.c     |   5 +
 man/man8/ip.8         |  18 ++-
 man/man8/tc.8         |   3 +-
 tc/tc.c               |   3 +
 10 files changed, 381 insertions(+), 172 deletions(-)
Signature · 1 line
2.15.1