Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright (C) B.A.T.M.A.N. contributors:
0003  *
0004  * Martin Hundebøll <martin@hundeboll.net>
0005  */
0006 
0007 #ifndef _NET_BATMAN_ADV_FRAGMENTATION_H_
0008 #define _NET_BATMAN_ADV_FRAGMENTATION_H_
0009 
0010 #include "main.h"
0011 
0012 #include <linux/compiler.h>
0013 #include <linux/list.h>
0014 #include <linux/skbuff.h>
0015 #include <linux/stddef.h>
0016 #include <linux/types.h>
0017 
0018 void batadv_frag_purge_orig(struct batadv_orig_node *orig,
0019                 bool (*check_cb)(struct batadv_frag_table_entry *));
0020 bool batadv_frag_skb_fwd(struct sk_buff *skb,
0021              struct batadv_hard_iface *recv_if,
0022              struct batadv_orig_node *orig_node_src);
0023 bool batadv_frag_skb_buffer(struct sk_buff **skb,
0024                 struct batadv_orig_node *orig_node);
0025 int batadv_frag_send_packet(struct sk_buff *skb,
0026                 struct batadv_orig_node *orig_node,
0027                 struct batadv_neigh_node *neigh_node);
0028 
0029 /**
0030  * batadv_frag_check_entry() - check if a list of fragments has timed out
0031  * @frags_entry: table entry to check
0032  *
0033  * Return: true if the frags entry has timed out, false otherwise.
0034  */
0035 static inline bool
0036 batadv_frag_check_entry(struct batadv_frag_table_entry *frags_entry)
0037 {
0038     if (!hlist_empty(&frags_entry->fragment_list) &&
0039         batadv_has_timed_out(frags_entry->timestamp, BATADV_FRAG_TIMEOUT))
0040         return true;
0041     return false;
0042 }
0043 
0044 #endif /* _NET_BATMAN_ADV_FRAGMENTATION_H_ */