diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-11-25 19:14:16 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-12-07 11:20:22 (GMT) |
commit | 05631628a57ce88fe1c884680eac6e00fcca810d (patch) | |
tree | e5e8efb3906e2689a3029b4ee291351ba13a4317 /include | |
parent | b2e7199cabe28fdd93f8651866da52d49c04f3ec (diff) | |
download | libnl-05631628a57ce88fe1c884680eac6e00fcca810d.zip libnl-05631628a57ce88fe1c884680eac6e00fcca810d.tar.gz libnl-05631628a57ce88fe1c884680eac6e00fcca810d.tar.bz2 |
bridge: add support for VLANs
Add operation for requesting VLAN data for AF_BRIDGE and parsing of
IFLA_AF_SPEC for AF_BRIDGE. VLANs are saved in a bitmap.
Also add dumping of vlan info to link list and neigh list.
For example:
$ nl-link-list --details --family=bridge
br1 ether 8e:6e:0e:86:e5:86 master br1 <broadcast,multicast,up,running,lowerup>
mtu 1500 txqlen 0 weight 0 index 18
mode default carrier down
bridge: pvid 1 all vlans: 1 301-400 601-610 untagged vlans: 1
bond1 ether 46:ef:e1:c9:46:fe <broadcast,multicast,master>
mtu 1500 txqlen 0 weight 0 index 20
state down mode default carrier down
bridge:
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
[thaller@redhat.com: modified original patch to use ao_parse_af_full().
Also renaming new API and drop some #defines]
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/route/link/bridge.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/netlink/route/link/bridge.h b/include/netlink/route/link/bridge.h index 16a4505..a314d77 100644 --- a/include/netlink/route/link/bridge.h +++ b/include/netlink/route/link/bridge.h @@ -19,6 +19,16 @@ extern "C" { #endif +#define RTNL_LINK_BRIDGE_VLAN_BITMAP_MAX 4096 +#define RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN (RTNL_LINK_BRIDGE_VLAN_BITMAP_MAX / 32) + +struct rtnl_link_bridge_vlan +{ + uint16_t pvid; + uint32_t vlan_bitmap[RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN]; + uint32_t untagged_bitmap[RTNL_LINK_BRIDGE_VLAN_BITMAP_LEN]; +}; + /** * Bridge flags * @ingroup bridge @@ -52,6 +62,11 @@ extern char * rtnl_link_bridge_flags2str(int, char *, size_t); extern int rtnl_link_bridge_str2flags(const char *); extern int rtnl_link_bridge_add(struct nl_sock *sk, const char *name); + +extern int rtnl_link_bridge_pvid(struct rtnl_link *link); +extern int rtnl_link_bridge_has_vlan(struct rtnl_link *link); + +extern struct bridge_vlan *rtnl_bridge_get_port_vlan(struct rtnl_link *link); #ifdef __cplusplus } #endif |