]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-common.c
pcap_create_interface() needs the interface name on Linux.
[libpcap] / pcap-common.c
index 4db49688547a4a2ce02d52666b0ee132dee3c9ca..1aca831a873eeda702e6f5ff92de31965d69e2f6 100644 (file)
@@ -25,9 +25,9 @@
 #include "config.h"
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <pcap-stdinc.h>
-#else /* WIN32 */
+#else /* _WIN32 */
 #if HAVE_INTTYPES_H
 #include <inttypes.h>
 #elif HAVE_STDINT_H
@@ -37,7 +37,7 @@
 #include <sys/bitypes.h>
 #endif
 #include <sys/types.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
 #include "pcap-int.h"
 #include "pcap/usb.h"
 
 #define LINKTYPE_GPRS_LLC      169             /* GPRS LLC */
 #define LINKTYPE_GPF_T         170             /* GPF-T (ITU-T G.7041/Y.1303) */
-#define LINKTYPE_GPF_F         171             /* GPF-T (ITU-T G.7041/Y.1303) */
+#define LINKTYPE_GPF_F         171             /* GPF-F (ITU-T G.7041/Y.1303) */
 
 /*
  * Requested by Oolan Zimmer <[email protected]> for use in Gcom's T1/E1 line
 #define LINKTYPE_A653_ICM       185
 
 /*
- * USB packets, beginning with a USB setup header; requested by
- * Paolo Abeni <[email protected]>.
+ * This used to be "USB packets, beginning with a USB setup header;
+ * requested by Paolo Abeni <[email protected]>."
+ *
+ * However, that header didn't work all that well - it left out some
+ * useful information - and was abandoned in favor of the DLT_USB_LINUX
+ * header.
+ *
+ * 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.
  */
-#define LINKTYPE_USB           186
+#define LINKTYPE_USB_FREEBSD   186
 
 /*
  * Bluetooth HCI UART transport layer (part H:4); requested by
  */
 #define LINKTYPE_PROFIBUS_DL           257
 
-
 /*
  * Apple's DLT_PKTAP headers.
  *
 #define LINKTYPE_ZWAVE_R1_R2   261
 #define LINKTYPE_ZWAVE_R3      262
 
-#define LINKTYPE_MATCHING_MAX  262             /* highest value in the "matching" range */
+/*
+ * per Steve Karg <[email protected]>, formats for Wattstopper
+ * Digital Lighting Management room bus serial protocol captures.
+ */
+#define LINKTYPE_WATTSTOPPER_DLM 263
+
+/*
+ * ISO 14443 contactless smart card messages.
+ */
+#define LINKTYPE_ISO_14443      264
+
+#define LINKTYPE_MATCHING_MAX  264             /* highest value in the "matching" range */
 
 static struct linktype_map {
        int     dlt;
@@ -1321,7 +1338,7 @@ swap_nflog_header(const struct pcap_pkthdr *hdr, u_char *buf)
                return;
        }
 
-       if (!(nfhdr->nflog_version) == 0) {
+       if (nfhdr->nflog_version != 0) {
                /* Unknown NFLOG version */
                return;
        }