]> git.proxmox.com Git - mirror_iproute2.git/commit
ip: link_macvlan.c: add json output support
authorJulien Fortin <julien@cumulusnetworks.com>
Thu, 17 Aug 2017 17:36:13 +0000 (10:36 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 18 Aug 2017 01:02:41 +0000 (18:02 -0700)
commit92b7454c3187314e72bddb3454affc513e0e755c
tree3977448ad83c4481516f74ea651dd043348751f2
parent063dd06cc1f272f6ab5342d29341cfa745bd75ff
ip: link_macvlan.c: add json output support

Schema:
{
    "mode": {
        "type": "string",
        "attr": "IFLA_MACVLAN_MODE"
    },
    "nopromisc": {
        "type": "bool",
        "attr": "MACVLAN_FLAG_NOPROMISC"
    },
    "macaddr_count": {
        "type": "int",
        "attr": "IFLA_MACVLAN_MACADDR_COUNT"
    },
    "macaddr_data": {
        "type": "array",
        "attr": "IFLA_MACVLAN_MACADDR_DATA",
        "array": [
            {
                "type": "string"
            }
        ]
    },
}

$ ip link add name peth0 link eth0 type macvlan
$ ip -details -json link show peth0
[{
        "ifindex": 26,
        "ifname": "peth0",
        "link": "eth0",
        "flags": ["BROADCAST","MULTICAST"],
        "mtu": 1500,
        "qdisc": "noop",
        "operstate": "DOWN",
        "linkmode": "DEFAULT",
        "group": "default",
        "link_type": "ether",
        "address": "7a:84:48:3e:7b:1c",
        "broadcast": "ff:ff:ff:ff:ff:ff",
        "promiscuity": 0,
        "linkinfo": {
            "info_kind": "macvlan",
            "info_data": {
                "mode": "vepa"
            }
        },
        "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>
ip/iplink_macvlan.c