/* CMS REPLACEMENT HISTORY, Element TCP.H */ /* *4A1 11-DEC-2000 17:38:44 MYTH "V51 baselevel code freeze" */ /* *4 19-SEP-2000 15:44:52 POUFFARY "remove include ip.h " */ /* 3A1 12-MAY-2000 00:52:15 MUGGERIDGE "V51IFT baselevel code freeze" */ /* 3B1 11-MAY-2000 15:39:27 MUGGERIDGE "V51IFT baselevel code freeze" */ /* *3 1-SEP-1999 09:41:30 POUFFARY "Steel Upgrade" */ /* 2B1 28-OCT-1998 19:51:39 MUGGERIDGE "V50SSB baselevel code freeze" */ /* 2A1 22-OCT-1998 18:19:08 MUGGERIDGE "V50SSB baselevel code freeze" */ /* *2 14-AUG-1998 14:26:10 KHAIT "Add TCP_PROBE_IDLE and TCP_DROP_IDLE options." */ /* 1A1 18-JUN-1998 05:37:27 MUGGERIDGE "V50IFT baselevel code freeze" */ /* *1 19-JAN-1998 15:24:49 GEMIGNANI "Initial population of IPv6 source" */ /* CMS REPLACEMENT HISTORY, Element TCP.H */ #ifndef __TCP_LOADED #define __TCP_LOADED /**************************************************************************** ** ** - TCP descriptions ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright Digital Equipment Corporation 1993, 1995. All rights reserved. ** ** Restricted Rights: Use, duplication, or disclosure by the U.S. ** Government is subject to restrictions as set forth in subparagraph ** (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR ** 52.227-14 Alt. III, as applicable. ** ** This software is proprietary to and embodies the confidential ** technology of Digital Equipment Corporation. Possession, use, or ** copying of this software and media is authorized only pursuant to a ** valid written license from Digital or an authorized sublicensor. ** ****************************************************************************** ** ** 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 ** X5.0-3 Yanick Pouffary 02-Jun-1997 ** ** X5.0-4 Larisa Khait 14-Aug-1998 ** Add TCP_PROBE_IDLE and TCP_DROP_IDLE options. ****************************************************************************** */ #pragma __nostandard #ifdef __cplusplus extern "C" { #endif #ifndef __CRTL_VER # define __CRTL_VER __VMS_VER #endif /* ** Ensure that regardless of user /pointer_size usage, we begin processing ** using a 32 bit pointer context. */ #if __INITIAL_POINTER_SIZE # if (__CRTL_VER < 70000000) || !defined __ALPHA # error " Pointer size usage not permitted before OpenVMS Alpha V7.0" # endif # 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 char * 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 */ #ifdef __VAX u_char th_x2:4, /* (unused) */ th_off:4; /* data offset */ #endif 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 TCPOPT_WINDOW 3 /* rfc 1323 window scale option */ #define TCPOPT_SACK_REQ 4 /* rfc 2018 Sack option requested SYN only */ #define TCPOPT_SACK 5 /* rfc 2018 SACK option */ #define TCPOPT_TS 8 /* rfc 1323 timestamp option */ /* * sack defines */ #define TCP_SACK_ELEMENT_LEN 8 /* Sack element have 2 int fields */ #define TCPOPT_SACK_LEN_OK( len ) ((len>=10) && (((((len-2)/8)*8)+2)==len)) /* * timestamp defines */ #define TCPOPT_TS_LEN 10 /* tcp timestamp option length */ #define TCPOLEN_TSTAMP_APPA ((TCPOPT_NOP<<24)|(TCPOPT_NOP<<16)|(TCPOPT_TS<<8)|TCPOPT_TS_LEN) #define TCPOPT_CREATE_TSOPT(opt, optlen, TSVAL, TSECR) \ { \ int *__tmp=(int*)(opt) ; \ __tmp[0]=htonl(TCPOLEN_TSTAMP_APPA) ; \ __tmp[1]=htonl(TSVAL) ; \ __tmp[2]=htonl(TSECR) ; \ optlen+=TCPOPT_TS_LEN+2 ; \ } #define TCPOPT_EXTRACT_TSOPT(opt, TSVAL, TSECR) \ { \ bcopy((caddr_t)(&(opt)[2]), &(TSVAL), sizeof(TSVAL)) ; \ TSVAL=ntohl(TSVAL) ; \ bcopy(&(opt)[2+sizeof(TSVAL)], &(TSECR) , sizeof(TSECR)) ; \ TSECR=ntohl(TSECR) ; \ } /* * Default maximum segment size for TCP. * For RFC1122 MUST conformance, this needs to be 536. */ #define TCP_MSS 536 #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ /* * User options (used with set/getockopt). */ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #define TCP_MAXSEG 0x02 /* 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 */ #define TCP_TSOPTENA 0x10 /* time stamp option */ #define TCP_PAWS 0x20 /* PAWS option */ #define TCP_SACKENA 0x40 /* SACK enabled */ #define TCP_PROBE_IDLE 0x80 /* Probe idle */ #define TCP_DROP_IDLE 0x81 /* Drop idle */ /* ** 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 */