"linux-includes/netinet/if_ether.h" to "ethertype.h".
Move other stuff used by dissectors from <netinet/if_ether.h> to
"ether.h", along the lines of "fddi.h" and "token.h".
Move ARP declarations from BSD include files to "print-arp.c".
Remove from dissectors includes of <netinet/if_ether.h>, and add
includes of "ethertype.h" and/or "ether.h" as necessary.
Get rid of configuration options that test declarations now made in
"ether.h" or "print-arp.c", as those declarations are now under our
control, not the OS's control.
decnet.h
dhcp6.h
dhcp6opt.h
+ether.h
ethertype.h
extract.h
fddi.h
-@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.44 2000-08-19 02:07:30 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.45 2000-09-23 08:03:27 guy Exp $ (LBL)
If you have not built libpcap, do so first. See the README
file in this directory for the ftp location.
with 2.0.25 and more modern, and 2.2.x kernels. It is guaranteed not
to work with 1.X kernels.
-If you use OSF 4, note that that there appears to be some serious bugs
-with the stock C compiler. The configure code fragments that detect if
-the ether_header and ether_arp structs use the ether_addr struct
-generates warnings instead of fatal errors (?!?!) This makes configure
-think that the ether_arp struct is used when in fact it is not. To get
-around this, comment out:
-
-#define ETHER_HEADER_HAS_EA 1
-and
-#define ETHER_ARP_HAS_EA 1
-
-from config.h after running configure (and before attempting to
-compile tcpdump).
-
-Another workaround is to use gcc.
-
If your system is not one which we have tested tcpdump on, you may have
to modify the configure script and Makefile.in. Please send us patches
for any modifications you need to make.
*/
#undef ETHER_HEADER_HAS_EA
-/*
- * define if struct ether_arp.arp_sha is a struct with ether_addr_octet
- */
-#undef ETHER_ARP_HAS_EA
-
/* define if struct ether_arp contains arp_xsha */
#undef ETHER_ARP_HAS_X
/* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE
-/*
- * define if struct ether_header.ether_dhost is a struct with ether_addr_octet
- */
-#undef ETHER_HEADER_HAS_EA
-
-/*
- * define if struct ether_arp.arp_sha is a struct with ether_addr_octet
- */
-#undef ETHER_ARP_HAS_EA
-
-/* define if struct ether_arp contains arp_xsha */
-#undef ETHER_ARP_HAS_X
-
/* define if you have the addrinfo function. */
#undef HAVE_ADDRINFO
fi
-echo $ac_n "checking if ether_header uses ether_addr structs""... $ac_c" 1>&6
-echo "configure:4355: checking if ether_header uses ether_addr structs" >&5
-if eval "test \"`echo '$''{'ac_cv_ether_header_has_ea'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- cat > conftest.$ac_ext <<EOF
-#line 4362 "configure"
-#include "confdefs.h"
-
-# include <sys/types.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <sys/socket.h>
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>
-int main() {
-u_int i =
- sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)
-; return 0; }
-EOF
-if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_ether_header_has_ea=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_ether_header_has_ea=no
-fi
-rm -f conftest*
- CFLAGS="$LBL_SAVE_CFLAGS"
-fi
-
-echo "$ac_t""$ac_cv_ether_header_has_ea" 1>&6
-if test $ac_cv_ether_header_has_ea = yes ; then
- cat >> confdefs.h <<\EOF
-#define ETHER_HEADER_HAS_EA 1
-EOF
-
-fi
-
-echo $ac_n "checking if ether_arp uses ether_addr structs""... $ac_c" 1>&6
-echo "configure:4402: checking if ether_arp uses ether_addr structs" >&5
-if eval "test \"`echo '$''{'ac_cv_ether_arp_has_ea'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- cat > conftest.$ac_ext <<EOF
-#line 4409 "configure"
-#include "confdefs.h"
-
-# include <sys/types.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <sys/socket.h>
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>
-int main() {
-u_int i =
- sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)
-; return 0; }
-EOF
-if { (eval echo configure:4427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_ether_arp_has_ea=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_ether_arp_has_ea=no
-fi
-rm -f conftest*
- CFLAGS="$LBL_SAVE_CFLAGS"
-fi
-
-echo "$ac_t""$ac_cv_ether_arp_has_ea" 1>&6
-if test $ac_cv_ether_arp_has_ea = yes ; then
- cat >> confdefs.h <<\EOF
-#define ETHER_ARP_HAS_EA 1
-EOF
-
-fi
-
-echo $ac_n "checking if ether_arp uses erp_xsha member""... $ac_c" 1>&6
-echo "configure:4449: checking if ether_arp uses erp_xsha member" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_ether_arp_x'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
-#include "confdefs.h"
-
-# include <sys/types.h>
-# include <sys/socket.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>
-int main() {
-u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)
-; return 0; }
-EOF
-if { (eval echo configure:4473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_ether_arp_x=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_ether_arp_x=no
-fi
-rm -f conftest*
- CFLAGS="$LBL_SAVE_CFLAGS"
-fi
-
-echo "$ac_t""$ac_cv_struct_ether_arp_x" 1>&6
-if test $ac_cv_struct_ether_arp_x = yes ; then
- cat >> confdefs.h <<\EOF
-#define ETHER_ARP_HAS_X 1
-EOF
-
-fi
-
echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6
-echo "configure:4495: checking if unaligned accesses fail" >&5
+echo "configure:4355: checking if unaligned accesses fail" >&5
if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for h_errno""... $ac_c" 1>&6
-echo "configure:4560: checking for h_errno" >&5
+echo "configure:4420: checking for h_errno" >&5
if eval "test \"`echo '$''{'ac_cv_var_h_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4565 "configure"
+#line 4425 "configure"
#include "confdefs.h"
# include <sys/types.h>
int foo = h_errno;
; return 0; }
EOF
-if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_var_h_errno=yes
else
else
echo $ac_n "checking for SSLeay""... $ac_c" 1>&6
-echo "configure:4602: checking for SSLeay" >&5
+echo "configure:4462: checking for SSLeay" >&5
ac_cv_ssleay_path=no
incdir=no
for dir in /usr /usr/local /usr/local/ssl /usr/pkg; do
LIBS="$LIBS -lrsaref"
fi
echo $ac_n "checking for des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6
-echo "configure:4634: checking for des_cbc_encrypt in -lcrypto" >&5
+echo "configure:4494: checking for des_cbc_encrypt in -lcrypto" >&5
ac_lib_var=`echo crypto'_'des_cbc_encrypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4642 "configure"
+#line 4502 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
des_cbc_encrypt()
; return 0; }
EOF
-if { (eval echo configure:4653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4687: checking for $ac_hdr" >&5
+echo "configure:4547: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4692 "configure"
+#line 4552 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test "$ac_cv_header_cast_h" = "yes"; then
echo $ac_n "checking for buggy CAST128""... $ac_c" 1>&6
-echo "configure:4726: checking for buggy CAST128" >&5
+echo "configure:4586: checking for buggy CAST128" >&5
if test "$cross_compiling" = yes; then
buggy_cast128="cross-compiling, assume yes"
else
cat > conftest.$ac_ext <<EOF
-#line 4731 "configure"
+#line 4591 "configure"
#include "confdefs.h"
#include <cast.h>
return 1;
}
EOF
-if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
buggy_cast128=yes
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4797: checking for a BSD compatible install" >&5
+echo "configure:4657: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.120 2000-07-11 00:48:16 assar Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.121 2000-09-23 08:03:29 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_REVISION($Revision: 1.120 $)
+AC_REVISION($Revision: 1.121 $)
AC_PREREQ(2.13)
AC_INIT(tcpdump.c)
AC_LBL_SOCKADDR_SA_LEN
-AC_MSG_CHECKING(if ether_header uses ether_addr structs)
-AC_CACHE_VAL(ac_cv_ether_header_has_ea,
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- AC_TRY_COMPILE([
-# include <sys/types.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <sys/socket.h>
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>],
- [u_int i =
- sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
- ac_cv_ether_header_has_ea=yes,
- ac_cv_ether_header_has_ea=no)
- CFLAGS="$LBL_SAVE_CFLAGS")
-AC_MSG_RESULT($ac_cv_ether_header_has_ea)
-if test $ac_cv_ether_header_has_ea = yes ; then
- AC_DEFINE(ETHER_HEADER_HAS_EA)
-fi
-
-AC_MSG_CHECKING(if ether_arp uses ether_addr structs)
-AC_CACHE_VAL(ac_cv_ether_arp_has_ea,
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- AC_TRY_COMPILE([
-# include <sys/types.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <sys/socket.h>
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>],
- [u_int i =
- sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)],
- ac_cv_ether_arp_has_ea=yes,
- ac_cv_ether_arp_has_ea=no)
- CFLAGS="$LBL_SAVE_CFLAGS")
-AC_MSG_RESULT($ac_cv_ether_arp_has_ea)
-if test $ac_cv_ether_arp_has_ea = yes ; then
- AC_DEFINE(ETHER_ARP_HAS_EA)
-fi
-
-AC_MSG_CHECKING(if ether_arp uses erp_xsha member)
-AC_CACHE_VAL(ac_cv_struct_ether_arp_x,
- LBL_SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- AC_TRY_COMPILE([
-# include <sys/types.h>
-# include <sys/socket.h>
-# if __STDC__
- /* osf3 has REALLY good prototyes */
- struct mbuf;
- struct rtentry;
-# endif
-# include <net/if.h>
-# include <netinet/in.h>
-# include <netinet/if_ether.h>],
- [u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)],
- ac_cv_struct_ether_arp_x=yes,
- ac_cv_struct_ether_arp_x=no)
- CFLAGS="$LBL_SAVE_CFLAGS")
-AC_MSG_RESULT($ac_cv_struct_ether_arp_x)
-if test $ac_cv_struct_ether_arp_x = yes ; then
- AC_DEFINE(ETHER_ARP_HAS_X)
-fi
-
AC_LBL_UNALIGNED_ACCESS
AC_VAR_H_ERRNO
--- /dev/null
+/*
+ * 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.
+ *
+ * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
+ */
+
+#if 0
+#include <net/if_arp.h>
+#endif
+
+#define ETHERMTU 1500
+
+/*
+ * The number of bytes in an ethernet (MAC) address.
+ */
+#define ETHER_ADDR_LEN 6
+
+/*
+ * Ethernet address - 6 octets
+ */
+struct ether_addr {
+ u_char ether_addr_octet[ETHER_ADDR_LEN];
+};
+
+/*
+ * Structure of a 10Mb/s Ethernet header.
+ */
+struct ether_header {
+ u_char ether_dhost[ETHER_ADDR_LEN];
+ u_char ether_shost[ETHER_ADDR_LEN];
+ u_short ether_type;
+};
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.11 2000-06-10 13:49:08 assar Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.12 2000-09-23 08:03:30 guy Exp $ (LBL)
*/
-/* Types missing from some systems */
+/*
+ * Ethernet types.
+ *
+ * We wrap the declarations with #ifdef, so that if a file includes
+ * <netinet/if_ether.h>, which may declare some of these, we don't
+ * get a bunch of complaints from the C compiler about redefinitions
+ * of these values.
+ *
+ * We declare all of them here so that no file has to include
+ * <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
+ */
+#ifndef ETHERTYPE_PUP
+#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
+#endif
+#ifndef ETHERTYPE_IP
+#define ETHERTYPE_IP 0x0800 /* IP protocol */
+#endif
+#ifndef ETHERTYPE_ARP
+#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
+#endif
+#ifndef ETHERTYPE_REVARP
+#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
+#endif
#ifndef ETHERTYPE_NS
#define ETHERTYPE_NS 0x0600
#endif
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.135 2000-09-18 05:11:43 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.136 2000-09-23 08:03:30 guy Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
#define LITTLE_ENDIAN 1234
#endif
-#ifdef ETHER_HEADER_HAS_EA
-#define ESRC(ep) ((ep)->ether_shost.ether_addr_octet)
-#define EDST(ep) ((ep)->ether_dhost.ether_addr_octet)
-#else
#define ESRC(ep) ((ep)->ether_shost)
#define EDST(ep) ((ep)->ether_dhost)
-#endif
-
-#ifdef ETHER_ARP_HAS_X
-#define SHA(ap) ((ap)->arp_xsha)
-#define THA(ap) ((ap)->arp_xtha)
-#define SPA(ap) ((ap)->arp_xspa)
-#define TPA(ap) ((ap)->arp_xtpa)
-#else
-#ifdef ETHER_ARP_HAS_EA
-#define SHA(ap) ((ap)->arp_sha.ether_addr_octet)
-#define THA(ap) ((ap)->arp_tha.ether_addr_octet)
-#else
-#define SHA(ap) ((ap)->arp_sha)
-#define THA(ap) ((ap)->arp_tha)
-#endif
-#define SPA(ap) ((ap)->arp_spa)
-#define TPA(ap) ((ap)->arp_tpa)
-#endif
#ifndef NTOHL
#define NTOHL(x) (x) = ntohl(x)
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.5 1999-12-15 08:10:17 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.6 2000-09-23 08:03:30 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.45 2000-07-01 03:39:01 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.46 2000-09-23 08:03:31 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <stdio.h>
#include <string.h>
#include "interface.h"
#include "addrtoname.h"
+#include "ether.h"
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
+/*
+ * Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. ARP packets are variable
+ * in size; the arphdr structure defines the fixed-length portion.
+ * Protocol type values are the same as those for 10 Mb/s Ethernet.
+ * It is followed by the variable-sized fields ar_sha, arp_spa,
+ * arp_tha and arp_tpa in that order, according to the lengths
+ * specified. Field names used correspond to RFC 826.
+ */
+struct arphdr {
+ u_short ar_hrd; /* format of hardware address */
+#define ARPHRD_ETHER 1 /* ethernet hardware format */
+#define ARPHRD_IEEE802 6 /* token-ring hardware format */
+#define ARPHRD_FRELAY 15 /* frame relay hardware format */
+ u_short ar_pro; /* format of protocol address */
+ u_char ar_hln; /* length of hardware address */
+ u_char ar_pln; /* length of protocol address */
+ u_short ar_op; /* one of: */
+#define ARPOP_REQUEST 1 /* request to resolve address */
+#define ARPOP_REPLY 2 /* response to previous request */
+#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
+#define ARPOP_REVREPLY 4 /* response giving protocol address */
+#define ARPOP_INVREQUEST 8 /* request to identify peer */
+#define ARPOP_INVREPLY 9 /* response identifying peer */
+/*
+ * The remaining fields are variable in size,
+ * according to the sizes above.
+ */
+#ifdef COMMENT_ONLY
+ u_char ar_sha[]; /* sender hardware address */
+ u_char ar_spa[]; /* sender protocol address */
+ u_char ar_tha[]; /* target hardware address */
+ u_char ar_tpa[]; /* target protocol address */
+#endif
+};
+
+/*
+ * Ethernet Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. Structure below is adapted
+ * to resolving internet addresses. Field names used correspond to
+ * RFC 826.
+ */
+struct ether_arp {
+ struct arphdr ea_hdr; /* fixed-size header */
+ u_char arp_sha[6]; /* sender hardware address */
+ u_char arp_spa[4]; /* sender protocol address */
+ u_char arp_tha[6]; /* target hardware address */
+ u_char arp_tpa[4]; /* target protocol address */
+};
+#define arp_hrd ea_hdr.ar_hrd
+#define arp_pro ea_hdr.ar_pro
+#define arp_hln ea_hdr.ar_hln
+#define arp_pln ea_hdr.ar_pln
+#define arp_op ea_hdr.ar_op
+
+#define SHA(ap) ((ap)->arp_sha)
+#define THA(ap) ((ap)->arp_tha)
+#define SPA(ap) ((ap)->arp_spa)
+#define TPA(ap) ((ap)->arp_tpa)
+
/* Compatibility */
#ifndef REVARP_REQUEST
#define REVARP_REQUEST 3
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.54 2000-04-02 23:50:48 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.55 2000-09-23 08:03:31 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#include <netinet/if_ether.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/tcp.h>
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.13 2000-07-01 03:39:01 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.14 2000-09-23 08:03:33 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.50 2000-07-01 03:56:43 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.51 2000-09-23 08:03:33 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <stdio.h>
#include "interface.h"
#include "addrtoname.h"
+#include "ether.h"
#include "bootp.h"
static void rfc1048_print(const u_char *, u_int);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.5 2000-09-18 05:11:44 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.6 2000-09-23 08:03:33 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <netdb.h>
#include "interface.h"
#include "addrtoname.h"
+#include "ethertype.h"
#include "ppp.h"
#include "chdlc.h"
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.4 2000-04-28 11:34:12 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.5 2000-09-23 08:03:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include "interface.h"
#include "addrtoname.h"
+#include "ethertype.h"
+#include "ether.h"
const u_char *packetp;
const u_char *snapend;
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.46 2000-07-05 23:50:37 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.47 2000-09-23 08:03:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.6 2000-01-15 02:33:06 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.7 2000-09-23 08:03:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.51 2000-07-01 03:39:02 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.52 2000-09-23 08:03:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include "addrtoname.h"
#include "ethertype.h"
+#include "ether.h"
+
const u_char *packetp;
const u_char *snapend;
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.41 2000-07-01 03:39:02 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.42 2000-09-23 08:03:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include "addrtoname.h"
#include "ethertype.h"
+#include "ether.h"
#include "fddi.h"
/*
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.5 2000-02-03 18:16:40 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.6 2000-09-23 08:03:35 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.48 2000-07-01 03:39:03 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.49 2000-09-23 08:03:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.21 2000-08-30 14:28:44 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.22 2000-09-23 08:03:36 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.4 2000-01-19 04:51:11 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.5 2000-09-23 08:03:36 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.15 2000-09-23 04:43:42 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.16 2000-09-23 08:03:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.17 2000-07-01 03:39:06 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.18 2000-09-23 08:03:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <stdio.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.4 2000-07-10 04:35:58 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.5 2000-09-23 08:03:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include "interface.h"
#include "addrtoname.h"
+#include "ether.h"
#include "lane.h"
static inline void
#ifndef lint
static const char rcsid[] =
-"@(#) $Header: /tcpdump/master/tcpdump/Attic/print-lcp.c,v 1.6 2000-07-01 03:39:06 assar Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/Attic/print-lcp.c,v 1.7 2000-09-23 08:03:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <stdio.h>
#include <string.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.81 2000-08-03 18:52:24 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.82 2000-09-23 08:03:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#ifdef INET6
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.28 2000-07-01 03:39:07 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.29 2000-09-23 08:03:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <stdio.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.31 2000-07-01 03:39:07 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.32 2000-09-23 08:03:39 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.45 2000-09-18 05:23:31 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.46 2000-09-23 08:03:39 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <netdb.h>
#ifndef lint
static const char rcsid[] =
-"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.6 2000-08-18 07:44:47 itojun Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.7 2000-09-23 08:03:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <stdio.h>
#include <string.h>
#include "addrtoname.h"
#include "ppp.h"
#include "ethertype.h"
+#include "ether.h"
#include "extract.h" /* must come after interface.h */
/* Codes */
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.27 2000-07-11 01:22:39 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.28 2000-09-23 08:03:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.9 2000-06-16 19:41:31 assar Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.10 2000-09-23 08:03:40 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.47 2000-07-01 03:39:09 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.48 2000-09-23 08:03:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.33 2000-07-01 03:39:10 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.34 2000-09-23 08:03:41 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.2 2000-07-30 05:55:44 assar Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.3 2000-09-23 08:03:41 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include "addrtoname.h"
#include "ethertype.h"
+#include "ether.h"
#include "token.h"
/* Extract src, dst addresses */
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.4 2000-07-01 03:39:11 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.5 2000-09-23 08:03:41 guy Exp $ (LBL)";
#endif
#include <sys/param.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <netdb.h>
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.9 2000-07-29 08:03:06 assar Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.10 2000-09-23 08:03:42 guy Exp $";
#endif
#include <sys/param.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <ctype.h>
#include <stdio.h>