iproute2/ip
Stephen Hemminger 74498126fd tcp_metrics: add json support
Add JSON support to the ip tcp_metrics output.

$ ip -j -p tcp_metrics show
[ {
        "dst": "192.18.1.11",
        "age": 23617.8,
        "ssthresh": 7,
        "cwnd": 3,
        "rtt": 0.039176,
        "rttvar": 0.039176,
        "source": "192.18.1.2"
    }
...

The JSON output does scale values differently since there is no good
way to indicate units. The rtt values are displayed in seconds in
JSON and microseconds in the original (non JSON) mode. In the example
above the output in without the -j flag, the output would be
 ... rtt 39176us rttvar 39176us

I did this since all the other values in the JSON record are also in
floating point seconds.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-03-06 15:39:07 -08:00
..
.gitignore Another .gitignore file. 2006-08-08 12:11:23 -07:00
Makefile ip: link: add support for netdevsim device type 2018-01-02 20:46:19 -08:00
ifcfg ifcfg/rtpr: convert to POSIX shell 2018-01-10 08:26:09 -08:00
ila_common.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
ip.c Merge branch 'iproute2-master' into iproute2-next 2018-02-22 14:43:33 -08:00
ip6tunnel.c iptunnel/ip6tunnel: Use netlink to walk through tunnels list 2018-02-07 16:15:42 -08:00
ip_common.h ipaddress: Make print_linkinfo_brief() static 2018-02-16 08:14:25 -08:00
ipaddress.c ip: always print interface name in color 2018-02-21 08:42:04 -08:00
ipaddrlabel.c ipaddrlabel: add json support 2018-03-06 15:38:41 -08:00
ipfou.c ip fou: pass family attribute as u8 2018-01-09 07:58:37 -08:00
ipila.c ila: fix formatting of help message 2017-11-24 09:21:43 -08:00
ipl2tp.c ipl2tp: Use get_addr_rta() 2018-01-25 09:31:25 -08:00
iplink.c ipaddress: Make print_linkinfo_brief() static 2018-02-16 08:14:25 -08:00
iplink_bond.c iplink: Use ll_name_to_index() instead of if_nametoindex() 2018-01-23 14:50:59 -08:00
iplink_bond_slave.c ip: iplink_bond_slave.c: add json output support (info_slave_data) 2017-08-17 18:02:40 -07:00
iplink_bridge.c iplink: Use ll_name_to_index() instead of if_nametoindex() 2018-01-23 14:50:59 -08:00
iplink_bridge_slave.c ip: Use print_0xhex() where appropriate 2018-02-09 08:05:30 -08:00
iplink_can.c Merge branch 'master' into net-next 2017-08-21 17:37:15 -07:00
iplink_dummy.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
iplink_geneve.c utils: Introduce and use inet_prefix_reset() 2018-02-14 09:00:26 -08:00
iplink_hsr.c ip: iplink_hsr.c: add json output support 2017-08-17 18:02:40 -07:00
iplink_ifb.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
iplink_ipoib.c ip: iplink_ipoib.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_ipvlan.c ip/ipvlan: enhance ability to add mode flags to existing modes 2017-11-01 22:17:01 +01:00
iplink_macvlan.c ip: link_macvlan.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_netdevsim.c ip: link: add support for netdevsim device type 2018-01-02 20:46:19 -08:00
iplink_nlmon.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
iplink_team.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
iplink_vcan.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
iplink_vlan.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
iplink_vrf.c lib/libnetlink: update rtnl_talk to support malloc buff at run time 2017-10-26 12:29:29 +02:00
iplink_vxcan.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
iplink_vxlan.c utils: Introduce and use inet_prefix_reset() 2018-02-14 09:00:26 -08:00
iplink_xdp.c ip: Consolidate ip, xdp and lwtunnel parse/dump prototypes in ip_common.h 2018-02-02 14:55:12 -08:00
iplink_xstats.c add missing iplink_xstats.c 2017-02-20 08:53:40 -08:00
ipmacsec.c ip: Minor cleanups 2018-02-02 14:58:26 -08:00
ipmaddr.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
ipmonitor.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
ipmroute.c ipmroute: Use inet_addr_match_rta() 2018-01-25 09:31:22 -08:00
ipneigh.c ipneigh: add color and json support 2018-03-06 15:38:18 -08:00
ipnetconf.c ipnetconf: add JSON support 2018-03-06 15:38:57 -08:00
ipnetns.c netns: allow negative nsid 2018-02-08 07:57:34 -08:00
ipntable.c ipntable: add json support 2018-03-06 15:38:50 -08:00
ipprefix.c netlink route attribute cleanup 2017-02-24 08:56:38 -08:00
iproute.c iproute: implement JSON and color output 2018-02-10 08:20:39 -08:00
iproute_lwtunnel.c iproute: implement JSON and color output 2018-02-10 08:20:39 -08:00
iprule.c iprule: add json support 2018-03-06 15:38:44 -08:00
ipseg6.c ip: Get rid of inet_get_addr() 2018-01-21 09:38:26 -08:00
iptoken.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
iptunnel.c iptunnel/ip6tunnel: Use netlink to walk through tunnels list 2018-02-07 16:15:42 -08:00
iptuntap.c ip link: add json support for tun attributes 2018-02-26 09:28:16 -08:00
ipvrf.c Convert harmful calls to strncpy() to strlcpy() 2017-09-01 12:10:54 -07:00
ipxfrm.c ipxfrm: Replace STRBUF_CAT macro with strlcat() 2017-09-01 12:10:54 -07:00
link_gre.c gre/gre6: Unify local/remote endpoint address parsing 2018-02-14 09:01:03 -08:00
link_gre6.c ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag 2018-02-25 19:45:39 -08:00
link_ip6tnl.c iptnl/ip6tnl: Unify local/remote endpoint and 6rd address parsing 2018-02-14 09:01:07 -08:00
link_iptnl.c iptnl/ip6tnl: Unify local/remote endpoint and 6rd address parsing 2018-02-14 09:01:07 -08:00
link_veth.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
link_vti.c vti/vti6: Unify local/remote endpoint address parsing 2018-02-14 09:00:46 -08:00
link_vti6.c vti/vti6: Unify local/remote endpoint address parsing 2018-02-14 09:00:46 -08:00
routef mark shell scripts +x 2018-01-10 08:23:49 -08:00
routel mark shell scripts +x 2018-01-10 08:23:49 -08:00
rtm_map.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
rtmon.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
rtpr ifcfg/rtpr: convert to POSIX shell 2018-01-10 08:26:09 -08:00
static-syms.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
tcp_metrics.c tcp_metrics: add json support 2018-03-06 15:39:07 -08:00
tunnel.c iptunnel/ip6tunnel: Use netlink to walk through tunnels list 2018-02-07 16:15:42 -08:00
tunnel.h iptunnel/ip6tunnel: Use netlink to walk through tunnels list 2018-02-07 16:15:42 -08:00
xfrm.h ip: Fix compilation break on old systems 2017-11-13 10:07:25 -08:00
xfrm_monitor.c netlink route attribute cleanup 2017-02-24 08:56:38 -08:00
xfrm_policy.c Merge branch 'master' into net-next 2017-11-09 09:45:17 +09:00
xfrm_state.c Merge branch 'master' into net-next 2017-11-09 09:45:17 +09:00