1 /* tcp_fsm.h 4.6 81/11/18 */ 2 3 /* 4 * TCP FSM state definitions. 5 * 6 * This TCP machine has two more states than suggested in RFC 793, 7 * the extra states being L_SYN_RCVD and RCV_WAIT 8 * 9 * EXPLAIN THE EXTRA STATES. 10 */ 11 12 /* 13 * States 14 */ 15 #define TCP_NSTATES 14 16 17 #define EFAILEC -1 /* new state for failure, internally */ 18 #define SAME 0 /* no state change, internally */ 19 #define LISTEN 1 /* listening for connection */ 20 #define SYN_SENT 2 /* active, have sent syn */ 21 #define SYN_RCVD 3 22 #define L_SYN_RCVD 4 23 #define ESTAB 5 /* established */ 24 #define FIN_W1 6 /* have closed and sent fin */ 25 #define FIN_W2 7 /* have closed and rcvd ack of fin */ 26 #define TIME_WAIT 8 /* in 2*msl quiet wait after close */ 27 #define CLOSE_WAIT 9 /* rcvd fin, waiting for close */ 28 #define CLOSING 10 /* closed xchd FIN; await FIN ACK */ 29 #define LAST_ACK 11 /* had fin and close; await FIN ACK */ 30 #define RCV_WAIT 12 /* waiting for user to drain data */ 31 #define CLOSED 13 /* closed */ 32 33 #ifdef KPROF 34 int tcp_acounts[TCP_NSTATES][PRU_NREQ]; 35 #endif 36 37 #ifdef TCPSTATES 38 char *tcpstates[] = { 39 "SAME", "LISTEN", "SYN_SENT", "SYN_RCVD", 40 "L_SYN_RCVD", "ESTAB", "FIN_W1", "FIN_W2", 41 "TIME_WAIT", "CLOSE_WAIT", "CLOSING", "LAST_ACK", 42 "RCV_WAIT", "CLOSED" 43 }; 44 char *tcptimers[] = { "INIT", "REXMT", "REXMTTL", "PERSIST", "FINACK" }; 45 #endif 46