]> The Tcpdump Group git mirrors - libpcap/commitdiff
DLT_ value added for the Bluetooth HCI UART transport layer for Paolo
authorguy <guy>
Fri, 13 Oct 2006 08:56:07 +0000 (08:56 +0000)
committerguy <guy>
Fri, 13 Oct 2006 08:56:07 +0000 (08:56 +0000)
Abeni.

Added DLT/DLT name table mappings and linktype values and DLT/linktype
mappings for USB and for the Bluetooth NCI UART transport layer.

Fix up indentation.

Copy some stuff for DLT_JUNIPER_VP and DLT_USB from the top of the main
branch.

gencode.c
pcap-bpf.h
pcap.c
savefile.c

index 214a1a05fa092e5308238fdb41ae5fdfa57f000a..324749293d7f46f4889d1d2fbea6d3552bdbd100 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.43 2006-09-13 07:36:19 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.44 2006-10-13 08:56:07 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1210,6 +1210,12 @@ init_linktype(p)
                off_nl_nosnap = -1;     /* no 802.2 LLC */
                return;
 
+       case DLT_JUNIPER_VP:
+               off_linktype = 18;
+               off_nl = -1;
+               off_nl_nosnap = -1;
+               return;
+
        case DLT_MTP2:
                off_sio = 3;
                off_opc = 4;
@@ -1236,6 +1242,24 @@ init_linktype(p)
                off_nl = -1;
                off_nl_nosnap = -1;
                return;
+
+       case DLT_USB:
+               /*
+                * Currently, only raw "link[N:M]" filtering is supported.
+                */
+               off_linktype = -1;
+               off_nl = -1;
+               off_nl_nosnap = -1;
+               return;
+
+       case DLT_BLUETOOTH_HCI_H4:
+               /*
+                * Currently, only raw "link[N:M]" filtering is supported.
+                */
+               off_linktype = -1;
+               off_nl = -1;
+               off_nl_nosnap = -1;
+               return;
        }
        bpf_error("unknown data link type %d", linktype);
        /* NOTREACHED */
@@ -2337,6 +2361,7 @@ gen_linktype(proto)
         case DLT_JUNIPER_PPP:
         case DLT_JUNIPER_FRELAY:
         case DLT_JUNIPER_CHDLC:
+        case DLT_JUNIPER_VP:
                /* just lets verify the magic number for now -
                 * on ATM we may have up to 6 different encapsulations on the wire
                 * and need a lot of heuristics to figure out that the payload
@@ -6173,6 +6198,7 @@ gen_inbound(dir)
         case DLT_JUNIPER_PPP:
         case DLT_JUNIPER_FRELAY:
         case DLT_JUNIPER_CHDLC:
+        case DLT_JUNIPER_VP:
                /* juniper flags (including direction) are stored
                 * the byte after the 3-byte magic number */
                if (dir) {
index f1ab1058c1d91f66a95faeb004b232ba756c2226..5841c3565db71cd0d89653d003fb70e0dd891682 100644 (file)
@@ -37,7 +37,7 @@
  *
  *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
  *
- * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.34.2.12 2006-10-03 00:12:57 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.34.2.13 2006-10-13 08:56:08 guy Exp $ (LBL)
  */
 
 /*
@@ -639,6 +639,12 @@ struct bpf_version {
  */
 #define DLT_USB                        186
 
+/*
+ * Bluetooth HCI UART transport layer (part H:4); requested by
+ * Paolo Abeni.
+ */
+#define DLT_BLUETOOTH_HCI_H4   187
+
 /*
  * Controller Area Network (CAN) v. 2.0B packets.
  * DLT_ requested by Gianluca Varenni <[email protected]>.
diff --git a/pcap.c b/pcap.c
index 412ce40b866cde1c9287b40425b65afaaf456be9..791abb3859b47d8945293b3d6fdf4d3cdaa8a71b 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.88.2.14 2006-09-25 18:17:26 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.88.2.15 2006-10-13 08:56:08 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -383,8 +383,10 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(DLT_JUNIPER_VP, "Juniper Voice PIC"),
        DLT_CHOICE(DLT_MTP2, "SS7 MTP2"),
        DLT_CHOICE(DLT_A429, "Arinc 429"),
-       DLT_CHOICE(DLT_CAN20B, "Controller Area Network (CAN) v. 2.0B"),
        DLT_CHOICE(DLT_A653_ICM, "Arinc 653 Interpartition Communication"),
+       DLT_CHOICE(DLT_USB, "USB"),
+       DLT_CHOICE(DLT_BLUETOOTH_HCI_H4, "Bluetooth HCI UART transport layer"),
+       DLT_CHOICE(DLT_CAN20B, "Controller Area Network (CAN) v. 2.0B"),
        DLT_CHOICE_SENTINEL
 };
 
index 62fea4f39a5ff45bb2b8e79178f345f4804728b1..5b164757fe60bfb78c1aed435231bccd16556695 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.126.2.17 2006-07-27 21:06:18 gianluca Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.126.2.18 2006-10-13 08:56:08 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -459,6 +459,17 @@ static const char rcsid[] _U_ =
  */
 #define LINKTYPE_A653_ICM       185
 
+/*
+ * USB packets; requested by Paolo Abeni <[email protected]>.
+ */
+#define LINKTYPE_USB           186
+
+/*
+ * Bluetooth HCI UART transport layer (part H:4); requested by
+ * Paolo Abeni.
+ */
+#define LINKTYPE_BLUETOOTH_HCI_H4      187
+
 /*
  * Controller Area Network (CAN) v. 2.0B packets.
  * DLT_ requested by Gianluca Varenni <[email protected]>.
@@ -679,14 +690,20 @@ static struct linktype_map {
         /* Juniper Voice PIC */
         { DLT_JUNIPER_VP,       LINKTYPE_JUNIPER_VP },
 
-               /* Controller Area Network (CAN) v2.0B */
-               { DLT_A429,                             LINKTYPE_A429 },
+       /* Controller Area Network (CAN) v2.0B */
+       { DLT_A429,                             LINKTYPE_A429 },
+
+       /* Arinc 653 Interpartition Communication messages */
+       { DLT_A653_ICM,         LINKTYPE_A653_ICM },
+
+       /* USB */
+       { DLT_USB,         LINKTYPE_USB },
 
-               /* Controller Area Network (CAN) v2.0B */
-               { DLT_CAN20B,                           LINKTYPE_CAN20B },
+       /* Bluetooth HCI UART transport layer */
+       { DLT_BLUETOOTH_HCI_H4,         LINKTYPE_BLUETOOTH_HCI_H4 },
 
-               /* Arinc 653 Interpartition Communication messages */
-               { DLT_A653_ICM,         LINKTYPE_A653_ICM },
+       /* Controller Area Network (CAN) v2.0B */
+       { DLT_CAN20B,                           LINKTYPE_CAN20B },
 
        { -1,                   -1 }
 };