Collaboration diagram for TCP:
|
TCP provides reliable, in-sequence delivery of a full-duplex stream of octets. It is used by applications which need a reliable, connection-oriented data transport.
Applications should call the TCP Socket API when using this protocol.
Defines | |
| #define | min(a, b) ((a>b)?b:a) |
| #define | max(a, b) ((a>b)?a:b) |
Functions | |
| void | NutTcpInput (NETBUF *nb) |
| Process incoming TCP segments from IP layer. | |
| int | NutTcpStatePassiveOpenEvent (TCPSOCKET *sock) |
| Initiated by the application. | |
| int | NutTcpStateActiveOpenEvent (TCPSOCKET *sock) |
| Initiated by the application. | |
| int | NutTcpStateCloseEvent (TCPSOCKET *sock) |
| Socket close by application. | |
| int | NutTcpStateWindowEvent (TCPSOCKET *sock) |
| Initiated by the application. | |
| int | NutTcpStateRetranTimeout (TCPSOCKET *sock) |
| Retransmit a segment after ACK timeout. | |
| void | NutTcpSm (void *arg) |
| TCP state machine thread. | |
| void | NutTcpStateMachine (NETBUF *nb) |
| Process incoming TCP segments. | |
| int | NutTcpInitStateMachine (void) |
| Start TCP state machine. | |
| int | NutTcpAbortSocket (TCPSOCKET *sock, u_short last_error) |
| Closes socket with error. | |
| int | IsInLimits (u_long x, u_long low, u_long high) |
| Sequence number comparisons. | |
| void | NutTcpCalcRtt (TCPSOCKET *sock) |
Variables | |
| HANDLE | tcp_in_rdy |
| NETBUF *volatile | tcp_in_nbq |
|
|
Process incoming TCP segments from IP layer.
|
|
|
Initiated by the application.
|
|
|
Initiated by the application. The caller must make sure, that the socket is in closed state.
|
|
|
Socket close by application. If socket is in state SYN_RECEIVED or ESTABLISHED, it is changed to FINWAIT1. No further data sending is accepted. Receiving is still allowed.
|
|
|
Initiated by the application.
|
|
|
Retransmit a segment after ACK timeout. This function is called by the TCP timer.
|
|
|
TCP state machine thread. The TCP state machine serves two purposes: It processes incoming TCP segments and handles TCP timers. |
|
|
Process incoming TCP segments. All incoming TCP packets are passed to this routine. They will be added to a global queue and processed by the TCP state machine, which is running on a separate thread.
|
|
|
Start TCP state machine. The socket interface will automatically call this routine as soon as the first socket is created.
|
|
||||||||||||
|
Closes socket with error. Aborts any socket activity and sets last error.
|
|
||||||||||||||||
|
Sequence number comparisons. Return true if x is between low and high inclusive, false otherwise |