#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.46 2000-09-23 08:03:31 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.49 2000-10-10 05:05:07 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <sys/param.h>
#include <sys/time.h>
-#include <sys/socket.h>
-
-struct mbuf;
-struct rtentry;
-#include <net/if.h>
#include <netinet/in.h>
#endif
};
+#define ARP_HDRLEN 8
+
/*
* Ethernet Address Resolution Protocol.
*
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op
+#define ETHER_ARP_HDRLEN (ARP_HDRLEN + 6 + 4 + 6 + 4)
+
#define SHA(ap) ((ap)->arp_sha)
#define THA(ap) ((ap)->arp_tha)
#define SPA(ap) ((ap)->arp_spa)
printf("[|arp]");
return;
}
- if (length < sizeof(struct ether_arp)) {
+ if (length < ETHER_ARP_HDRLEN) {
(void)printf("truncated-arp");
default_print((u_char *)ap, length);
return;