#include <net/if.h>
-/*
- * NetBSD insists on having <net/if.h> pull in <net/dlt.h>, so that
- * including <net/if.h> defines a bunch of stuff we later define in our
- * pcap/dlt.h; those definitions will be different, if they haven't
- * picked up all of our changes yet.
- *
- * Undefine some of the offending items.
- */
-#ifdef __NetBSD__
-#undef DLT_USB /* we now define it as DLT_FREEBSD_USB */
-#undef DLT_MATCHING_MAX /* we may define more DLT_ values than they do */
-#endif
-
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
struct rtentry; /* declarations in <net/if.h> */
#include <net/if.h>
#include <netinet/in.h>
-
-/*
- * NetBSD insists on having <net/if.h> pull in <net/dlt.h>, so that
- * including <net/if.h> defines a bunch of stuff we later define in our
- * pcap/dlt.h; those definitions will be different, if they haven't
- * picked up all of our changes yet.
- *
- * Undefine some of the offending items.
- */
-#ifdef __NetBSD__
-#undef DLT_USB /* we now define it as DLT_FREEBSD_USB */
-#undef DLT_MATCHING_MAX /* we may define more DLT_ values than they do */
-#endif
-
#endif /* _WIN32 */
#include <ctype.h>
struct rtentry; /* declarations in <net/if.h> */
#include <net/if.h>
#include <netinet/in.h>
-
-/*
- * NetBSD insists on having <net/if.h> pull in <net/dlt.h>, so that
- * including <net/if.h> defines a bunch of stuff we later define in our
- * pcap/dlt.h; those definitions will be different, if they haven't
- * picked up all of our changes yet.
- *
- * Undefine some of the offending items.
- */
-#ifdef __NetBSD__
-#undef DLT_USB /* we now define it as DLT_FREEBSD_USB */
-#undef DLT_MATCHING_MAX /* we may define more DLT_ values than they do */
-#endif
-
#endif /* _WIN32 */
#include <errno.h>
struct rtentry; /* declarations in <net/if.h> */
#include <net/if.h> /* for "struct ifnet" in "struct arpcom" on Solaris */
#include <netinet/if_ether.h>
-
-/*
- * NetBSD insists on having <net/if.h> pull in <net/dlt.h>, so that
- * including <net/if.h> defines a bunch of stuff we later define in our
- * pcap/dlt.h; those definitions will be different, if they haven't
- * picked up all of our changes yet.
- *
- * Undefine some of the offending items.
- */
-#ifdef __NetBSD__
-#undef DLT_USB /* we now define it as DLT_FREEBSD_USB */
-#undef DLT_MATCHING_MAX /* we may define more DLT_ values than they do */
-#endif
-
#endif /* HAVE_NETINET_IF_ETHER_H */
#ifdef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON
#include <netinet/ether.h>
*
* This is now used by FreeBSD for its BPF taps for USB; that has its
* own headers. So it is written, so it is done.
+ *
+ * For source-code compatibility, we also define DLT_USB to have this
+ * value. We do it numerically so that, if code that includes this
+ * file (directly or indirectly) also includes an OS header that also
+ * defines DLT_USB as 186, we don't get a redefinition warning.
+ * (NetBSD 7 does that.)
*/
#define DLT_USB_FREEBSD 186
-#define DLT_USB DLT_USB_FREEBSD /* source compatibility */
+#define DLT_USB 186
/*
* Bluetooth HCI UART transport layer (part H:4); requested by
*/
#define DLT_ISO_14443 264
+/*
+ * In case the code that includes this file (directly or indirectly)
+ * has also included OS files that happen to define DLT_MATCHING_MAX,
+ * with a different value (perhaps because that OS hasn't picked up
+ * the latest version of our DLT definitions), we undefine the
+ * previous value of DLT_MATCHING_MAX.
+ */
+#ifdef DLT_MATCHING_MAX
+#undef DLT_MATCHING_MAX
+#endif
#define DLT_MATCHING_MAX 264 /* highest value in the "matching" range */
/*