]>
git.ipfire.org Git - thirdparty/iproute2.git/commit
iplink: Add JSON support to MPLS stats formatter
MPLS stats currently do not support dumping in JSON format. Recognize when
JSON is requested and dump in an obvious manner:
# ip -n ns0-2G8Ozd9z -j stats show dev veth01 group afstats | jq
[
{
"ifindex": 3,
"ifname": "veth01",
"group": "afstats",
"subgroup": "mpls",
"mpls_stats": {
"rx": {
"bytes": 0,
"packets": 0,
"errors": 0,
"dropped": 0,
"noroute": 0
},
"tx": {
"bytes": 216,
"packets": 2,
"errors": 0,
"dropped": 0
}
}
}
]
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>