supplied by Linux's ARCNET code aren't the same as the ones supplied by
NetBSD's ARCNET code.
Fix up some LINKTYPE_ values to match the corresponding DLT_ values.
(There is no released version of libpcap/tcpdump that supports their
previous values.)
*
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
*
*
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
*
- * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.65 2002-12-26 08:53:07 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.66 2003-01-21 04:39:05 guy Exp $ (LBL)
*/
#ifndef BPF_MAJOR_VERSION
*/
#ifndef BPF_MAJOR_VERSION
#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
#define DLT_CHAOS 5 /* Chaos */
#define DLT_IEEE802 6 /* IEEE 802 Networks */
#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_ARCNET 7 /* ARCNET, with NetBSD-style header */
#define DLT_SLIP 8 /* Serial Line IP */
#define DLT_PPP 9 /* Point-to-point Protocol */
#define DLT_FDDI 10 /* FDDI */
#define DLT_SLIP 8 /* Serial Line IP */
#define DLT_PPP 9 /* Point-to-point Protocol */
#define DLT_FDDI 10 /* FDDI */
*/
#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */
*/
#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */
+/*
+ * NetBSD's ARCNET headers have the source host, destination host,
+ * and type at the beginning of the packet; that's what's handed
+ * up to userland via BPF.
+ *
+ * Linux's ARCNET headers, however, have a 2-byte offset field
+ * between the host IDs and the type; that's what's handed up
+ * to userland via PF_PACKET sockets.
+ *
+ * We therefore have to have separate DLT_ values for them.
+ */
+#define DLT_ARCNET_LINUX 129 /* ARCNET */
+
/*
* The instruction encodings.
*/
/*
* The instruction encodings.
*/
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.73 2002-12-26 08:53:07 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.74 2003-01-21 04:39:05 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
#define LINKTYPE_PRONET DLT_PRONET
#define LINKTYPE_CHAOS DLT_CHAOS
#define LINKTYPE_TOKEN_RING DLT_IEEE802 /* DLT_IEEE802 is used for Token Ring */
#define LINKTYPE_PRONET DLT_PRONET
#define LINKTYPE_CHAOS DLT_CHAOS
#define LINKTYPE_TOKEN_RING DLT_IEEE802 /* DLT_IEEE802 is used for Token Ring */
-#define LINKTYPE_ARCNET DLT_ARCNET
+#define LINKTYPE_ARCNET DLT_ARCNET /* NetBSD-style headers */
#define LINKTYPE_SLIP DLT_SLIP
#define LINKTYPE_PPP DLT_PPP
#define LINKTYPE_FDDI DLT_FDDI
#define LINKTYPE_SLIP DLT_SLIP
#define LINKTYPE_PPP DLT_PPP
#define LINKTYPE_FDDI DLT_FDDI
#define LINKTYPE_IP_OVER_FC 122 /* RFC 2625 IP-over-Fibre Channel */
#define LINKTYPE_SUNATM 123 /* Solaris+SunATM */
#define LINKTYPE_IP_OVER_FC 122 /* RFC 2625 IP-over-Fibre Channel */
#define LINKTYPE_SUNATM 123 /* Solaris+SunATM */
-#define LINKTYPE_TZSP 126 /* Tazmen Sniffer Protocol */
-
#define LINKTYPE_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */
#define LINKTYPE_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */
+#define LINKTYPE_TZSP 128 /* Tazmen Sniffer Protocol */
+
+#define LINKTYPE_ARCNET_LINUX 129 /* Linux-style headers */
+
/*
* These types are reserved for future use.
*/
/*
* These types are reserved for future use.
*/
#define LINKTYPE_IPFILTER 116 /* IP Filter capture files */
#define LINKTYPE_PFLOG 117 /* OpenBSD DLT_PFLOG */
#define LINKTYPE_HHDLC 121 /* Siemens HiPath HDLC */
#define LINKTYPE_IPFILTER 116 /* IP Filter capture files */
#define LINKTYPE_PFLOG 117 /* OpenBSD DLT_PFLOG */
#define LINKTYPE_HHDLC 121 /* Siemens HiPath HDLC */
-#define LINKTYPE_RIO 123 /* RapidIO */
-#define LINKTYPE_PCI_EXP 124 /* PCI Express */
-#define LINKTYPE_AURORA 125 /* Xilinx Aurora link layer */
+#define LINKTYPE_RIO 124 /* RapidIO */
+#define LINKTYPE_PCI_EXP 125 /* PCI Express */
+#define LINKTYPE_AURORA 126 /* Xilinx Aurora link layer */
static struct linktype_map {
int dlt;
static struct linktype_map {
int dlt;
/* Xilinx Aurora link layer */
{ DLT_AURORA, LINKTYPE_AURORA },
/* Xilinx Aurora link layer */
{ DLT_AURORA, LINKTYPE_AURORA },
+ /* 802.11 plus WLAN header */
+ { DLT_IEEE802_11_RADIO, LINKTYPE_IEEE802_11_RADIO },
+
/* Tazmen Sniffer Protocol */
{ DLT_TZSP, LINKTYPE_TZSP },
/* Tazmen Sniffer Protocol */
{ DLT_TZSP, LINKTYPE_TZSP },
- /* 802.11 plus WLAN header */
- { DLT_IEEE802_11_RADIO, LINKTYPE_IEEE802_11_RADIO },
+ /* Arcnet with Linux-style link-layer headers */
+ { DLT_ARCNET_LINUX, LINKTYPE_ARCNET_LINUX },
/*
* Any platform that defines additional DLT_* codes should:
/*
* Any platform that defines additional DLT_* codes should: