renamed TCP's TSval/TSecr
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
336ce7039c
commit
785e7ef7dd
@ -236,7 +236,7 @@ TCPEndpoint::TCPEndpoint(net_socket *socket)
|
|||||||
fRoundTripTime(TCP_INITIAL_RTT / kTimestampFactor),
|
fRoundTripTime(TCP_INITIAL_RTT / kTimestampFactor),
|
||||||
fRoundTripDeviation(TCP_INITIAL_RTT / kTimestampFactor),
|
fRoundTripDeviation(TCP_INITIAL_RTT / kTimestampFactor),
|
||||||
fRetransmitTimeout(TCP_INITIAL_RTT),
|
fRetransmitTimeout(TCP_INITIAL_RTT),
|
||||||
fReceivedTSval(0),
|
fReceivedTimestamp(0),
|
||||||
fCongestionWindow(0),
|
fCongestionWindow(0),
|
||||||
fSlowStartThreshold(0),
|
fSlowStartThreshold(0),
|
||||||
fState(CLOSED),
|
fState(CLOSED),
|
||||||
@ -1120,8 +1120,8 @@ TCPEndpoint::_SendQueued(bool force, uint32 sendWindow)
|
|||||||
if ((fOptions & TCP_NOOPT) == 0) {
|
if ((fOptions & TCP_NOOPT) == 0) {
|
||||||
if (fFlags & FLAG_OPTION_TIMESTAMP) {
|
if (fFlags & FLAG_OPTION_TIMESTAMP) {
|
||||||
segment.options |= TCP_HAS_TIMESTAMPS;
|
segment.options |= TCP_HAS_TIMESTAMPS;
|
||||||
segment.TSecr = fReceivedTSval;
|
segment.TimestampReply = fReceivedTimestamp;
|
||||||
segment.TSval = tcp_now();
|
segment.TimestampValue = tcp_now();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((segment.flags & TCP_FLAG_SYNCHRONIZE)
|
if ((segment.flags & TCP_FLAG_SYNCHRONIZE)
|
||||||
@ -1579,7 +1579,7 @@ TCPEndpoint::_UpdateTimestamps(tcp_segment_header &segment,
|
|||||||
|
|
||||||
if ((fLastAcknowledgeSent >= sequence
|
if ((fLastAcknowledgeSent >= sequence
|
||||||
&& fLastAcknowledgeSent < (sequence + segmentLength)))
|
&& 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) {
|
if (segment.options & TCP_HAS_TIMESTAMPS) {
|
||||||
fFlags |= FLAG_OPTION_TIMESTAMP;
|
fFlags |= FLAG_OPTION_TIMESTAMP;
|
||||||
fReceivedTSval = segment.TSval;
|
fReceivedTimestamp = segment.TimestampValue;
|
||||||
} else
|
} else
|
||||||
fFlags &= ~FLAG_OPTION_TIMESTAMP;
|
fFlags &= ~FLAG_OPTION_TIMESTAMP;
|
||||||
}
|
}
|
||||||
@ -1715,7 +1715,7 @@ TCPEndpoint::_Acknowledged(tcp_segment_header &segment)
|
|||||||
// this ACK acknowledged data
|
// this ACK acknowledged data
|
||||||
|
|
||||||
if (segment.options & TCP_HAS_TIMESTAMPS)
|
if (segment.options & TCP_HAS_TIMESTAMPS)
|
||||||
_UpdateSRTT(tcp_diff_timestamp(segment.TSecr));
|
_UpdateSRTT(tcp_diff_timestamp(segment.TimestampReply));
|
||||||
else {
|
else {
|
||||||
// TODO Fallback to RFC 793 type estimation
|
// TODO Fallback to RFC 793 type estimation
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ class TCPEndpoint : public net_protocol, public ProtocolSocket {
|
|||||||
int32 fRoundTripDeviation;
|
int32 fRoundTripDeviation;
|
||||||
bigtime_t fRetransmitTimeout;
|
bigtime_t fRetransmitTimeout;
|
||||||
|
|
||||||
uint32 fReceivedTSval;
|
uint32 fReceivedTimestamp;
|
||||||
|
|
||||||
uint32 fCongestionWindow;
|
uint32 fCongestionWindow;
|
||||||
uint32 fSlowStartThreshold;
|
uint32 fSlowStartThreshold;
|
||||||
|
@ -134,9 +134,9 @@ add_options(tcp_segment_header &segment, uint8 *buffer, size_t bufferSize)
|
|||||||
bump_option(option, length);
|
bump_option(option, length);
|
||||||
option->kind = TCP_OPTION_TIMESTAMP;
|
option->kind = TCP_OPTION_TIMESTAMP;
|
||||||
option->length = 10;
|
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.
|
// 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);
|
bump_option(option, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,8 +307,9 @@ process_options(tcp_segment_header &segment, net_buffer *buffer, size_t size)
|
|||||||
case TCP_OPTION_TIMESTAMP:
|
case TCP_OPTION_TIMESTAMP:
|
||||||
if (option->length == 10 && (size - 10) >= 0) {
|
if (option->length == 10 && (size - 10) >= 0) {
|
||||||
segment.options |= TCP_HAS_TIMESTAMPS;
|
segment.options |= TCP_HAS_TIMESTAMPS;
|
||||||
segment.TSval = option->timestamp.TSval;
|
segment.TimestampValue = option->timestamp.TimestampValue;
|
||||||
segment.TSecr = ntohl(option->timestamp.TSecr);
|
segment.TimestampReply =
|
||||||
|
ntohl(option->timestamp.TimestampReply);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TCP_OPTION_SACK_PERMITTED:
|
case TCP_OPTION_SACK_PERMITTED:
|
||||||
|
@ -118,8 +118,8 @@ struct tcp_option {
|
|||||||
uint8 window_shift;
|
uint8 window_shift;
|
||||||
uint16 max_segment_size;
|
uint16 max_segment_size;
|
||||||
struct {
|
struct {
|
||||||
uint32 TSval;
|
uint32 TimestampValue;
|
||||||
uint32 TSecr;
|
uint32 TimestampReply;
|
||||||
} timestamp;
|
} timestamp;
|
||||||
tcp_sack sack[0];
|
tcp_sack sack[0];
|
||||||
};
|
};
|
||||||
@ -161,8 +161,8 @@ struct tcp_segment_header {
|
|||||||
uint8 window_shift;
|
uint8 window_shift;
|
||||||
uint16 max_segment_size;
|
uint16 max_segment_size;
|
||||||
|
|
||||||
uint32 TSval;
|
uint32 TimestampValue;
|
||||||
uint32 TSecr;
|
uint32 TimestampReply;
|
||||||
|
|
||||||
tcp_sack *sacks;
|
tcp_sack *sacks;
|
||||||
int sack_count;
|
int sack_count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user