tcp_fsm.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1997-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* TCP FSM state definitions.
* Per RFC793, September, 1981.
*/
#ifndef _NETINET_TCP_FSM_H
#define _NETINET_TCP_FSM_H
#pragma ident "%Z%%M% %I% %E% SMI"
/* tcp_fsm.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86 */
#ifdef __cplusplus
extern "C" {
#endif
#define TCP_NSTATES 11
#define TCPS_CLOSED 0 /* closed */
/* states < TCPS_ESTABLISHED are those where connections not established */
/* states > TCPS_CLOSE_WAIT are those where user has closed */
/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
#ifdef TCPOUTFLAGS
/*
* Flags used when sending segments in tcp_output.
* Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
* determined by state, with the proviso that TH_FIN is sent only
* if all data queued for output is included in the segment.
*/
};
#endif
#ifdef KPROF
#endif
#ifdef TCPSTATES
char *tcpstates[] = {
"CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
"ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
"LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
};
#endif
#ifdef __cplusplus
}
#endif
#endif /* _NETINET_TCP_FSM_H */