diff options
Diffstat (limited to 'net/dccp/ackvec.h')
-rw-r--r-- | net/dccp/ackvec.h | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index f7dfb5f67b87..ec7a89bb7b39 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/list.h> | ||
16 | #include <linux/time.h> | 17 | #include <linux/time.h> |
17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
18 | 19 | ||
@@ -42,39 +43,57 @@ | |||
42 | * Ack Vectors it has recently sent. For each packet sent carrying an | 43 | * Ack Vectors it has recently sent. For each packet sent carrying an |
43 | * Ack Vector, it remembers four variables: | 44 | * Ack Vector, it remembers four variables: |
44 | * | 45 | * |
45 | * @dccpav_ack_seqno - the Sequence Number used for the packet | ||
46 | * (HC-Receiver seqno) | ||
47 | * @dccpav_ack_ptr - the value of buf_head at the time of acknowledgement. | 46 | * @dccpav_ack_ptr - the value of buf_head at the time of acknowledgement. |
48 | * @dccpav_ack_ackno - the Acknowledgement Number used for the packet | 47 | * @dccpav_records - list of dccp_ackvec_record |
49 | * (HC-Sender seqno) | ||
50 | * @dccpav_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. | 48 | * @dccpav_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. |
51 | * | 49 | * |
52 | * @dccpav_buf_len - circular buffer length | ||
53 | * @dccpav_time - the time in usecs | 50 | * @dccpav_time - the time in usecs |
54 | * @dccpav_buf - circular buffer of acknowledgeable packets | 51 | * @dccpav_buf - circular buffer of acknowledgeable packets |
55 | */ | 52 | */ |
56 | struct dccp_ackvec { | 53 | struct dccp_ackvec { |
57 | u64 dccpav_buf_ackno; | 54 | u64 dccpav_buf_ackno; |
58 | u64 dccpav_ack_seqno; | 55 | struct list_head dccpav_records; |
59 | u64 dccpav_ack_ackno; | ||
60 | struct timeval dccpav_time; | 56 | struct timeval dccpav_time; |
61 | u8 dccpav_buf_head; | 57 | u8 dccpav_buf_head; |
62 | u8 dccpav_buf_tail; | 58 | u8 dccpav_buf_tail; |
63 | u8 dccpav_ack_ptr; | 59 | u8 dccpav_ack_ptr; |
64 | u8 dccpav_sent_len; | 60 | u8 dccpav_sent_len; |
65 | u8 dccpav_vec_len; | 61 | u8 dccpav_vec_len; |
66 | u8 dccpav_buf_len; | ||
67 | u8 dccpav_buf_nonce; | 62 | u8 dccpav_buf_nonce; |
68 | u8 dccpav_ack_nonce; | 63 | u8 dccpav_ack_nonce; |
69 | u8 dccpav_buf[0]; | 64 | u8 dccpav_buf[DCCP_MAX_ACKVEC_LEN]; |
65 | }; | ||
66 | |||
67 | /** struct dccp_ackvec_record - ack vector record | ||
68 | * | ||
69 | * ACK vector record as defined in Appendix A of spec. | ||
70 | * | ||
71 | * The list is sorted by dccpavr_ack_seqno | ||
72 | * | ||
73 | * @dccpavr_node - node in dccpav_records | ||
74 | * @dccpavr_ack_seqno - sequence number of the packet this record was sent on | ||
75 | * @dccpavr_ack_ackno - sequence number being acknowledged | ||
76 | * @dccpavr_ack_ptr - pointer into dccpav_buf where this record starts | ||
77 | * @dccpavr_ack_nonce - dccpav_ack_nonce at the time this record was sent | ||
78 | * @dccpavr_sent_len - lenght of the record in dccpav_buf | ||
79 | */ | ||
80 | struct dccp_ackvec_record { | ||
81 | struct list_head dccpavr_node; | ||
82 | u64 dccpavr_ack_seqno; | ||
83 | u64 dccpavr_ack_ackno; | ||
84 | u8 dccpavr_ack_ptr; | ||
85 | u8 dccpavr_ack_nonce; | ||
86 | u8 dccpavr_sent_len; | ||
70 | }; | 87 | }; |
71 | 88 | ||
72 | struct sock; | 89 | struct sock; |
73 | struct sk_buff; | 90 | struct sk_buff; |
74 | 91 | ||
75 | #ifdef CONFIG_IP_DCCP_ACKVEC | 92 | #ifdef CONFIG_IP_DCCP_ACKVEC |
76 | extern struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, | 93 | extern int dccp_ackvec_init(void); |
77 | const gfp_t priority); | 94 | extern void dccp_ackvec_exit(void); |
95 | |||
96 | extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); | ||
78 | extern void dccp_ackvec_free(struct dccp_ackvec *av); | 97 | extern void dccp_ackvec_free(struct dccp_ackvec *av); |
79 | 98 | ||
80 | extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | 99 | extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, |
@@ -92,8 +111,16 @@ static inline int dccp_ackvec_pending(const struct dccp_ackvec *av) | |||
92 | return av->dccpav_sent_len != av->dccpav_vec_len; | 111 | return av->dccpav_sent_len != av->dccpav_vec_len; |
93 | } | 112 | } |
94 | #else /* CONFIG_IP_DCCP_ACKVEC */ | 113 | #else /* CONFIG_IP_DCCP_ACKVEC */ |
95 | static inline struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, | 114 | static inline int dccp_ackvec_init(void) |
96 | const gfp_t priority) | 115 | { |
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static inline void dccp_ackvec_exit(void) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | static inline struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) | ||
97 | { | 124 | { |
98 | return NULL; | 125 | return NULL; |
99 | } | 126 | } |