Nut/OS  4.10.3
API Reference
tcp_fsm.h File Reference

TCP state machine definitions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define TCP_NSTATES   11
 Total number of possible states.
#define TCPS_CLOSED   0
 closed
#define TCPS_LISTEN   1
 listening for connection
#define TCPS_SYN_SENT   2
 active, have sent syn
#define TCPS_SYN_RECEIVED   3
 have sent and received syn
#define TCPS_ESTABLISHED   4
 established
#define TCPS_CLOSE_WAIT   5
 rcvd fin, waiting for close
#define TCPS_FIN_WAIT_1   6
 have closed, sent fin
#define TCPS_CLOSING   7
 closed xchd FIN; await FIN ACK
#define TCPS_LAST_ACK   8
 had fin and close; await FIN ACK
#define TCPS_FIN_WAIT_2   9
 have closed, fin is acked
#define TCPS_TIME_WAIT   10
 in 2*msl quiet wait after close

Functions

void NutTcpStateMachine (NETBUF *nb)
 Process incoming TCP segments.
int NutTcpInitStateMachine (void)
 Start TCP state machine.
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.

Detailed Description

TCP state machine definitions.

Definition in file tcp_fsm.h.


Define Documentation

#define TCP_NSTATES   11

Total number of possible states.

Definition at line 89 of file tcp_fsm.h.

#define TCPS_LISTEN   1

listening for connection

Examples:
httpd/httpserv.c.

Definition at line 96 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpConnect(), NutTcpFindSocket(), NutTcpSm(), NutTcpStateCloseEvent(), and NutTcpStatePassiveOpenEvent().

#define TCPS_SYN_SENT   2

active, have sent syn

Examples:
httpd/httpserv.c.

Definition at line 97 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpStateActiveOpenEvent(), and NutTcpStateCloseEvent().

#define TCPS_SYN_RECEIVED   3

have sent and received syn

Examples:
httpd/httpserv.c.

Definition at line 98 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpSm(), and NutTcpStateCloseEvent().

#define TCPS_ESTABLISHED   4
#define TCPS_CLOSE_WAIT   5

rcvd fin, waiting for close

Examples:
httpd/httpserv.c.

Definition at line 100 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpReceive(), NutTcpStateActiveOpenEvent(), and NutTcpStateCloseEvent().

#define TCPS_FIN_WAIT_1   6

have closed, sent fin

Examples:
httpd/httpserv.c.

Definition at line 101 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpAbortSocket(), and NutTcpStateCloseEvent().

#define TCPS_CLOSING   7

closed xchd FIN; await FIN ACK

Examples:
httpd/httpserv.c.

Definition at line 102 of file tcp_fsm.h.

Referenced by NutDumpSockState(), and NutTcpStateCloseEvent().

#define TCPS_LAST_ACK   8

had fin and close; await FIN ACK

Examples:
httpd/httpserv.c.

Definition at line 103 of file tcp_fsm.h.

Referenced by NutDumpSockState(), and NutTcpStateCloseEvent().

#define TCPS_FIN_WAIT_2   9

have closed, fin is acked

Examples:
httpd/httpserv.c.

Definition at line 104 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpSm(), and NutTcpStateCloseEvent().

#define TCPS_TIME_WAIT   10

in 2*msl quiet wait after close

Examples:
httpd/httpserv.c.

Definition at line 105 of file tcp_fsm.h.

Referenced by NutDumpSockState(), NutTcpAbortSocket(), NutTcpSm(), and NutTcpStateCloseEvent().