mirror_iproute2/ip
Julien Fortin e2d4588331 ip: link_gre.c: add json output support
Schema
{
    "external": {
        "type": "bool",
        "comment": "!tb[IFLA_GRE_COLLECT_METADATA]"
    },
    "remote": {
        "type": "string",
        "attr": "IFLA_GRE_REMOTE"
    },
    "local": {
        "type": "string",
        "attr": "IFLA_GRE_LOCAL"
    },
    "link": {
        "type": "string",
        "attr": "IFLA_GRE_LINK",
        "mutually_exclusive": {
            "link_index": {
                "type": "uint",
            }
        }
    },
    "ttl": {
        "type": "int",
        "attr": "IFLA_GRE_TTL"
    },
    "tos": {
        "type": "string",
        "attr": "IFLA_GRE_TOS"
    },
    "pmtudisc": {
        "type": "bool",
        "attr": "IFLA_GRE_PMTUDISC"
    },
    "ikey": {
        "type": "string",
        "attr": "IFLA_GRE_IKEY"
    },
    "okey": {
        "type": "string",
        "attr": "IFLA_GRE_OKEY"
    },
    "iseq": {
        "type": "bool",
        "attr": "IFLA_GRE_IFLAGS & GRE_SEQ"
    },
    "oseq": {
        "type": "bool",
        "attr": "IFLA_GRE_OFLAGS & GRE_SEQ"
    },
    "icsum": {
        "type": "bool",
        "attr": "IFLA_GRE_IFLAGS & GRE_CSUM"
    },
    "ocsum": {
        "type": "bool",
        "attr": "IFLA_GRE_OFLAGS & GRE_CSUM"
    },
    "ignore_df": {
        "type": "bool",
        "attr": "IFLA_GRE_IGNORE_DF"
    },
    "encap": {
        "type": "dict",
        "attr": "IFLA_GRE_ENCAP_TYPE != TUNNEL_ENCAP_NONE",
        "dict": {
            "type": {
                "type": "string",
                "attr": "IFLA_GRE_ENCAP_TYPE"
            },
            "sport": {
                "type": "uint",
                "attr": "IFLA_GRE_ENCAP_SPORT"
            },
            "dport": {
                "type": "uint",
                "attr": "IFLA_GRE_ENCAP_DPORT"
            },
            "csum": {
                "type": "bool",
                "attr": "TUNNEL_ENCAP_FLAG_CSUM"
            },
            "csum6": {
                "type": "bool",
                "attr": "TUNNEL_ENCAP_FLAG_CSUM6"
            },
            "remcsum": {
                "type": "bool",
                "attr": "TUNNEL_ENCAP_FLAG_REMCSUM"
            }
        }
    }
}

$ ip link show
$ ip tunnel add tun42 mode gre local 192.0.2.42 remote 203.0.113.42 key 42
$ ip link show
10: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group
default
    link/gre 0.0.0.0 brd 0.0.0.0
11: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
12: tun42@NONE: <POINTOPOINT,NOARP> mtu 1472 qdisc noop state DOWN mode
DEFAULT group default
    link/gre 192.0.2.42 peer 203.0.113.42
