network-coding.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Copyright (C) 2012-2013 B.A.T.M.A.N. contributors:
  2. *
  3. * Martin Hundebøll, Jeppe Ledet-Pedersen
  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_NETWORK_CODING_H_
  20. #define _NET_BATMAN_ADV_NETWORK_CODING_H_
  21. #ifdef CONFIG_BATMAN_ADV_NC
  22. int batadv_nc_init(struct batadv_priv *bat_priv);
  23. void batadv_nc_free(struct batadv_priv *bat_priv);
  24. void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
  25. struct batadv_orig_node *orig_node,
  26. struct batadv_orig_node *orig_neigh_node,
  27. struct batadv_ogm_packet *ogm_packet,
  28. int is_single_hop_neigh);
  29. void batadv_nc_purge_orig(struct batadv_priv *bat_priv,
  30. struct batadv_orig_node *orig_node,
  31. bool (*to_purge)(struct batadv_priv *,
  32. struct batadv_nc_node *));
  33. void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv);
  34. void batadv_nc_init_orig(struct batadv_orig_node *orig_node);
  35. int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset);
  36. int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
  37. #else /* ifdef CONFIG_BATMAN_ADV_NC */
  38. static inline int batadv_nc_init(struct batadv_priv *bat_priv)
  39. {
  40. return 0;
  41. }
  42. static inline void batadv_nc_free(struct batadv_priv *bat_priv)
  43. {
  44. return;
  45. }
  46. static inline void
  47. batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
  48. struct batadv_orig_node *orig_node,
  49. struct batadv_orig_node *orig_neigh_node,
  50. struct batadv_ogm_packet *ogm_packet,
  51. int is_single_hop_neigh)
  52. {
  53. return;
  54. }
  55. static inline void
  56. batadv_nc_purge_orig(struct batadv_priv *bat_priv,
  57. struct batadv_orig_node *orig_node,
  58. bool (*to_purge)(struct batadv_priv *,
  59. struct batadv_nc_node *))
  60. {
  61. return;
  62. }
  63. static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv)
  64. {
  65. return;
  66. }
  67. static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
  68. {
  69. return;
  70. }
  71. static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq,
  72. void *offset)
  73. {
  74. return 0;
  75. }
  76. static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
  77. {
  78. return 0;
  79. }
  80. #endif /* ifdef CONFIG_BATMAN_ADV_NC */
  81. #endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */