bridge_loop_avoidance.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* Copyright (C) 2011-2012 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, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. * 02110-1301, USA
  18. */
  19. #ifndef _NET_BATMAN_ADV_BLA_H_
  20. #define _NET_BATMAN_ADV_BLA_H_
  21. #ifdef CONFIG_BATMAN_ADV_BLA
  22. int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
  23. int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
  24. int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  25. struct orig_node *orig_node, int hdr_size);
  26. int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
  27. int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig);
  28. int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
  29. struct batadv_bcast_packet *bcast_packet,
  30. int hdr_size);
  31. void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
  32. struct hard_iface *primary_if,
  33. struct hard_iface *oldif);
  34. int batadv_bla_init(struct bat_priv *bat_priv);
  35. void batadv_bla_free(struct bat_priv *bat_priv);
  36. #define BATADV_BLA_CRC_INIT 0
  37. #else /* ifdef CONFIG_BATMAN_ADV_BLA */
  38. static inline int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb,
  39. short vid)
  40. {
  41. return 0;
  42. }
  43. static inline int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb,
  44. short vid)
  45. {
  46. return 0;
  47. }
  48. static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb,
  49. struct orig_node *orig_node,
  50. int hdr_size)
  51. {
  52. return 0;
  53. }
  54. static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq,
  55. void *offset)
  56. {
  57. return 0;
  58. }
  59. static inline int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv,
  60. uint8_t *orig)
  61. {
  62. return 0;
  63. }
  64. static inline int
  65. batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
  66. struct batadv_bcast_packet *bcast_packet,
  67. int hdr_size)
  68. {
  69. return 0;
  70. }
  71. static inline void
  72. batadv_bla_update_orig_address(struct bat_priv *bat_priv,
  73. struct hard_iface *primary_if,
  74. struct hard_iface *oldif)
  75. {
  76. }
  77. static inline int batadv_bla_init(struct bat_priv *bat_priv)
  78. {
  79. return 1;
  80. }
  81. static inline void batadv_bla_free(struct bat_priv *bat_priv)
  82. {
  83. }
  84. #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
  85. #endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */