]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add an "ip.h" header, to declare the IP stuff needed by dissectors, and
authorguy <guy>
Sat, 23 Sep 2000 08:54:24 +0000 (08:54 +0000)
committerguy <guy>
Sat, 23 Sep 2000 08:54:24 +0000 (08:54 +0000)
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.

Put the declarations of the ICMP stuff directly into "print-icmp.c".

Remove all unnecessary includes of <netinet/ip*.h> files.

Copy the byte-order stuff from "nameser.h" into "tcp.h".

50 files changed:
FILES
ether.h
ip.h [new file with mode: 0644]
print-ah.c
print-atalk.c
print-atm.c
print-bgp.c
print-chdlc.c
print-cip.c
print-domain.c
print-dvmrp.c
print-egp.c
print-esp.c
print-ether.c
print-fddi.c
print-frag6.c
print-gre.c
print-icmp.c
print-icmp6.c
print-igrp.c
print-ip.c
print-ip6.c
print-ipcomp.c
print-ipx.c
print-isakmp.c
print-krb.c
print-lane.c
print-mobile.c
print-netbios.c
print-nfs.c
print-null.c
print-ospf.c
print-ospf6.c
print-pim.c
print-ppp.c
print-raw.c
print-rip.c
print-ripng.c
print-rt6.c
print-rx.c
print-sl.c
print-stp.c
print-sunrpc.c
print-tcp.c
print-telnet.c
print-token.c
print-udp.c
print-vjc.c
tcp.h
tcpdump.c

diff --git a/FILES b/FILES
index f5425825908432bc37a26a7f3860834f524a1704..9608558ce29d0526475602aebd03bc533d030803 100644 (file)
--- a/FILES
+++ b/FILES
@@ -30,6 +30,7 @@ gmt2local.h
 igrp.h
 install-sh
 interface.h
+ip.h
 ipsec_doi.h
 ipx.h
 isakmp.h
diff --git a/ether.h b/ether.h
index 22170f476e5d67ca32f809a73f8ee343aa4e7bee..0056e550341957c3656e601cdda17297da21b8e7 100644 (file)
--- a/ether.h
+++ b/ether.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.2 2000-09-23 08:26:30 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.3 2000-09-23 08:54:25 guy Exp $ (LBL) */
 /*
  * Copyright (c) 1982, 1986, 1993
  *     The Regents of the University of California.  All rights reserved.
  *     @(#)if_ether.h  8.3 (Berkeley) 5/2/95
  */
 
-#if 0
-#include <net/if_arp.h>
-#endif
-
 #define        ETHERMTU        1500
 
 /*
diff --git a/ip.h b/ip.h
new file mode 100644 (file)
index 0000000..75ec5a8
--- /dev/null
+++ b/ip.h
@@ -0,0 +1,192 @@
+/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.1 2000-09-23 08:54:25 guy Exp $ (LBL) */
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)ip.h        8.2 (Berkeley) 6/1/94
+ */
+
+#ifndef BYTE_ORDER
+#define        LITTLE_ENDIAN   1234    /* least-significant byte first (vax, pc) */
+#define        BIG_ENDIAN      4321    /* most-significant byte first (IBM, net) */
+#define        PDP_ENDIAN      3412    /* LSB first in word, MSW first in long (pdp)*/
+
+#ifdef WORDS_BIGENDIAN
+#define BYTE_ORDER     BIG_ENDIAN
+#else
+#define BYTE_ORDER     LITTLE_ENDIAN
+#endif /* WORDS_BIGENDIAN */
+#endif /* BYTE_ORDER */
+
+#if !defined(BYTE_ORDER) || \
+    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
+    BYTE_ORDER != PDP_ENDIAN)
+       /* you must determine what the correct bit order is for
+        * your compiler - the next line is an intentional error
+        * which will force your compiles to bomb until you fix
+        * the above macros.
+        */
+  #error "Undefined or invalid BYTE_ORDER";
+#endif
+
+/*
+ * Definitions for internet protocol version 4.
+ * Per RFC 791, September 1981.
+ */
+#define        IPVERSION       4
+
+/*
+ * Structure of an internet header, naked of options.
+ *
+ * We declare ip_len and ip_off to be short, rather than u_short
+ * pragmatically since otherwise unsigned comparisons can result
+ * against negative integers quite easily, and fail in subtle ways.
+ */
+struct ip {
+#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
+       u_char  ip_tos;                 /* type of service */
+       short   ip_len;                 /* total length */
+       u_short ip_id;                  /* identification */
+       short   ip_off;                 /* fragment offset field */
+#define        IP_DF 0x4000                    /* dont fragment flag */
+#define        IP_MF 0x2000                    /* more fragments flag */
+#define        IP_OFFMASK 0x1fff               /* mask for fragmenting bits */
+       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 */
+} __attribute__ ((packed));
+
+#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
+
+/*
+ * 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              0x00
+
+/*
+ * Definitions for options.
+ */
+#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 */
+#define        IPOPT_SECURITY          130             /* provide s,c,h,tcc */
+#define        IPOPT_LSRR              131             /* loose source route */
+#define        IPOPT_SATID             136             /* satnet id */
+#define        IPOPT_SSRR              137             /* strict source route */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define        IPOPT_OPTVAL            0               /* option ID */
+#define        IPOPT_OLEN              1               /* option length */
+#define IPOPT_OFFSET           2               /* offset within option */
+#define        IPOPT_MINOFF            4               /* min value of above */
+
+/*
+ * Time stamp option structure.
+ */
+struct ip_timestamp {
+       u_char  ipt_code;               /* IPOPT_TS */
+       u_char  ipt_len;                /* size of structure (variable) */
+       u_char  ipt_ptr;                /* index of current entry */
+#if BYTE_ORDER == LITTLE_ENDIAN 
+       u_char  ipt_flg:4,              /* flags, see below */
+               ipt_oflw:4;             /* overflow counter */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN 
+       u_char  ipt_oflw:4,             /* overflow counter */
+               ipt_flg:4;              /* flags, see below */
+#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;
+} __attribute__ ((packed));
+
+/* flag bits for ipt_flg */
+#define        IPOPT_TS_TSONLY         0               /* timestamps only */
+#define        IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
+#define        IPOPT_TS_PRESPEC        3               /* specified modules 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.
+ */
+#define        MAXTTL          255             /* maximum time to live (seconds) */
+#define        IPDEFTTL        64              /* default ttl, from RFC 1340 */
+#define        IPFRAGTTL       60              /* time to live for frags, slowhz */
+#define        IPTTLDEC        1               /* subtracted when forwarding */
+
+#define        IP_MSS          576             /* default maximum segment size */
index 4780251434cc43ebaa88f7c018a1f687fe7f9836..4787471bef67a27a3aa82136b60abe5aad77e44d 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.7 2000-09-23 08:26:30 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.8 2000-09-23 08:54:25 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,9 +40,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 
index 4dd12d667cc96bd6ba1410d672933b9543ea3980..9bce53fe1b1b960d42b5453928bc496866a548a7 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.56 2000-09-23 08:26:30 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.57 2000-09-23 08:54:25 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -42,8 +42,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index b0c92b88c40ba93791bc586472e33a7e12288e08..e8151f630e958d4935bfa3c2dec946f1107ff759 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.15 2000-09-23 08:26:31 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.16 2000-09-23 08:54:26 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,8 +37,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <pcap.h>
index fe5895872a76711c8a7afe7e811234d00e07212c..c9c7acce00f1ba45df7e64e35dec88da28414b6e 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.14 2000-09-23 08:26:31 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.15 2000-09-23 08:54:26 guy Exp $";
 #endif
 
 #include <sys/param.h>
@@ -43,8 +43,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <errno.h>
 #include <stdio.h>
index 673fec6d2bb8be1ea7233dd799c8e03122cacfe6..47c7d8cd40a2f5696ab1ec6a467d40ef72d4c3fe 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.6 2000-09-23 08:03:33 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.7 2000-09-23 08:54:26 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -41,7 +41,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <ctype.h>
 #include <netdb.h>
