tcp.h revision a68b0110cd3338c318b355c0ac5ac72f92e510b7
2362N/A * Copyright (c) 1982, 1986, 1993 0N/A * The Regents of the University of California. All rights reserved. 0N/A * Redistribution and use in source and binary forms, with or without 0N/A * modification, are permitted provided that the following conditions 0N/A * 1. Redistributions of source code must retain the above copyright 2362N/A * notice, this list of conditions and the following disclaimer. 0N/A * 2. Redistributions in binary form must reproduce the above copyright 0N/A * notice, this list of conditions and the following disclaimer in the 0N/A * documentation and/or other materials provided with the distribution. 0N/A * 3. All advertising materials mentioning features or use of this software 0N/A * must display the following acknowledgement: 0N/A * This product includes software developed by the University of 0N/A * California, Berkeley and its contributors. 0N/A * 4. Neither the name of the University nor the names of its contributors 0N/A * may be used to endorse or promote products derived from this software 0N/A * without specific prior written permission. 2362N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2362N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2362N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 0N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 0N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 0N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 0N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 0N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 0N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 0N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 0N/A * tcp.h,v 1.3 1994/08/21 05:27:34 paul Exp 0N/A#
define PR_SLOWHZ 2 /* 2 slow timeouts per second (approx) */ 0N/A#
define PR_FASTHZ 5 /* 5 fast timeouts per second (not important) */ 0N/A * Per RFC 793, September, 1981. 0N/A * bitfield types must be u_int8_t for MSVC, otherwise it will use a full dword (for u_int) 0N/A * Default maximum segment size for TCP. 0N/A * With an IP MSS of 576, this is 536, 0N/A * but 512 is probably more convenient. 0N/A * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). 0N/A * We make this 1460 because we only care about Ethernet in the qemu context. 0N/A#
define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ 0N/A * User-settable options (used with setsockopt). 0N/A * We don't use the system headers on unix because we have conflicting 0N/A * local structures. We can't avoid the system definitions on Windows, 0N/A * so we undefine them. 0N/A/* #define TCP_MAXSEG 0x02 */ /* set maximum segment size */ 0N/A * TCP FSM state definitions. 0N/A * Per RFC793, September, 1981. /* 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 */ * TCP sequence numbers are 32 bit integers operated * on with modular arithmetic. These macros can be * used to compare such integers. #
define SEQ_LT(a,b) ((
int)((a)-(b)) < 0)
#
define SEQ_LEQ(a,b) ((
int)((a)-(b)) <= 0)
#
define SEQ_GT(a,b) ((
int)((a)-(b)) > 0)
#
define SEQ_GEQ(a,b) ((
int)((a)-(b)) >= 0)
* Macros to initialize tcp sequence numbers for * send and receive from initial send and receive #
define TCP_ISSINCR (
125*
1024)
/* increment for tcp_iss each second */