Go to the documentation of this file.
32 #define TRACE_LEVEL TCP_TRACE_LEVEL
44 #if (TCP_SUPPORT == ENABLED)
102 if(
socket->retransmitQueue != NULL)
107 #if (TCP_CONGEST_CONTROL_SUPPORT == ENABLED)
111 if(
socket->retransmitCount == 0)
138 TRACE_INFO(
"%s: TCP segment retransmission #%u (%u data bytes)...\r\n",
140 socket->retransmitCount + 1,
141 socket->retransmitQueue->length);
152 socket->retransmitCount++;
189 if(
socket->sndWnd == 0 &&
socket->wndProbeInterval != 0)
199 TRACE_INFO(
"%s: TCP zero window probe #%u...\r\n",
242 #if (TCP_KEEP_ALIVE_SUPPORT == ENABLED)
249 if(
socket->keepAliveEnabled)
255 if(
socket->keepAliveProbeCount == 0)
259 socket->keepAliveIdle) >= 0)
267 socket->keepAliveProbeCount = 1;
279 if(
socket->keepAliveProbeCount <
socket->keepAliveMaxProbes)
287 socket->keepAliveProbeCount++;
337 #if (TCP_CONGEST_CONTROL_SUPPORT == ENABLED)
345 while(
socket->sndUser > 0)
402 TRACE_INFO(
"TCP FIN-WAIT-2 timer elapsed...\r\n");
Date and time management.
void netStartTimer(NetTimer *timer, systime_t interval)
Start timer.
void tcpCheckPersistTimer(Socket *socket)
Check persist timer.
void tcpCheckTimeWaitTimer(Socket *socket)
Check 2MSL timer.
#define TCP_OVERRIDE_TIMEOUT
error_t tcpSendResetSegment(Socket *socket, uint32_t seqNum)
Send a TCP reset segment.
const char_t * formatSystemTime(systime_t time, char_t *str)
Format system time.
#define timeCompare(t1, t2)
void tcpDeleteControlBlock(Socket *socket)
Delete TCB structure.
void tcpCheckOverrideTimer(Socket *socket)
Check override timer.
#define TCP_MAX_PROBE_INTERVAL
Helper functions for TCP.
void tcpChangeState(Socket *socket, TcpState newState)
Update TCP FSM current state.
void netStopTimer(NetTimer *timer)
Stop timer.
@ TCP_CONGEST_STATE_LOSS_RECOVERY
int_t socket(int_t family, int_t type, int_t protocol)
Create a socket that is bound to a specific transport service provider.
error_t tcpRetransmitSegment(Socket *socket)
TCP segment retransmission.
void tcpUpdateEvents(Socket *socket)
Update TCP related events.
Socket socketTable[SOCKET_MAX_COUNT]
void tcpCheckRetransmitTimer(Socket *socket)
Check retransmission timer.
uint32_t systime_t
System time.
void tcpCheckKeepAliveTimer(Socket *socket)
Check TCP keep-alive timer.
#define TRACE_WARNING(...)
TCP (Transmission Control Protocol)
void tcpTick(void)
TCP timer handler.
error_t tcpSendSegment(Socket *socket, uint8_t flags, uint32_t seqNum, uint32_t ackNum, size_t length, bool_t addToQueue)
Send a TCP segment.
bool_t netTimerExpired(NetTimer *timer)
Check whether the timer has expired.
void tcpCheckFinWait2Timer(Socket *socket)
Check FIN-WAIT-2 timer.
systime_t osGetSystemTime(void)
Retrieve system time.