diff options
-rw-r--r-- | include/net/inet_frag.h | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 5024d6c20407..90015c47b447 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -15,25 +15,49 @@ struct netns_frags { | |||
15 | int low_thresh; | 15 | int low_thresh; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | /** | ||
19 | * fragment queue flags | ||
20 | * | ||
21 | * @INET_FRAG_FIRST_IN: first fragment has arrived | ||
22 | * @INET_FRAG_LAST_IN: final fragment has arrived | ||
23 | * @INET_FRAG_COMPLETE: frag queue has been processed and is due for destruction | ||
24 | * @INET_FRAG_EVICTED: frag queue is being evicted | ||
25 | */ | ||
26 | enum { | ||
27 | INET_FRAG_FIRST_IN = BIT(0), | ||
28 | INET_FRAG_LAST_IN = BIT(1), | ||
29 | INET_FRAG_COMPLETE = BIT(2), | ||
30 | INET_FRAG_EVICTED = BIT(3) | ||
31 | }; | ||
32 | |||
33 | /** | ||
34 | * struct inet_frag_queue - fragment queue | ||
35 | * | ||
36 | * @lock: spinlock protecting the queue | ||
37 | * @timer: queue expiration timer | ||
38 | * @list: hash bucket list | ||
39 | * @refcnt: reference count of the queue | ||
40 | * @fragments: received fragments head | ||
41 | * @fragments_tail: received fragments tail | ||
42 | * @stamp: timestamp of the last received fragment | ||
43 | * @len: total length of the original datagram | ||
44 | * @meat: length of received fragments so far | ||
45 | * @flags: fragment queue flags | ||
46 | * @max_size: (ipv4 only) maximum received fragment size with IP_DF set | ||
47 | * @net: namespace that this frag belongs to | ||
48 | */ | ||
18 | struct inet_frag_queue { | 49 | struct inet_frag_queue { |
19 | spinlock_t lock; | 50 | spinlock_t lock; |
20 | struct timer_list timer; /* when will this queue expire? */ | 51 | struct timer_list timer; |
21 | struct hlist_node list; | 52 | struct hlist_node list; |
22 | atomic_t refcnt; | 53 | atomic_t refcnt; |
23 | struct sk_buff *fragments; /* list of received fragments */ | 54 | struct sk_buff *fragments; |
24 | struct sk_buff *fragments_tail; | 55 | struct sk_buff *fragments_tail; |
25 | ktime_t stamp; | 56 | ktime_t stamp; |
26 | int len; /* total length of orig datagram */ | 57 | int len; |
27 | int meat; | 58 | int meat; |
28 | __u8 flags; /* first/last segment arrived? */ | 59 | __u8 flags; |
29 | |||
30 | #define INET_FRAG_EVICTED 8 | ||
31 | #define INET_FRAG_COMPLETE 4 | ||
32 | #define INET_FRAG_FIRST_IN 2 | ||
33 | #define INET_FRAG_LAST_IN 1 | ||
34 | |||
35 | u16 max_size; | 60 | u16 max_size; |
36 | |||
37 | struct netns_frags *net; | 61 | struct netns_frags *net; |
38 | }; | 62 | }; |
39 | 63 | ||