aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorIan McDonald <iam4@cs.waikato.ac.nz>2005-08-19 23:23:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 19:02:34 -0400
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 4efdce47000b..aab72b8d0703 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -4,7 +4,8 @@
4 * net/dccp/dccp.h 4 * net/dccp/dccp.h
5 * 5 *
6 * An implementation of the DCCP protocol 6 * An implementation of the DCCP protocol
7 * Arnaldo Carvalho de Melo <acme@conectiva.com.br> 7 * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
8 * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
8 * 9 *
9 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as 11 * under the terms of the GNU General Public License version 2 as
@@ -404,6 +405,7 @@ extern struct socket *dccp_ctl_socket;
404 * @dccpap_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. 405 * @dccpap_ack_nonce - the one-bit sum of the ECN Nonces for all State 0.
405 * 406 *
406 * @dccpap_buf_len - circular buffer length 407 * @dccpap_buf_len - circular buffer length
408 * @dccpap_time - the time in usecs
407 * @dccpap_buf - circular buffer of acknowledgeable packets 409 * @dccpap_buf - circular buffer of acknowledgeable packets
408 */ 410 */
409struct dccp_ackpkts { 411struct dccp_ackpkts {
@@ -416,7 +418,7 @@ struct dccp_ackpkts {
416 unsigned int dccpap_buf_vector_len; 418 unsigned int dccpap_buf_vector_len;
417 unsigned int dccpap_ack_vector_len; 419 unsigned int dccpap_ack_vector_len;
418 unsigned int dccpap_buf_len; 420 unsigned int dccpap_buf_len;
419 unsigned long dccpap_time; 421 struct timeval dccpap_time;
420 u8 dccpap_buf_nonce; 422 u8 dccpap_buf_nonce;
421 u8 dccpap_ack_nonce; 423 u8 dccpap_ack_nonce;
422 u8 dccpap_buf[0]; 424 u8 dccpap_buf[0];
@@ -430,6 +432,19 @@ extern int dccp_ackpkts_add(struct dccp_ackpkts *ap, u64 ackno, u8 state);
430extern void dccp_ackpkts_check_rcv_ackno(struct dccp_ackpkts *ap, 432extern void dccp_ackpkts_check_rcv_ackno(struct dccp_ackpkts *ap,
431 struct sock *sk, u64 ackno); 433 struct sock *sk, u64 ackno);
432 434
435/*
436 * Returns the difference in usecs between timeval
437 * passed in and current time
438 */
439static inline u32 now_delta(struct timeval tv)
440{
441 struct timeval now;
442
443 do_gettimeofday(&now);
444 return (now.tv_sec - tv.tv_sec) * USEC_PER_SEC +
445 (now.tv_usec - tv.tv_usec);
446}
447
433#ifdef CONFIG_IP_DCCP_DEBUG 448#ifdef CONFIG_IP_DCCP_DEBUG
434extern void dccp_ackvector_print(const u64 ackno, 449extern void dccp_ackvector_print(const u64 ackno,
435 const unsigned char *vector, int len); 450 const unsigned char *vector, int len);