br_private_tunnel.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Bridge per vlan tunnels
  3. *
  4. * Authors:
  5. * Roopa Prabhu <roopa@cumulusnetworks.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the License, or (at your option) any later version.
  11. */
  12. #ifndef _BR_PRIVATE_TUNNEL_H
  13. #define _BR_PRIVATE_TUNNEL_H
  14. struct vtunnel_info {
  15. u32 tunid;
  16. u16 vid;
  17. u16 flags;
  18. };
  19. /* br_netlink_tunnel.c */
  20. int br_parse_vlan_tunnel_info(struct nlattr *attr,
  21. struct vtunnel_info *tinfo);
  22. int br_process_vlan_tunnel_info(struct net_bridge *br,
  23. struct net_bridge_port *p,
  24. int cmd,
  25. struct vtunnel_info *tinfo_curr,
  26. struct vtunnel_info *tinfo_last,
  27. bool *changed);
  28. int br_get_vlan_tunnel_info_size(struct net_bridge_vlan_group *vg);
  29. int br_fill_vlan_tunnel_info(struct sk_buff *skb,
  30. struct net_bridge_vlan_group *vg);
  31. #ifdef CONFIG_BRIDGE_VLAN_FILTERING
  32. /* br_vlan_tunnel.c */
  33. int vlan_tunnel_init(struct net_bridge_vlan_group *vg);
  34. void vlan_tunnel_deinit(struct net_bridge_vlan_group *vg);
  35. int nbp_vlan_tunnel_info_delete(struct net_bridge_port *port, u16 vid);
  36. int nbp_vlan_tunnel_info_add(struct net_bridge_port *port, u16 vid, u32 tun_id);
  37. void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port);
  38. void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
  39. struct net_bridge_vlan *vlan);
  40. int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
  41. struct net_bridge_port *p,
  42. struct net_bridge_vlan_group *vg);
  43. int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
  44. struct net_bridge_vlan *vlan);
  45. #else
  46. static inline int vlan_tunnel_init(struct net_bridge_vlan_group *vg)
  47. {
  48. return 0;
  49. }
  50. static inline int nbp_vlan_tunnel_info_delete(struct net_bridge_port *port,
  51. u16 vid)
  52. {
  53. return 0;
  54. }
  55. static inline int nbp_vlan_tunnel_info_add(struct net_bridge_port *port,
  56. u16 vid, u32 tun_id)
  57. {
  58. return 0;
  59. }
  60. static inline void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port)
  61. {
  62. }
  63. static inline void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
  64. struct net_bridge_vlan *vlan)
  65. {
  66. }
  67. static inline int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
  68. struct net_bridge_port *p,
  69. struct net_bridge_vlan_group *vg)
  70. {
  71. return 0;
  72. }
  73. #endif
  74. #endif