# 2.11BSD#431 - /usr/src/sys/netinet/tcp_fsm.h

##### Variables

    tcp_acounts       X
    tcpstates         X

##### Macros

    TCPS_CLOSED       X
    TCPS_CLOSE_WAIT   X
    TCPS_CLOSING      X
    TCPS_ESTABLISHED  X
    TCPS_FIN_WAIT_1   X
    TCPS_FIN_WAIT_2   X
    TCPS_HAVERCVDFIN  X
    TCPS_HAVERCVDSYN  X
    TCPS_LAST_ACK     X
    TCPS_LISTEN       X
    TCPS_SYN_RECEIVED X
    TCPS_SYN_SENT     X
    TCPS_TIME_WAIT    X
    TCP_NSTATES       X

       1: /*
       2:  * Copyright (c) 1982, 1986 Regents of the University of California.
       3:  * All rights reserved.
       4:  *
       5:  * Redistribution and use in source and binary forms are permitted
       6:  * provided that this notice is preserved and that due credit is given
       7:  * to the University of California at Berkeley. The name of the University
       8:  * may not be used to endorse or promote products derived from this
       9:  * software without specific prior written permission. This software
      10:  * is provided ``as is'' without express or implied warranty.
      11:  *
      12:  *	@(#)tcp_fsm.h	7.2 (Berkeley) 12/7/87
      13:  */
      14:
      15: /*
      16:  * TCP FSM state definitions.
      17:  * Per RFC793, September, 1981.
      18:  */
      19:
      20: #define TCP_NSTATES 11
      21:
      22: #define TCPS_CLOSED     0   /* closed */
      23: #define TCPS_LISTEN     1   /* listening for connection */
      24: #define TCPS_SYN_SENT       2   /* active, have sent syn */
      25: #define TCPS_SYN_RECEIVED   3   /* have send and received syn */
      26: /* states < TCPS_ESTABLISHED are those where connections not established */
      27: #define TCPS_ESTABLISHED    4   /* established */
      28: #define TCPS_CLOSE_WAIT     5   /* rcvd fin, waiting for close */
      29: /* states > TCPS_CLOSE_WAIT are those where user has closed */
      30: #define TCPS_FIN_WAIT_1     6   /* have closed, sent fin */
      31: #define TCPS_CLOSING        7   /* closed xchd FIN; await FIN ACK */
      32: #define TCPS_LAST_ACK       8   /* had fin and close; await FIN ACK */
      33: /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
      34: #define TCPS_FIN_WAIT_2     9   /* have closed, fin is acked */
      35: #define TCPS_TIME_WAIT      10  /* in 2*msl quiet wait after close */
      36:
      37: #define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
      38: #define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
      39:
      40: #ifdef  TCPOUTFLAGS
      41: /*
      42:  * Flags used when sending segments in tcp_output.
      43:  * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
      44:  * determined by state, with the proviso that TH_FIN is sent only
      45:  * if all data queued for output is included in the segment.
      46:  */
      47: u_char  tcp_outflags[TCP_NSTATES] = {
      48:     TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
      49:     TH_ACK, TH_ACK,
      50:     TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
      51: };
      52: #endif
      53:
      54: #ifdef KPROF
      55: int tcp_acounts[TCP_NSTATES][PRU_NREQ];
      56: #endif
      57:
      58: #ifdef  TCPSTATES
      59: char *tcpstates[] = {
      60:     "CLOSED",   "LISTEN",   "SYN_SENT", "SYN_RCVD",
      61:     "ESTABLISHED",  "CLOSE_WAIT",   "FIN_WAIT_1",   "CLOSING",
      62:     "LAST_ACK", "FIN_WAIT_2",   "TIME_WAIT",
      63: };
      64: #endif

#### Defined variables

tcp_acounts defined in line 55; used 1 times

- in /usr/src/sys/netinet/tcp_usrreq.c line 90

tcpstates defined in line 59; used 14 times

- in /usr/src/new/crash/inet.c line 162
- in /usr/src/sys/netinet/tcp_debug.c line 83, 127
- in /usr/src/sys/netns/spp_debug.c line 58, 81, 138
- in /usr/src/ucb/PORT/systat/netstat.c line 306
- in /usr/src/ucb/netstat/inet.c line 136
- in /usr/src/ucb/netstat/ns.c line 128-132(2)
- in /usr/src/usr.sbin/trpt/trpt.c line 246, 294
- in /usr/src/usr.sbin/trsp/trsp.c line 256, 303

#### Defined macros

TCPS_CLOSED defined in line 22; used 6 times

