blob: d51f23873da96dbfe5f59980926910ece0eae5e8 [file] [log] [blame]
Pavel Emelyanov5ab11c92007-10-15 02:24:19 -07001#ifndef __NET_FRAG_H__
2#define __NET_FRAG_H__
3
4struct inet_frag_queue {
5 struct hlist_node list;
6 struct list_head lru_list; /* lru list member */
7 spinlock_t lock;
8 atomic_t refcnt;
9 struct timer_list timer; /* when will this queue expire? */
10 struct sk_buff *fragments; /* list of received fragments */
11 ktime_t stamp;
12 int len; /* total length of orig datagram */
13 int meat;
14 __u8 last_in; /* first/last segment arrived? */
15
16#define COMPLETE 4
17#define FIRST_IN 2
18#define LAST_IN 1
19};
20
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070021#define INETFRAGS_HASHSZ 64
22
23struct inet_frags {
24 struct list_head lru_list;
25 struct hlist_head hash[INETFRAGS_HASHSZ];
26 rwlock_t lock;
27 u32 rnd;
28 int nqueues;
29 atomic_t mem;
30 struct timer_list secret_timer;
31};
32
33void inet_frags_init(struct inet_frags *);
34void inet_frags_fini(struct inet_frags *);
35
Pavel Emelyanov5ab11c92007-10-15 02:24:19 -070036#endif