home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / netinet / h / tcp_fsm < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.6 KB  |  76 lines

  1. /*
  2.  * $Header: /ax/networking:include/netinet/tcp_fsm.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/netinet/tcp_fsm.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    tcp_fsm.h,v $
  8.  * Revision 1.1  95/01/11  10:17:02  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:27:29  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)tcp_fsm.h        1.1 87/07/01 3.2/4.3NFSSRC */
  16. /*
  17.  * Copyright (c) 1982, 1986 Regents of the University of California.
  18.  * All rights reserved.  The Berkeley software License Agreement
  19.  * specifies the terms and conditions for redistribution.
  20.  *
  21.  *      @(#)tcp_fsm.h   7.1 (Berkeley) 6/5/86
  22.  */
  23.  
  24. /*
  25.  * TCP FSM state definitions.
  26.  * Per RFC793, September, 1981.
  27.  */
  28.  
  29. #define TCP_NSTATES     11
  30.  
  31. #define TCPS_CLOSED             0       /* closed */
  32. #define TCPS_LISTEN             1       /* listening for connection */
  33. #define TCPS_SYN_SENT           2       /* active, have sent syn */
  34. #define TCPS_SYN_RECEIVED       3       /* have send and received syn */
  35. /* states < TCPS_ESTABLISHED are those where connections not established */
  36. #define TCPS_ESTABLISHED        4       /* established */
  37. #define TCPS_CLOSE_WAIT         5       /* rcvd fin, waiting for close */
  38. /* states > TCPS_CLOSE_WAIT are those where user has closed */
  39. #define TCPS_FIN_WAIT_1         6       /* have closed, sent fin */
  40. #define TCPS_CLOSING            7       /* closed xchd FIN; await FIN ACK */
  41. #define TCPS_LAST_ACK           8       /* had fin and close; await FIN ACK */
  42. /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
  43. #define TCPS_FIN_WAIT_2         9       /* have closed, fin is acked */
  44. #define TCPS_TIME_WAIT          10      /* in 2*msl quiet wait after close */
  45.  
  46. #define TCPS_HAVERCVDSYN(s)     ((s) >= TCPS_SYN_RECEIVED)
  47. #define TCPS_HAVERCVDFIN(s)     ((s) >= TCPS_TIME_WAIT)
  48.  
  49. #ifdef  TCPOUTFLAGS
  50. /*
  51.  * Flags used when sending segments in tcp_output.
  52.  * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
  53.  * determined by state, with the proviso that TH_FIN is sent only
  54.  * if all data queued for output is included in the segment.
  55.  */
  56. u_char  tcp_outflags[TCP_NSTATES] = {
  57.     TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
  58.     TH_ACK, TH_ACK,
  59.     TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
  60. };
  61. #endif
  62.  
  63. #ifdef KPROF
  64. int     tcp_acounts[TCP_NSTATES][PRU_NREQ];
  65. #endif
  66.  
  67. #ifdef  TCPSTATES
  68. char *tcpstates[] = {
  69.         "CLOSED",       "LISTEN",       "SYN_SENT",     "SYN_RCVD",
  70.         "ESTABLISHED",  "CLOSE_WAIT",   "FIN_WAIT_1",   "CLOSING",
  71.         "LAST_ACK",     "FIN_WAIT_2",   "TIME_WAIT",
  72. };
  73. #endif
  74.  
  75. /* EOF tcp_fsm.h */
  76.