aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>2006-03-20 20:43:56 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 20:43:56 -0500
commitafe00251dd9b53d51de91ff0099961f42bbf3754 (patch)
treea56aa987140662cf3e6e65be402b8591298c5ced /include
parent2a91aa3967398fb94eccc8da67c82bce9f67afdf (diff)
[DCCP]: Initial feature negotiation implementation
Still needs more work, but boots and doesn't crashes, even does some negotiation! 18:38:52.174934 127.0.0.1.43458 > 127.0.0.1.5001: request <change_l ack_ratio 2, change_r ccid 2, change_l ccid 2> 18:38:52.218526 127.0.0.1.5001 > 127.0.0.1.43458: response <nop, nop, change_l ack_ratio 2, confirm_r ccid 2 2, confirm_l ccid 2 2, confirm_r ack_ratio 2> 18:38:52.185398 127.0.0.1.43458 > 127.0.0.1.5001: <nop, confirm_r ack_ratio 2, ack_vector0 0x00, elapsed_time 212> :-) Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dccp.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 268b4579d7e5..f91c8a62406d 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -154,6 +154,10 @@ enum {
154 DCCPO_MANDATORY = 1, 154 DCCPO_MANDATORY = 1,
155 DCCPO_MIN_RESERVED = 3, 155 DCCPO_MIN_RESERVED = 3,
156 DCCPO_MAX_RESERVED = 31, 156 DCCPO_MAX_RESERVED = 31,
157 DCCPO_CHANGE_L = 32,
158 DCCPO_CONFIRM_L = 33,
159 DCCPO_CHANGE_R = 34,
160 DCCPO_CONFIRM_R = 35,
157 DCCPO_NDP_COUNT = 37, 161 DCCPO_NDP_COUNT = 37,
158 DCCPO_ACK_VECTOR_0 = 38, 162 DCCPO_ACK_VECTOR_0 = 38,
159 DCCPO_ACK_VECTOR_1 = 39, 163 DCCPO_ACK_VECTOR_1 = 39,
@@ -168,7 +172,9 @@ enum {
168/* DCCP features */ 172/* DCCP features */
169enum { 173enum {
170 DCCPF_RESERVED = 0, 174 DCCPF_RESERVED = 0,
175 DCCPF_CCID = 1,
171 DCCPF_SEQUENCE_WINDOW = 3, 176 DCCPF_SEQUENCE_WINDOW = 3,
177 DCCPF_ACK_RATIO = 5,
172 DCCPF_SEND_ACK_VECTOR = 6, 178 DCCPF_SEND_ACK_VECTOR = 6,
173 DCCPF_SEND_NDP_COUNT = 7, 179 DCCPF_SEND_NDP_COUNT = 7,
174 /* 10-127 reserved */ 180 /* 10-127 reserved */
@@ -176,9 +182,18 @@ enum {
176 DCCPF_MAX_CCID_SPECIFIC = 255, 182 DCCPF_MAX_CCID_SPECIFIC = 255,
177}; 183};
178 184
185/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
186struct dccp_so_feat {
187 __u8 dccpsf_feat;
188 __u8 *dccpsf_val;
189 __u8 dccpsf_len;
190};
191
179/* DCCP socket options */ 192/* DCCP socket options */
180#define DCCP_SOCKOPT_PACKET_SIZE 1 193#define DCCP_SOCKOPT_PACKET_SIZE 1
181#define DCCP_SOCKOPT_SERVICE 2 194#define DCCP_SOCKOPT_SERVICE 2
195#define DCCP_SOCKOPT_CHANGE_L 3
196#define DCCP_SOCKOPT_CHANGE_R 4
182#define DCCP_SOCKOPT_CCID_RX_INFO 128 197#define DCCP_SOCKOPT_CCID_RX_INFO 128
183#define DCCP_SOCKOPT_CCID_TX_INFO 192 198#define DCCP_SOCKOPT_CCID_TX_INFO 192
184 199
@@ -314,8 +329,8 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
314 329
315/* initial values for each feature */ 330/* initial values for each feature */
316#define DCCPF_INITIAL_SEQUENCE_WINDOW 100 331#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
317/* FIXME: for now we're using CCID 2 (TCP-Like) */
318#define DCCPF_INITIAL_CCID 2 332#define DCCPF_INITIAL_CCID 2
333#define DCCPF_INITIAL_ACK_RATIO 2
319#define DCCPF_INITIAL_SEND_ACK_VECTOR 1 334#define DCCPF_INITIAL_SEND_ACK_VECTOR 1
320/* FIXME: for now we're default to 1 but it should really be 0 */ 335/* FIXME: for now we're default to 1 but it should really be 0 */
321#define DCCPF_INITIAL_SEND_NDP_COUNT 1 336#define DCCPF_INITIAL_SEND_NDP_COUNT 1
@@ -335,6 +350,24 @@ struct dccp_options {
335 __u8 dccpo_tx_ccid; 350 __u8 dccpo_tx_ccid;
336 __u8 dccpo_send_ack_vector; 351 __u8 dccpo_send_ack_vector;
337 __u8 dccpo_send_ndp_count; 352 __u8 dccpo_send_ndp_count;
353 __u8 dccpo_ack_ratio;
354 struct list_head dccpo_pending;
355 struct list_head dccpo_conf;
356};
357
358struct dccp_opt_conf {
359 __u8 *dccpoc_val;
360 __u8 dccpoc_len;
361};
362
363struct dccp_opt_pend {
364 struct list_head dccpop_node;
365 __u8 dccpop_type;
366 __u8 dccpop_feat;
367 __u8 *dccpop_val;
368 __u8 dccpop_len;
369 int dccpop_conf;
370 struct dccp_opt_conf *dccpop_sc;
338}; 371};
339 372
340extern void __dccp_options_init(struct dccp_options *dccpo); 373extern void __dccp_options_init(struct dccp_options *dccpo);