bridge_loop_avoidance.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 batadv_hard_iface;
  22. struct batadv_orig_node;
  23. struct batadv_priv;
  24. struct seq_file;
  25. struct sk_buff;
  26. #ifdef CONFIG_BATMAN_ADV_BLA
  27. int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
  28. unsigned short vid, bool is_bcast);
  29. int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
  30. unsigned short vid);
  31. int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  32. struct batadv_orig_node *orig_node, int hdr_size);
  33. int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
  34. int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
  35. void *offset);
  36. bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig,
  37. unsigned short vid);
  38. int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
  39. struct sk_buff *skb);
  40. void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
  41. struct batadv_hard_iface *primary_if,
  42. struct batadv_hard_iface *oldif);
  43. int batadv_bla_init(struct batadv_priv *bat_priv);
  44. void batadv_bla_free(struct batadv_priv *bat_priv);
  45. #define BATADV_BLA_CRC_INIT 0
  46. #else /* ifdef CONFIG_BATMAN_ADV_BLA */
  47. static inline int batadv_bla_rx(struct batadv_priv *bat_priv,
  48. struct sk_buff *skb, unsigned short vid,
  49. bool is_bcast)
  50. {
  51. return 0;
  52. }
  53. static inline int batadv_bla_tx(struct batadv_priv *bat_priv,
  54. struct sk_buff *skb, unsigned short vid)
  55. {
  56. return 0;
  57. }
  58. static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  59. struct batadv_orig_node *orig_node,
  60. int hdr_size)
  61. {
  62. return 0;
  63. }
  64. static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq,
  65. void *offset)
  66. {
  67. return 0;
  68. }
  69. static inline int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
  70. void *offset)
  71. {
  72. return 0;
  73. }
  74. static inline bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv,
  75. uint8_t *orig,
  76. unsigned short vid)
  77. {
  78. return false;
  79. }
  80. static inline int
  81. batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
  82. struct sk_buff *skb)
  83. {
  84. return 0;
  85. }
  86. static inline void
  87. batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
  88. struct batadv_hard_iface *primary_if,
  89. struct batadv_hard_iface *oldif)
  90. {
  91. }
  92. static inline int batadv_bla_init(struct batadv_priv *bat_priv)
  93. {
  94. return 1;
  95. }
  96. static inline void batadv_bla_free(struct batadv_priv *bat_priv)
  97. {
  98. }
  99. #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
  100. #endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */