Commit Graph

42 Commits

Author SHA1 Message Date
Julien Fortin
20aeecfbf5 ip: iplink_bridge.c: add json output support
Schema and live example:
bridge: IFLA_INFO_DATA
{
    "forward_delay": {
        "type": "uint",
        "attr": "IFLA_BR_FORWARD_DELAY"
    },
    "hello_time": {
        "type": "uint",
        "attr": "IFLA_BR_HELLO_TIME"
    },
    "max_age": {
        "type": "uint",
        "attr": "IFLA_BR_MAX_AGE"
    },
    "ageing_time": {
        "type": "uint",
        "attr": "IFLA_BR_AGEING_TIME"
    },
    "stp_state": {
        "type": "uint",
        "attr": "IFLA_BR_STP_STATE"
    },
    "priority": {
        "type": "uint",
        "attr": "IFLA_BR_PRIORITY"
    },
    "vlan_filtering": {
        "type": "uint",
        "attr": "IFLA_BR_VLAN_FILTERING"
    },
    "vlan_protocol": {
        "type": "string",
        "attr": "IFLA_BR_VLAN_PROTOCOL"
    },
    "bridge_id": {
        "type": "string",
        "attr": "IFLA_BR_BRIDGE_ID"
    },
    "root_id": {
        "type": "string",
        "attr": "IFLA_BR_ROOT_ID"
    },
    "root_port": {
        "type": "uint",
        "attr": "IFLA_BR_ROOT_PORT"
    },
    "root_path_cost": {
        "type": "uint",
        "attr": "IFLA_BR_ROOT_PATH_COST"
    },
    "topology_change": {
        "type": "uint",
        "attr": "IFLA_BR_TOPOLOGY_CHANGE"
    },
    "topology_change_detected": {
        "type": "uint",
        "attr": "IFLA_BR_TOPOLOGY_CHANGE_DETECTED"
    },
    "hello_timer": {
        "type": "float",
        "attr": "IFLA_BR_HELLO_TIMER"
    },
    "tcn_timer": {
        "type": "float",
        "attr": "IFLA_BR_TCN_TIMER"
    },
    "topology_change_timer": {
        "type": "float",
        "attr": "IFLA_BR_TOPOLOGY_CHANGE_TIMER"
    },
    "gc_timer": {
        "type": "float",
        "attr": "IFLA_BR_GC_TIMER"
    },
    "vlan_default_pvid": {
        "type": "uint",
        "attr": "IFLA_BR_VLAN_DEFAULT_PVID"
    },
    "vlan_stats_enabled": {
        "type": "uint",
        "attr": "IFLA_BR_VLAN_STATS_ENABLED"
    },
    "group_fwd_mask": {
        "type": "string",
        "attr": "IFLA_BR_GROUP_FWD_MASK"
    },
    "group_addr": {
        "type": "string",
        "attr": "IFLA_BR_GROUP_ADDR"
    },
    "mcast_snooping": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_SNOOPING"
    },
    "mcast_router": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_ROUTER"
    },
    "mcast_query_use_ifaddr": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_QUERY_USE_IFADDR"
    },
    "mcast_querier": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_QUERIER"
    },
    "mcast_hash_elasticity": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_HASH_ELASTICITY"
    },
    "mcast_hash_max": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_HASH_MAX"
    },
    "mcast_last_member_cnt": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_LAST_MEMBER_CNT"
    },
    "mcast_startup_query_cnt": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_STARTUP_QUERY_CNT"
    },
    "mcast_last_member_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_LAST_MEMBER_INTVL"
    },
    "mcast_membership_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_MEMBERSHIP_INTVL"
    },
    "mcast_querier_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_QUERIER_INTVL"
    },
    "mcast_query_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_QUERY_INTVL"
    },
    "mcast_query_response_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_QUERY_RESPONSE_INTVL"
    },
    "mcast_startup_query_intvl": {
        "type": "lluint",
        "attr": "IFLA_BR_MCAST_STARTUP_QUERY_INTVL"
    },
    "mcast_stats_enabled": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_STATS_ENABLED"
    },
    "mcast_igmp_version": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_IGMP_VERSION"
    },
    "mcast_mld_version": {
        "type": "uint",
        "attr": "IFLA_BR_MCAST_MLD_VERSION"
    },
    "nf_call_iptables": {
        "type": "uint",
        "attr": "IFLA_BR_NF_CALL_IPTABLES"
    },
    "nf_call_ip6tables": {
        "type": "uint",
        "attr": "IFLA_BR_NF_CALL_IP6TABLES"
    },
    "nf_call_arptables": {
        "type": "uint",
        "attr": "IFLA_BR_NF_CALL_ARPTABLES"
    }
}

