diff options
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r-- | net/bridge/br_private.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 06e85d9c05aa..1f3b309beea8 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/netpoll.h> | 18 | #include <linux/netpoll.h> |
19 | #include <linux/u64_stats_sync.h> | 19 | #include <linux/u64_stats_sync.h> |
20 | #include <net/route.h> | 20 | #include <net/route.h> |
21 | #include <linux/if_vlan.h> | ||
21 | 22 | ||
22 | #define BR_HASH_BITS 8 | 23 | #define BR_HASH_BITS 8 |
23 | #define BR_HASH_SIZE (1 << BR_HASH_BITS) | 24 | #define BR_HASH_SIZE (1 << BR_HASH_BITS) |
@@ -26,6 +27,7 @@ | |||
26 | 27 | ||
27 | #define BR_PORT_BITS 10 | 28 | #define BR_PORT_BITS 10 |
28 | #define BR_MAX_PORTS (1<<BR_PORT_BITS) | 29 | #define BR_MAX_PORTS (1<<BR_PORT_BITS) |
30 | #define BR_VLAN_BITMAP_LEN BITS_TO_LONGS(VLAN_N_VID) | ||
29 | 31 | ||
30 | #define BR_VERSION "2.3" | 32 | #define BR_VERSION "2.3" |
31 | 33 | ||
@@ -63,6 +65,16 @@ struct br_ip | |||
63 | __be16 proto; | 65 | __be16 proto; |
64 | }; | 66 | }; |
65 | 67 | ||
68 | struct net_port_vlans { | ||
69 | u16 port_idx; | ||
70 | union { | ||
71 | struct net_bridge_port *port; | ||
72 | struct net_bridge *br; | ||
73 | } parent; | ||
74 | struct rcu_head rcu; | ||
75 | unsigned long vlan_bitmap[BR_VLAN_BITMAP_LEN]; | ||
76 | }; | ||
77 | |||
66 | struct net_bridge_fdb_entry | 78 | struct net_bridge_fdb_entry |
67 | { | 79 | { |
68 | struct hlist_node hlist; | 80 | struct hlist_node hlist; |
@@ -156,6 +168,9 @@ struct net_bridge_port | |||
156 | #ifdef CONFIG_NET_POLL_CONTROLLER | 168 | #ifdef CONFIG_NET_POLL_CONTROLLER |
157 | struct netpoll *np; | 169 | struct netpoll *np; |
158 | #endif | 170 | #endif |
171 | #ifdef CONFIG_BRIDGE_VLAN_FILTERING | ||
172 | struct net_port_vlans __rcu *vlan_info; | ||
173 | #endif | ||
159 | }; | 174 | }; |
160 | 175 | ||
161 | #define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT) | 176 | #define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT) |
@@ -257,6 +272,10 @@ struct net_bridge | |||
257 | struct timer_list topology_change_timer; | 272 | struct timer_list topology_change_timer; |
258 | struct timer_list gc_timer; | 273 | struct timer_list gc_timer; |
259 | struct kobject *ifobj; | 274 | struct kobject *ifobj; |
275 | #ifdef CONFIG_BRIDGE_VLAN_FILTERING | ||
276 | u8 vlan_enabled; | ||
277 | struct net_port_vlans __rcu *vlan_info; | ||
278 | #endif | ||
260 | }; | 279 | }; |
261 | 280 | ||
262 | struct br_input_skb_cb { | 281 | struct br_input_skb_cb { |
@@ -531,6 +550,46 @@ static inline void br_mdb_uninit(void) | |||
531 | } | 550 | } |
532 | #endif | 551 | #endif |
533 | 552 | ||
553 | /* br_vlan.c */ | ||
554 | #ifdef CONFIG_BRIDGE_VLAN_FILTERING | ||
555 | extern int br_vlan_add(struct net_bridge *br, u16 vid); | ||
556 | extern int br_vlan_delete(struct net_bridge *br, u16 vid); | ||
557 | extern void br_vlan_flush(struct net_bridge *br); | ||
558 | extern int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val); | ||
559 | extern int nbp_vlan_add(struct net_bridge_port *port, u16 vid); | ||
560 | extern int nbp_vlan_delete(struct net_bridge_port *port, u16 vid); | ||
561 | extern void nbp_vlan_flush(struct net_bridge_port *port); | ||
562 | #else | ||
563 | static inline int br_vlan_add(struct net_bridge *br, u16 vid) | ||
564 | { | ||
565 | return -EOPNOTSUPP; | ||
566 | } | ||
567 | |||
568 | static inline int br_vlan_delete(struct net_bridge *br, u16 vid) | ||
569 | { | ||
570 | return -EOPNOTSUPP; | ||
571 | } | ||
572 | |||
573 | static inline void br_vlan_flush(struct net_bridge *br) | ||
574 | { | ||
575 | } | ||
576 | |||
577 | static inline int nbp_vlan_add(struct net_bridge_port *port, u16 vid) | ||
578 | { | ||
579 | return -EOPNOTSUPP; | ||
580 | } | ||
581 | |||
582 | static inline int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) | ||
583 | { | ||
584 | return -EOPNOTSUPP; | ||
585 | } | ||
586 | |||
587 | static inline void nbp_vlan_flush(struct net_bridge_port *port) | ||
588 | { | ||
589 | } | ||
590 | |||
591 | #endif | ||
592 | |||
534 | /* br_netfilter.c */ | 593 | /* br_netfilter.c */ |
535 | #ifdef CONFIG_BRIDGE_NETFILTER | 594 | #ifdef CONFIG_BRIDGE_NETFILTER |
536 | extern int br_netfilter_init(void); | 595 | extern int br_netfilter_init(void); |