From 785e7ef7dd751385821998a5cf513d14f2456b3e Mon Sep 17 00:00:00 2001 From: Hugo Santos Date: Fri, 4 May 2007 11:27:00 +0000 Subject: [PATCH] renamed TCP's TSval/TSecr git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21014 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/network/protocols/tcp/TCPEndpoint.cpp | 12 ++++++------ .../kernel/network/protocols/tcp/TCPEndpoint.h | 2 +- src/add-ons/kernel/network/protocols/tcp/tcp.cpp | 9 +++++---- src/add-ons/kernel/network/protocols/tcp/tcp.h | 8 ++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp index b2b819a59a..4e620b604b 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp +++ b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp @@ -236,7 +236,7 @@ TCPEndpoint::TCPEndpoint(net_socket *socket) fRoundTripTime(TCP_INITIAL_RTT / kTimestampFactor), fRoundTripDeviation(TCP_INITIAL_RTT / kTimestampFactor), fRetransmitTimeout(TCP_INITIAL_RTT), - fReceivedTSval(0), + fReceivedTimestamp(0), fCongestionWindow(0), fSlowStartThreshold(0), fState(CLOSED), @@ -1120,8 +1120,8 @@ TCPEndpoint::_SendQueued(bool force, uint32 sendWindow) if ((fOptions & TCP_NOOPT) == 0) { if (fFlags & FLAG_OPTION_TIMESTAMP) { segment.options |= TCP_HAS_TIMESTAMPS; - segment.TSecr = fReceivedTSval; - segment.TSval = tcp_now(); + segment.TimestampReply = fReceivedTimestamp; + segment.TimestampValue = tcp_now(); } if ((segment.flags & TCP_FLAG_SYNCHRONIZE) @@ -1579,7 +1579,7 @@ TCPEndpoint::_UpdateTimestamps(tcp_segment_header &segment, if ((fLastAcknowledgeSent >= sequence && fLastAcknowledgeSent < (sequence + segmentLength))) - fReceivedTSval = segment.TSval; + fReceivedTimestamp = segment.TimestampValue; } } @@ -1650,7 +1650,7 @@ TCPEndpoint::_PrepareReceivePath(tcp_segment_header &segment) if (segment.options & TCP_HAS_TIMESTAMPS) { fFlags |= FLAG_OPTION_TIMESTAMP; - fReceivedTSval = segment.TSval; + fReceivedTimestamp = segment.TimestampValue; } else fFlags &= ~FLAG_OPTION_TIMESTAMP; } @@ -1715,7 +1715,7 @@ TCPEndpoint::_Acknowledged(tcp_segment_header &segment) // this ACK acknowledged data if (segment.options & TCP_HAS_TIMESTAMPS) - _UpdateSRTT(tcp_diff_timestamp(segment.TSecr)); + _UpdateSRTT(tcp_diff_timestamp(segment.TimestampReply)); else { // TODO Fallback to RFC 793 type estimation } diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.h b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.h index a1d16f722b..ddc1f43abf 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.h +++ b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.h @@ -162,7 +162,7 @@ class TCPEndpoint : public net_protocol, public ProtocolSocket { int32 fRoundTripDeviation; bigtime_t fRetransmitTimeout; - uint32 fReceivedTSval; + uint32 fReceivedTimestamp; uint32 fCongestionWindow; uint32 fSlowStartThreshold; diff --git a/src/add-ons/kernel/network/protocols/tcp/tcp.cpp b/src/add-ons/kernel/network/protocols/tcp/tcp.cpp index 95ba38efab..f6e1a590d1 100644 --- a/src/add-ons/kernel/network/protocols/tcp/tcp.cpp +++ b/src/add-ons/kernel/network/protocols/tcp/tcp.cpp @@ -134,9 +134,9 @@ add_options(tcp_segment_header &segment, uint8 *buffer, size_t bufferSize) bump_option(option, length); option->kind = TCP_OPTION_TIMESTAMP; option->length = 10; - option->timestamp.TSval = htonl(segment.TSval); + option->timestamp.TimestampValue = htonl(segment.TimestampValue); // TSecr is opaque to us, we send it as we received it. - option->timestamp.TSecr = segment.TSecr; + option->timestamp.TimestampReply = segment.TimestampReply; bump_option(option, length); } @@ -307,8 +307,9 @@ process_options(tcp_segment_header &segment, net_buffer *buffer, size_t size) case TCP_OPTION_TIMESTAMP: if (option->length == 10 && (size - 10) >= 0) { segment.options |= TCP_HAS_TIMESTAMPS; - segment.TSval = option->timestamp.TSval; - segment.TSecr = ntohl(option->timestamp.TSecr); + segment.TimestampValue = option->timestamp.TimestampValue; + segment.TimestampReply = + ntohl(option->timestamp.TimestampReply); } break; case TCP_OPTION_SACK_PERMITTED: diff --git a/src/add-ons/kernel/network/protocols/tcp/tcp.h b/src/add-ons/kernel/network/protocols/tcp/tcp.h index 7ceeda03a7..30ffeea84d 100644 --- a/src/add-ons/kernel/network/protocols/tcp/tcp.h +++ b/src/add-ons/kernel/network/protocols/tcp/tcp.h @@ -118,8 +118,8 @@ struct tcp_option { uint8 window_shift; uint16 max_segment_size; struct { - uint32 TSval; - uint32 TSecr; + uint32 TimestampValue; + uint32 TimestampReply; } timestamp; tcp_sack sack[0]; }; @@ -161,8 +161,8 @@ struct tcp_segment_header { uint8 window_shift; uint16 max_segment_size; - uint32 TSval; - uint32 TSecr; + uint32 TimestampValue; + uint32 TimestampReply; tcp_sack *sacks; int sack_count;