blob: 2bdef2ea34205ae80ef7afa1853f89d8012c04df [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Roopa Prabhuefa53562017-01-31 22:59:54 -08002/*
3 * Bridge per vlan tunnels
4 *
5 * Authors:
6 * Roopa Prabhu <roopa@cumulusnetworks.com>
Roopa Prabhuefa53562017-01-31 22:59:54 -08007 */
8
9#ifndef _BR_PRIVATE_TUNNEL_H
10#define _BR_PRIVATE_TUNNEL_H
11
12struct vtunnel_info {
13 u32 tunid;
14 u16 vid;
15 u16 flags;
16};
17
18/* br_netlink_tunnel.c */
19int br_parse_vlan_tunnel_info(struct nlattr *attr,
20 struct vtunnel_info *tinfo);
21int br_process_vlan_tunnel_info(struct net_bridge *br,
22 struct net_bridge_port *p,
23 int cmd,
24 struct vtunnel_info *tinfo_curr,
Nikolay Aleksandrove19b42a2017-10-27 13:19:36 +030025 struct vtunnel_info *tinfo_last,
26 bool *changed);
Roopa Prabhuefa53562017-01-31 22:59:54 -080027int br_get_vlan_tunnel_info_size(struct net_bridge_vlan_group *vg);
28int br_fill_vlan_tunnel_info(struct sk_buff *skb,
29 struct net_bridge_vlan_group *vg);
30
31#ifdef CONFIG_BRIDGE_VLAN_FILTERING
32/* br_vlan_tunnel.c */
33int vlan_tunnel_init(struct net_bridge_vlan_group *vg);
34void vlan_tunnel_deinit(struct net_bridge_vlan_group *vg);
35int nbp_vlan_tunnel_info_delete(struct net_bridge_port *port, u16 vid);
36int nbp_vlan_tunnel_info_add(struct net_bridge_port *port, u16 vid, u32 tun_id);
37void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port);
38void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
39 struct net_bridge_vlan *vlan);
Roopa Prabhu11538d02017-01-31 22:59:55 -080040int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
41 struct net_bridge_port *p,
42 struct net_bridge_vlan_group *vg);
43int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
44 struct net_bridge_vlan *vlan);
Roopa Prabhuefa53562017-01-31 22:59:54 -080045#else
46static inline int vlan_tunnel_init(struct net_bridge_vlan_group *vg)
47{
48 return 0;
49}
50
51static inline int nbp_vlan_tunnel_info_delete(struct net_bridge_port *port,
52 u16 vid)
53{
54 return 0;
55}
56
57static inline int nbp_vlan_tunnel_info_add(struct net_bridge_port *port,
58 u16 vid, u32 tun_id)
59{
60 return 0;
61}
62
63static inline void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port)
64{
65}
66
67static inline void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
68 struct net_bridge_vlan *vlan)
69{
70}
71
Roopa Prabhu11538d02017-01-31 22:59:55 -080072static inline int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
73 struct net_bridge_port *p,
74 struct net_bridge_vlan_group *vg)
75{
76 return 0;
77}
Roopa Prabhuefa53562017-01-31 22:59:54 -080078#endif
79
80#endif