[PATCH iproute2 master v3] bridge: fdb show: fix fdb entry state output for json context

2020-07-29 Thread Julien Fortin
From: Julien Fortin bridge json fdb show is printing an incorrect / non-machine readable value, when using -j (json output) we are expecting machine readable data that shouldn't require special handling/parsing. $ bridge -j fdb show | \ python -c \ 'import sys,json;print(json.dumps(

Re: [PATCH iproute2-next master v2] bridge: fdb show: fix fdb entry state output (+ add json support)

2020-07-27 Thread Julien Fortin
On Mon, Jul 27, 2020 at 6:30 PM Stephen Hemminger wrote: > > On Mon, 27 Jul 2020 18:20:09 +0200 > Julien Fortin wrote: > > > diff --git a/bridge/fdb.c b/bridge/fdb.c > > index d1f8afbe..765f4e51 100644 > > --- a/bridge/fdb.c > > +++ b/bridge/fdb.c >

[PATCH iproute2-next master v2] bridge: fdb show: fix fdb entry state output (+ add json support)

2020-07-27 Thread Julien Fortin
From: Julien Fortin bridge json fdb show is printing an incorrect / non-machine readable value, when using -j (json output) we are expecting machine readable data that shouldn't require special handling/parsing. $ bridge -j fdb show | \ python -c \ 'import sys,json;print(json.dumps(

Re: [PATCH iproute2-next master] bridge: fdb show: fix fdb entry state output for json context

2020-07-14 Thread Julien Fortin
On Mon, Jul 13, 2020 at 4:54 PM Stephen Hemminger wrote: > > On Fri, 10 Jul 2020 02:50:55 +0200 > Julien Fortin wrote: > > > From: Julien Fortin > > > > bridge json fdb show is printing an incorrect / non-machine readable > > value, when using -j (json outpu

[PATCH iproute2-next master] bridge: fdb get: add missing json init (new_json_obj)

2020-07-09 Thread Julien Fortin
From: Julien Fortin 'bridge fdb get' has json support but the json object is never initialized before patch: $ bridge -j fdb get 56:23:28:4f:4f:e5 dev vx0 56:23:28:4f:4f:e5 dev vx0 master br0 permanent $ after patch: $ bridge -j fdb get 56:23:28:4f:4f:e5 dev vx0 | \ python -c \ &

[PATCH iproute2-next master] bridge: fdb show: fix fdb entry state output for json context

2020-07-09 Thread Julien Fortin
From: Julien Fortin bridge json fdb show is printing an incorrect / non-machine readable value, when using -j (json output) we are expecting machine readable data that shouldn't require special handling/parsing. $ bridge -j fdb show | \ python -c \ 'import sys,json;print(json.dumps(

Re: [PATCH iproute2(-next) v2 1/1] ip: fix ip route show json output for multipath nexthops

2019-10-01 Thread Julien Fortin
Thanks David! On Tue, Oct 1, 2019 at 5:14 PM David Ahern wrote: > > On 9/26/19 9:29 AM, Julien Fortin wrote: > > From: Julien Fortin > > > > print_rta_multipath doesn't support JSON output: > > > > { > > "dst":"27.0.0.13&q

Re: [PATCH iproute2(-next) v2 1/1] ip: fix ip route show json output for multipath nexthops

2019-09-26 Thread Julien Fortin
On Thu, Sep 26, 2019 at 6:07 PM Stephen Hemminger wrote: > > On Thu, 26 Sep 2019 17:29:34 +0200 > Julien Fortin wrote: > > > + print_string(PRINT_ANY, "dev", > > + "%s", ll_index_to_name(nh->rtn

[PATCH iproute2(-next) v2 1/1] ip: fix ip route show json output for multipath nexthops

2019-09-26 Thread Julien Fortin
From: Julien Fortin print_rta_multipath doesn't support JSON output: { "dst":"27.0.0.13", "protocol":"bgp", "metric":20, "flags":[], "gateway":"169.254.0.1"dev uplink-1 weight 1 , "

[PATCH iproute2(-next) 1/1] ip: fix ip route show json output for multipath nexthops

2019-09-24 Thread Julien Fortin
From: Julien Fortin print_rta_multipath doesn't support JSON output: { "dst":"27.0.0.13", "protocol":"bgp", "metric":20, "flags":[], "gateway":"169.254.0.1"dev uplink-1 weight 1 , "

[PATCH iproute2 v3] lib: json_print: rework 'new_json_obj' drop FILE* argument

2017-09-26 Thread Julien Fortin
From: Julien Fortin As Stephen Hemminger mentioned on the last submission the new_json_obj function is always called with fp == stdout, so right now, there's no need of this extra argument. The background for the rework is the following: The ip monitor didn't call `new_json_obj` (e

Re: [PATCH iproute2 master 1/2] json: move json printer to common library

2017-09-21 Thread Julien Fortin
the library already anyway. > No functional changes. > > Signed-off-by: Daniel Borkmann Acked-by: Julien Fortin > --- > include/json_print.h | 71 > ip/Makefile | 2 +- > ip/ip_common.h | 65 ++-

[PATCH iproute2 v3] ip: ip_print: if no json obj is initialized default fp is stdout

2017-09-20 Thread Julien Fortin
From: Julien Fortin The ip monitor didn't call `new_json_obj` (even for in non json context), so the static FILE* _fp variable wasn't initialized, thus raising a SIGSEGV in ipaddress.c. This patch should fix this issue for good, new paths won't have to call `new_json_obj`. $

Re: [PATCH iproute2 v2] ip: ip_print: if no json obj is initialized default fp is stdout

2017-09-20 Thread Julien Fortin
looks like git-mail ate all the traceback lines starting with #, will re-submit v3 On Wed, Sep 20, 2017 at 6:16 PM, Julien Fortin wrote: > From: Julien Fortin > > The ip monitor didn't call `new_json_obj` (even for in non json context), > so the static FILE* _fp variable w

[PATCH iproute2 v2] ip: ip_print: if no json obj is initialized default fp is stdout

2017-09-20 Thread Julien Fortin
From: Julien Fortin The ip monitor didn't call `new_json_obj` (even for in non json context), so the static FILE* _fp variable wasn't initialized, thus raising a SIGSEGV in ipaddress.c. This patch should fix this issue for good, new paths won't have to call `new_json_obj`. $

[PATCH 1/1] ip: ip_print: if no json obj is initialized default fp is stdout

2017-09-20 Thread Julien Fortin
From: Julien Fortin The ip monitor didn't call `new_json_obj` (even for in non json context), so the static FILE* _fp variable wasn't initialized, thus raising a SIGSEGV in ipaddress.c. This patch should fix this issue for good, new paths won't have to call `new_json_obj`. $

[PATCH iproute2 v2] ip: ipaddress: fix missing space after prefixlen

2017-09-20 Thread Julien Fortin
From: Julien Fortin Fixes: d0e720111aad2 ("ip: ipaddress.c: add support for json output") Reported-by: Sabrina Dubroca Reviewed-by: Roopa Prabhu Signed-off-by: Julien Fortin --- ip/ipaddress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/i

Re: [iproute2 json PATCH] ip: ipaddress: fix missing space after prefixlen

2017-09-20 Thread Julien Fortin
Sorry Sabrina, looks like i forgot the reported-by tag, i'll send a v2... On Wed, Sep 20, 2017 at 1:04 PM, Julien Fortin wrote: > From: Julien Fortin > > Fixes: d0e720111aad2 ("ip: ipaddress.c: add support for json output") > > Signed-off-by: Julien Fortin >

[iproute2 json PATCH] ip: ipaddress: fix missing space after prefixlen

2017-09-20 Thread Julien Fortin
From: Julien Fortin Fixes: d0e720111aad2 ("ip: ipaddress.c: add support for json output") Signed-off-by: Julien Fortin --- ip/ipaddress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 97971450..fb496bbb 100644 --- a/ip/i

Re: [iproute PATCH v2] ipaddress: Fix segfault in 'addr showdump'

2017-09-14 Thread Julien Fortin
ence a NULL FILE pointer. > > Cc: Julien Fortin > Fixes: d0e720111aad2 ("ip: ipaddress.c: add support for json output") > Signed-off-by: Phil Sutter Acked-by: Julien Fortin > -- > Changes since v1: > Align json output with that of 'ip -j addr show': > - I

Re: [PATCH iproute2 json v2 00/27] ip: add -json support to 'ip link show'

2017-08-23 Thread Julien Fortin
On Wed, Aug 23, 2017 at 2:51 PM, Jiri Pirko wrote: > Thu, Aug 17, 2017 at 07:35:47PM CEST, jul...@cumulusnetworks.com wrote: >>From: Julien Fortin >> >>This patch series adds json support to 'ip [-details] link show [dev DEV]' >>Each patch describes the

Re: [PATCH iproute2 json v2 00/27] ip: add -json support to 'ip link show'

2017-08-18 Thread Julien Fortin
Ack, thanks Stephen. On Thu, Aug 17, 2017 at 6:04 PM, Stephen Hemminger wrote: > On Thu, 17 Aug 2017 10:35:47 -0700 > Julien Fortin wrote: > >> From: Julien Fortin >> >> This patch series adds json support to 'ip [-details] link show [dev DEV]' >> E

[PATCH iproute2 json v2 23/27] ip: link_iptnl.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "remote": { "type": "string", "attr": "IFLA_IPTUN_REMOTE" }, "local": { "type": "string", "attr": "IF

[PATCH iproute2 json v2 26/27] ip: link_macvlan.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "mode": { "type": "string", "attr": "IFLA_MACVLAN_MODE" }, "nopromisc": { "type": "bool", "attr": "MACVLAN_FLAG_NOPROMISC&qu

[PATCH iproute2 json v2 27/27] ip: iplink_vlan.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "protocol": { "type": "string", "attr": "IFLA_VLAN_PROTOCOL" }, "id": { "type": "uint", "attr": "IFLA_VLAN_ID&qu

[PATCH iproute2 json v2 25/27] ip: link_vti6.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "remote": { "type": "string", "attr": "IFLA_VTI_REMOTE" }, "local": { "type": "string", "attr": "IFLA_VTI_LOCAL" },

[PATCH iproute2 json v2 24/27] ip: link_vti.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "remote": { "type": "string", "attr": "IFLA_VTI_REMOTE" }, "local": { "type": "string", "attr": "IFLA_VTI_LOCAL" },

[PATCH iproute2 json v2 22/27] ip: link_ip6tnl.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "proto": { "type": "string", "attr": "IFLA_IPTUN_PROTO" }, "remote": { "type": "string", "attr": "IFLA_IPTUN_REMOTE"

[PATCH iproute2 json v2 21/27] ip: link_gre6.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "remote": { "type": "string", "attr": "IFLA_GRE_REMOTE" }, "local": { "type": "string", "attr": "IFLA_GRE_LOCAL" },

[PATCH iproute2 json v2 18/27] ip: iplink_xdp.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "attached": { "type": "uint", "attr": "IFLA_XDP_ATTACHED" }, "prog_id": { "type": "uint", "attr": "IFLA_XDP_PROG_ID"

[PATCH iproute2 json v2 20/27] ip: link_gre.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "external": { "type": "bool", "comment": "!tb[IFLA_GRE_COLLECT_METADATA]" }, "remote": { "type": "string", "attr": "I

[PATCH iproute2 json v2 19/27] ip: ipmacsec.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema { "sci": { "type": "string", "attr": "IFLA_MACSEC_SCI" }, "protect": { "type": "string", "attr": "IFLA_MACSEC_PROTECT&qu

[PATCH iproute2 json v2 15/27] ip: iplink_ipvlan.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "mode": { "type": "string", "attr": "IFLA_IPVLAN_MODE" } } Signed-off-by: Julien Fortin --- ip/iplink_ipvlan.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --g

[PATCH iproute2 json v2 16/27] ip: iplink_vrf.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "table": { "type": "uint", "attr": "IFLA_VRF_TABLE" } } Signed-off-by: Julien Fortin --- ip/iplink_vrf.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git

[PATCH iproute2 json v2 17/27] ip: iplink_vxlan.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "id": { "type": "uint", "attr": "IFLA_VXLAN_ID" }, "group": { "type": "string", "attr": "IFLA_VXLAN_GROUP"

[PATCH iproute2 json v2 13/27] ip: iplink_geneve.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "id": { "type": "uint", "attr": "IFLA_GENEVE_ID" }, "remote": { "type": "string", "attr": "IFLA_GENEVE_REMOTE"

[PATCH iproute2 json v2 14/27] ip: iplink_ipoib.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: { "key": { "type": "string", "attr": "IFLA_IPOIB_PKEY" }, "mode": { "type": "string", "attr": "IFLA_IPOIB_PKEY" },

[PATCH iproute2 json v2 11/27] ip: iplink_bridge_slave.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: bridge_slave: IFLA_INFO_SLAVE_DATA { "state": { "type": "string", "attr": "IFLA_BRPORT_STATE", "mutually_exclusive": { "state_index": { &qu

[PATCH iproute2 json v2 12/27] ip: iplink_can.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: IFLA_INFO_DATA { "ctrlmode": { "type": "array", "attr": "IFLA_CAN_CTRLMODE", "array": [ { "type": "string" } ]

[PATCH iproute2 json v2 06/27] ip: iplink.c: open/close json obj for ip -brief -json link show dev DEV

2017-08-17 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- ip/iplink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ip/iplink.c b/ip/iplink.c index 5aff2fde..19bda1b9 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -1041,10 +1041,12 @@ int iplink_get(unsigned int flags, char *name, __u32

[PATCH iproute2 json v2 08/27] ip: iplink_bond_slave.c: add json output support (info_slave_data)

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema and live example: bond_slave: IFLA_INFO_SLAVE_DATA { "state": { "type": "string", "attr": "IFLA_BOND_SLAVE_STATE", "mutually_exclusive": { "state_index":

[PATCH iproute2 json v2 09/27] ip: iplink_hsr.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema: hsr: IFLA_INFO_DATA { "slave1": { "type": "string", "attr": "IFLA_HSR_SLAVE1" }, "slave2": { "type": "string", "attr": "

[PATCH iproute2 json v2 10/27] ip: iplink_bridge.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema and live example: bridge: IFLA_INFO_DATA { "forward_delay": { "type": "uint", "attr": "IFLA_BR_FORWARD_DELAY" }, "hello_time": { "type": "uint",

[PATCH iproute2 json v2 07/27] ip: iplink_bond.c: add json output support

2017-08-17 Thread Julien Fortin
From: Julien Fortin Schema and live example: bond: IFLA_INFO_DATA { "mode": { "type": "string", "attr": "IFLA_BOND_MODE" }, "active_slave": { "type": "str

[PATCH iproute2 json v2 04/27] ip: ip_print: add new API to print JSON or regular format output

2017-08-17 Thread Julien Fortin
From: Julien Fortin To avoid code duplication and have a ligther impact on most of the files, these functions were made to handle both stdout (FP context) or JSON output. Using this api, the changes are easier to read and the code stays as compact as possible. includes json_writer.h in

[PATCH iproute2 json v2 05/27] ip: ipaddress.c: add support for json output

2017-08-17 Thread Julien Fortin
From: Julien Fortin This patch converts all output (mostly fprintfs) to the new ip_print api which handle both regular and json output. Initialize a json_writer and open an array object if -json was specified. Note that the JSON attribute naming follows the NETLINK_ATTRIBUTE naming. In many

[PATCH iproute2 json v2 03/27] json_writer: add new json handlers (null, float with format, lluint, hu)

2017-08-17 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/json_writer.h | 9 + lib/json_writer.c | 44 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/include/json_writer.h b/include/json_writer.h index ab9a008a

[PATCH iproute2 json v2 02/27] ip: add new command line argument -json (mutually exclusive with -color)

2017-08-17 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/utils.h | 1 + ip/ip.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/utils.h b/include/utils.h index 6080b962..565bda60 100644 --- a/include/utils.h +++ b/include/utils.h @@ -20,6 +20,7 @@ extern int

[PATCH iproute2 json v2 01/27] color: add new COLOR_NONE and disable_color function

2017-08-17 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/color.h | 2 ++ lib/color.c | 12 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/color.h b/include/color.h index ba0b237e..1cd6f7d2 100644 --- a/include/color.h +++ b/include/color.h @@ -2,6

[PATCH iproute2 json v2 00/27] ip: add -json support to 'ip link show'

2017-08-17 Thread Julien Fortin
From: Julien Fortin This patch series adds json support to 'ip [-details] link show [dev DEV]' Each patch describes the json schema it adds and provides some examples. Julien Fortin (27): color: add new COLOR_NONE and disable_color function ip: add new command line argument -json

Re: [PATCH 00/27] ip: add -json support to 'ip link show'

2017-08-03 Thread Julien Fortin
On Thu, Aug 3, 2017 at 7:08 PM, Oliver Hartkopp wrote: > Hi Julien, > > On 08/03/2017 05:54 PM, Julien Fortin wrote: >> >> From: Julien Fortin > > > what about > > link_veth.c > iplink_vcan.c > iplink_vxcan.c > > ?? Hello Oliver, None of

[PATCH 03/27] json_writer: add new json handlers (null, float with format, lluint, hu)

2017-08-03 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/json_writer.h | 9 + lib/json_writer.c | 44 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/include/json_writer.h b/include/json_writer.h index ab9a008a

[PATCH 01/27] color: add new COLOR_NONE and disable_color function

2017-08-03 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/color.h | 2 ++ lib/color.c | 9 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/color.h b/include/color.h index ba0b237e..a4ca1177 100644 --- a/include/color.h +++ b/include/color.h @@ -2,6 +2,7

[PATCH 07/27] ip: iplink_bond.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema and live example: bond: IFLA_INFO_DATA { "mode": { "type": "string", "attr": "IFLA_BOND_MODE" }, "active_slave": { "type": "str

[PATCH 05/27] ip: ipaddress.c: add support for json output

2017-08-03 Thread Julien Fortin
From: Julien Fortin This patch converts all output (mostly fprintfs) to the new ip_print api which handle both regular and json output. Initialize a json_writer and open an array object if -json was specified. Note that the JSON attribute naming follows the NETLINK_ATTRIBUTE naming. In many

[PATCH 10/27] ip: iplink_bridge.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema and live example: bridge: IFLA_INFO_DATA { "forward_delay": { "type": "uint", "attr": "IFLA_BR_FORWARD_DELAY" }, "hello_time": { "type": "uint",

[PATCH 16/27] ip: iplink_vrf.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "table": { "type": "uint", "attr": "IFLA_VRF_TABLE" } } Signed-off-by: Julien Fortin --- ip/iplink_vrf.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git

[PATCH 08/27] ip: iplink_bond_slave.c: add json output support (info_slave_data)

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema and live example: bond_slave: IFLA_INFO_SLAVE_DATA { "state": { "type": "string", "attr": "IFLA_BOND_SLAVE_STATE", "mutually_exclusive": { "state_index":

[PATCH 13/27] ip: iplink_geneve.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "id": { "type": "uint", "attr": "IFLA_GENEVE_ID" }, "remote": { "type": "string", "attr": "IFLA_GENEVE_REMOTE"

[PATCH 18/27] ip: iplink_xdp.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "attached": { "type": "uint", "attr": "IFLA_XDP_ATTACHED" }, "prog_id": { "type": "uint", "attr": "IFLA_XDP_PROG_ID"

[PATCH 15/27] ip: iplink_ipvlan.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "mode": { "type": "string", "attr": "IFLA_IPVLAN_MODE" } } Signed-off-by: Julien Fortin --- ip/iplink_ipvlan.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --g

[PATCH 14/27] ip: iplink_ipoib.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "key": { "type": "string", "attr": "IFLA_IPOIB_PKEY" }, "mode": { "type": "string", "attr": "IFLA_IPOIB_PKEY" },

[PATCH 12/27] ip: iplink_can.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: IFLA_INFO_DATA { "ctrlmode": { "type": "array", "attr": "IFLA_CAN_CTRLMODE", "array": [ { "type": "string" } ]

[PATCH 20/27] ip: link_gre.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "external": { "type": "bool", "comment": "!tb[IFLA_GRE_COLLECT_METADATA]" }, "remote": { "type": "string", "attr": "I

[PATCH 21/27] ip: link_gre6.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "remote": { "type": "string", "attr": "IFLA_GRE_REMOTE" }, "local": { "type": "string", "attr": "IFLA_GRE_LOCAL" },

[PATCH 22/27] ip: link_ip6tnl.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "proto": { "type": "string", "attr": "IFLA_IPTUN_PROTO" }, "remote": { "type": "string", "attr": "IFLA_IPTUN_REMOTE"

[PATCH 19/27] ip: ipmacsec.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "sci": { "type": "string", "attr": "IFLA_MACSEC_SCI" }, "protect": { "type": "string", "attr": "IFLA_MACSEC_PROTECT&qu

[PATCH 27/27] ip: iplink_vlan.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "protocol": { "type": "string", "attr": "IFLA_VLAN_PROTOCOL" }, "id": { "type": "uint", "attr": "IFLA_VLAN_ID&qu

[PATCH 24/27] ip: link_vti.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "remote": { "type": "string", "attr": "IFLA_VTI_REMOTE" }, "local": { "type": "string", "attr": "IFLA_VTI_LOCAL" },

[PATCH 26/27] ip: link_macvlan.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "mode": { "type": "string", "attr": "IFLA_MACVLAN_MODE" }, "nopromisc": { "type": "bool", "attr": "MACVLAN_FLAG_NOPROMISC&qu

[PATCH 25/27] ip: link_vti6.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "remote": { "type": "string", "attr": "IFLA_VTI_REMOTE" }, "local": { "type": "string", "attr": "IFLA_VTI_LOCAL" },

[PATCH 23/27] ip: link_iptnl.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema { "remote": { "type": "string", "attr": "IFLA_IPTUN_REMOTE" }, "local": { "type": "string", "attr": "IF

[PATCH 17/27] ip: iplink_vxlan.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: { "id": { "type": "uint", "attr": "IFLA_VXLAN_ID" }, "group": { "type": "string", "attr": "IFLA_VXLAN_GROUP"

[PATCH 11/27] ip: iplink_bridge_slave.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: bridge_slave: IFLA_INFO_SLAVE_DATA { "state": { "type": "string", "attr": "IFLA_BRPORT_STATE", "mutually_exclusive": { "state_index": { &qu

[PATCH 06/27] ip: iplink.c: open/close json object for ip -brief -json link show dev DEV

2017-08-03 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- ip/iplink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ip/iplink.c b/ip/iplink.c index 5aff2fde..19bda1b9 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -1041,10 +1041,12 @@ int iplink_get(unsigned int flags, char *name, __u32

[PATCH 09/27] ip: iplink_hsr.c: add json output support

2017-08-03 Thread Julien Fortin
From: Julien Fortin Schema: hsr: IFLA_INFO_DATA { "slave1": { "type": "string", "attr": "IFLA_HSR_SLAVE1" }, "slave2": { "type": "string", "attr": "

[PATCH 04/27] ip: ip_print: add new API to print JSON or regular format output

2017-08-03 Thread Julien Fortin
From: Julien Fortin To avoid code duplication and have a ligther impact on most of the files, these functions were made to handle both stdout (FP context) or JSON output. Using this api, the changes are easier to read and the code stays as compact as possible. includes json_writer.h in

[PATCH 02/27] ip: add new command line argument -json (mutually exclusive with -color)

2017-08-03 Thread Julien Fortin
From: Julien Fortin Signed-off-by: Julien Fortin --- include/utils.h | 1 + ip/ip.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/utils.h b/include/utils.h index 6080b962..565bda60 100644 --- a/include/utils.h +++ b/include/utils.h @@ -20,6 +20,7 @@ extern int

[PATCH 00/27] ip: add -json support to 'ip link show'

2017-08-03 Thread Julien Fortin
From: Julien Fortin This patch series adds json support to 'ip [-details] link show [dev DEV]' Each patch describes the json schema it adds and provides some examples. Julien Fortin (27): color: add new COLOR_NONE and disable_color function ip: add new command line argument -json

[PATCH] ip: vfinfo: remove code duplication for IFLA_VF_RSS_QUERY_EN

2016-12-16 Thread Julien Fortin
From: Julien Fortin Fixes: 4fb4a10e120b1 ("ipaddress: Print IFLA_VF_QUERY_RSS_EN setting”) Signed-off-by: Julien Fortin --- ip/ipaddress.c | 8 1 file changed, 8 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index de64877..400ebb4 100644 --- a/ip/ipaddress.c +++