]> git.proxmox.com Git - mirror_iproute2.git/commit
ip: bridge: add xstats json support
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 12 Mar 2019 16:41:27 +0000 (18:41 +0200)
committerDavid Ahern <dsahern@gmail.com>
Fri, 15 Mar 2019 20:58:09 +0000 (13:58 -0700)
commita9bc23a79227acbf8f11010e5ab3fc28da4b1aaa
treeef82e94085ffcbb4c1b68062907831bcc5d44030
parent8ff3d1d3a33537088fa184a9c74bb8eb063720b2
ip: bridge: add xstats json support

Add json support for bridge's xstats output.
The plain text output format should remain the same.
Note that this patch pulls the interface out of the attribute
loop, this was an oversight when the set was upstreamed. This does not
change the output format, but fixes it when new xstats attributes show
up.

Example:
$ ip -p -j link xstats type bridge
  [ {
        "ifname": "br0",
        "multicast": {
            "igmp_queries": {
                "rx_v1": 0,
                "rx_v2": 32,
                "rx_v3": 0,
                "tx_v1": 0,
                "tx_v2": 0,
                "tx_v3": 0
            },
            "igmp_reports": {
                "rx_v1": 0,
                "rx_v2": 32,
                "rx_v3": 0,
                "tx_v1": 0,
                "tx_v2": 0,
                "tx_v3": 0
            },
            "igmp_leaves": {
                "rx": 0,
                "tx": 0
            },
            "igmp_parse_errors": 0,
            "mld_queries": {
                "rx_v1": 33,
                "rx_v2": 0,
                "tx_v1": 0,
                "tx_v2": 0
            },
            "mld_reports": {
                "rx_v1": 66,
                "rx_v2": 2,
                "tx_v1": 0,
                "tx_v2": 0
            },
            "mld_leaves": {
                "rx": 0,
                "tx": 0
            },
            "mld_parse_errors": 0
        }
    } ]

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
ip/iplink_bridge.c