tvlv.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (C) 2007-2016 B.A.T.M.A.N. contributors:
  2. *
  3. * Marek Lindner, 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_TVLV_H_
  18. #define _NET_BATMAN_ADV_TVLV_H_
  19. #include "main.h"
  20. #include <linux/types.h>
  21. struct batadv_ogm_packet;
  22. void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
  23. u8 type, u8 version,
  24. void *tvlv_value, u16 tvlv_value_len);
  25. u16 batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
  26. unsigned char **packet_buff,
  27. int *packet_buff_len, int packet_min_len);
  28. void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv,
  29. struct batadv_ogm_packet *batadv_ogm_packet,
  30. struct batadv_orig_node *orig_node);
  31. void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv,
  32. u8 type, u8 version);
  33. void batadv_tvlv_handler_register(struct batadv_priv *bat_priv,
  34. void (*optr)(struct batadv_priv *bat_priv,
  35. struct batadv_orig_node *orig,
  36. u8 flags,
  37. void *tvlv_value,
  38. u16 tvlv_value_len),
  39. int (*uptr)(struct batadv_priv *bat_priv,
  40. u8 *src, u8 *dst,
  41. void *tvlv_value,
  42. u16 tvlv_value_len),
  43. u8 type, u8 version, u8 flags);
  44. void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv,
  45. u8 type, u8 version);
  46. int batadv_tvlv_containers_process(struct batadv_priv *bat_priv,
  47. bool ogm_source,
  48. struct batadv_orig_node *orig_node,
  49. u8 *src, u8 *dst,
  50. void *tvlv_buff, u16 tvlv_buff_len);
  51. void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src,
  52. u8 *dst, u8 type, u8 version,
  53. void *tvlv_value, u16 tvlv_value_len);
  54. #endif /* _NET_BATMAN_ADV_TVLV_H_ */