summaryrefslogtreecommitdiff
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorIan McDonald <iam4@cs.waikato.ac.nz>2005-08-20 00:23:43 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 16:02:34 -0700
commit1bc0986957b63a2fbbc46ab95d3d1d72830bda83 (patch)
tree8be8f0e0e19f58cc5cc9cb7d789f3283436712ed /net/dccp/dccp.h
parentbf0ff9e578ba7dd8331005f00ad7310122011f43 (diff)
[DCCP]: Fix the timestamp options
This changes timestamp, timestamp echo, and elapsed time to use units of 10 usecs as per DCCP spec. This has been tested to verify that times are correct. Also fixed up length and used hton/ntoh more. Still to add in later patches: - actually use elapsed time to adjust RTT (commented out as was prior to this patch) - send options at times more closely following the spec (content is now correct) Signed-off-by: Ian McDonald <iam4@cs.waikato.ac.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 4efdce47000..aab72b8d070 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -4,7 +4,8 @@
* net/dccp/dccp.h
*
* An implementation of the DCCP protocol
- * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as
@@ -404,6 +405,7 @@ extern struct socket *dccp_ctl_socket;
* @dccpap_ack_nonce - the one-bit sum of the ECN Nonces for all State 0.
*
* @dccpap_buf_len - circular buffer length
+ * @dccpap_time - the time in usecs
* @dccpap_buf - circular buffer of acknowledgeable packets
*/
struct dccp_ackpkts {
@@ -416,7 +418,7 @@ struct dccp_ackpkts {
unsigned int dccpap_buf_vector_len;
unsigned int dccpap_ack_vector_len;
unsigned int dccpap_buf_len;
- unsigned long dccpap_time;
+ struct timeval dccpap_time;
u8 dccpap_buf_nonce;
u8 dccpap_ack_nonce;
u8 dccpap_buf[0];
@@ -430,6 +432,19 @@ extern int dccp_ackpkts_add(struct dccp_ackpkts *ap, u64 ackno, u8 state);
extern void dccp_ackpkts_check_rcv_ackno(struct dccp_ackpkts *ap,
struct sock *sk, u64 ackno);
+/*
+ * Returns the difference in usecs between timeval
+ * passed in and current time
+ */
+static inline u32 now_delta(struct timeval tv)
+{
+ struct timeval now;
+
+ do_gettimeofday(&now);
+ return (now.tv_sec - tv.tv_sec) * USEC_PER_SEC +
+ (now.tv_usec - tv.tv_usec);
+}
+
#ifdef CONFIG_IP_DCCP_DEBUG
extern void dccp_ackvector_print(const u64 ackno,
const unsigned char *vector, int len);