fragmentation.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2013-2020 B.A.T.M.A.N. contributors:
  3. *
  4. * Martin Hundebøll <martin@hundeboll.net>
  5. */
  6. #ifndef _NET_BATMAN_ADV_FRAGMENTATION_H_
  7. #define _NET_BATMAN_ADV_FRAGMENTATION_H_
  8. #include "main.h"
  9. #include <linux/compiler.h>
  10. #include <linux/list.h>
  11. #include <linux/skbuff.h>
  12. #include <linux/stddef.h>
  13. #include <linux/types.h>
  14. void batadv_frag_purge_orig(struct batadv_orig_node *orig,
  15. bool (*check_cb)(struct batadv_frag_table_entry *));
  16. bool batadv_frag_skb_fwd(struct sk_buff *skb,
  17. struct batadv_hard_iface *recv_if,
  18. struct batadv_orig_node *orig_node_src);
  19. bool batadv_frag_skb_buffer(struct sk_buff **skb,
  20. struct batadv_orig_node *orig_node);
  21. int batadv_frag_send_packet(struct sk_buff *skb,
  22. struct batadv_orig_node *orig_node,
  23. struct batadv_neigh_node *neigh_node);
  24. /**
  25. * batadv_frag_check_entry() - check if a list of fragments has timed out
  26. * @frags_entry: table entry to check
  27. *
  28. * Return: true if the frags entry has timed out, false otherwise.
  29. */
  30. static inline bool
  31. batadv_frag_check_entry(struct batadv_frag_table_entry *frags_entry)
  32. {
  33. if (!hlist_empty(&frags_entry->fragment_list) &&
  34. batadv_has_timed_out(frags_entry->timestamp, BATADV_FRAG_TIMEOUT))
  35. return true;
  36. return false;
  37. }
  38. #endif /* _NET_BATMAN_ADV_FRAGMENTATION_H_ */