diff options
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r-- | net/dccp/dccp.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index ee97950d77d1..ebe59d98721a 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -72,11 +72,21 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo); | |||
72 | /* RFC 1122, 4.2.3.1 initial RTO value */ | 72 | /* RFC 1122, 4.2.3.1 initial RTO value */ |
73 | #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) | 73 | #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) |
74 | 74 | ||
75 | #define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */ | 75 | /* |
76 | * The maximum back-off value for retransmissions. This is needed for | ||
77 | * - retransmitting client-Requests (sec. 8.1.1), | ||
78 | * - retransmitting Close/CloseReq when closing (sec. 8.3), | ||
79 | * - feature-negotiation retransmission (sec. 6.6.3), | ||
80 | * - Acks in client-PARTOPEN state (sec. 8.1.5). | ||
81 | */ | ||
82 | #define DCCP_RTO_MAX ((unsigned)(64 * HZ)) | ||
76 | 83 | ||
77 | /* bounds for sampled RTT values from packet exchanges (in usec) */ | 84 | /* |
85 | * RTT sampling: sanity bounds and fallback RTT value from RFC 4340, section 3.4 | ||
86 | */ | ||
78 | #define DCCP_SANE_RTT_MIN 100 | 87 | #define DCCP_SANE_RTT_MIN 100 |
79 | #define DCCP_SANE_RTT_MAX (4 * USEC_PER_SEC) | 88 | #define DCCP_FALLBACK_RTT (USEC_PER_SEC / 5) |
89 | #define DCCP_SANE_RTT_MAX (3 * USEC_PER_SEC) | ||
80 | 90 | ||
81 | /* Maximal interval between probes for local resources. */ | 91 | /* Maximal interval between probes for local resources. */ |
82 | #define DCCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ / 2U)) | 92 | #define DCCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ / 2U)) |
@@ -143,12 +153,6 @@ static inline u64 max48(const u64 seq1, const u64 seq2) | |||
143 | return after48(seq1, seq2) ? seq1 : seq2; | 153 | return after48(seq1, seq2) ? seq1 : seq2; |
144 | } | 154 | } |
145 | 155 | ||
146 | /* is seq1 next seqno after seq2 */ | ||
147 | static inline int follows48(const u64 seq1, const u64 seq2) | ||
148 | { | ||
149 | return dccp_delta_seqno(seq2, seq1) == 1; | ||
150 | } | ||
151 | |||
152 | enum { | 156 | enum { |
153 | DCCP_MIB_NUM = 0, | 157 | DCCP_MIB_NUM = 0, |
154 | DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */ | 158 | DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */ |
@@ -334,6 +338,7 @@ struct dccp_skb_cb { | |||
334 | 338 | ||
335 | #define DCCP_SKB_CB(__skb) ((struct dccp_skb_cb *)&((__skb)->cb[0])) | 339 | #define DCCP_SKB_CB(__skb) ((struct dccp_skb_cb *)&((__skb)->cb[0])) |
336 | 340 | ||
341 | /* RFC 4340, sec. 7.7 */ | ||
337 | static inline int dccp_non_data_packet(const struct sk_buff *skb) | 342 | static inline int dccp_non_data_packet(const struct sk_buff *skb) |
338 | { | 343 | { |
339 | const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; | 344 | const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; |
@@ -346,6 +351,17 @@ static inline int dccp_non_data_packet(const struct sk_buff *skb) | |||
346 | type == DCCP_PKT_SYNCACK; | 351 | type == DCCP_PKT_SYNCACK; |
347 | } | 352 | } |
348 | 353 | ||
354 | /* RFC 4340, sec. 7.7 */ | ||
355 | static inline int dccp_data_packet(const struct sk_buff *skb) | ||
356 | { | ||
357 | const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; | ||
358 | |||
359 | return type == DCCP_PKT_DATA || | ||
360 | type == DCCP_PKT_DATAACK || | ||
361 | type == DCCP_PKT_REQUEST || | ||
362 | type == DCCP_PKT_RESPONSE; | ||
363 | } | ||
364 | |||
349 | static inline int dccp_packet_without_ack(const struct sk_buff *skb) | 365 | static inline int dccp_packet_without_ack(const struct sk_buff *skb) |
350 | { | 366 | { |
351 | const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; | 367 | const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; |
@@ -406,6 +422,7 @@ static inline int dccp_ack_pending(const struct sock *sk) | |||
406 | } | 422 | } |
407 | 423 | ||
408 | extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb); | 424 | extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb); |
425 | extern int dccp_insert_options_rsk(struct dccp_request_sock*, struct sk_buff*); | ||
409 | extern int dccp_insert_option_elapsed_time(struct sock *sk, | 426 | extern int dccp_insert_option_elapsed_time(struct sock *sk, |
410 | struct sk_buff *skb, | 427 | struct sk_buff *skb, |
411 | u32 elapsed_time); | 428 | u32 elapsed_time); |