aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-03-20 14:23:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:00 -0400
commit4712a792ee661921374c163eb6a4d06e33fd305f (patch)
tree0c5ecf7973a195bff36101904417bb7b90fd18aa /net/dccp/dccp.h
parent0c150efb280986db7958cf2a559b91d826241e59 (diff)
[DCCP]: Provide function for RTT sampling
A recurring problem, in particular in the CCID code, is that RTT samples from packets with timestamp echo and elapsed time options need to be taken. This service is provided via a new function dccp_sample_rtt in this patch. Furthermore, to protect against `insane' RTT samples, the sampled value is bounded between 100 microseconds and 4 seconds - for which u32 is sufficient. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 292f18ef4f61..d8ad27bfe01a 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -71,11 +71,15 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);
71/* RFC 1122, 4.2.3.1 initial RTO value */ 71/* RFC 1122, 4.2.3.1 initial RTO value */
72#define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) 72#define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ))
73 73
74#define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */
75
76/* bounds for sampled RTT values from packet exchanges (in usec) */
77#define DCCP_SANE_RTT_MIN 100
78#define DCCP_SANE_RTT_MAX (4 * USEC_PER_SEC)
79
74/* Maximal interval between probes for local resources. */ 80/* Maximal interval between probes for local resources. */
75#define DCCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ / 2U)) 81#define DCCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ / 2U))
76 82
77#define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */
78
79/* sysctl variables for DCCP */ 83/* sysctl variables for DCCP */
80extern int sysctl_dccp_request_retries; 84extern int sysctl_dccp_request_retries;
81extern int sysctl_dccp_retries1; 85extern int sysctl_dccp_retries1;
@@ -292,6 +296,8 @@ extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
292extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); 296extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code);
293extern void dccp_send_close(struct sock *sk, const int active); 297extern void dccp_send_close(struct sock *sk, const int active);
294extern int dccp_invalid_packet(struct sk_buff *skb); 298extern int dccp_invalid_packet(struct sk_buff *skb);
299extern u32 dccp_sample_rtt(struct sock *sk, struct timeval *t_recv,
300 struct timeval *t_history);
295 301
296static inline int dccp_bad_service_code(const struct sock *sk, 302static inline int dccp_bad_service_code(const struct sock *sk,
297 const __be32 service) 303 const __be32 service)