aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2009-01-16 18:36:31 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:34:04 -0500
commit792b48780e8b6435d017cef4b5c304876a48653e (patch)
tree6949d6058f4d84f171a339e580ca906d30d67fad /include
parentf90f92eed74251034f251e3cdf4fa5c4c1f09df0 (diff)
dccp: Implement both feature-local and feature-remote Sequence Window feature
This adds full support for local/remote Sequence Window feature, from which the * sequence-number-validity (W) and * acknowledgment-number-validity (W') windows derive as specified in RFC 4340, 7.5.3. Specifically, the following is contained in this patch: * integrated new socket fields into dccp_sk; * updated the update_gsr/gss routines with regard to these fields; * updated handler code: the Sequence Window feature is located at the TX side, so the local feature is meant if the handler-rx flag is false; * the initialisation of `rcv_wnd' in reqsk is removed, since - rcv_wnd is not used by the code anywhere; - sequence number checks are not done in the LISTEN state (cf. 7.5.3); - dccp_check_req checks the Ack number validity more rigorously; * the `struct dccp_minisock' became empty and is now removed. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dccp.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 990e97fa1f07..7a0502ab383a 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -364,19 +364,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
364#define DCCPF_INITIAL_SEND_NDP_COUNT 1 364#define DCCPF_INITIAL_SEND_NDP_COUNT 1
365 365
366/** 366/**
367 * struct dccp_minisock - Minimal DCCP connection representation
368 *
369 * Will be used to pass the state from dccp_request_sock to dccp_sock.
370 *
371 * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2)
372 */
373struct dccp_minisock {
374 __u64 dccpms_sequence_window;
375};
376
377extern void dccp_minisock_init(struct dccp_minisock *dmsk);
378
379/**
380 * struct dccp_request_sock - represent DCCP-specific connection request 367 * struct dccp_request_sock - represent DCCP-specific connection request
381 * @dreq_inet_rsk: structure inherited from 368 * @dreq_inet_rsk: structure inherited from
382 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) 369 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1)
@@ -464,13 +451,14 @@ struct dccp_ackvec;
464 * @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo 451 * @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo
465 * @dccps_l_ack_ratio - feature-local Ack Ratio 452 * @dccps_l_ack_ratio - feature-local Ack Ratio
466 * @dccps_r_ack_ratio - feature-remote Ack Ratio 453 * @dccps_r_ack_ratio - feature-remote Ack Ratio
454 * @dccps_l_seq_win - local Sequence Window (influences ack number validity)
455 * @dccps_r_seq_win - remote Sequence Window (influences seq number validity)
467 * @dccps_pcslen - sender partial checksum coverage (via sockopt) 456 * @dccps_pcslen - sender partial checksum coverage (via sockopt)
468 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) 457 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt)
469 * @dccps_send_ndp_count - local Send NDP Count feature (7.7.2) 458 * @dccps_send_ndp_count - local Send NDP Count feature (7.7.2)
470 * @dccps_ndp_count - number of Non Data Packets since last data packet 459 * @dccps_ndp_count - number of Non Data Packets since last data packet
471 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) 460 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes)
472 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4) 461 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4)
473 * @dccps_minisock - associated minisock (accessed via dccp_msk)
474 * @dccps_featneg - tracks feature-negotiation state (mostly during handshake) 462 * @dccps_featneg - tracks feature-negotiation state (mostly during handshake)
475 * @dccps_hc_rx_ackvec - rx half connection ack vector 463 * @dccps_hc_rx_ackvec - rx half connection ack vector
476 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) 464 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection)
@@ -504,12 +492,13 @@ struct dccp_sock {
504 __u32 dccps_timestamp_time; 492 __u32 dccps_timestamp_time;
505 __u16 dccps_l_ack_ratio; 493 __u16 dccps_l_ack_ratio;
506 __u16 dccps_r_ack_ratio; 494 __u16 dccps_r_ack_ratio;
495 __u64 dccps_l_seq_win:48;
496 __u64 dccps_r_seq_win:48;
507 __u8 dccps_pcslen:4; 497 __u8 dccps_pcslen:4;
508 __u8 dccps_pcrlen:4; 498 __u8 dccps_pcrlen:4;
509 __u8 dccps_send_ndp_count:1; 499 __u8 dccps_send_ndp_count:1;
510 __u64 dccps_ndp_count:48; 500 __u64 dccps_ndp_count:48;
511 unsigned long dccps_rate_last; 501 unsigned long dccps_rate_last;
512 struct dccp_minisock dccps_minisock;
513 struct list_head dccps_featneg; 502 struct list_head dccps_featneg;
514 struct dccp_ackvec *dccps_hc_rx_ackvec; 503 struct dccp_ackvec *dccps_hc_rx_ackvec;
515 struct ccid *dccps_hc_rx_ccid; 504 struct ccid *dccps_hc_rx_ccid;
@@ -527,11 +516,6 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk)
527 return (struct dccp_sock *)sk; 516 return (struct dccp_sock *)sk;
528} 517}
529 518
530static inline struct dccp_minisock *dccp_msk(const struct sock *sk)
531{
532 return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock;
533}
534
535static inline const char *dccp_role(const struct sock *sk) 519static inline const char *dccp_role(const struct sock *sk)
536{ 520{
537 switch (dccp_sk(sk)->dccps_role) { 521 switch (dccp_sk(sk)->dccps_role) {