% Librarian A09-22bm%.!um%bc  (]Q BPFZENDIAN *IF_ETHER IN_SYSTM#<IPFPCAP:TCP4UDP |em%/*D * *****************************************************************D * * *D * * Copyright Compaq Computer Corporation, 2000 *D * * *D * * The software contained on this media is proprietary to *D * * and embodies the confidential technology of Compaq *D * * Computer Corporation. Possession, use, duplication o r *D * * dissemination of the software and media is authorized only *D * * pursuant to a valid written license from Compaq Computer *D * * Corporation. *D * * *D * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *D * * by the U.S. Government is subject to restrictions as set *D * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *D * * or in FAR 52.227-19, as applicable. *D * * *D * ***************************************************************** *//* * HISTORY *//* W * @(#)$RCSfile: includes_vms.tlb,v $ $Revision: 5.1 $ (DEC) $Date: 2002/06/21 04:45:46 $ */ /* *//*5 * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED *//* * OSF/1 Release 1.0 *//*D * Copyright (c) 1982, 1986 Regents of  the University of California. * All rights reserved. *K * Redistribution and use in source and binary forms are permitted providedI * that: (1) source distributions retain this entire copyright notice andJ * comment, and (2) distributions including binaries display the followingF * acknowledgement: ``This product includes software developed by theC * University of California, Berkeley and its contributors'' in theI * documentation or other materials provided with the distribution and i nI * all advertising materials mentioning features or use of this software.K * Neither the name of the University nor the names of its contributors mayL * be used to endorse or promote products derived from this software without% * specific prior written permission.I * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIEDG * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF8 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** * Base: in_systm.h 7.3 (Berkeley) 6/29/88, * Merged: in_systm.h 7.4 (Berkeley) 6/28/90 */#ifndef _NETINET_IN_SYSTM_H#define _NETINET_IN_SYSTM_H/* * Miscellaneous internetwork! * definitions for include files. */#include #include /* * Network types. *E * Internally the system keeps counters in the headers with the bytesG * in native byte order so that machine instructions will work on them.J * It reverses the bytes if necessary before transmission at each protocolL * level. The n_ types represent the types with the bytes in ``high-ender'' * (big endian) order. */>typedef u_short n_short; /* short as received from the net */Ktypedef u_int n_long; /* long as received from the net */@typedef u_int n_time; /* ms since 00:00 GMT, net byte order */#ifdef _KERNEL9#include "netinet/proto_inet.h" /* Function prototypes */#if MACH:#include /* Dynamic config requires dependency */#endif/*F * Global configuration parameters for Internet. With the exception ofC * INETPRINTFS, these control the default value of kernel variablesG * settable by the system administrator. These variables are int's with, * the names of the #defines, in lower case. */</* GATEWAY turns on IP forwarding and expands ARP tables. */#ifdef GATEWAY#define IPFORWARDING 1#define IPGATEWAY 1#else#define IPFORWARDING 0#define IPGATEWAY 0#endif5/* DIRECTED_BROADCAST makes broadcast addresses match& * only for their proper interface. */#ifdef DIRECTED_BROADCAST#define IPDIRECTED_BROADCAST 1#else#define IPDIRECTED_BROADCAST 0#endif=/* SUBNETSARELOCAL makes subnets appear as directly connected* * for the purpose of max segsize, etc. */#ifndef SUBNETSARELOCAL#define SUBNETSARELOCAL 1#endif?/* TCP_COMPAT_42 makes TCP adjust initial send sequence numbers2 * and keepalives to make 4.2-based systems happy. */#ifndef TCP_COMPAT_42#define TCP_COMPAT_42 1#endif</* IPSENDREDIRECTS enables the sending of ICMP redirects. */#ifndef IPSENDREDIRECTS#define IPSENDREDIRECTS 1#endifH/* INETPRINTFS enables printfs for various errors and/or information. */#ifndef INETPRINTFS#define INETPRINTFS DEBUG#endif#endif /* #ifdef _KERNEL */)#endif /* #ifndef _NETINET_IN_SYSTM_H */ww,gm%/*D * *****************************************************************D * * *D * * Copyright Compaq Computer Corporation, 2000 *D * * *D * * The software contained on this media is proprietary to *D * * and embodies the confidential technology of Compaq *D * * Computer Corporation. Possession, use, duplication or *D * * dissemination of the software and media is authorized only *D * * pursuant to a valid written license from Compaq Computer *D * * Corporation. *D * * *D * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *D * * by the U.S. Government is subject to restrictions as set *D * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *D * * or in FAR 52.227-19, as applicable. *D * * *D * ***************************************************************** *//* * HISTORY *//* + * "@(#)endian.h 9.1 (ULTRIX/OSF) 10/21/91" */ /*D * *****************************************************************D * * *D * * Copyright Compaq Computer Corporation, 2000 *D * * *D * * The software contained on this media is proprietary to *D * * and embodies the confidential technology of Compaq *D * * Computer Corporation. Possession, use, duplication or *D * * dissemination of the software and media is authorized only *D * * pursuant to a valid written license from Compaq Computer *D * * Corporation. *D * * *D * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *D * * by the U.S. Government is subject to re strictions as set *D * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *D * * or in FAR 52.227-19, as applicable. *D * * *D * ***************************************************************** */I/************************************************************************) * Modification History: alpha/endian.h * * 28-May-91 afd* * Created this file for Alpha/OSF support *J ************************************************************************/#ifndef _MACHINE_ENDIAN_H_#define _MACHINE_ENDIAN_H_#ifdef __cplusplus extern "C" {#endif>#if !defined (_XOPEN_SOURCE_EXTENDED) || defined (_OSF_SOURCE)/* * Definitions for byte order,; * according to byte significance from low address to high. */C#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */D#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */H#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */:/* MIPS may use either endian, compiler tells us which. */ #define BYTE_ORDER LITTLE_ENDIANG#endif /* !defined (_XOPEN_SOURCE_EXTENDED) || defined (_OSF_SOURCE) *//*@ * Macros for network/external number representation conversion. */#ifdef _KERNEL.extern unsigned short nuxi_16(unsigned short);*extern unsigned int nuxi_32(unsigned int);#define ntohl(x) nuxi_32(x)#define ntohs(x) nuxi_16(x)#define htonl(x) nuxi_32(x)#define htons(x) nuxi_16(x)&#define NTOHL(x) (x) = ntohl((u_int)x)(#define NTOHS(x) (x) = ntohs((u_short)x)##if defined(_USE_KERNEL_INTRINSICS) #pragma linkage nuxi_linkage = \K (preserved(r2,r3,r4,r5,r6,r7,r8,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25)))#pragma use_linkage nuxi_linkage(nuxi_16))#pragma use_linkage nuxi_linkage(nuxi_32)#endif#else /* !_KERNEL */#ifdef _XOPEN_SOURCE_EXTENDED#if _XOPEN_SOURCE>=500#include 1extern uint16_t ntohs(uint16_t), htons(uint1 6_t);1extern uint32_t ntohl(uint32_t), htonl(uint32_t); #else /* !_XOPEN_SOURCE>= 500 */#include 4extern in_port_t ntohs(in_port_t), htons(in_port_t);4extern in_addr_t ntohl(in_addr_t), htonl(in_addr_t); #endif /* _XOPEN_SOURCE>= 500 */##else /* !_XOPEN_SOURCE_EXTENDED */Cextern unsigned short ntohs(unsigned short), htons(unsigned short);=extern unsigned int ntohl(unsigned int), htonl(unsigned int);##endif /* _XOPEN_SOURCE_EXTENDED */#endif /* !_KERNEL */#ifdef _!_cplusplus}#endif#endifww im%#ifndef _IF_ETHER_H_#define _IF_ETHER_H_/*F * Structure of a 10Mb/s (or for that matter 100Mb/s) Ethernet header. */struct ether_header { u_char ether_dhost[6]; u_char ether_shost[6]; u_short ether_type;};struct ether_addr { u_char ether_addr_octet[6];};/*G * Note that PUP is <= 1500 and since falls in the range of valid 802.3/ * frames. Hence, PUP is not actually usuable. */0#define ETHERTYPE_PUP " 0x0200 /* PUP protocol */.#define ETHERTYPE_IP 0x0800 /* IP protocol */=#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */>#define ETHERTYPE_LAT 0x6004 /* Local Area Transport (LAT) */5#define ETHERTYPE_DECnet 0x6003 /* Phase IV DECnet */;#define ETHERTYPE_MOPRC 0x6002 /* MOP CCR protocol type */E#define ETHERTYPE_MOPDL 0x6001 /* MOP Downline Load protocol type */@#define ETHERTYPE_LBACK 0x9000 /* MOP loopback protocol type */2#define ETHERTYPE_IPV6 0x86DD /* IPV6 protoco#l *//*G * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have4 * (type-ETHERTYPE_TRAIL)*512 bytes of data followedK * by an ETHER type (as given above) and then the (variable-length) header. */5#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */#define ETHERTYPE_NTRAILER 16#define ETHERMTU 1500#define ETHERMIN (60-14)/* * Ethernet Bandwidth. */C#define ETHER_BANDWIDTH_10MB 10000000 /* Ethernet - 10Mbs */J#define ETHER_BANDWIDTH_100MB 100000 $000 /* Fast Ethernet - 100Mbs */#endifwwZjm%,/* CMS REPLACEMENT HISTORY, Element IP.H */K/* 2A1 12-MAY-2000 02:29:56 MUGGERIDGE "V51IFT baselevel code freeze" */K/* 2B1 11-MAY-2000 17:01:12 MUGGERIDGE "V51IFT baselevel code freeze" */9/* *2 6-AUG-1999 14:11:20 POUFFARY "Steel update" */K/* 1B1 28-OCT-1998 20:14:15 MUGGERIDGE "V50SSB baselevel code freeze" */K/* 1A1 18-JUN-1998 06:18:07 MUGGERIDGE "V50IFT baselevel code freeze" */O/* *1 30-S%EP-1997 18:24:09 GEMIGNANI "Initial population of IPv6 source" */,/* CMS REPLACEMENT HISTORY, Element IP.H *//* * @DEC_COPYRIGHT@ *//* * HISTORY * $Log: includes_vms.tlb,v $ * HISTORY * Revision 5.1 2002/06/21 04:45:46 alakhian * HISTORY * Added new files: * HISTORY * README.OpenVMS * HISTORY * includes_vms.tlb * HISTORY * mkae_vms.com * HISTORY * snprintf_vms.c * HISTORY * tcptrace.opt * HISTORY * and modified * HISTORY * CHANGES * HISTORY * THANKS * HISTORY * compress.c * HISTORY * gcache.c * HISTORY * ns.c * HISTORY * plotter.c * HISTORY * tcptrace.h * HISTORY * The new files and patches were provided by Matt Muggeridge, and are required * HISTORY * to get tcptrace to run on OpenVMS. All changes are incorporated within * HISTORY * #ifdef __VMS preprocessor directives. * HISTORY *9 * Revision 4.2.16.3 1995/11/15 20:26:43 Ajay_Kachrani3 * Define MINTTL and DEFTTL for settable ipdefttl.) * [1995/11/13 21:22:10 Ajay_Kachrani] *8 * Revision 4.2.16.2 1995/06/30 22:38:10 Mike_Milicia$ * Add MLS secure networking hooks.( * [1995/06/20 22:19:37 Mike_Milicia] * 8 * Revision 4.2.13.2& 1994/08/24 14:20:20 Heather_Gray' * Include in.h to be self-describing.( * [1994/08/24 13:29:52 Heather_Gray] * 6 * Revision 4.2.9.3 1993/10/07 17:54:15 John_Dustin * sterling to gold merge' * [1993/10/04 18:47:51 John_Dustin] * 2 * Revision 4.2.11.3 1993/06/29 18:12:01 SJ_Lee * add #ifndef" * [1993/06/29 17:46:51 SJ_Lee] * 8 * Revision 4.2.11.2 1993/06/23 13:46:05 Heather_Gray0 * Change ip_len and uh_ulen fields to unsigned' * for Host Requirements 'and NFS usage( * [1993/06/22 04:19:13 Heather_Gray] * 8 * Revision 4.2.5.2 1993/04/12 14:03:05 Ajay_Kachrani8 * Fix ANSI bitfields warning when compiled using -std1) * [1993/04/07 19:46:46 Ajay_Kachrani] * ; * Revision 4.2.3.2 1992/01/29 15:24:35 Geraldine_Harter * merged in Silver BL34 * Revision 4.2.1.2 92/01/24 18:10:20 devbld_gsf@ * First AG_BL3 version. Moved from AG baselevel delivery tree.* * [92/01/29 14:59:53 Geraldine_Harter] * ( * Merge from ODE(/TIN: revision 3.1.9.2Q * date: 91/11/14 15:40:37; author: devrcs; state: Exp; lines added/del: 11/1G * sccs rev: 3.2; orig date: 91/11/04 15:50:46; orig author: heather7 * fix for BYTE_ORDER undefined if _KERNEL not defined' * [91/12/04 10:27:03 William_Burns] * + * Revision 4.2 91/09/19 22:47:22 devbld * Adding ODE Headers * * $EndLog$ *//* R * @(#)$RCSfile: includes_vms.tlb,v $ $Revision: 5.1 $ (DEC) $Date: 2002/06/21 04:45:46 $ */ /* *//*5 * (c) Copyr)ight 1990, OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED *//* * OSF/1 Release 1.0 *//*L * Copyright (C) 1988,1989 Encore Computer Corporation. All Rights Reserved *+ * Property of Encore Computer Corporation.B * This software is made available solely pursuant to the terms ofC * a software license agreement which governs its use. Unauthorized= * duplication, distribution or sale are strictly prohibited. * *//*D * Copyright (c) 1982, 1986 Regents of the Universit *y of California. * All rights reserved. *K * Redistribution and use in source and binary forms are permitted providedI * that: (1) source distributions retain this entire copyright notice andJ * comment, and (2) distributions including binaries display the followingF * acknowledgement: ``This product includes software developed by theC * University of California, Berkeley and its contributors'' in theI * documentation or other materials provided with the distribution and inI * all adv +ertising materials mentioning features or use of this software.K * Neither the name of the University nor the names of its contributors mayL * be used to endorse or promote products derived from this software without% * specific prior written permission.I * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIEDG * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF8 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *$ * Base: ip.h 7.8 (Berkeley) 2/2,0/89' * Merged: ip.h 7.10 (Berkeley) 6/28/90 *//* * Revision History: * * 4-Nov-91 Heather Gray- * Include endian.h if BYTE_ORDER not defined */#ifndef _NETINET_IP_H#define _NETINET_IP_H#include #include #ifndef BYTE_ORDER#include #endif/*/ * Definitions for internet protocol version 4. * Per RFC 791, September 1981. */#define IPVERSION 4/*5 * Structure of an internet header, naked of opt-ions. *D * Beware: We now correctly declare ip_len and ip_off to be u_short. * */ struct ip {A#if defined(_KERNEL) || defined(_NO_BITFIELDS) || (__STDC__ == 1)1 u_char ip_vhl; /* version and header length */#else #if BYTE_ORDER == LITTLE_ENDIAN % u_char ip_hl:4, /* header length */ ip_v:4; /* version */#endif#if BYTE_ORDER == BIG_ENDIAN  u_char ip_v:4, /* version */ ip_hl:4; /* header length */#endif#endif' u_char ip_tos; /* type of service */% u_s.hort ip_len; /* total length */& u_short ip_id; /* identification */. u_short ip_off; /* fragment offset field *//#define IP_DF 0x4000 /* dont fragment flag */0#define IP_MF 0x2000 /* more fragments flag */$ u_char ip_ttl; /* time to live */ u_char ip_p; /* protocol */! u_short ip_sum; /* checksum */< struct in_addr ip_src,ip_dst; /* source and dest address */};5#define IP_MAXPACKET 65535 /* maximum packet size *//*. * Definitions for IP type of service (ip_tos)/ */#define IPTOS_LOWDELAY 0x10#define IPTOS_THROUGHPUT 0x08#define IPTOS_RELIABILITY 0x04/*D * Definitions for IP precedence (also in ip_tos) (hopefully unused) */##define IPTOS_PREC_NETCONTROL 0xe0'#define IPTOS_PREC_INTERNETCONTROL 0xc0##define IPTOS_PREC_CRITIC_ECP 0xa0%#define IPTOS_PREC_FLASHOVERRIDE 0x80#define IPTOS_PREC_FLASH 0x60"#define IPTOS_PREC_IMMEDIATE 0x40!#define IPTOS_PREC_PRIORITY 0x20 #define IPTOS_PREC_ROUTINE 0x10/* * Definitions for o0ptions. */##define IPOPT_COPIED(o) ((o)&0x80)"#define IPOPT_CLASS(o) ((o)&0x60)##define IPOPT_NUMBER(o) ((o)&0x1f)#define IPOPT_CONTROL 0x00#define IPOPT_RESERVED1 0x20#define IPOPT_DEBMEAS 0x40#define IPOPT_RESERVED2 0x60.#define IPOPT_EOL 0 /* end of option list */(#define IPOPT_NOP 1 /* no operation */.#define IPOPT_RR 7 /* record packet route */%#define IPOPT_TS 68 /* timestamp */4#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */1#define IPOPT_LS1RR 131 /* loose source route */ #if SEC_NETM#define IPOPT_RIPSO_AUX 133 /* RIPSO extended options. */M#define IPOPT_CIPSO 134 /* CIPSO security options. */#endif)#define IPOPT_SATID 136 /* satnet id */2#define IPOPT_SSRR 137 /* strict source route *//*7 * Offsets to fields in options other than EOL and NOP. */(#define IPOPT_OPTVAL 0 /* option ID */*#define IPOPT_OLEN 1 /* option length */3#define IPOPT_OFFSET 2 /* offset w2ithin option */1#define IPOPT_MINOFF 4 /* min value of above *//* * Time stamp option structure. */struct ip_timestamp {! u_char ipt_code; /* IPOPT_TS */4 u_char ipt_len; /* size of structure (variable) */. u_char ipt_ptr; /* index of current entry */A#if defined(_KERNEL) || defined(_NO_BITFIELDS) || (__STDC__ == 1)+ u_char ipt_oflg; /* overflow and flags */#else #if BYTE_ORDER == LITTLE_ENDIAN * u_char ipt_flg:4, /* flags, see below */% ipt_oflw:4; /* overflow c3ounter */#endif#if BYTE_ORDER == BIG_ENDIAN + u_char ipt_oflw:4, /* overflow counter */$ ipt_flg:4; /* flags, see below */#endif#endif union ipt_timestamp { n_long ipt_time[1]; struct ipt_ta { struct in_addr ipt_addr; n_long ipt_time; } ipt_ta[1]; } ipt_timestamp;};/* flag bits for ipt_flg */1#define IPOPT_TS_TSONLY 0 /* timestamps only */<#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */8#define IPOPT_TS_PRESPEC 3 /* specified modules4 only */*/* bits for security (not byte swapped) */"#define IPOPT_SECUR_UNCLASS 0x0000!#define IPOPT_SECUR_CONFID 0xf135#define IPOPT_SECUR_EFTO 0x789a#define IPOPT_SECUR_MMMM 0xbc4d #define IPOPT_SECUR_RESTR 0xaf13!#define IPOPT_SECUR_SECRET 0xd788$#define IPOPT_SECUR_TOPSECRET 0x6bc5/*& * Internet implementation parameters. */9#define MAXTTL 255 /* maximum time to live (seconds) */L#define MINTTL 1 /* minimum time to live (seconds) */L#define DEFT5TL 64 /* default time to live (rfc1700) */:#define IPFRAGTTL 60 /* time to live for frags, slowhz */4#define IPTTLDEC 1 /* subtracted when forwarding */7#define IP_MSS 576 /* default maximum segment size */#endifww>mm%/*D * *****************************************************************D * * *D * * Copyright Compaq Computer Corporation, 2000 *D * * 6 *D * * The software contained on this media is proprietary to *D * * and embodies the confidential technology of Compaq *D * * Computer Corporation. Possession, use, duplication or *D * * dissemination of the software and media is authorized only *D * * pursuant to a valid written license from Compaq Computer *D * * Corporation. *D * * 7 *D * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *D * * by the U.S. Government is subject to restrictions as set *D * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *D * * or in FAR 52.227-19, as applicable. *D * * *D * ***************************************************************** *//* * HISTORY *//* S * @(#)$RCSfile: includes_vms.tlb,v $ $Revision: 5.1 $ (DEC) $Date: 2002/06/21 04:45:46 $ */ /* *//*5 * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED *//* * OSF/1 Release 1.0 *//*D * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. *K * Redistribution and use in source and binary forms are permitted providedI * that: (1) source distributions retain this entire copyright notice andJ * comment, and (2) distributions includ9ing binaries display the followingF * acknowledgement: ``This product includes software developed by theC * University of California, Berkeley and its contributors'' in theI * documentation or other materials provided with the distribution and inI * all advertising materials mentioning features or use of this software.K * Neither the name of the University nor the names of its contributors mayL * be used to endorse or promote products derived from this software without% * specific prior wr:itten permission.I * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIEDG * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF8 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *% * Base: udp.h 7.3 (Berkeley) 6/29/88' * Merged: udp.h 7.4 (Berkeley) 6/28/90 */#ifndef _NETINET_UDP_H_#define _NETINET_UDP_H_/* * Udp protocol header. * Per RFC 768, September, 1981. */struct udphdr {% u_short uh_sport; /* source port */* u_s;hort uh_dport; /* destination port */# u_short uh_ulen; /* udp length */% u_short uh_sum; /* udp checksum */};#endifwwwom%/*D * *****************************************************************D * * *D * * Copyright Compaq Computer Corporation, 2000 *D * * *D * * The software contained on this media is proprietary to < *D * * and embodies the confidential technology of Compaq *D * * Computer Corporation. Possession, use, duplication or *D * * dissemination of the software and media is authorized only *D * * pursuant to a valid written license from Compaq Computer *D * * Corporation. *D * * *D * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *D * * by th=e U.S. Government is subject to restrictions as set *D * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *D * * or in FAR 52.227-19, as applicable. *D * * *D * ***************************************************************** *//* * HISTORY *//* S * @(#)$RCSfile: includes_vms.tlb,v $ $Revision: 5.1 $ (DEC) $Date: 2002/06/21 04:45:46 $ */ /* *//*5 * (c) Copyright 1990, OPEN >SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED *//* * OSF/1 Release 1.0 *//*L * Copyright (C) 1988,1989 Encore Computer Corporation. All Rights Reserved *+ * Property of Encore Computer Corporation.B * This software is made available solely pursuant to the terms ofC * a software license agreement which governs its use. Unauthorized= * duplication, distribution or sale are strictly prohibited. * *//*D * Copyright (c) 1982, 1986 Regents of the University of California. ? * All rights reserved. *K * Redistribution and use in source and binary forms are permitted providedI * that: (1) source distributions retain this entire copyright notice andJ * comment, and (2) distributions including binaries display the followingF * acknowledgement: ``This product includes software developed by theC * University of California, Berkeley and its contributors'' in theI * documentation or other materials provided with the distribution and inI * all advertising materia @ls mentioning features or use of this software.K * Neither the name of the University nor the names of its contributors mayL * be used to endorse or promote products derived from this software without% * specific prior written permission.I * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIEDG * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF8 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *% * Base: tcp.h 7.5 (Berkeley) 6/29/88' * MergeAd: tcp.h 7.7 (Berkeley) 6/28/90 */#ifndef _NETINET_TCP_H#define _NETINET_TCP_H#include #ifndef BYTE_ORDER#include #endiftypedef u_int 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 */A#if defined(_KERNEL) || defined(_NO_BITFIELDS) || B(__STDC__ == 1) u_char th_xoff;#else #if BYTE_ORDER == LITTLE_ENDIAN u_char th_x2:4, /* (unused) */ th_off:4; /* data offset */#endif#if BYTE_ORDER == BIG_ENDIAN $ u_char th_off:4, /* data offset */ th_x2:4; /* (unused) */#endif#endif u_char th_flags;#define TH_FIN 0x01#define TH_SYN 0x02#define TH_RST 0x04#define TH_PUSH 0x08#define TH_ACK 0x10#define TH_URG 0x20 u_short th_win; /* window */! u_short th_sum; /* checksum */' u_short th_urp; C /* urgent pointer */};#define TCPOPT_MAX_LEN 40#define TCPOPT_EOL 0#define TCPOPT_NOP 1#define TCPOPT_MAXSEG 2C#define TCPOPT_WINDOW 3 /* rfc 1323 window scale option */H#define TCPOPT_SACK_REQ 4 /* rfc 2018 Sack option requested SYN only */1#define TCPOPT_SACK 5 /* rfc 2018 SACK option */:#define TCPOPT_TS 8 /* rfc 1323 timestamp option *//* * sack defines */D#define TCP_SACK_ELEMENT_LEN 8 /* Sack element have 2 int fields */K#define TCPOPT_SACK_LEN_DOK( 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)9#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 ; \}3#define ETCPOPT_EXTRACT_TSOPT(opt, TSVAL, TSECR) \ { \9 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.6 * For RFC1122 MUST conformance, this needs to be 536. */#define TCP_MSS 536C#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */;#define TCP_MAX_WINSHIFT 14 /* maximum window shiFft *//** * User options (used with set/getockopt). */C#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */2#define TCP_MAXSEG 0x02 /* maximum segment size *//* F * Number of retransmissions before dropping connection. Larger than & * TCP_MAXRXTSHIFT or -1 for infinity  */B#define TCP_RPTR2RXT 0x03 /* set repeat count for R2 RXT timer */ F#define TCP_KEEPIDLE 0x04 /* seconds before initial keepalive probe */A#define TCP_KEEPINTVL 0x05 /* seconds between keepalive Gprobes */E#define TCP_KEEPCNT 0x06 /* number of keepalive probes before drop */A#define TCP_KEEPINIT 0x07 /* initial connect timeout (seconds) */A#define TCP_PUSH 0x08 /* set push bit in outbound data packets */D#define TCP_NODELACK 0x09 /* don't delay send to coalesce packets */1#define TCP_TSOPTENA 0x10 /* time stamp option */'#define TCP_PAWS 0x20 /* PAWS option */+#define TCP_SACKENA 0x40 /* SACK enabled */#endifwwoLrm%/*- * Copyright (c) 1993, 1994, 1995, 199 H6, 1997E * The Regents of the University of California. All rights reserved. *E * Redistribution and use in source and binary forms, with or withoutE * modification, are permitted provided that the following conditions * are met:D * 1. Redistributions of source code must retain the above copyrightC * notice, this list of conditions and the following disclaimer.G * 2. Redistributions in binary form must reproduce the above copyrightI * notice, this list of conditions and the foIllowing disclaimer in theJ * documentation and/or other materials provided with the distribution.K * 3. All advertising materials mentioning features or use of this software1 * must display the following acknowledgement:C * This product includes software developed by the Computer Systems5 * Engineering Group at Lawrence Berkeley Laboratory.J * 4. Neither the name of the University nor of the Laboratory may be usedG * to endorse or promote products derived from this software withou Jt( * specific prior written permission. *J * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' ANDH * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEM * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEK * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLEM * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALJ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTEK GOODSH * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)M * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTL * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAYI * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *B * @(#) $Header: /usr/local/cvs/tcptrace/includes_vms.tlb,v 5.1 2002/06/21 04:45:46 alakhian Exp $ (LBL) */#ifndef lib_pcap_h#define lib_pcap_h#include #include L#include #include #define PCAP_VERSION_MAJOR 2#define PCAP_VERSION_MINOR 4#define PCAP_ERRBUF_SIZE 256/*3 * Compatibility for systems that have a bpf.h that0 * predates the bpf typedefs for 64-bit support. */#if BPF_RELEASE - 0 < 199406typedef int bpf_int32;typedef u_int bpf_u_int32;#endiftypedef struct pcap pcap_t;)typedef struct pcap_dumper pcap_dumper_t;/*> * The first record in the file contains saved values for some7 * of the flags Mused in the printout phases of tcpdump.F * Many fields here are 32 bit ints so compilers won't insert unwantedH * padding; these files need to be interchangeable across architectures. */struct pcap_file_header { bpf_u_int32 magic; u_short version_major; u_short version_minor;2 bpf_int32 thiszone; /* gmt to local correction */2 bpf_u_int32 sigfigs; /* accuracy of timestamps */@ bpf_u_int32 snaplen; /* max length saved portion of each pkt */3 bpf_u_int32 linktype; /* data link typeN (DLT_*) */};/*F * Each packet in the dump file is prepended with this generic header.B * This gets around the problem of different headers for different * packet interfaces. */struct pcap_pkthdr {$ struct timeval ts; /* time stamp */4 bpf_u_int32 caplen; /* length of portion present */5 bpf_u_int32 len; /* length this packet (off wire) */};/*" * As returned by the pcap_stats() */struct pcap_stat {1 u_int ps_recv; /* number of packets received */0 u_int ps_drop; /O* number of packets dropped */@ u_int ps_ifdrop; /* drops by interface XXX not yet supported */};Btypedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *, const u_char *);char *pcap_lookupdev(char *);Aint pcap_lookupnet(char *, bpf_u_int32 *, bpf_u_int32 *, char *);6pcap_t *pcap_open_live(char *, int, int, int, char *);0pcap_t *pcap_open_offline(const char *, char *);void pcap_close(pcap_t *);5int pcap_loop(pcap_t *, int, pcap_handler, u_char *);9int pcap_dispatcPh(pcap_t *, int, pcap_handler, u_char *); const u_char*+ pcap_next(pcap_t *, struct pcap_pkthdr *);-int pcap_stats(pcap_t *, struct pcap_stat *);3int pcap_setfilter(pcap_t *, struct bpf_program *);#void pcap_perror(pcap_t *, char *);char *pcap_strerror(int);char *pcap_geterr(pcap_t *);=int pcap_compile(pcap_t *, struct bpf_program *, char *, int, bpf_u_int32); /* XXX */2int pcap_freecode(pcap_t *, struct bpf_program *);int pcap_datalink(pcap_t *);int pcap_snapshot(pcap_tQ *);int pcap_is_swapped(pcap_t *);!int pcap_major_version(pcap_t *);!int pcap_minor_version(pcap_t *); /* XXX */FILE *pcap_file(pcap_t *);int pcap_fileno(pcap_t *);6pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);&void pcap_dump_close(pcap_dumper_t *);Evoid pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);(/* XXX this guy lives in the bpf tree */<u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);(char *bpf_image(struct bpf_insn *, int);#endif Rww.!um%/*-? * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997E * The Regents of the University of California. All rights reserved. *A * This code is derived from the Stanford/CMU enet packet filter,C * (net/enet.c) distributed as part of 4.3BSD, and code contributedC * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence  * Berkeley Laboratory. *E * Redistribution and use in source and binary forms, with or withoutE * modification, are per Smitted provided that the following conditions * are met:D * 1. Redistributions of source code must retain the above copyrightC * notice, this list of conditions and the following disclaimer.G * 2. Redistributions in binary form must reproduce the above copyrightI * notice, this list of conditions and the following disclaimer in theJ * documentation and/or other materials provided with the distribution.K * 3. All advertising materials mentioning features or use of this software1 T * must display the following acknowledgement:E * This product includes software developed by the University of2 * California, Berkeley and its contributors.J * 4. Neither the name of the University nor the names of its contributorsK * may be used to endorse or promote products derived from this software0 * without specific prior written permission. *J * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' ANDH * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDINUG, BUT NOT LIMITED TO, THEM * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEK * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLEM * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALJ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODSH * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)M * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTL * LIABILIVTY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAYI * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *- * @(#)bpf.h 7.1 (Berkeley) 5/7/91 *A * @(#) $Header: /usr/local/cvs/tcptrace/includes_vms.tlb,v 5.1 2002/06/21 04:45:46 alakhian Exp $ (LBL) */#ifndef BPF_MAJOR_VERSION/* BSD style release date */#define BPF_RELEASE 199606typedef int bpf_int32;typedef u_int bpf_u_int32;/*: * Alignment macros. BPF_WORDALIGN rounds up to the next # * eWven multiple of BPF_ALIGNMENT.  */'#define BPF_ALIGNMENT sizeof(bpf_int32)E#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))#define BPF_MAXINSNS 512#define BPF_MAXBUFSIZE 0x8000#define BPF_MINBUFSIZE 32/* * Structure for BIOCSETF. */struct bpf_program { u_int bf_len; struct bpf_insn *bf_insns;}; /*! * Struct returned by BIOCGSTATS. */struct bpf_stat {1 u_int bs_recv; /* number of packets received */0 u_int bs_drop; /* number o Xf packets dropped */};/*H * Struct return by BIOCVERSION. This represents the version number of D * the filter language described by the instruction encodings below.@ * bpf understands a program iff kernel_major == filter_major &&F * kernel_minor >= filter_minor, that is, if the value returned by theD * running kernel has the same major number and a minor number equalE * equal to or less than the filter being downloaded. Otherwise, theE * results are undefined, meaning an error may be Yreturned or packets * may be accepted haphazardly.5 * It has nothing to do with the source code version. */struct bpf_version { u_short bv_major; u_short bv_minor;};4/* Current version number of filter architecture. */#define BPF_MAJOR_VERSION 1#define BPF_MINOR_VERSION 1/* * BPF ioctls *: * The first set is for compatibility with Sun's pcc style7 * header files. If your using gcc, we assume that you6 * have run fixincludes so the latter set should work. */;#i Zf (defined(sun) || defined(ibm032)) && !defined(__GNUC__)$#define BIOCGBLEN _IOR(B,102, u_int)%#define BIOCSBLEN _IOWR(B,102, u_int)0#define BIOCSETF _IOW(B,103, struct bpf_program)#define BIOCFLUSH _IO(B,104)#define BIOCPROMISC _IO(B,105)##define BIOCGDLT _IOR(B,106, u_int)+#define BIOCGETIF _IOR(B,107, struct ifreq)+#define BIOCSETIF _IOW(B,108, struct ifreq)1#define BIOCSRTIMEOUT _IOW(B,109, struct timeval)1#define BIOCGRTIMEOUT _IOR(B,110, struct timeval)/#define BIOCGSTATS _IO [R(B,111, struct bpf_stat)(#define BIOCIMMEDIATE _IOW(B,112, u_int)3#define BIOCVERSION _IOR(B,113, struct bpf_version)1#define BIOCSTCPF _IOW(B,114, struct bpf_program)1#define BIOCSUDPF _IOW(B,115, struct bpf_program)#else&#define BIOCGBLEN _IOR('B',102, u_int)'#define BIOCSBLEN _IOWR('B',102, u_int)2#define BIOCSETF _IOW('B',103, struct bpf_program)#define BIOCFLUSH _IO('B',104) #define BIOCPROMISC _IO('B',105)%#define BIOCGDLT _IOR('B',106, u_int)-#define BIOCGETIF _IOR('B',107\, struct ifreq)-#define BIOCSETIF _IOW('B',108, struct ifreq)3#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)3#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)1#define BIOCGSTATS _IOR('B',111, struct bpf_stat)*#define BIOCIMMEDIATE _IOW('B',112, u_int)5#define BIOCVERSION _IOR('B',113, struct bpf_version)3#define BIOCSTCPF _IOW('B',114, struct bpf_program)3#define BIOCSUDPF _IOW('B',115, struct bpf_program)#endif/*& * Structure prepended to each packet. */struct bpf_h ]dr {+ struct timeval bh_tstamp; /* time stamp */8 bpf_u_int32 bh_caplen; /* length of captured portion */8 bpf_u_int32 bh_datalen; /* original length of packet */9 u_short bh_hdrlen; /* length of bpf header (this struct" plus alignment padding) */};/*K * Because the structure above is not a multiple of 4 bytes, some compilersN * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.F * Only the kernel needs to know about it; applications use bh_hdrlen. */^ #ifdef KERNEL#define SIZEOF_BPF_HDR 18#endif/* * Data-link level type codes. */4#define DLT_NULL 0 /* no link-layer encapsulation */*#define DLT_EN10MB 1 /* Ethernet (10Mb) */5#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */,#define DLT_AX25 3 /* Amateur Radio AX.25 */4#define DLT_PRONET 4 /* Proteon ProNET Token Ring */#define DLT_CHAOS 5 /* Chaos */-#define DLT_IEEE802 6 /* IEEE 802 Networks */!#define DLT_ARCNET 7 /* ARCNET */'#define DLT_SLIP 8 /* Serial Line IP_ */0#define DLT_PPP 9 /* Point-to-point Protocol */#define DLT_FDDI 10 /* FDDI */:#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */ #define DLT_RAW 12 /* raw IP */5#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */=#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol *//* * The instruction encondings. *//* instruction classes */'#define BPF_CLASS(code) ((code) & 0x07)#define BPF_LD 0x00#define BPF_LDX 0x01#define BPF_ST 0x02#define BPF_STX `0x03#define BPF_ALU 0x04#define BPF_JMP 0x05#define BPF_RET 0x06#define BPF_MISC 0x07/* ld/ldx fields */&#define BPF_SIZE(code) ((code) & 0x18)#define BPF_W 0x00#define BPF_H 0x08#define BPF_B 0x10&#define BPF_MODE(code) ((code) & 0xe0)#define BPF_IMM 0x00#define BPF_ABS 0x20#define BPF_IND 0x40#define BPF_MEM 0x60#define BPF_LEN 0x80#define BPF_MSH 0xa0/* alu/jmp fields */$#define BPF_OP(code) ((code) & 0xf0)#define BPF_ADD 0x00#defaine BPF_SUB 0x10#define BPF_MUL 0x20#define BPF_DIV 0x30#define BPF_OR 0x40#define BPF_AND 0x50#define BPF_LSH 0x60#define BPF_RSH 0x70#define BPF_NEG 0x80#define BPF_JA 0x00#define BPF_JEQ 0x10#define BPF_JGT 0x20#define BPF_JGE 0x30#define BPF_JSET 0x40%#define BPF_SRC(code) ((code) & 0x08)#define BPF_K 0x00#define BPF_X 0x08&/* ret - BPF_K and BPF_X also apply */&#define BPF_RVAL(code) ((code) & 0x18)#define BPF_A 0x10 /* misc b*/(#define BPF_MISCOP(code) ((code) & 0xf8)#define BPF_TAX 0x00#define BPF_TXA 0x80/*" * The instruction data structure. */struct bpf_insn { u_short code; u_char jt; u_char jf; bpf_int32 k;};/*& * Macros for insn array initializers. */6#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }@#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } #ifdef KERNELextern u_int bpf_filter();extern void bpfattach();extern void bpf_tap();extern void bpf_mtap();#else #if __STDC__Cextern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);#endif#endif/*B * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). */#define BPF_MEMWORDS 16#endifww