bridge_loop_avoidance.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* Copyright (C) 2011-2015 B.A.T.M.A.N. contributors:
  2. *
  3. * Simon Wunderlich
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of version 2 of the GNU General Public
  7. * License as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _NET_BATMAN_ADV_BLA_H_
  18. #define _NET_BATMAN_ADV_BLA_H_
  19. #include "main.h"
  20. #include <linux/types.h>
  21. struct seq_file;
  22. struct sk_buff;
  23. #ifdef CONFIG_BATMAN_ADV_BLA
  24. int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
  25. unsigned short vid, bool is_bcast);
  26. int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
  27. unsigned short vid);
  28. int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  29. struct batadv_orig_node *orig_node, int hdr_size);
  30. int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
  31. int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
  32. void *offset);
  33. bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, u8 *orig,
  34. unsigned short vid);
  35. int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
  36. struct sk_buff *skb);
  37. void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
  38. struct batadv_hard_iface *primary_if,
  39. struct batadv_hard_iface *oldif);
  40. int batadv_bla_init(struct batadv_priv *bat_priv);
  41. void batadv_bla_free(struct batadv_priv *bat_priv);
  42. #define BATADV_BLA_CRC_INIT 0
  43. #else /* ifdef CONFIG_BATMAN_ADV_BLA */
  44. static inline int batadv_bla_rx(struct batadv_priv *bat_priv,
  45. struct sk_buff *skb, unsigned short vid,
  46. bool is_bcast)
  47. {
  48. return 0;
  49. }
  50. static inline int batadv_bla_tx(struct batadv_priv *bat_priv,
  51. struct sk_buff *skb, unsigned short vid)
  52. {
  53. return 0;
  54. }
  55. static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  56. struct batadv_orig_node *orig_node,
  57. int hdr_size)
  58. {
  59. return 0;
  60. }
  61. static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq,
  62. void *offset)
  63. {
  64. return 0;
  65. }
  66. static inline int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
  67. void *offset)
  68. {
  69. return 0;
  70. }
  71. static inline bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv,
  72. u8 *orig, unsigned short vid)
  73. {
  74. return false;
  75. }
  76. static inline int
  77. batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
  78. struct sk_buff *skb)
  79. {
  80. return 0;
  81. }
  82. static inline void
  83. batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
  84. struct batadv_hard_iface *primary_if,
  85. struct batadv_hard_iface *oldif)
  86. {
  87. }
  88. static inline int batadv_bla_init(struct batadv_priv *bat_priv)
  89. {
  90. return 1;
  91. }
  92. static inline void batadv_bla_free(struct batadv_priv *bat_priv)
  93. {
  94. }
  95. #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
  96. #endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */