]> The Tcpdump Group git mirrors - libpcap/commitdiff
Add a LINKTYPE/DLT_ value for FreeBSD USB.
authorGuy Harris <[email protected]>
Sat, 20 Feb 2016 01:40:18 +0000 (17:40 -0800)
committerGuy Harris <[email protected]>
Sat, 20 Feb 2016 01:40:18 +0000 (17:40 -0800)
186 wasn't used for USB-on-Linux for very long, and had some problems;
it was replaced by 189.

FreeBSD used 186 for its own USB tapping; rename LINKTYPE_USB to
LINKTYPE_USB_FREEBSD and DLT_USB to DLT_USB_FREEBSD, and leave behind
DLT_USB for source compatibility.

Add DLT_USBPCAP to the list of types for which we say "USB link-layer
type filtering not implemented".

gencode.c
pcap-common.c
pcap.c
pcap/dlt.h

index 28df756ddea68a8ae199a17434d3165ba627417f..1899fd92cfa3e52d7c91cc0cd8ce060e2dd3bed9 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -3386,9 +3386,10 @@ gen_linktype(compiler_state_t *cstate, int proto)
        case DLT_LINUX_LAPD:
                bpf_error(cstate, "LAPD link-layer type filtering not implemented");
 
-       case DLT_USB:
+       case DLT_USB_FREEBSD:
        case DLT_USB_LINUX:
        case DLT_USB_LINUX_MMAPPED:
+       case DLT_USBPCAP:
                bpf_error(cstate, "USB link-layer type filtering not implemented");
 
        case DLT_BLUETOOTH_HCI_H4:
index 3c947d7d1fc19983017039e81c67f7b70608b74c..debaedff875b73efbc0a5490f8c786a9c5452c82 100644 (file)
 #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
diff --git a/pcap.c b/pcap.c
index 63c594110c4bc5dd289fd08ea1f95ebc0ed33a19..29459de9bb814cea1372e9a19f4f3758ded76166 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -1209,7 +1209,7 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(DLT_JUNIPER_VP, "Juniper Voice PIC"),
        DLT_CHOICE(DLT_A429, "Arinc 429"),
        DLT_CHOICE(DLT_A653_ICM, "Arinc 653 Interpartition Communication"),
-       DLT_CHOICE(DLT_USB, "USB"),
+       DLT_CHOICE(DLT_USB_FREEBSD, "USB with FreeBSD header"),
        DLT_CHOICE(DLT_BLUETOOTH_HCI_H4, "Bluetooth HCI UART transport layer"),
        DLT_CHOICE(DLT_IEEE802_16_MAC_CPS, "IEEE 802.16 MAC Common Part Sublayer"),
        DLT_CHOICE(DLT_USB_LINUX, "USB with Linux header"),
index 140185b80399624f3359d2f7a9377cf102a32d4d..9891d98403251321169ba49b84543c029d7b598a 100644 (file)
 #define DLT_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 DLT_USB                        186
+#define DLT_USB_FREEBSD                186
+#define DLT_USB                        DLT_USB_FREEBSD /* source compatibility */
 
 /*
  * Bluetooth HCI UART transport layer (part H:4); requested by