bridge_loop_avoidance.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
  3. *
  4. * Simon Wunderlich
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of version 2 of the GNU General Public
  8. * License as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. * 02110-1301, USA
  19. *
  20. */
  21. #ifndef _NET_BATMAN_ADV_BLA_H_
  22. #define _NET_BATMAN_ADV_BLA_H_
  23. #ifdef CONFIG_BATMAN_ADV_BLA
  24. int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
  25. int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
  26. int bla_is_backbone_gw(struct sk_buff *skb,
  27. struct orig_node *orig_node, int hdr_size);
  28. int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
  29. int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig);
  30. int bla_check_bcast_duplist(struct bat_priv *bat_priv,
  31. struct bcast_packet *bcast_packet, int hdr_size);
  32. void bla_update_orig_address(struct bat_priv *bat_priv,
  33. struct hard_iface *primary_if,
  34. struct hard_iface *oldif);
  35. int bla_init(struct bat_priv *bat_priv);
  36. void bla_free(struct bat_priv *bat_priv);
  37. #define BLA_CRC_INIT 0
  38. #else /* ifdef CONFIG_BATMAN_ADV_BLA */
  39. static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb,
  40. short vid)
  41. {
  42. return 0;
  43. }
  44. static inline int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb,
  45. short vid)
  46. {
  47. return 0;
  48. }
  49. static inline int bla_is_backbone_gw(struct sk_buff *skb,
  50. struct orig_node *orig_node,
  51. int hdr_size)
  52. {
  53. return 0;
  54. }
  55. static inline int bla_claim_table_seq_print_text(struct seq_file *seq,
  56. void *offset)
  57. {
  58. return 0;
  59. }
  60. static inline int bla_is_backbone_gw_orig(struct bat_priv *bat_priv,
  61. uint8_t *orig)
  62. {
  63. return 0;
  64. }
  65. static inline int bla_check_bcast_duplist(struct bat_priv *bat_priv,
  66. struct bcast_packet *bcast_packet,
  67. int hdr_size)
  68. {
  69. return 0;
  70. }
  71. static inline void bla_update_orig_address(struct bat_priv *bat_priv,
  72. struct hard_iface *primary_if,
  73. struct hard_iface *oldif)
  74. {
  75. }
  76. static inline int bla_init(struct bat_priv *bat_priv)
  77. {
  78. return 1;
  79. }
  80. static inline void bla_free(struct bat_priv *bat_priv)
  81. {
  82. }
  83. #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
  84. #endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */