|
Lines 1166-1173
TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress,
|
Link Here
|
|---|
|
| 1166 |
|
1166 |
|
| 1167 |
m_rxTrace (packet, tcpHeader, this); |
1167 |
m_rxTrace (packet, tcpHeader, this); |
| 1168 |
|
1168 |
|
| 1169 |
ReadOptions (tcpHeader); |
|
|
| 1170 |
|
| 1171 |
if (tcpHeader.GetFlags () & TcpHeader::SYN) |
1169 |
if (tcpHeader.GetFlags () & TcpHeader::SYN) |
| 1172 |
{ |
1170 |
{ |
| 1173 |
/* The window field in a segment where the SYN bit is set (i.e., a <SYN> |
1171 |
/* The window field in a segment where the SYN bit is set (i.e., a <SYN> |
|
Lines 1176-1183
TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress,
|
Link Here
|
|---|
|
| 1176 |
*/ |
1174 |
*/ |
| 1177 |
m_rWnd = tcpHeader.GetWindowSize (); |
1175 |
m_rWnd = tcpHeader.GetWindowSize (); |
| 1178 |
|
1176 |
|
|
|
1177 |
if (tcpHeader.HasOption (TcpOption::WINSCALE) && m_winScalingEnabled) |
| 1178 |
{ |
| 1179 |
ProcessOptionWScale (tcpHeader.GetOption (TcpOption::WINSCALE)); |
| 1180 |
} |
| 1181 |
else |
| 1182 |
{ |
| 1183 |
m_winScalingEnabled = false; |
| 1184 |
} |
| 1185 |
|
| 1186 |
// Scale initial slow start threshold to the size of the largest possible |
| 1187 |
// advertised window (RFC 5681, page 4) |
| 1179 |
if (m_tcb->m_initialSsThresh == UINT32_MAX) |
1188 |
if (m_tcb->m_initialSsThresh == UINT32_MAX) |
| 1180 |
{ |
1189 |
{ |
|
|
1190 |
// m_sndWindShift is initialized to 0, no problem even if winScale is |
| 1191 |
// disabled |
| 1181 |
m_tcb->m_initialSsThresh = m_rWnd << m_sndWindShift; |
1192 |
m_tcb->m_initialSsThresh = m_rWnd << m_sndWindShift; |
| 1182 |
} |
1193 |
} |
| 1183 |
|
1194 |
|
|
Lines 3110-3135
TcpSocketBase::GetAllowBroadcast (void) const
|
Link Here
|
|---|
|
| 3110 |
} |
3121 |
} |
| 3111 |
|
3122 |
|
| 3112 |
void |
3123 |
void |
| 3113 |
TcpSocketBase::ReadOptions (const TcpHeader& header) |
|
|
| 3114 |
{ |
| 3115 |
NS_LOG_FUNCTION (this << header); |
| 3116 |
|
| 3117 |
if ((header.GetFlags () & TcpHeader::SYN)) |
| 3118 |
{ |
| 3119 |
if (m_winScalingEnabled) |
| 3120 |
{ |
| 3121 |
m_winScalingEnabled = false; |
| 3122 |
|
| 3123 |
if (header.HasOption (TcpOption::WINSCALE)) |
| 3124 |
{ |
| 3125 |
m_winScalingEnabled = true; |
| 3126 |
ProcessOptionWScale (header.GetOption (TcpOption::WINSCALE)); |
| 3127 |
} |
| 3128 |
} |
| 3129 |
} |
| 3130 |
} |
| 3131 |
|
| 3132 |
void |
| 3133 |
TcpSocketBase::AddOptions (TcpHeader& header) |
3124 |
TcpSocketBase::AddOptions (TcpHeader& header) |
| 3134 |
{ |
3125 |
{ |
| 3135 |
NS_LOG_FUNCTION (this << header); |
3126 |
NS_LOG_FUNCTION (this << header); |