43error_t tcpSendSegment(Socket *socket, uint8_t flags, uint32_t seqNum,
44 uint32_t ackNum,
size_t length, bool_t addToQueue);
46error_t tcpSendResetSegment(Socket *socket, uint32_t seqNum);
48error_t tcpRejectSegment(NetInterface *interface,
49 const IpPseudoHeader *pseudoHeader,
const TcpHeader *segment,
size_t length);
51error_t tcpAddOption(TcpHeader *segment, uint8_t kind,
const void *value,
54const TcpOption *tcpGetOption(
const TcpHeader *segment, uint8_t kind);
56uint32_t tcpGenerateInitialSeqNum(
const IpAddr *localIpAddr,
57 uint16_t localPort,
const IpAddr *remoteIpAddr, uint16_t remotePort);
59error_t tcpCheckSeqNum(Socket *socket,
const TcpHeader *segment,
size_t length);
60error_t tcpCheckSyn(Socket *socket,
const TcpHeader *segment,
size_t length);
61error_t tcpCheckAck(Socket *socket,
const TcpHeader *segment,
size_t length);
63bool_t tcpIsDuplicateSyn(Socket *socket,
const IpPseudoHeader *pseudoHeader,
64 const TcpHeader *segment);
66bool_t tcpIsDuplicateAck(Socket *socket,
const TcpHeader *segment,
69void tcpFastRetransmit(Socket *socket);
70void tcpFastRecovery(Socket *socket,
const TcpHeader *segment, uint_t n);
71void tcpFastLossRecovery(Socket *socket,
const TcpHeader *segment);
73void tcpProcessSegmentData(Socket *socket,
const TcpHeader *segment,
74 const NetBuffer *buffer,
size_t offset,
size_t length);
76void tcpDeleteControlBlock(Socket *socket);
78void tcpUpdateRetransmitQueue(Socket *socket);
79void tcpFlushRetransmitQueue(Socket *socket);
81void tcpFlushSynQueue(Socket *socket);
83void tcpUpdateSackBlocks(Socket *socket, uint32_t *leftEdge, uint32_t *rightEdge);
84void tcpUpdateSendWindow(Socket *socket,
const TcpHeader *segment);
85void tcpUpdateReceiveWindow(Socket *socket);
87bool_t tcpComputeRto(Socket *socket);
88error_t tcpRetransmitSegment(Socket *socket);
89error_t tcpNagleAlgo(Socket *socket, uint_t flags);
91void tcpChangeState(Socket *socket,
TcpState newState);
93void tcpUpdateEvents(Socket *socket);
94uint_t tcpWaitForEvents(Socket *socket, uint_t eventMask,
systime_t timeout);
96void tcpWriteTxBuffer(Socket *socket, uint32_t seqNum,
97 const uint8_t *data,
size_t length);
99error_t tcpReadTxBuffer(Socket *socket, uint32_t seqNum,
102void tcpWriteRxBuffer(Socket *socket, uint32_t seqNum,
103 const NetBuffer *data,
size_t dataOffset,
size_t length);
105void tcpReadRxBuffer(Socket *socket, uint32_t seqNum, uint8_t *data,
108void tcpDumpHeader(
const TcpHeader *segment,
size_t length, uint32_t iss,
error_t
Error codes.
Definition error.h:43
uint32_t systime_t
System time.
Definition os_port_none.h:90
IP network address.
Definition ip.h:72
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
TCP (Transmission Control Protocol)
TcpState
TCP FSM states.
Definition tcp.h:267