index 3b9e1f6762b80d672e742160aad53c7e646c381f..17c0d7235e8f9e98b0e3a6133bfef52188277819 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.6 2000-09-23 08:26:31 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.7 2000-09-23 08:54:27 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,8 +38,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <pcap.h>
index 738224070a8b3cc6883aa280470f8d9f73c771cf..50388fd1f9c91193db0f5215e90e0b615f3f7aad 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.48 2000-09-23 08:26:32 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.49 2000-09-23 08:54:27 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,8 +38,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #ifdef NOERROR
 #undef NOERROR                                 /* Solaris sucks */
index cc1da70515c17646f65291548f2c40a9e10b0076..88da1e1700780968d7ce1f5cf8df79be2146653d 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.18 2000-09-23 08:26:33 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.19 2000-09-23 08:54:27 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,8 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <string.h>
index 0c2ba934acf8f3e14199ab95954d8ff3e7b0553f..ca14f9898d0113620a40fba9fb984f489c71fddb 100644 (file)
@@ -20,7 +20,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.24 1999-11-21 09:36:51 fenner Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.25 2000-09-23 08:54:27 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,7 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <netdb.h>
 #include <stdio.h>
@@ -42,6 +41,8 @@ static const char rcsid[] =
 #include "interface.h"
 #include "addrtoname.h"
 
