1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Bridge per vlan tunnels
6 * Roopa Prabhu <roopa@cumulusnetworks.com>
9 #ifndef _BR_PRIVATE_TUNNEL_H
10 #define _BR_PRIVATE_TUNNEL_H
18 /* br_netlink_tunnel.c */
19 int br_parse_vlan_tunnel_info(struct nlattr
*attr
,
20 struct vtunnel_info
*tinfo
);
21 int br_process_vlan_tunnel_info(const struct net_bridge
*br
,
22 const struct net_bridge_port
*p
,
24 struct vtunnel_info
*tinfo_curr
,
25 struct vtunnel_info
*tinfo_last
,
27 int br_get_vlan_tunnel_info_size(struct net_bridge_vlan_group
*vg
);
28 int br_fill_vlan_tunnel_info(struct sk_buff
*skb
,
29 struct net_bridge_vlan_group
*vg
);
30 bool vlan_tunid_inrange(const struct net_bridge_vlan
*v_curr
,
31 const struct net_bridge_vlan
*v_last
);
32 int br_vlan_tunnel_info(const struct net_bridge_port
*p
, int cmd
,
33 u16 vid
, u32 tun_id
, bool *changed
);
35 #ifdef CONFIG_BRIDGE_VLAN_FILTERING
36 /* br_vlan_tunnel.c */
37 int vlan_tunnel_init(struct net_bridge_vlan_group
*vg
);
38 void vlan_tunnel_deinit(struct net_bridge_vlan_group
*vg
);
39 int nbp_vlan_tunnel_info_delete(const struct net_bridge_port
*port
, u16 vid
);
40 int nbp_vlan_tunnel_info_add(const struct net_bridge_port
*port
, u16 vid
,
42 void nbp_vlan_tunnel_info_flush(struct net_bridge_port
*port
);
43 void vlan_tunnel_info_del(struct net_bridge_vlan_group
*vg
,
44 struct net_bridge_vlan
*vlan
);
45 void br_handle_ingress_vlan_tunnel(struct sk_buff
*skb
,
46 struct net_bridge_port
*p
,
47 struct net_bridge_vlan_group
*vg
);
48 int br_handle_egress_vlan_tunnel(struct sk_buff
*skb
,
49 struct net_bridge_vlan
*vlan
);
51 static inline int vlan_tunnel_init(struct net_bridge_vlan_group
*vg
)
56 static inline int nbp_vlan_tunnel_info_delete(const struct net_bridge_port
*port
,
62 static inline int nbp_vlan_tunnel_info_add(const struct net_bridge_port
*port
,
68 static inline void nbp_vlan_tunnel_info_flush(struct net_bridge_port
*port
)
72 static inline void vlan_tunnel_info_del(struct net_bridge_vlan_group
*vg
,
73 struct net_bridge_vlan
*vlan
)
77 static inline int br_handle_ingress_vlan_tunnel(struct sk_buff
*skb
,
78 struct net_bridge_port
*p
,
79 struct net_bridge_vlan_group
*vg
)