diff options
Diffstat (limited to 'include/linux/dccp.h')
-rw-r--r-- | include/linux/dccp.h | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 53553c99cad..1cb054bd93f 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -30,7 +30,7 @@ struct dccp_hdr { | |||
30 | #else | 30 | #else |
31 | #error "Adjust your <asm/byteorder.h> defines" | 31 | #error "Adjust your <asm/byteorder.h> defines" |
32 | #endif | 32 | #endif |
33 | __u16 dccph_checksum; | 33 | __sum16 dccph_checksum; |
34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
35 | __u8 dccph_x:1, | 35 | __u8 dccph_x:1, |
36 | dccph_type:4, | 36 | dccph_type:4, |
@@ -175,14 +175,18 @@ enum { | |||
175 | DCCPC_CCID3 = 3, | 175 | DCCPC_CCID3 = 3, |
176 | }; | 176 | }; |
177 | 177 | ||
178 | /* DCCP features */ | 178 | /* DCCP features (RFC 4340 section 6.4) */ |
179 | enum { | 179 | enum { |
180 | DCCPF_RESERVED = 0, | 180 | DCCPF_RESERVED = 0, |
181 | DCCPF_CCID = 1, | 181 | DCCPF_CCID = 1, |
182 | DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ | ||
182 | DCCPF_SEQUENCE_WINDOW = 3, | 183 | DCCPF_SEQUENCE_WINDOW = 3, |
184 | DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ | ||
183 | DCCPF_ACK_RATIO = 5, | 185 | DCCPF_ACK_RATIO = 5, |
184 | DCCPF_SEND_ACK_VECTOR = 6, | 186 | DCCPF_SEND_ACK_VECTOR = 6, |
185 | DCCPF_SEND_NDP_COUNT = 7, | 187 | DCCPF_SEND_NDP_COUNT = 7, |
188 | DCCPF_MIN_CSUM_COVER = 8, | ||
189 | DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ | ||
186 | /* 10-127 reserved */ | 190 | /* 10-127 reserved */ |
187 | DCCPF_MIN_CCID_SPECIFIC = 128, | 191 | DCCPF_MIN_CCID_SPECIFIC = 128, |
188 | DCCPF_MAX_CCID_SPECIFIC = 255, | 192 | DCCPF_MAX_CCID_SPECIFIC = 255, |
@@ -196,13 +200,16 @@ struct dccp_so_feat { | |||
196 | }; | 200 | }; |
197 | 201 | ||
198 | /* DCCP socket options */ | 202 | /* DCCP socket options */ |
199 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | 203 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ |
200 | #define DCCP_SOCKOPT_SERVICE 2 | 204 | #define DCCP_SOCKOPT_SERVICE 2 |
201 | #define DCCP_SOCKOPT_CHANGE_L 3 | 205 | #define DCCP_SOCKOPT_CHANGE_L 3 |
202 | #define DCCP_SOCKOPT_CHANGE_R 4 | 206 | #define DCCP_SOCKOPT_CHANGE_R 4 |
207 | #define DCCP_SOCKOPT_SEND_CSCOV 10 | ||
208 | #define DCCP_SOCKOPT_RECV_CSCOV 11 | ||
203 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 209 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
204 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 210 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
205 | 211 | ||
212 | /* maximum number of services provided on the same listening port */ | ||
206 | #define DCCP_SERVICE_LIST_MAX_LEN 32 | 213 | #define DCCP_SERVICE_LIST_MAX_LEN 32 |
207 | 214 | ||
208 | #ifdef __KERNEL__ | 215 | #ifdef __KERNEL__ |
@@ -256,6 +263,13 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | |||
256 | return (struct dccp_hdr *)skb->h.raw; | 263 | return (struct dccp_hdr *)skb->h.raw; |
257 | } | 264 | } |
258 | 265 | ||
266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) | ||
267 | { | ||
268 | skb->h.raw = skb_push(skb, headlen); | ||
269 | memset(skb->h.raw, 0, headlen); | ||
270 | return dccp_hdr(skb); | ||
271 | } | ||
272 | |||
259 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) | 273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) |
260 | { | 274 | { |
261 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); | 275 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); |
@@ -342,6 +356,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
342 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) | 356 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) |
343 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) | 357 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) |
344 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) | 358 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) |
359 | * @dccpms_ack_ratio - Ack Ratio Feature (section 11.3) | ||
360 | * @dccpms_pending - List of features being negotiated | ||
361 | * @dccpms_conf - | ||
345 | */ | 362 | */ |
346 | struct dccp_minisock { | 363 | struct dccp_minisock { |
347 | __u64 dccpms_sequence_window; | 364 | __u64 dccpms_sequence_window; |
@@ -410,7 +427,7 @@ struct dccp_service_list { | |||
410 | }; | 427 | }; |
411 | 428 | ||
412 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | 429 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) |
413 | #define DCCP_SERVICE_CODE_IS_ABSENT 0 | 430 | #define DCCP_SERVICE_CODE_IS_ABSENT 0 |
414 | 431 | ||
415 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | 432 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, |
416 | const __be32 service) | 433 | const __be32 service) |
@@ -419,7 +436,7 @@ static inline int dccp_list_has_service(const struct dccp_service_list *sl, | |||
419 | u32 i = sl->dccpsl_nr; | 436 | u32 i = sl->dccpsl_nr; |
420 | while (i--) | 437 | while (i--) |
421 | if (sl->dccpsl_list[i] == service) | 438 | if (sl->dccpsl_list[i] == service) |
422 | return 1; | 439 | return 1; |
423 | } | 440 | } |
424 | return 0; | 441 | return 0; |
425 | } | 442 | } |
@@ -439,12 +456,25 @@ struct dccp_ackvec; | |||
439 | * @dccps_gss - greatest sequence number sent | 456 | * @dccps_gss - greatest sequence number sent |
440 | * @dccps_gsr - greatest valid sequence number received | 457 | * @dccps_gsr - greatest valid sequence number received |
441 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss | 458 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss |
459 | * @dccps_service - first (passive sock) or unique (active sock) service code | ||
460 | * @dccps_service_list - second .. last service code on passive socket | ||
442 | * @dccps_timestamp_time - time of latest TIMESTAMP option | 461 | * @dccps_timestamp_time - time of latest TIMESTAMP option |
443 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option | 462 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option |
444 | * @dccps_packet_size - Set thru setsockopt | 463 | * @dccps_l_ack_ratio - |
445 | * @dccps_role - Role of this sock, one of %dccp_role | 464 | * @dccps_r_ack_ratio - |
465 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) | ||
466 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) | ||
446 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 467 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
468 | * @dccps_mss_cache - | ||
469 | * @dccps_minisock - | ||
447 | * @dccps_hc_rx_ackvec - rx half connection ack vector | 470 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
471 | * @dccps_hc_rx_ccid - | ||
472 | * @dccps_hc_tx_ccid - | ||
473 | * @dccps_options_received - | ||
474 | * @dccps_epoch - | ||
475 | * @dccps_role - Role of this sock, one of %dccp_role | ||
476 | * @dccps_hc_rx_insert_options - | ||
477 | * @dccps_hc_tx_insert_options - | ||
448 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 478 | * @dccps_xmit_timer - timer for when CCID is not ready to send |
449 | */ | 479 | */ |
450 | struct dccp_sock { | 480 | struct dccp_sock { |
@@ -464,9 +494,10 @@ struct dccp_sock { | |||
464 | struct dccp_service_list *dccps_service_list; | 494 | struct dccp_service_list *dccps_service_list; |
465 | struct timeval dccps_timestamp_time; | 495 | struct timeval dccps_timestamp_time; |
466 | __u32 dccps_timestamp_echo; | 496 | __u32 dccps_timestamp_echo; |
467 | __u32 dccps_packet_size; | ||
468 | __u16 dccps_l_ack_ratio; | 497 | __u16 dccps_l_ack_ratio; |
469 | __u16 dccps_r_ack_ratio; | 498 | __u16 dccps_r_ack_ratio; |
499 | __u16 dccps_pcslen; | ||
500 | __u16 dccps_pcrlen; | ||
470 | unsigned long dccps_ndp_count; | 501 | unsigned long dccps_ndp_count; |
471 | __u32 dccps_mss_cache; | 502 | __u32 dccps_mss_cache; |
472 | struct dccp_minisock dccps_minisock; | 503 | struct dccp_minisock dccps_minisock; |
@@ -480,7 +511,7 @@ struct dccp_sock { | |||
480 | __u8 dccps_hc_tx_insert_options:1; | 511 | __u8 dccps_hc_tx_insert_options:1; |
481 | struct timer_list dccps_xmit_timer; | 512 | struct timer_list dccps_xmit_timer; |
482 | }; | 513 | }; |
483 | 514 | ||
484 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) | 515 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) |
485 | { | 516 | { |
486 | return (struct dccp_sock *)sk; | 517 | return (struct dccp_sock *)sk; |