$ ip -details -json link show
[{
        "ifindex": 10,
        "ifname": "gre0",
        "link": null,
        "flags": ["NOARP"],
        "mtu": 1476,
        "qdisc": "noop",
        "operstate": "DOWN",
        "linkmode": "DEFAULT",
        "group": "default",
        "link_type": "gre",
        "address": "0.0.0.0",
        "broadcast": "0.0.0.0",
        "promiscuity": 0,
        "linkinfo": {
            "info_kind": "gre",
            "info_data": {
                "remote": "any",
                "local": "any",
                "ttl": 0,
                "pmtudisc": false
            }
        },
        "inet6_addr_gen_mode": "eui64",
        "num_tx_queues": 1,
        "num_rx_queues": 1,
        "gso_max_size": 65536,
        "gso_max_segs": 65535
    },{
        "ifindex": 11,
        "ifname": "gretap0",
        "link": null,
        "flags": ["BROADCAST","MULTICAST"],
        "mtu": 1462,
        "qdisc": "noop",
        "operstate": "DOWN",
        "linkmode": "DEFAULT",
        "group": "default",
        "txqlen": 1000,
        "link_type": "ether",
        "address": "00:00:00:00:00:00",
        "broadcast": "ff:ff:ff:ff:ff:ff",
        "promiscuity": 0,
        "linkinfo": {
            "info_kind": "gretap",
            "info_data": {
                "remote": "any",
                "local": "any",
                "ttl": 0,
                "pmtudisc": false
            }
        },
        "inet6_addr_gen_mode": "eui64",
        "num_tx_queues": 1,
        "num_rx_queues": 1,
        "gso_max_size": 65536,
        "gso_max_segs": 65535
    },{
        "ifindex": 12,
        "ifname": "tun42",
        "link": null,
        "flags": ["POINTOPOINT","NOARP"],
        "mtu": 1472,
        "qdisc": "noop",
        "operstate": "DOWN",
        "linkmode": "DEFAULT",
        "group": "default",
        "link_type": "gre",
        "address": "192.0.2.42",
        "link_pointtopoint": true,
        "broadcast": "203.0.113.42",
        "promiscuity": 0,
        "linkinfo": {
            "info_kind": "gre",
            "info_data": {
                "remote": "203.0.113.42",
                "local": "192.0.2.42",
                "ttl": 0,
                "pmtudisc": true,
                "ikey": "0.0.0.42",
                "okey": "0.0.0.42"
            }
        },
        "inet6_addr_gen_mode": "eui64",
        "num_tx_queues": 1,
        "num_rx_queues": 1,
        "gso_max_size": 65536,
        "gso_max_segs": 65535
    }
]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-08-17 18:02:41 -07:00
..
.gitignore Another .gitignore file. 2006-08-08 12:11:23 -07:00
ifcfg Remove trailing whitespace 2006-12-05 10:10:22 -08:00
ip6tunnel.c ip6tunnel: Align ipv6 tunnel key display with ipv4 2017-01-12 17:34:02 -08:00
ip_common.h ip: ip_print: add new API to print JSON or regular format output 2017-08-17 18:02:40 -07:00
ip_print.c ip: ip_print: add new API to print JSON or regular format output 2017-08-17 18:02:40 -07:00
ip.c ip: add new command line argument -json (mutually exclusive with -color) 2017-08-17 18:02:40 -07:00
ipaddress.c ip: ipaddress.c: add support for json output 2017-08-17 18:02:40 -07:00
ipaddrlabel.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipfou.c fou: show usage even if the module is not available 2016-08-17 14:00:22 -07:00
ipila.c ila: show usage even if the module is not available 2016-08-17 14:00:28 -07:00
ipl2tp.c utils: make hex2mem available to all users 2017-01-17 08:45:22 -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_bond.c ip: iplink_bond.c: add json output support 2017-08-17 18:02:40 -07:00
iplink_bridge_slave.c ip: iplink_bridge_slave.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_bridge.c ip: iplink_bridge.c: add json output support 2017-08-17 18:02:40 -07:00
iplink_can.c ip: iplink_can.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_dummy.c ip: link: Add missing link type help texts 2017-04-04 14:51:29 -07:00
iplink_geneve.c ip: iplink_geneve.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_hsr.c ip: iplink_hsr.c: add json output support 2017-08-17 18:02:40 -07:00
iplink_ifb.c ip: link: Add missing link type help texts 2017-04-04 14:51:29 -07:00
iplink_ipoib.c ip: iplink_ipoib.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_ipvlan.c ip: iplink_ipvlan.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_macvlan.c ip: link: macvlan: Add newline to help output 2017-04-04 14:51:29 -07:00
iplink_nlmon.c ip: link: Add missing link type help texts 2017-04-04 14:51:29 -07:00
iplink_team.c ip: link: Add missing link type help texts 2017-04-04 14:51:29 -07:00
iplink_vcan.c ip: link: Add missing link type help texts 2017-04-04 14:51:29 -07:00
iplink_vlan.c ip: link: Unify link type help functions a bit 2017-04-04 14:51:29 -07:00
iplink_vrf.c ip: iplink_vrf.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_vxcan.c ip: link add vxcan support 2017-06-05 12:27:32 -07:00
iplink_vxlan.c ip: iplink_vxlan.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_xdp.c ip: iplink_xdp.c: add json output support 2017-08-17 18:02:41 -07:00
iplink_xstats.c add missing iplink_xstats.c 2017-02-20 08:53:40 -08:00
iplink.c ip: iplink.c: open/close json obj for ip -brief -json link show dev DEV 2017-08-17 18:02:40 -07:00
ipmacsec.c ip: ipmacsec.c: add json output support 2017-08-17 18:02:41 -07:00
ipmaddr.c ip: fix igmp parsing when iface is long 2017-01-17 08:39:55 -08:00
ipmonitor.c ip: Add support for MPLS netconf 2017-02-23 08:58:40 -08:00
ipmroute.c ip: mroute: Add table output to show command 2017-06-15 08:29:30 -07:00
ipneigh.c ip neigh: allow flush FAILED neighbour entry 2017-06-16 09:01:02 -07:00
ipnetconf.c ip netconf: show all families on dev request 2017-04-14 16:00:15 -07:00
ipnetns.c netns: make /var/run/netns bind-mount recursive 2017-08-04 12:08:52 -07:00
ipntable.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipprefix.c netlink route attribute cleanup 2017-02-24 08:56:38 -08:00
iproute_lwtunnel.c iproute: add support for SRv6 local segment processing 2017-08-15 16:44:23 -07:00
iproute_lwtunnel.h lwtunnel: Add encapsulation support to ip route 2015-10-16 16:13:22 -07:00
iproute.c iproute: add support for SRv6 local segment processing 2017-08-15 16:44:23 -07:00
iprule.c ip: support UID range routing. 2016-11-29 12:26:37 -08:00
ipseg6.c ip: add ip sr command to control SR-IPv6 internal structures 2017-04-16 10:21:43 -07:00
iptoken.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
iptunnel.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
iptuntap.c tuntap: Add name attribute to usage text 2016-09-08 14:31:33 -07:00
ipvrf.c ip vrf: Add show command 2017-05-30 17:54:03 -07:00
ipxfrm.c ip xfrm: Add xfrm state crypto offload 2017-05-01 09:30:25 -07:00
link_gre6.c link_gre6: really support encaplimit option 2017-06-15 08:29:30 -07:00
link_gre.c ip: link_gre.c: add json output support 2017-08-17 18:02:41 -07:00
link_ip6tnl.c iplink: Expose IFLA_*_FWMARK attributes for supported link types 2017-04-23 09:14:46 -07:00
link_iptnl.c iptunnel: add support for mpls/ip to ipip tunnels 2017-07-05 09:04:59 -07:00
link_veth.c ip: code cleanup 2016-03-21 11:52:19 -07:00
link_vti6.c vti6: fix local/remote any addr handling 2017-08-09 08:39:27 -07:00
link_vti.c vti: print keys in hex not dotted notation 2017-08-09 09:11:02 -07:00
Makefile ip: ip_print: add new API to print JSON or regular format output 2017-08-17 18:02:40 -07:00
routef ip/routef lifesaver 2007-07-10 18:29:20 -07:00
routel routel: fix infinite loop in line parser 2017-04-27 16:42:29 -07:00
rtm_map.c ip, realms: also allow to pass in raw realms value 2015-10-22 23:40:51 -07:00
rtmon.c ip: code cleanup 2016-03-21 11:52:19 -07:00
rtpr (Logical change 1.3) 2004-04-15 20:56:59 +00:00
static-syms.c Fix build when shared libraries are disabled 2013-03-13 08:29:59 -07:00
tcp_metrics.c libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
tunnel.c iptunnel: add support for mpls/ip to sit tunnels 2017-07-05 09:04:59 -07:00
tunnel.h ip{,6}tunnel: have a shared stats parser/printer 2015-12-18 11:46:21 -08:00
xdp.h bpf: allow requesting XDP HW offload 2017-06-27 16:13:55 -07:00
xfrm_monitor.c netlink route attribute cleanup 2017-02-24 08:56:38 -08:00
xfrm_policy.c netlink route attribute cleanup 2017-02-24 08:56:38 -08:00
xfrm_state.c ip xfrm: Add xfrm state crypto offload 2017-05-01 09:30:25 -07:00
xfrm.h xfrm: get #define's from linux includes 2017-06-14 10:25:39 -07:00