$ ip link add dev br42 type bridge
$ ip link add dev bond42 type bond
$ ip link set dev bond42 master br42
$ ip link set dev bond42 up
$ ip link set dev br42 up

$ ip -details link show
15: br42: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP mode DEFAULT group default
    link/ether 22:8f:91:bb:9f:09 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time
30000 stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1Q
bridge_id 8000.22:8f:91:bb:9f:9 designated_root 8000.22:8f:91:bb:9f:9
root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0
hello_timer    0.00 tcn_timer    0.00 topology_change_timer    0.00
gc_timer  199.11 vlan_default_pvid 1 vlan_stats_enabled 0 group_fwd_mask 0
group_address 01:80:c2:00:00:00 mcast_snooping 1 mcast_router 1
mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 4096
mcast_hash_max 4096 mcast_last_member_count 2 mcast_startup_query_count 2
mcast_last_member_interval 100 mcast_membership_interval 26000
mcast_querier_interval 25500 mcast_query_interval 12500
mcast_query_response_interval 1000 mcast_startup_query_interval 3125
mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1
nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode
eui64
16: bond42: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue master br42 state UNKNOWN mode DEFAULT group default
    link/ether 22:8f:91:bb:9f:09 brd ff:ff:ff:ff:ff:ff promiscuity 1
    bond mode 802.3ad miimon 100 updelay 0 downdelay 0 use_carrier 1
arp_interval 0 arp_validate none arp_all_targets any primary_reselect
always fail_over_mac none xmit_hash_policy layer3+4 resend_igmp 1
num_grat_arp 1 all_slaves_active 0 min_links 1 lp_interval 1
packets_per_slave 1 lacp_rate fast ad_select stable ad_actor_sys_prio
65535 ad_user_port_key 0 ad_actor_system 00:00:00:00:00:00
    bridge_slave state forwarding priority 8 cost 100 hairpin off guard
off root_block off fastleave off learning on flood on port_id 0x8001
port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge
8000.22:8f:91:bb:9f:9 designated_root 8000.22:8f:91:bb:9f:9 hold_timer
0.00 message_age_timer    0.00 forward_delay_timer    0.00
topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off
mcast_router 1 mcast_fast_leave off mcast_flood on neigh_suppress off
addrgenmode eui64

