OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [tcpip/] [current/] [include/] [netinet/] [tcp_fsm.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      include/netinet_tcp_fsm.h
4
//
5
//      
6
//
7
//==========================================================================
8
// ####BSDALTCOPYRIGHTBEGIN####                                             
9
// -------------------------------------------                              
10
// Portions of this software may have been derived from OpenBSD             
11
// or other sources, and if so are covered by the appropriate copyright     
12
// and license included herein.                                             
13
// -------------------------------------------                              
14
// ####BSDALTCOPYRIGHTEND####                                               
15
//==========================================================================
16
//#####DESCRIPTIONBEGIN####
17
//
18
// Author(s):    gthomas
19
// Contributors: gthomas
20
// Date:         2000-01-10
21
// Purpose:      
22
// Description:  
23
//              
24
//
25
//####DESCRIPTIONEND####
26
//
27
//==========================================================================
28
 
29
 
30
/*      $OpenBSD: tcp_fsm.h,v 1.4 1997/11/08 19:54:12 deraadt Exp $     */
31
/*      $NetBSD: tcp_fsm.h,v 1.6 1994/10/14 16:01:48 mycroft Exp $      */
32
 
33
/*
34
 * Copyright (c) 1982, 1986, 1993
35
 *      The Regents of the University of California.  All rights reserved.
36
 *
37
 * Redistribution and use in source and binary forms, with or without
38
 * modification, are permitted provided that the following conditions
39
 * are met:
40
 * 1. Redistributions of source code must retain the above copyright
41
 *    notice, this list of conditions and the following disclaimer.
42
 * 2. Redistributions in binary form must reproduce the above copyright
43
 *    notice, this list of conditions and the following disclaimer in the
44
 *    documentation and/or other materials provided with the distribution.
45
 * 3. All advertising materials mentioning features or use of this software
46
 *    must display the following acknowledgement:
47
 *      This product includes software developed by the University of
48
 *      California, Berkeley and its contributors.
49
 * 4. Neither the name of the University nor the names of its contributors
50
 *    may be used to endorse or promote products derived from this software
51
 *    without specific prior written permission.
52
 *
53
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63
 * SUCH DAMAGE.
64
 *
65
 *      @(#)tcp_fsm.h   8.1 (Berkeley) 6/10/93
66
 */
67
 
68
#ifndef _NETINET_TCP_FSM_H_
69
#define _NETINET_TCP_FSM_H_
70
 
71
/*
72
 * TCP FSM state definitions.
73
 * Per RFC793, September, 1981.
74
 */
75
 
76
#define TCP_NSTATES     11
77
 
78
#define TCPS_CLOSED             0        /* closed */
79
#define TCPS_LISTEN             1       /* listening for connection */
80
#define TCPS_SYN_SENT           2       /* active, have sent syn */
81
#define TCPS_SYN_RECEIVED       3       /* have sent and received syn */
82
/* states < TCPS_ESTABLISHED are those where connections not established */
83
#define TCPS_ESTABLISHED        4       /* established */
84
#define TCPS_CLOSE_WAIT         5       /* rcvd fin, waiting for close */
85
/* states > TCPS_CLOSE_WAIT are those where user has closed */
86
#define TCPS_FIN_WAIT_1         6       /* have closed, sent fin */
87
#define TCPS_CLOSING            7       /* closed xchd FIN; await ACK */
88
#define TCPS_LAST_ACK           8       /* had fin and close; await FIN ACK */
89
/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
90
#define TCPS_FIN_WAIT_2         9       /* have closed, fin is acked */
91
#define TCPS_TIME_WAIT          10      /* in 2*msl quiet wait after close */
92
 
93
#define TCPS_HAVERCVDSYN(s)     ((s) >= TCPS_SYN_RECEIVED)
94
#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
95
#define TCPS_HAVERCVDFIN(s)     ((s) >= TCPS_TIME_WAIT)
96
 
97
#ifdef  TCPOUTFLAGS
98
/*
99
 * Flags used when sending segments in tcp_output.
100
 * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
101
 * determined by state, with the proviso that TH_FIN is sent only
102
 * if all data queued for output is included in the segment.
103
 */
104
u_char  tcp_outflags[TCP_NSTATES] = {
105
    TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
106
    TH_ACK, TH_ACK,
107
    TH_FIN|TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
108
};
109
#endif
110
 
111
#ifdef KPROF
112
int     tcp_acounts[TCP_NSTATES][PRU_NREQ];
113
#endif
114
 
115
#ifdef  TCPSTATES
116
char *tcpstates[] = {
117
        "CLOSED",       "LISTEN",       "SYN_SENT",     "SYN_RCVD",
118
        "ESTABLISHED",  "CLOSE_WAIT",   "FIN_WAIT_1",   "CLOSING",
119
        "LAST_ACK",     "FIN_WAIT_2",   "TIME_WAIT",
120
};
121
#endif
122
 
123
#endif // _NETINET_TCP_FSM_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.