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(
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
>
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(
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
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 \
&
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(
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
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
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 ,
"
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 ,
"
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
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 ++-
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`.
$
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
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`.
$
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`.
$
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
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
>
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
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
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
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
From: Julien Fortin
Schema
{
"remote": {
"type": "string",
"attr": "IFLA_IPTUN_REMOTE"
},
"local": {
"type": "string",
"attr": "IF
From: Julien Fortin
Schema:
{
"mode": {
"type": "string",
"attr": "IFLA_MACVLAN_MODE"
},
"nopromisc": {
"type": "bool",
"attr": "MACVLAN_FLAG_NOPROMISC&qu
From: Julien Fortin
Schema:
{
"protocol": {
"type": "string",
"attr": "IFLA_VLAN_PROTOCOL"
},
"id": {
"type": "uint",
"attr": "IFLA_VLAN_ID&qu
From: Julien Fortin
Schema:
{
"remote": {
"type": "string",
"attr": "IFLA_VTI_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_VTI_LOCAL"
},
From: Julien Fortin
Schema:
{
"remote": {
"type": "string",
"attr": "IFLA_VTI_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_VTI_LOCAL"
},
From: Julien Fortin
Schema
{
"proto": {
"type": "string",
"attr": "IFLA_IPTUN_PROTO"
},
"remote": {
"type": "string",
"attr": "IFLA_IPTUN_REMOTE"
From: Julien Fortin
Schema
{
"remote": {
"type": "string",
"attr": "IFLA_GRE_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_GRE_LOCAL"
},
From: Julien Fortin
Schema
{
"attached": {
"type": "uint",
"attr": "IFLA_XDP_ATTACHED"
},
"prog_id": {
"type": "uint",
"attr": "IFLA_XDP_PROG_ID"
From: Julien Fortin
Schema
{
"external": {
"type": "bool",
"comment": "!tb[IFLA_GRE_COLLECT_METADATA]"
},
"remote": {
"type": "string",
"attr": "I
From: Julien Fortin
Schema
{
"sci": {
"type": "string",
"attr": "IFLA_MACSEC_SCI"
},
"protect": {
"type": "string",
"attr": "IFLA_MACSEC_PROTECT&qu
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
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
From: Julien Fortin
Schema:
{
"id": {
"type": "uint",
"attr": "IFLA_VXLAN_ID"
},
"group": {
"type": "string",
"attr": "IFLA_VXLAN_GROUP"
From: Julien Fortin
Schema:
{
"id": {
"type": "uint",
"attr": "IFLA_GENEVE_ID"
},
"remote": {
"type": "string",
"attr": "IFLA_GENEVE_REMOTE"
From: Julien Fortin
Schema:
{
"key": {
"type": "string",
"attr": "IFLA_IPOIB_PKEY"
},
"mode": {
"type": "string",
"attr": "IFLA_IPOIB_PKEY"
},
From: Julien Fortin
Schema:
bridge_slave: IFLA_INFO_SLAVE_DATA
{
"state": {
"type": "string",
"attr": "IFLA_BRPORT_STATE",
"mutually_exclusive": {
"state_index": {
&qu
From: Julien Fortin
Schema: IFLA_INFO_DATA
{
"ctrlmode": {
"type": "array",
"attr": "IFLA_CAN_CTRLMODE",
"array": [
{
"type": "string"
}
]
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
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":
From: Julien Fortin
Schema:
hsr: IFLA_INFO_DATA
{
"slave1": {
"type": "string",
"attr": "IFLA_HSR_SLAVE1"
},
"slave2": {
"type": "string",
"attr": "
From: Julien Fortin
Schema and live example:
bridge: IFLA_INFO_DATA
{
"forward_delay": {
"type": "uint",
"attr": "IFLA_BR_FORWARD_DELAY"
},
"hello_time": {
"type": "uint",
From: Julien Fortin
Schema and live example:
bond: IFLA_INFO_DATA
{
"mode": {
"type": "string",
"attr": "IFLA_BOND_MODE"
},
"active_slave": {
"type": "str
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
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
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
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
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
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
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
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
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
From: Julien Fortin
Schema and live example:
bond: IFLA_INFO_DATA
{
"mode": {
"type": "string",
"attr": "IFLA_BOND_MODE"
},
"active_slave": {
"type": "str
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
From: Julien Fortin
Schema and live example:
bridge: IFLA_INFO_DATA
{
"forward_delay": {
"type": "uint",
"attr": "IFLA_BR_FORWARD_DELAY"
},
"hello_time": {
"type": "uint",
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
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":
From: Julien Fortin
Schema:
{
"id": {
"type": "uint",
"attr": "IFLA_GENEVE_ID"
},
"remote": {
"type": "string",
"attr": "IFLA_GENEVE_REMOTE"
From: Julien Fortin
Schema
{
"attached": {
"type": "uint",
"attr": "IFLA_XDP_ATTACHED"
},
"prog_id": {
"type": "uint",
"attr": "IFLA_XDP_PROG_ID"
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
From: Julien Fortin
Schema:
{
"key": {
"type": "string",
"attr": "IFLA_IPOIB_PKEY"
},
"mode": {
"type": "string",
"attr": "IFLA_IPOIB_PKEY"
},
From: Julien Fortin
Schema: IFLA_INFO_DATA
{
"ctrlmode": {
"type": "array",
"attr": "IFLA_CAN_CTRLMODE",
"array": [
{
"type": "string"
}
]
From: Julien Fortin
Schema
{
"external": {
"type": "bool",
"comment": "!tb[IFLA_GRE_COLLECT_METADATA]"
},
"remote": {
"type": "string",
"attr": "I
From: Julien Fortin
Schema
{
"remote": {
"type": "string",
"attr": "IFLA_GRE_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_GRE_LOCAL"
},
From: Julien Fortin
Schema
{
"proto": {
"type": "string",
"attr": "IFLA_IPTUN_PROTO"
},
"remote": {
"type": "string",
"attr": "IFLA_IPTUN_REMOTE"
From: Julien Fortin
Schema
{
"sci": {
"type": "string",
"attr": "IFLA_MACSEC_SCI"
},
"protect": {
"type": "string",
"attr": "IFLA_MACSEC_PROTECT&qu
From: Julien Fortin
Schema:
{
"protocol": {
"type": "string",
"attr": "IFLA_VLAN_PROTOCOL"
},
"id": {
"type": "uint",
"attr": "IFLA_VLAN_ID&qu
From: Julien Fortin
Schema:
{
"remote": {
"type": "string",
"attr": "IFLA_VTI_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_VTI_LOCAL"
},
From: Julien Fortin
Schema:
{
"mode": {
"type": "string",
"attr": "IFLA_MACVLAN_MODE"
},
"nopromisc": {
"type": "bool",
"attr": "MACVLAN_FLAG_NOPROMISC&qu
From: Julien Fortin
Schema:
{
"remote": {
"type": "string",
"attr": "IFLA_VTI_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_VTI_LOCAL"
},
From: Julien Fortin
Schema
{
"remote": {
"type": "string",
"attr": "IFLA_IPTUN_REMOTE"
},
"local": {
"type": "string",
"attr": "IF
From: Julien Fortin
Schema:
{
"id": {
"type": "uint",
"attr": "IFLA_VXLAN_ID"
},
"group": {
"type": "string",
"attr": "IFLA_VXLAN_GROUP"
From: Julien Fortin
Schema:
bridge_slave: IFLA_INFO_SLAVE_DATA
{
"state": {
"type": "string",
"attr": "IFLA_BRPORT_STATE",
"mutually_exclusive": {
"state_index": {
&qu
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
From: Julien Fortin
Schema:
hsr: IFLA_INFO_DATA
{
"slave1": {
"type": "string",
"attr": "IFLA_HSR_SLAVE1"
},
"slave2": {
"type": "string",
"attr": "
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
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
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
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
+++
80 matches
Mail list logo