$ ip -details -json link show
[{
        "ifindex": 15,
        "ifname": "br42",
        "flags": ["BROADCAST","MULTICAST","UP","LOWER_UP"],
        "mtu": 1500,
        "qdisc": "noqueue",
        "operstate": "UP",
        "linkmode": "DEFAULT",
        "group": "default",
        "link_type": "ether",
        "address": "22:8f:91:bb:9f:09",
        "broadcast": "ff:ff:ff:ff:ff:ff",
        "promiscuity": 0,
        "linkinfo": {
            "info_kind": "bridge",
            "info_data": {
                "forward_delay": 1500,
                "hello_time": 200,
                "max_age": 2000,
                "ageing_time": 30000,
                "stp_state": 0,
                "priority": 32768,
                "vlan_filtering": 0,
                "vlan_protocol": "802.1Q",
                "bridge_id": "8000.22:8f:91:bb:9f:9",
                "root_id": "8000.22:8f:91:bb:9f:9",
                "root_port": 0,
                "root_path_cost": 0,
                "topology_change": 0,
                "topology_change_detected": 0,
                "hello_timer": 0.00,
                "tcn_timer": 0.00,
                "topology_change_timer": 0.00,
                "gc_timer": 298.27,
                "vlan_default_pvid": 1,
                "vlan_stats_enabled": 0,
                "group_fwd_mask": "0",
                "group_addr": "01:80:c2:00:00:00",
                "mcast_snooping": 1,
                "mcast_router": 1,
                "mcast_query_use_ifaddr": 0,
                "mcast_querier": 0,
                "mcast_hash_elasticity": 4096,
                "mcast_hash_max": 4096,
                "mcast_last_member_cnt": 2,
                "mcast_startup_query_cnt": 2,
                "mcast_last_member_intvl": 100,
                "mcast_membership_intvl": 26000,
                "mcast_querier_intvl": 25500,
                "mcast_query_intvl": 12500,
                "mcast_query_response_intvl": 1000,
                "mcast_startup_query_intvl": 3125,
                "mcast_stats_enabled": 0,
                "mcast_igmp_version": 2,
                "mcast_mld_version": 1,
                "nf_call_iptables": 0,
                "nf_call_ip6tables": 0,
                "nf_call_arptables": 0
            }
        },
        "inet6_addr_gen_mode": "eui64",
        "num_tx_queues": 1,
        "num_rx_queues": 1,
        "gso_max_size": 65536,
        "gso_max_segs": 65535
    },{
        "ifindex": 16,
        "ifname": "bond42",
        "flags": ["BROADCAST","MULTICAST","MASTER","UP","LOWER_UP"],
        "mtu": 1500,
        "qdisc": "noqueue",
        "master": "br42",
        "operstate": "UNKNOWN",
        "linkmode": "DEFAULT",
        "group": "default",
        "link_type": "ether",
        "address": "22:8f:91:bb:9f:09",
        "broadcast": "ff:ff:ff:ff:ff:ff",
        "promiscuity": 1,
        "linkinfo": {
            "info_kind": "bond",
            "info_data": {
                "mode": "802.3ad",
                "miimon": 100,
                "updelay": 0,
                "downdelay": 0,
                "use_carrier": 1,
                "arp_interval": 0,
                "arp_validate": null,
                "arp_all_targets": "any",
                "primary_reselect": "always",
                "fail_over_mac": "none",
                "xmit_hash_policy": "layer3+4",
                "resend_igmp": 1,
                "num_peer_notif": 1,
                "all_slaves_active": 0,
                "min_links": 1,
                "lp_interval": 1,
                "packets_per_slave": 1,
                "ad_lacp_rate": "fast",
                "ad_select": "stable",
                "ad_actor_sys_prio": 65535,
                "ad_user_port_key": 0,
                "ad_actor_system": "00:00:00:00:00:00"
            },
            "info_slave_kind": "bridge",
            "info_slave_data": {
                "state": "forwarding",
                "priority": 8,
                "cost": 100,
                "hairpin": false,
                "guard": false,
                "root_block": false,
                "fastleave": false,
                "learning": true,
                "flood": true,
                "id": "0x8001",
                "no": "0x1",
                "designated_port": 32769,
                "designated_cost": 0,
                "bridge_id": "8000.22:8f:91:bb:9f:9",
                "root_id": "8000.22:8f:91:bb:9f:9",
                "hold_timer": 0.00,
                "message_age_timer": 0.00,
                "forward_delay_timer": 11.97,
                "topology_change_ack": 0,
                "config_pending": 0,
                "proxy_arp": false,
                "proxy_arp_wifi": false,
                "multicast_router": 1,
                "mcast_flood": true
            }
        },
        "inet6_addr_gen_mode": "eui64",
        "num_tx_queues": 16,
        "num_rx_queues": 16,
        "gso_max_size": 65536,
        "gso_max_segs": 65535
    }
]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-08-17 18:02:40 -07:00
Baruch Siach
98447086f8 ip: include libc headers first
Including libc headers first helps as a workaround to redefinition of struct
ethhdr with a suitably patched musl libc that suppresses the kernel
if_ether.h.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2017-05-30 17:27:58 -07:00
Nikolay Aleksandrov
217264a079 iplink: bridge_slave: add support for displaying xstats
This patch adds support to the bridge_slave link type for displaying
xstats by reusing the previously added bridge xstats callbacks.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2017-02-18 16:37:24 -08:00
Nikolay Aleksandrov
60ec0ecf0f iplink: bridge: add support for displaying xstats
Add support for the new parse/print_ifla_xstats callbacks and use them to
print the per-bridge multicast stats.
Example:
$ ip link xstats type bridge
br0
                    IGMP queries:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP reports:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP leaves: RX: 0 TX: 0
                    IGMP parse errors: 0
                    MLD queries:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD reports:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD leaves: RX: 0 TX: 0
                    MLD parse errors: 0

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2017-02-18 16:36:58 -08:00
Hangbin Liu
c3f1e3c425 iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
This patch implements support for the IFLA_BR_MCAST_MLD_VERSION
attribute in iproute2 so it can change the mcast mld version.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2017-01-20 10:32:34 -08:00
Hangbin Liu
19756950f7 iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION
attribute in iproute2 so it can change the mcast igmp version.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2017-01-20 10:32:34 -08:00
Hangbin Liu
6ddad009e2 iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED
attribute in iproute2 so it can enable/disable mcast stats accounting.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2017-01-20 10:32:34 -08:00
Hangbin Liu
7d93b567ea iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED
attribute in iproute2 so it can enable/disable vlan stats accounting.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2017-01-20 10:32:34 -08:00
Hangbin Liu
f3372d62eb iplink: bridge: add support for IFLA_BR_FDB_FLUSH
This patch implements support for the IFLA_BR_FDB_FLUSH attribute
in iproute2 so it can flush bridge fdb dynamic entries.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2017-01-20 10:32:34 -08:00
Nikolay Aleksandrov
8a4cd3943f iplink: bridge: remove unnecessary returns
invarg exits so no need to return, remove this c&p error from my recent
patches

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-21 12:00:47 -08:00
Nikolay Aleksandrov
3069539fb8 iplink: bridge_slave: export read-only values
Export all the read-only values that get returned about a bridge port
such as the timers, the ids, designated_port and cost,
topology_change_ack and config_pending. For the bridge ids the
br_dump_bridge_id function is exported from iplink_bridge.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-17 17:47:00 -08:00
Nikolay Aleksandrov
861c5dae5c iplink: bridge: add support for netfilter call attributes
This patch implements support for the IFLA_BR_NF_CALL_(IP|IP6|ARP)TABLES
attributes in iproute2 so it can change their values.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
178b18066a iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_INTVL
This patch implements support for the IFLA_BR_MCAST_STARTUP_QUERY_INTVL
attribute in iproute2 so it can change the startup query interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
483df11cf1 iplink: bridge: add support for IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
This patch implements support for the IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
attribute in iproute2 so it can change the query response interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
5a32388f5c iplink: bridge: add support for IFLA_BR_MCAST_QUERY_INTVL
This patch implements support for the IFLA_BR_MCAST_QUERY_INTVL attribute
in iproute2 so it can change the query interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
1f2244b851 iplink: bridge: add support for IFLA_BR_MCAST_QUERIER_INTVL
This patch implements support for the IFLA_BR_MCAST_QUERIER_INTVL
attribute in iproute2 so it can change the querier interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
7f3d559226 iplink: bridge: add support for IFLA_BR_MCAST_MEMBERSHIP_INTVL
This patch implements support for the IFLA_BR_MCAST_MEMBERSHIP_INTVL
attribute in iproute2 so it can change the membership interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
10082a253f iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_INTVL
This patch implements support for the IFLA_BR_MCAST_LAST_MEMBER_INTVL
attribute in iproute2 so it can change the last member interval.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
ceb6486655 iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_CNT
This patch implements support for the IFLA_BR_MCAST_STARTUP_QUERY_CNT
attribute in iproute2 so it can change the startup query count.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
fb44cadb92 iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_CNT
This patch implements support for the IFLA_BR_MCAST_LAST_MEMBER_CNT
attribute in iproute2 so it can change the last member count value.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
8b9eb7cd25 iplink: bridge: add support for IFLA_BR_MCAST_HASH_MAX
This patch implements support for the IFLA_BR_MCAST_HASH_MAX attribute
in iproute2 so it can change the maximum hashed entries.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
92c0ef7071 iplink: bridge: add support for IFLA_BR_MCAST_HASH_ELASTICITY
This patch implements support for the IFLA_BR_MCAST_HASH_ELASTICTITY
attribute in iproute2 so it can change the hash elasticity value.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
0778b74122 iplink: bridge: add support for IFLA_BR_MCAST_QUERIER
This patch implements support for the IFLA_BR_MCAST_QUERIER attribute
in iproute2 so it can toggle the mcast querier value.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
449843d1d6 iplink: bridge: add support for IFLA_BR_MCAST_QUERY_USE_IFADDR
This patch implements support for the IFLA_BR_MCAST_QUERY_USE_IFADDR
attribute in iproute2 so it can toggle the multicast_query_use_ifaddr val.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
7ddd2d946c iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute
in iproute2 so it can change the multicast snooping value.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
963d137cf9 iplink: bridge: add support for IFLA_BR_MCAST_ROUTER
This patch implements support for the IFLA_BR_MCAST_ROUTER attribute
in iproute2 so it can change the multicast router value.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
719832af6c iplink: bridge: add support for IFLA_BR_VLAN_DEFAULT_PVID
This patch implements support for the IFLA_BR_VLAN_DEFAULT_PVID
attribute in iproute2 so it can change the default pvid.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
0a61aa3963 iplink: bridge: add support for IFLA_BR_GROUP_ADDR
This patch implements support for the IFLA_BR_GROUP_ADDR attribute
in iproute2 so it can change the group address.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
8caaf33bdb iplink: bridge: add support for IFLA_BR_GROUP_FWD_MASK
This patch implements support for the IFLA_BR_GROUP_FWD_MASK attribute
in iproute2 so it can change the group forwarding mask.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
8c0f7a1630 iplink: bridge: export read-only timers
Netlink already provides hello_timer, tcn_timer, topology_change_timer
and gc_timer, so let's make them visible.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
4e3bbc6658 iplink: bridge: export root_(port|path_cost), topology_change and change_detected
Netlink already export these values, we just need to make them visible.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Nikolay Aleksandrov
70dfb0b883 iplink: bridge: export bridge_id and designated_root
Netlink returns the bridge_id and designated_root, we just need to
make them visible.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2016-02-09 10:42:03 -08:00
Toshiaki Makita
1eea5c46ec iplink: Add support for IFLA_BR_VLAN_PROTOCOL attribute
This patch adds support for bridge vlan_protocol.

