home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / comm / amitcp-3.0ß2.lha / AmiTCP / src / amitcp / netinet / tcp_fsm.h < prev    next >
C/C++ Source or Header  |  1993-08-12  |  4KB  |  102 lines

  1. /*
  2.  * $Id: tcp_fsm.h,v 1.2 1993/03/03 21:20:34 jraja Exp $
  3.  *
  4.  * HISTORY
  5.  * $Log: tcp_fsm.h,v $
  6.  * Revision 1.2  1993/03/03  21:20:34  jraja
  7.  * Moved data definitions to .c files.
  8.  *
  9.  * Revision 1.1  92/11/17  16:30:25  16:30:25  jraja (Jarno Tapio Rajahalme)
  10.  * Initial revision
  11.  * 
  12.  *
  13.  */
  14.  
  15. /*
  16.  * Copyright (c) 1982, 1986 Regents of the University of California.
  17.  * All rights reserved.
  18.  *
  19.  * Redistribution and use in source and binary forms, with or without
  20.  * modification, are permitted provided that the following conditions
  21.  * are met:
  22.  * 1. Redistributions of source code must retain the above copyright
  23.  *    notice, this list of conditions and the following disclaimer.
  24.  * 2. Redistributions in binary form must reproduce the above copyright
  25.  *    notice, this list of conditions and the following disclaimer in the
  26.  *    documentation and/or other materials provided with the distribution.
  27.  * 3. All advertising materials mentioning features or use of this software
  28.  *    must display the following acknowledgement:
  29.  *    This product includes software developed by the University of
  30.  *    California, Berkeley and its contributors.
  31.  * 4. Neither the name of the University nor the names of its contributors
  32.  *    may be used to endorse or promote products derived from this software
  33.  *    without specific prior written permission.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  36.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  38.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  39.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  40.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  41.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  42.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  43.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  44.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  45.  * SUCH DAMAGE.
  46.  *
  47.  *    @(#)tcp_fsm.h    7.4 (Berkeley) 6/28/90
  48.  */
  49.  
  50. #ifndef TCP_FSM_H
  51. #define TCP_FSM_H
  52.  
  53. /*
  54.  * TCP FSM state definitions.
  55.  * Per RFC793, September, 1981.
  56.  */
  57.  
  58. #define    TCP_NSTATES    11
  59.  
  60. #define    TCPS_CLOSED        0    /* closed */
  61. #define    TCPS_LISTEN        1    /* listening for connection */
  62. #define    TCPS_SYN_SENT        2    /* active, have sent syn */
  63. #define    TCPS_SYN_RECEIVED    3    /* have send and received syn */
  64. /* states < TCPS_ESTABLISHED are those where connections not established */
  65. #define    TCPS_ESTABLISHED    4    /* established */
  66. #define    TCPS_CLOSE_WAIT        5    /* rcvd fin, waiting for close */
  67. /* states > TCPS_CLOSE_WAIT are those where user has closed */
  68. #define    TCPS_FIN_WAIT_1        6    /* have closed, sent fin */
  69. #define    TCPS_CLOSING        7    /* closed xchd FIN; await FIN ACK */
  70. #define    TCPS_LAST_ACK        8    /* had fin and close; await FIN ACK */
  71. /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
  72. #define    TCPS_FIN_WAIT_2        9    /* have closed, fin is acked */
  73. #define    TCPS_TIME_WAIT        10    /* in 2*msl quiet wait after close */
  74.  
  75. #define    TCPS_HAVERCVDSYN(s)    ((s) >= TCPS_SYN_RECEIVED)
  76. #define    TCPS_HAVERCVDFIN(s)    ((s) >= TCPS_TIME_WAIT)
  77.  
  78. #ifdef    TCPOUTFLAGS
  79. /*
  80.  * Flags used when sending segments in tcp_output.
  81.  * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
  82.  * determined by state, with the proviso that TH_FIN is sent only
  83.  * if all data queued for output is included in the segment.
  84.  *
  85.  * definition moved to tcp_output.c
  86.  */
  87. extern u_char    tcp_outflags[TCP_NSTATES];
  88. #endif
  89.  
  90. /*
  91.  * tcp_acounts definition moved to tcp_usrreq.c
  92.  */
  93. #ifdef KPROF
  94. extern int    tcp_acounts[TCP_NSTATES][PRU_NREQ];
  95. #endif
  96.  
  97. #ifdef    TCPSTATES
  98. extern char *tcpstates[];    /* definition moved to tcp_debug.c */
  99. #endif
  100.  
  101. #endif /* !TCP_FSM_H */
  102.