+++ /dev/null
-/*\r
- * Copyright (c) 1982, 1986, 1993\r
- * The Regents of the University of California. All rights reserved.\r
- *\r
- * Portions copyright (c) 1999, 2000\r
- * Intel Corporation.\r
- * All rights reserved.\r
- * \r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * \r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * \r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * \r
- * 3. All advertising materials mentioning features or use of this software\r
- * must display the following acknowledgement:\r
- * \r
- * This product includes software developed by the University of\r
- * California, Berkeley, Intel Corporation, and its contributors.\r
- * \r
- * 4. Neither the name of University, Intel Corporation, or their respective\r
- * contributors may be used to endorse or promote products derived from\r
- * this software without specific prior written permission.\r
- * \r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND\r
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\r
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS,\r
- * INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- *\r
- * @(#)ip.h 8.2 (Berkeley) 6/1/94\r
- * $Id: ip.h,v 1.1.1.1 2006/05/30 06:12:48 hhzhou Exp $\r
- */\r
-\r
-#ifndef _NETINET_IP_H_\r
-#define _NETINET_IP_H_\r
-\r
-#ifndef _ORG_FREEBSD_\r
-#define _IP_VHL\r
-#endif\r
-\r
-/*\r
- * Definitions for internet protocol version 4.\r
- * Per RFC 791, September 1981.\r
- */\r
-#define IPVERSION 4\r
-\r
-/*\r
- * Structure of an internet header, naked of options.\r
- */\r
-struct ip {\r
-#ifdef _IP_VHL\r
- u_char ip_vhl; /* version << 4 | header length >> 2 */\r
-#else\r
-#if BYTE_ORDER == LITTLE_ENDIAN\r
- u_int ip_hl:4, /* header length */\r
- ip_v:4; /* version */\r
-#endif\r
-#if BYTE_ORDER == BIG_ENDIAN\r
- u_int ip_v:4, /* version */\r
- ip_hl:4; /* header length */\r
-#endif\r
-#endif /* not _IP_VHL */\r
- u_char ip_tos; /* type of service */\r
- u_short ip_len; /* total length */\r
- u_short ip_id; /* identification */\r
- u_short ip_off; /* fragment offset field */\r
-#define IP_RF 0x8000 /* reserved fragment flag */\r
-#define IP_DF 0x4000 /* dont fragment flag */\r
-#define IP_MF 0x2000 /* more fragments flag */\r
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */\r
- u_char ip_ttl; /* time to live */\r
- u_char ip_p; /* protocol */\r
- u_short ip_sum; /* checksum */\r
- struct in_addr ip_src,ip_dst; /* source and dest address */\r
-};\r
-\r
-#ifdef _IP_VHL\r
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))\r
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)\r
-#define IP_VHL_V(vhl) ((vhl) >> 4)\r
-#define IP_VHL_BORING 0x45\r
-#endif\r
-\r
-#define IP_MAXPACKET 65535 /* maximum packet size */\r
-\r
-/*\r
- * Definitions for IP type of service (ip_tos)\r
- */\r
-#define IPTOS_LOWDELAY 0x10\r
-#define IPTOS_THROUGHPUT 0x08\r
-#define IPTOS_RELIABILITY 0x04\r
-#define IPTOS_MINCOST 0x02\r
-\r
-/*\r
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)\r
- */\r
-#define IPTOS_PREC_NETCONTROL 0xe0\r
-#define IPTOS_PREC_INTERNETCONTROL 0xc0\r
-#define IPTOS_PREC_CRITIC_ECP 0xa0\r
-#define IPTOS_PREC_FLASHOVERRIDE 0x80\r
-#define IPTOS_PREC_FLASH 0x60\r
-#define IPTOS_PREC_IMMEDIATE 0x40\r
-#define IPTOS_PREC_PRIORITY 0x20\r
-#define IPTOS_PREC_ROUTINE 0x00\r
-\r
-/*\r
- * Definitions for options.\r
- */\r
-#define IPOPT_COPIED(o) ((o)&0x80)\r
-#define IPOPT_CLASS(o) ((o)&0x60)\r
-#define IPOPT_NUMBER(o) ((o)&0x1f)\r
-\r
-#define IPOPT_CONTROL 0x00\r
-#define IPOPT_RESERVED1 0x20\r
-#define IPOPT_DEBMEAS 0x40\r
-#define IPOPT_RESERVED2 0x60\r
-\r
-#define IPOPT_EOL 0 /* end of option list */\r
-#define IPOPT_NOP 1 /* no operation */\r
-\r
-#define IPOPT_RR 7 /* record packet route */\r
-#define IPOPT_TS 68 /* timestamp */\r
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */\r
-#define IPOPT_LSRR 131 /* loose source route */\r
-#define IPOPT_SATID 136 /* satnet id */\r
-#define IPOPT_SSRR 137 /* strict source route */\r
-#define IPOPT_RA 148 /* router alert */\r
-\r
-/*\r
- * Offsets to fields in options other than EOL and NOP.\r
- */\r
-#define IPOPT_OPTVAL 0 /* option ID */\r
-#define IPOPT_OLEN 1 /* option length */\r
-#define IPOPT_OFFSET 2 /* offset within option */\r
-#define IPOPT_MINOFF 4 /* min value of above */\r
-\r
-/*\r
- * Time stamp option structure.\r
- */\r
-struct ip_timestamp {\r
- u_char ipt_code; /* IPOPT_TS */\r
- u_char ipt_len; /* size of structure (variable) */\r
- u_char ipt_ptr; /* index of current entry */\r
-#if BYTE_ORDER == LITTLE_ENDIAN\r
- u_int ipt_flg:4, /* flags, see below */\r
- ipt_oflw:4; /* overflow counter */\r
-#endif\r
-#if BYTE_ORDER == BIG_ENDIAN\r
- u_int ipt_oflw:4, /* overflow counter */\r
- ipt_flg:4; /* flags, see below */\r
-#endif\r
- union ipt_timestamp {\r
- n_long ipt_time[1];\r
- struct ipt_ta {\r
- struct in_addr ipt_addr;\r
- n_long ipt_time;\r
- } ipt_ta[1];\r
- } ipt_timestamp;\r
-};\r
-\r
-/* flag bits for ipt_flg */\r
-#define IPOPT_TS_TSONLY 0 /* timestamps only */\r
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */\r
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */\r
-\r
-/* bits for security (not byte swapped) */\r
-#define IPOPT_SECUR_UNCLASS 0x0000\r
-#define IPOPT_SECUR_CONFID 0xf135\r
-#define IPOPT_SECUR_EFTO 0x789a\r
-#define IPOPT_SECUR_MMMM 0xbc4d\r
-#define IPOPT_SECUR_RESTR 0xaf13\r
-#define IPOPT_SECUR_SECRET 0xd788\r
-#define IPOPT_SECUR_TOPSECRET 0x6bc5\r
-\r
-/*\r
- * Internet implementation parameters.\r
- */\r
-#define MAXTTL 255 /* maximum time to live (seconds) */\r
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */\r
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */\r
-#define IPTTLDEC 1 /* subtracted when forwarding */\r
-\r
-#define IP_MSS 576 /* default maximum segment size */\r
-\r
-#endif\r