Example:
$ ip link set br0 type bridge vlan_protocol 802.1ad
$ ip -d link show br0
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP mode DEFAULT group default qlen 1000
    link/ether 44:37:e6🆎cd:ef brd ff:ff:ff:ff:ff:ff promiscuity 0
    bridge forward_delay 0 hello_time 200 max_age 2000 ageing_time 30000
stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1ad
addrgenmode eui64

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-08-31 16:35:25 -07:00
Stephen Hemminger
9a6422c243 Merge branch 'master' into net-next 2015-08-13 19:42:41 -07:00
Zhang Shengju
6a9ce30e78 ip-link: remove unnecessary return
Remove unnecessary retrun, because invarg() exit.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
2015-08-13 14:12:33 -07:00
Nikolay Aleksandrov
e4d456f0bb iplink: add support for IFLA_BR_VLAN_FILTERING attribute
This patch implements support for the IFLA_BR_VLAN_FILTERING attribute
in iproute2 so it can enable/disable vlan_filtering.

Example:
$ ip link set br0 type bridge vlan_filtering 1
$ ip -d link show br0
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP mode DEFAULT group default
    link/ether 08:00:27:ea:07:38 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bridge forward_delay 1500 hello_time 200 max_age 2000 vlan_filtering 1
    addrgenmode eui64

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2015-08-12 09:19:06 -07:00
Nikolay Aleksandrov
fdba05155c iplink: add ageing_time, stp_state and priority for bridge
When showing bridge attributes, show also ageing_time, stp_state and
priority if available.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2015-08-12 09:11:30 -07:00
Zhang Shengju
43367ef7eb iplink: use the short format to print help info
Allow to print link type usage by: ip link help bridge

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
2015-08-12 09:05:57 -07:00
Nikolay Aleksandrov
b0197a047e iplink_bridge: add support for priority
This patch adds support to set bridge stp priority via IFLA_BR_PRIORITY.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
2015-06-26 00:06:45 -04:00
Nikolay Aleksandrov
dab049628a iplink_bridge: add support for stp_state
This patch adds support to set stp_state via IFLA_BR_STP_STATE.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
2015-06-26 00:06:45 -04:00
Nikolay Aleksandrov
6c99fb6076 iplink_bridge: add support for ageing_time
This patch adds support to set ageing_time via IFLA_BR_AGEING_TIME.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
2015-06-26 00:06:45 -04:00
Jiri Pirko
28d84b429e add bridge master device support
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2014-09-28 16:33:29 -07:00