+#include "ip.h"
+
 struct egp_packet {
        u_char  egp_version;
 #define        EGP_VERSION     2
index b0438494a2f330bff619192317d8d23654de3b66..f74d84ba5a06bb5376683edcbd00457b8d7af583 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.8 2000-09-23 08:26:33 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.9 2000-09-23 08:54:28 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -41,9 +41,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #ifdef HAVE_LIBCRYPTO
 #include <des.h>
@@ -62,6 +59,8 @@ static const char rcsid[] =
 #include <netinet/ip6.h>
 #endif
 
+#include "ip.h"
+
 /* there's no standard definition so we are on our own */
 struct esp {
        u_int32_t       esp_spi;        /* ESP */
index aba4b5844d27ce35a1aa5e5bb28409567cf9f59d..a1f03c7fe511d2767defb7c4ad8bebfe73e1dcfd 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.53 2000-09-23 08:26:33 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.54 2000-09-23 08:54:28 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,8 +37,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <pcap.h>
index 161ed37c9b9a8c2095941871e94980c96f334253..a866cbdb273bcf9831545a258cbff6839a50cb4f 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.42 2000-09-23 08:03:35 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.43 2000-09-23 08:54:28 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,7 +40,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <ctype.h>
 #include <netdb.h>
index 31d5983605bb31cea363307a70f5cd3a711db152..4e422a691ea29508a3e581d276a13201ddbd208c 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.7 2000-09-23 08:26:33 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.8 2000-09-23 08:54:29 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -39,9 +39,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 
index bdd02ecc2b444249141a3ae84cddca84c7a09be2..a97259e7077b1c47adfd2cfa01f49fcdb81481d8 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.6 1999-11-21 09:36:52 fenner Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.7 2000-09-23 08:54:29 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,7 +38,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <netdb.h>
 #include <stdio.h>
index 169f61e28512ddb15c21c64ab7b19a179c261f3f..2e6e4d5972e8ae66637b02ceccbe8e5e9a93779b 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.50 2000-09-23 08:26:34 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.51 2000-09-23 08:54:29 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,9 +38,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -49,8 +46,126 @@ struct rtentry;
 #include "addrtoname.h"
 #include "extract.h"                   /* must come after interface.h */
 
+#include "ip.h"
 #include "udp.h"
 
+/*
+ * Interface Control Message Protocol Definitions.
+ * Per RFC 792, September 1981.
+ */
+
+/*
+ * Structure of an icmp header.
+ */
+struct icmp {
+       u_char  icmp_type;              /* type of message, see below */
+       u_char  icmp_code;              /* type sub code */
+       u_short icmp_cksum;             /* ones complement cksum of struct */
+       union {
+               u_char ih_pptr;                 /* ICMP_PARAMPROB */
+               struct in_addr ih_gwaddr;       /* ICMP_REDIRECT */
+               struct ih_idseq {
+                       n_short icd_id;
+                       n_short icd_seq;
+               } ih_idseq;
+               int ih_void;
+
+               /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+               struct ih_pmtu {
+                       n_short ipm_void;    
+                       n_short ipm_nextmtu;
+               } ih_pmtu;
+       } icmp_hun;
+#define        icmp_pptr       icmp_hun.ih_pptr
+#define        icmp_gwaddr     icmp_hun.ih_gwaddr
+#define        icmp_id         icmp_hun.ih_idseq.icd_id
+#define        icmp_seq        icmp_hun.ih_idseq.icd_seq
+#define        icmp_void       icmp_hun.ih_void
+#define        icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
+#define        icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
+       union {
+               struct id_ts {
+                       n_time its_otime;
+                       n_time its_rtime;
+                       n_time its_ttime;
+               } id_ts;
+               struct id_ip  {
+                       struct ip idi_ip;
+                       /* options and then 64 bits of data */
+               } id_ip;
+               u_int   id_mask;
+               char    id_data[1];
+       } icmp_dun;
+#define        icmp_otime      icmp_dun.id_ts.its_otime
+#define        icmp_rtime      icmp_dun.id_ts.its_rtime
+#define        icmp_ttime      icmp_dun.id_ts.its_ttime
+#define        icmp_ip         icmp_dun.id_ip.idi_ip
+#define        icmp_mask       icmp_dun.id_mask
+#define        icmp_data       icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enought to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define        ICMP_MINLEN     8                               /* abs minimum */
+#define        ICMP_TSLEN      (8 + 3 * sizeof (n_time))       /* timestamp */
+#define        ICMP_MASKLEN    12                              /* address mask */
+#define        ICMP_ADVLENMIN  (8 + sizeof (struct ip) + 8)    /* min */
+#define        ICMP_ADVLEN(p)  (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+       /* N.B.: must separately check that ip_hl >= 5 */
+
+/*
+ * Definition of type and code field values.
+ */
+#define        ICMP_ECHOREPLY          0               /* echo reply */
+#define        ICMP_UNREACH            3               /* dest unreachable, codes: */
+#define                ICMP_UNREACH_NET        0               /* bad net */
+#define                ICMP_UNREACH_HOST       1               /* bad host */
+#define                ICMP_UNREACH_PROTOCOL   2               /* bad protocol */
+#define                ICMP_UNREACH_PORT       3               /* bad port */
+#define                ICMP_UNREACH_NEEDFRAG   4               /* IP_DF caused drop */
+#define                ICMP_UNREACH_SRCFAIL    5               /* src route failed */
+#define                ICMP_UNREACH_NET_UNKNOWN 6              /* unknown net */
+#define                ICMP_UNREACH_HOST_UNKNOWN 7             /* unknown host */
+#define                ICMP_UNREACH_ISOLATED   8               /* src host isolated */
+#define                ICMP_UNREACH_NET_PROHIB 9               /* prohibited access */
+#define                ICMP_UNREACH_HOST_PROHIB 10             /* ditto */
+#define                ICMP_UNREACH_TOSNET     11              /* bad tos for net */
+#define                ICMP_UNREACH_TOSHOST    12              /* bad tos for host */
+#define        ICMP_SOURCEQUENCH       4               /* packet lost, slow down */
+#define        ICMP_REDIRECT           5               /* shorter route, codes: */
+#define                ICMP_REDIRECT_NET       0               /* for network */
+#define                ICMP_REDIRECT_HOST      1               /* for host */
+#define                ICMP_REDIRECT_TOSNET    2               /* for tos and net */
+#define                ICMP_REDIRECT_TOSHOST   3               /* for tos and host */
+#define        ICMP_ECHO               8               /* echo service */
+#define        ICMP_ROUTERADVERT       9               /* router advertisement */
+#define        ICMP_ROUTERSOLICIT      10              /* router solicitation */
+#define        ICMP_TIMXCEED           11              /* time exceeded, code: */
+#define                ICMP_TIMXCEED_INTRANS   0               /* ttl==0 in transit */
+#define                ICMP_TIMXCEED_REASS     1               /* ttl==0 in reass */
+#define        ICMP_PARAMPROB          12              /* ip header bad */
+#define                ICMP_PARAMPROB_OPTABSENT 1              /* req. opt. absent */
+#define        ICMP_TSTAMP             13              /* timestamp request */
+#define        ICMP_TSTAMPREPLY        14              /* timestamp reply */
+#define        ICMP_IREQ               15              /* information request */
+#define        ICMP_IREQREPLY          16              /* information reply */
+#define        ICMP_MASKREQ            17              /* address mask request */
+#define        ICMP_MASKREPLY          18              /* address mask reply */
+
+#define        ICMP_MAXTYPE            18
+
+#define        ICMP_INFOTYPE(type) \
+       ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+       (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+       (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+       (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+       (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
 /* rfc1700 */
 #ifndef ICMP_UNREACH_NET_UNKNOWN
 #define ICMP_UNREACH_NET_UNKNOWN       6       /* destination net unknown */
@@ -85,14 +200,6 @@ struct rtentry;
 #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15      /* precedence cutoff */
 #endif
 
-/* rfc1256 */
-#ifndef ICMP_ROUTERADVERT
-#define ICMP_ROUTERADVERT              9       /* router advertisement */
-#endif
-#ifndef ICMP_ROUTERSOLICIT
-#define ICMP_ROUTERSOLICIT             10      /* router solicitation */
-#endif
-
 /* Most of the icmp types */
 static struct tok icmp2str[] = {
        { ICMP_ECHOREPLY,               "echo reply" },
index 4ceb899472eaca118ef8f261bfe79071f9eaa69d..5d32dcb9bc4f5bdf87d4ebfb82561dd7e7340afa 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.23 2000-09-23 08:26:34 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.24 2000-09-23 08:54:29 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -41,9 +41,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <arpa/inet.h>
 
index b3eead128fb84514773bfeece511e58ee7277a73..0d4473b9781df15ef9f266cc7f0dde28ddc4a9a8 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.13 2000-09-23 08:26:34 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.14 2000-09-23 08:54:30 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,8 +36,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <errno.h>
 #include <stdio.h>
@@ -45,6 +43,7 @@ static const char rcsid[] =
 #include "interface.h"
 #include "addrtoname.h"
 #include "igrp.h"
+#include "ip.h"
 #include "extract.h"                   /* must come after interface.h */
 
 static void
index 6f770bd658771eef1f16d0579c4fb72adf1a6330..86686d22b0e7148a38b314aded6a9ef99be0b091 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.86 2000-09-23 08:26:34 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.87 2000-09-23 08:54:31 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,8 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -46,6 +44,8 @@ static const char rcsid[] =
 #include "interface.h"
 #include "extract.h"                   /* must come after interface.h */
 
+#include "ip.h"
+
 /* Compatibility */
 #ifndef        IPPROTO_ND
 #define        IPPROTO_ND      77
index 2bf8e089205c00b4ad94a036863d214f919d41d3..0ac8e7f707955f52ec14ab6f60c86840a570bc27 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.10 2000-09-23 08:26:35 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.11 2000-09-23 08:54:31 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,8 +37,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 70cf7aa0023a9dc1a0d6533c0a987dcb5128a2ee..4994b49ff02d7bf6f017f493ad6705a5adfb9e0a 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.6 2000-09-23 08:26:35 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.7 2000-09-23 08:54:31 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -39,9 +39,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 
index 074755d1ef4c7a1c309d822e0c973459595f9757..4372ce984a52f59e9d72bb1101d0c2484d32eb55 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.25 2000-09-23 08:26:35 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.26 2000-09-23 08:54:33 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,8 +37,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index b3d0e79986295b717c46a8d02bf15b7d971d42a8..4ad58e487a154ecaf3fb692544607c7524901d69 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.17 2000-09-23 08:26:35 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.18 2000-09-23 08:54:33 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -49,8 +49,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #ifdef INET6
 #include <netinet/ip6.h>
@@ -66,6 +64,8 @@ struct rtentry;
 #include "addrtoname.h"
 #include "extract.h"                    /* must come after interface.h */
 
+#include "ip.h"
+
 #ifndef HAVE_SOCKADDR_STORAGE
 #define sockaddr_storage sockaddr
 #endif
index ca7a10abe338a0c33f95712f4fed22ffe95c3e8e..15d596dad15723fbfc47522db0f7198deee1e31c 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.13 2000-09-23 08:26:36 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.14 2000-09-23 08:54:34 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,8 +36,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <ctype.h>
 #include <errno.h>
index 5af3218292faac2863e5d6176a101c5425d7707c..5e1dd4e6da2a0ef05a18eeac826c085c8ec7b884 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.6 2000-09-23 08:26:36 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.7 2000-09-23 08:54:34 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,8 +38,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <pcap.h>
index 977d9ee7b969b48510132f238c57a7bed7c8d422..561e048f89027cbd8c25a3040f58a286a00c2946 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.3 2000-01-09 21:34:18 fenner Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.4 2000-09-23 08:54:34 guy Exp $";
 #endif
 
 #include <sys/param.h>
@@ -52,7 +52,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <netdb.h>
 #include <stdio.h>
index 5579999df066b9adea47131209bc9574dcc212e0..56e2b42c931b19f7b85ac1e14d7806201dc83c3e 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.15 2000-09-23 08:26:36 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.16 2000-09-23 08:54:35 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,8 +36,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index 395107bfecac36e956c04eea5e5578a7e9cedaa3..02421b65fd87b34fe16e3e607ffcb3bdf7b062c9 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.82 2000-09-23 08:03:38 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.83 2000-09-23 08:54:35 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,7 +38,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 #ifdef INET6
 #include <netinet/ip6.h>
 #endif
@@ -56,6 +55,8 @@ struct rtentry;
 #include "nfs.h"
 #include "nfsfh.h"
 
+#include "ip.h"
+
 static void nfs_printfh(const u_int32_t *, const u_int);
 static void xid_map_enter(const struct rpc_msg *, const u_char *);
 static int32_t xid_map_find(const struct rpc_msg *, const u_char *,
index b7072181561443293e333da817f264d4f4b01514..cf9d6c497e425f5ba9a55b15322ce7c180a94dc8 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.33 2000-09-23 08:26:37 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.34 2000-09-23 08:54:35 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,8 +40,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <pcap.h>
 #include <stdio.h>
@@ -54,6 +52,8 @@ struct rtentry;
 #include "interface.h"
 #include "addrtoname.h"
 
+#include "ip.h"
+
 #ifndef AF_NS
 #define AF_NS          6               /* XEROX NS protocols */
 #endif
index 094977ed256703ee73810fe4471308266a7920f1..c929e57e6da134ae13c3da10d84aef890ef98c92 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.27 1999-11-21 09:36:58 fenner Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.28 2000-09-23 08:54:36 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,8 +36,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <ctype.h>
 #include <stdio.h>
@@ -47,6 +45,8 @@ static const char rcsid[] =
 
 #include "ospf.h"
 
+#include "ip.h"
+
 struct bits {
        u_int32_t bit;
        const char *str;
index bd1b0c5fdab26154495bbc590db8f633ceeb7c75..e5944b854f8a0f6d11ebe0aa7567b7cde2f0d415 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.4 2000-05-12 13:01:02 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.5 2000-09-23 08:54:36 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,8 +36,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <ctype.h>
 #include <stdio.h>
index ab869dc4e6e2938c431bf61e93cefd59cb1ace01..2097c90b44308965bfc16ab2db79bbe660eb7bed 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.20 2000-08-17 18:38:24 fenner Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.21 2000-09-23 08:54:37 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,7 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 /*
  * XXX: We consider a case where IPv6 is not ready yet for portability,
@@ -64,6 +63,8 @@ struct pim {
 #include "addrtoname.h"
 #include "extract.h"
 
+#include "ip.h"
+
 static void pimv2_print(register const u_char *bp, register u_int len);
 
 static void
index 4f0215a307f152c43db5078a37dd3c73205946f1..ee8160d371d0a4c9251d80ee95e21789d8d7dae5 100644 (file)
@@ -31,7 +31,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.46 2000-09-23 08:03:39 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.47 2000-09-23 08:54:37 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -50,7 +50,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <ctype.h>
 #include <netdb.h>
index 19b04547b718848d9b89b7d4a763168248f31908..576d64bd40e7a05fc7ab3d5cfccd0e449ebfdd23 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.29 2000-09-23 08:26:37 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.30 2000-09-23 08:54:37 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,8 +40,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <pcap.h>
 #include <stdio.h>
index 1fbae15286a9aaa3032ddb53763834d40e90b678..89a06df7f86d2bfe071add4a14ec08b26cfa8fa8 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.43 2000-09-23 08:26:37 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.44 2000-09-23 08:54:38 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,8 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <ctype.h>
index bade766ea490b9a5a1ad868b0b40b807a3e67174..d38ce82b1fc3631b3648dff9f7a69e2d4c8ccf34 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.4 2000-09-23 08:26:37 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.5 2000-09-23 08:54:38 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,8 +37,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <errno.h>
 #include <stdio.h>
index 13b403d5a1010ff89668d4a40f872ec2785fcba6..1df6aaaaf8dee790e9123c1e809c427433b6800f 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.11 2000-09-23 08:26:37 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.12 2000-09-23 08:54:38 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -39,9 +39,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 
index cff131c553274575a347b5009bf8a27fba15b638..a26785c08eb4a1523ae6577536a5d5939c845786 100644 (file)
@@ -13,7 +13,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.15 2000-07-29 09:20:26 assar Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.16 2000-09-23 08:54:39 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -29,7 +29,6 @@ static const char rcsid[] =
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 #include <arpa/inet.h>
 
 #include "interface.h"
@@ -41,6 +40,8 @@ static const char rcsid[] =
 
 #include "rx.h"
 
+#include "ip.h"
+
 static struct tok rx_types[] = {
        { RX_PACKET_TYPE_DATA,          "data" },
        { RX_PACKET_TYPE_ACK,           "ack" },
index e748391fa2249c857277bc3b516c8f3df8c7e49b..08dd0d695924c9e80e2caf05590213b8cd81371b 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.49 2000-09-23 08:26:38 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.50 2000-09-23 08:54:40 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -43,10 +43,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-
-#include <net/slcompress.h>
-#include <net/slip.h>
 
 #include <ctype.h>
 #include <netdb.h>
@@ -57,8 +53,12 @@ struct rtentry;
 #include "addrtoname.h"
 #include "extract.h"                   /* must come after interface.h */
 
+#include "ip.h"
 #include "tcp.h"
 
+#include <net/slcompress.h>
+#include <net/slip.h>
+
 static u_int lastlen[2][256];
 static u_int lastconn = 255;
 
index 9e622a060799631739153121f308a09a9d3e0a7c..c28b4f9a567dda99d4b5158a6e6976ec25e3ac3b 100644 (file)
@@ -11,7 +11,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.4 2000-09-23 08:26:38 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.5 2000-09-23 08:54:41 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -24,8 +24,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index d3f75ab1464b7430a0bc1a022d2ed5657ee61c23..7bb19223f7903f0b5085da02a3deb171a2f3c872 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.34 2000-09-23 08:03:41 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.35 2000-09-23 08:54:41 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,8 +38,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #ifdef INET6
 #include <netinet/ip6.h>
 #endif
@@ -58,6 +56,8 @@ struct rtentry;
 #include "interface.h"
 #include "addrtoname.h"
 
+#include "ip.h"
+
 static struct tok proc2str[] = {
        { PMAPPROC_NULL,        "null" },
        { PMAPPROC_SET,         "set" },
index 3b0202fcb1584bc5a7d953a2b95caf4d214b4c64..b7773df2d07388fbb21361b26042c0f22d6172ff 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.73 2000-09-23 08:26:38 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.74 2000-09-23 08:54:41 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -35,8 +35,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -54,6 +52,8 @@ static const char rcsid[] =
 
 #include "tcp.h"
 
+#include "ip.h"
+
 static void print_tcp_rst_data(register const u_char *sp, u_int length);
 
 #define MAX_RST_DATA_LEN       30
index 7ba929f9b086e28c9335f9d7be58bbd63f2033ac..635dd2301659580ed1edd7e4e38bb95afaaaee27 100644 (file)
@@ -51,7 +51,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.10 2000-09-23 08:26:38 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.11 2000-09-23 08:54:42 guy Exp $";
 #endif
 
 #include <sys/param.h>
@@ -61,8 +61,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #define TELCMDS
 #define TELOPTS
index 917c225b914fc394694472030d7809dd11ace68e..d87164109895073f7ea26480ab6269665617c573 100644 (file)
@@ -25,7 +25,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.3 2000-09-23 08:03:41 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.4 2000-09-23 08:54:42 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -42,7 +42,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <pcap.h>
 #include <stdio.h>
index eefec6db8f6156ae16fe031949d1c064b0ee468a..911a980eb1586827272aa7de2da42d4f4ce6486e 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.78 2000-09-23 08:26:39 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.79 2000-09-23 08:54:42 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,8 +34,6 @@ static const char rcsid[] =
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #ifdef SEGSIZE
 #undef SEGSIZE
@@ -56,6 +54,8 @@ static const char rcsid[] =
 
 #include "udp.h"
 
+#include "ip.h"
+
 #ifdef NOERROR
 #undef NOERROR                                 /* Solaris sucks */
 #endif
index 817e4f0f79198ae726bc76d063e8977c1083c920..fe2f4e3793f0d2567ad3248765b4c10e3e25bc4f 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.5 2000-09-23 08:03:41 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.6 2000-09-23 08:54:43 guy Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -42,7 +42,6 @@ struct rtentry;
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include <ctype.h>
 #include <netdb.h>
diff --git a/tcp.h b/tcp.h
index 38b959c0a26245af1b68cc85f32badf7a5945b17..0addc8a4d439f9e710c0825d8735a481a4586461 100644 (file)
--- a/tcp.h
+++ b/tcp.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.1 2000-09-23 08:26:39 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.2 2000-09-23 08:54:43 guy Exp $ (LBL) */
 /*
  * Copyright (c) 1982, 1986, 1993
  *     The Regents of the University of California.  All rights reserved.
  *     @(#)tcp.h       8.1 (Berkeley) 6/10/93
  */
 
+#ifndef BYTE_ORDER
+#define        LITTLE_ENDIAN   1234    /* least-significant byte first (vax, pc) */
+#define        BIG_ENDIAN      4321    /* most-significant byte first (IBM, net) */
+#define        PDP_ENDIAN      3412    /* LSB first in word, MSW first in long (pdp)*/
+
+#ifdef WORDS_BIGENDIAN
+#define BYTE_ORDER     BIG_ENDIAN
+#else
+#define BYTE_ORDER     LITTLE_ENDIAN
+#endif /* WORDS_BIGENDIAN */
+#endif /* BYTE_ORDER */
+
+#if !defined(BYTE_ORDER) || \
+    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
+    BYTE_ORDER != PDP_ENDIAN)
+       /* you must determine what the correct bit order is for
+        * your compiler - the next line is an intentional error
+        * which will force your compiles to bomb until you fix
+        * the above macros.
+        */
+  #error "Undefined or invalid BYTE_ORDER";
+#endif
+
 typedef        u_int   tcp_seq;
 /*
  * TCP header.
index bc07a1abb5d62ef1e627d1f5965cfb0d0d40289d..b68699baec1cbe06ba71bdc63ef5448a1ab31482 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -24,7 +24,7 @@ static const char copyright[] =
     "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
 The Regents of the University of California.  All rights reserved.\n";
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.152 2000-09-18 05:11:44 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.153 2000-09-23 08:54:44 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -53,7 +53,6 @@ static const char rcsid[] =
 #include <ctype.h>
 
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 
 #include "interface.h"
 #include "addrtoname.h"