- in /usr/src/sys/netinet/tcp_input.c line 298, 655
- in /usr/src/sys/netinet/tcp_subr.c line 209
- in /usr/src/sys/netinet/tcp_usrreq.c line 410, 462
- in /usr/src/sys/netns/spp_usrreq.c line 1525

TCPS_CLOSE_WAIT defined in line 28; used 3 times

- in /usr/src/sys/netinet/tcp_input.c line 576, 1073
- in /usr/src/sys/netinet/tcp_timer.c line 247

TCPS_CLOSING defined in line 31; used 1 times

- in /usr/src/sys/netinet/tcp_input.c line 1081

TCPS_ESTABLISHED defined in line 27; used 10 times

- in /usr/src/sys/netinet/tcp_input.c line 59, 467, 698
- in /usr/src/sys/netinet/tcp_timer.c line 244
- in /usr/src/sys/netinet/tcp_usrreq.c line 428
- in /usr/src/sys/netns/spp_usrreq.c line 192, 219, 825, 985, 1691

TCPS_FIN_WAIT_1 defined in line 30; used 1 times

- in /usr/src/sys/netinet/tcp_usrreq.c line 468

TCPS_FIN_WAIT_2 defined in line 34; used 2 times

- in /usr/src/sys/netinet/tcp_input.c line 902
- in /usr/src/sys/netinet/tcp_usrreq.c line 475

TCPS_HAVERCVDFIN defined in line 38; used 3 times

- in /usr/src/sys/netinet/tcp_input.c line 970, 1036, 1060

TCPS_HAVERCVDSYN defined in line 37; used 3 times

- in /usr/src/sys/netinet/tcp_input.c line 149
- in /usr/src/sys/netinet/tcp_subr.c line 208
- in /usr/src/sys/netns/spp_usrreq.c line 1523

TCPS_LAST_ACK defined in line 32; used 1 times

- in /usr/src/sys/netinet/tcp_usrreq.c line 472

TCPS_LISTEN defined in line 23; used 8 times

- in /usr/src/sys/netinet/tcp_input.c line 328, 342
- in /usr/src/sys/netinet/tcp_usrreq.c line 122, 144
- in /usr/src/sys/netns/spp_usrreq.c line 120, 1235, 1260, 1274

TCPS_SYN_RECEIVED defined in line 25; used 5 times

- in line 37
- in /usr/src/sys/netinet/tcp_input.c line 154, 424, 483
- in /usr/src/sys/netns/spp_usrreq.c line 170

TCPS_SYN_SENT defined in line 24; used 2 times

- in /usr/src/sys/netinet/tcp_usrreq.c line 171
- in /usr/src/sys/netns/spp_usrreq.c line 1294

TCPS_TIME_WAIT defined in line 35; used 6 times

- in line 38
- in /usr/src/sys/netinet/tcp_input.c line 598, 914, 1090
- in /usr/src/sys/netinet/tcp_subr.c line 268
- in /usr/src/sys/netinet/tcp_timer.c line 148

TCP_NSTATES defined in line 20; used 8 times

- in line 47, 55
- in /usr/src/new/crash/inet.c line 159
- in /usr/src/sys/netns/spp_debug.c line 78
- in /usr/src/ucb/PORT/systat/netstat.c line 301
- in /usr/src/ucb/netstat/inet.c line 133
- in /usr/src/ucb/netstat/ns.c line 129
- in /usr/src/usr.sbin/trsp/trsp.c line 252

#### Usage of this include

tcp_fsm.h used 15 times

- in /usr/src/new/crash/dispnet.c line 35
- in /usr/src/new/crash/inet.c line 29
- in /usr/src/sys/netinet/tcp_debug.c line 40
- in /usr/src/sys/netinet/tcp_input.c line 33
- in /usr/src/sys/netinet/tcp_output.c line 33
- in /usr/src/sys/netinet/tcp_subr.c line 34
- in /usr/src/sys/netinet/tcp_timer.c line 33
- in /usr/src/sys/netinet/tcp_usrreq.c line 34
- in /usr/src/sys/netns/spp_debug.c line 26
- in /usr/src/sys/netns/spp_usrreq.c line 27
- in /usr/src/ucb/PORT/systat/netstat.c line 32
- in /usr/src/ucb/netstat/inet.c line 40
- in /usr/src/ucb/netstat/ns.c line 30
- in /usr/src/usr.sbin/trpt/trpt.c line 35
- in /usr/src/usr.sbin/trsp/trsp.c line 28

Last modified: 1988-04-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1397 |