Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

inc/netinet/tcp.h

Go to the documentation of this file.
00001 00005 /* $NetBSD: tcp.h,v 1.8 1995/04/17 05:32:58 cgd Exp $ */ 00006 00007 /* 00008 * Copyright (c) 1982, 1986, 1993 00009 * The Regents of the University of California. All rights reserved. 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 1. Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright 00017 * notice, this list of conditions and the following disclaimer in the 00018 * documentation and/or other materials provided with the distribution. 00019 * 3. All advertising materials mentioning features or use of this software 00020 * must display the following acknowledgement: 00021 * This product includes software developed by the University of 00022 * California, Berkeley and its contributors. 00023 * 4. Neither the name of the University nor the names of its contributors 00024 * may be used to endorse or promote products derived from this software 00025 * without specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00028 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00031 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00032 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00033 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00034 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00035 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00036 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00037 * SUCH DAMAGE. 00038 * 00039 * @(#)tcp.h 8.1 (Berkeley) 6/10/93 00040 */ 00041 00042 #ifndef __NETINET_TCP_H 00043 #define __NETINET_TCP_H 00044 00045 typedef u_long tcp_seq; 00046 typedef u_long tcp_cc; /* connection count per rfc1644 */ 00047 00048 #include <sys/pack_on.h> 00049 00050 00051 /* 00052 * TCP header. 00053 * Per RFC 793, September, 1981. 00054 */ 00055 struct tcphdr { 00056 u_short th_sport; /* source port */ 00057 u_short th_dport; /* destination port */ 00058 tcp_seq th_seq; /* sequence number */ 00059 tcp_seq th_ack; /* acknowledgement number */ 00060 u_char th_x2:4; /* (unused) */ 00061 u_char th_off:4; /* data offset */ 00062 u_char th_flags; 00063 #define TH_FIN 0x01 00064 #define TH_SYN 0x02 00065 #define TH_RST 0x04 00066 #define TH_PUSH 0x08 00067 #define TH_ACK 0x10 00068 #define TH_URG 0x20 00069 #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) 00070 00071 u_short th_win; /* window */ 00072 u_short th_sum; /* checksum */ 00073 u_short th_urp; /* urgent pointer */ 00074 }; 00075 00076 #include <sys/pack_off.h> 00077 00078 #define TCPOPT_EOL 0 00079 #define TCPOPT_NOP 1 00080 #define TCPOPT_MAXSEG 2 00081 #define TCPOLEN_MAXSEG 4 00082 #define TCPOPT_WINDOW 3 00083 #define TCPOLEN_WINDOW 3 00084 #define TCPOPT_SACK_PERMITTED 4 00085 #define TCPOLEN_SACK_PERMITTED 2 00086 #define TCPOPT_SACK 5 00087 #define TCPOPT_TIMESTAMP 8 00088 #define TCPOLEN_TIMESTAMP 10 00089 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ 00090 00091 #define TCPOPT_TSTAMP_HDR \ 00092 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) 00093 00094 #define TCPOPT_CC 11 /* CC options: RFC-1644 */ 00095 #define TCPOPT_CCNEW 12 00096 #define TCPOPT_CCECHO 13 00097 #define TCPOLEN_CC 6 00098 #define TCPOLEN_CC_APPA (TCPOLEN_CC+2) 00099 #define TCPOPT_CC_HDR(ccopt) \ 00100 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) 00101 00102 #define TCPOPT_SIGNATURE 19 00103 #define TCP_SIGLEN 16 00104 00105 /* 00106 * Default maximum segment size for TCP. 00107 * With an IP MSS of 576, this is 536, 00108 * but 512 is probably more convenient. 00109 * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). 00110 */ 00111 #define TCP_MSS 512 00112 00113 #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ 00114 #define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ 00115 00116 #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ 00117 00118 #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ 00119 #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) 00120 /* max space left for options */ 00121 00122 /* 00123 * User-settable options (used with setsockopt). 00124 */ 00125 #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ 00126 #define TCP_MAXSEG 0x02 /* set maximum segment size */ 00127 #ifdef TCP_AUTO 00128 #define TCP_AUTO_OP 0x03 /* 0 to disable autotuning, 1 to reenable */ 00129 #endif 00130 #define TCP_NOPUSH 0x04 /* don't push last block of write */ 00131 #define TCP_NOOPT 0x08 /* don't use TCP options */ 00132 00133 /* For PSC modifications */ 00134 #if defined(TCP_AUTO) || defined(TCP_SACK) || defined(TCP_FACK) 00135 #define PSC_VERSION "0.8" 00136 #endif 00137 00138 #endif

Generated on Wed Aug 4 08:55:46 2010 for Watt-32 tcp/ip by doxygen 1.3.8