#ifndef __TCP_LOADED #define __TCP_LOADED /**************************************************************************** ** ** - TCP descriptions ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** ** ** Copyright (c) 1982 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** ** @(#)tcp.h 6.3 (Berkeley) 6/8/85 ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Member align structures */ #pragma __member_alignment __save #pragma __nomember_alignment /* ** Disable messages */ #pragma __message __save #pragma __message __disable (__MISALGNDSTRCT) #pragma __message __disable (__MISALGNDMEM) #if defined __DECC # pragma __message __disable (__BITNOTINT) #endif /* ** Define a caddr_t if not defined elsewhere */ #if !defined __CADDR_T && !defined CADDR_T # define __CADDR_T 1 # ifndef __HIDE_FORBIDDEN_NAMES # define CADDR_T 1 # endif typedef __caddr_t caddr_t; #endif /* ** Define non-standard BSD socket compatible typedefs */ #ifndef __SOCKET_TYPEDEFS # define __SOCKET_TYPEDEFS 1 typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long u_long; #endif typedef u_long tcp_seq; /* ** TCP header. Per RFC 793, September, 1981. */ struct tcphdr { u_short th_sport; /* source port */ u_short th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ /* LITTLE_ENDIAN defn */ u_char th_x2:4; /* (unused) */ u_char th_off:4; /* data offset */ u_char th_flags; /* */ u_short th_win; /* window */ u_short th_sum; /* checksum */ u_short th_urp; /* urgent pointer */ }; /* ** Define th_flags values */ #define TH_FIN 0x01 #define TH_SYN 0x02 #define TH_RST 0x04 #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 #define TCPOPT_EOL 0 #define TCPOPT_NOP 1 #define TCPOPT_MAXSEG 2 #define TCPOLEN_MAXSEG 4 #define TCPOPT_WINDOW 3 #define TCPOLEN_WINDOW 3 #define TCPOPT_SACK_PERMITTED 4 /* Experimental */ #define TCPOLEN_SACK_PERMITTED 2 #define TCPOPT_SACK 5 /* Experimental */ #define TCPOPT_TIMESTAMP 8 #define TCPOLEN_TIMESTAMP 10 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ #define TCPOPT_TSTAMP_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) /* * Default maximum segment size for TCP. * For RFC1122 MUST conformance, this needs to be 536. * With an IP MSS of 576, this is 536, * but 512 is probably more convenient. * This should be defined as min(512, IP_MSS - sizeof (struct tcpiphdr)). */ #define TCP_MSS 536 /* XXX - BSD4.4lite uses 512 */ #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ /* * User-settable options (used with set/getsockopt). */ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #define TCP_MAXSEG 0x02 /* set maximum segment size */ /* * Number of retransmissions before dropping connection. Larger than * TCP_MAXRXTSHIFT or -1 for infinity */ #define TCP_RPTR2RXT 0x03 /* set repeat count for R2 RXT timer */ #define TCP_KEEPIDLE 0x04 /* seconds before initial keepalive probe */ #define TCP_KEEPINTVL 0x05 /* seconds between keepalive probes */ #define TCP_KEEPCNT 0x06 /* number of keepalive probes before drop */ #define TCP_KEEPINIT 0x07 /* initial connect timeout (seconds) */ #define TCP_PUSH 0x08 /* set push bit in outbound data packets */ #define TCP_NODELACK 0x09 /* don't delay send to coalesce packets */ /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __message __restore #pragma __member_alignment __restore #pragma __standard #endif /* __TCP_LOADED */