]> The Tcpdump Group git mirrors - libpcap/commitdiff
Link-layer type for 802.15.4 with PHY-level preamble, SFD, and frame
authorguy <guy>
Mon, 22 Sep 2008 20:16:01 +0000 (20:16 +0000)
committerguy <guy>
Mon, 22 Sep 2008 20:16:01 +0000 (20:16 +0000)
length, as requested by Max Filippov <[email protected]>.

gencode.c
pcap.c
pcap/bpf.h
savefile.c

index fb1d1ec0fd8bc39f030acc3561c6136220001631..41057ba8cb12a98c5dae50f795be0634a809473d 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.290.2.15 2007-12-29 23:15:43 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.290.2.16 2008-09-22 20:16:01 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1487,6 +1487,16 @@ init_linktype(p)
                off_nl_nosnap = -1;     /* no 802.2 LLC */
                off_mac = 1;            /* step over the kiss length byte */
                return;
+
+       case DLT_IEEE802_15_4_NONASK_PHY:
+               /*
+                * Currently, only raw "link[N:M]" filtering is supported.
+                */
+               off_linktype = -1;
+               off_macpl = -1;
+               off_nl = -1;
+               off_nl_nosnap = -1;
+               return;
        }
        bpf_error("unknown data link type %d", linktype);
        /* NOTREACHED */
@@ -3351,6 +3361,7 @@ gen_linktype(proto)
 
        case DLT_IEEE802_15_4:
        case DLT_IEEE802_15_4_LINUX:
+       case DLT_IEEE802_15_4_NONASK_PHY:
                bpf_error("IEEE 802.15.4 link-layer type filtering not implemented");
 
        case DLT_IEEE802_16_MAC_CPS_RADIO:
diff --git a/pcap.c b/pcap.c
index bceed2c61aeefd113f9b54a996b265eeb86b7a88..010ef74cd01d57f1becd00035b717e53b8932617 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.112.2.11 2008-07-01 08:04:03 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.112.2.12 2008-09-22 20:16:01 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -622,6 +622,7 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(DLT_JUNIPER_ST, "Juniper Secure Tunnel"),
        DLT_CHOICE(DLT_BLUETOOTH_HCI_H4_WITH_PHDR, "Bluetooth HCI UART transport layer plus pseudo-header"),
        DLT_CHOICE(DLT_AX25_KISS, "AX.25 with KISS header"),
+       DLT_CHOICE(DLT_IEEE802_15_4_NONASK_PHY, "IEEE 802.15.4 with non-ASK PHY data"),
        DLT_CHOICE_SENTINEL
 };
 
index 7281a6ef329bcad680575e8eebd95538e2807088..9f4ca33e350a83475ac6cc60110ca6224ec1865e 100644 (file)
@@ -37,7 +37,7 @@
  *
  *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
  *
- * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.7 2008-05-30 01:36:06 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.8 2008-09-22 20:16:01 guy Exp $ (LBL)
  */
 
 /*
@@ -810,6 +810,17 @@ struct bpf_version {
  */
 #define DLT_X2E_XORAYA         214
 
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
+ * of 0 as preamble, one octet of SFD, one octet of frame length+
+ * reserved bit, and then the MAC-layer data, starting with the
+ * frame control field).
+ *
+ * Requested by Max Filippov <[email protected]>.
+ */
+#define DLT_IEEE802_15_4_NONASK_PHY    215
+
 
 /*
  * DLT and savefile link type values are split into a class and
index 0a36c5a201daa6d8a5eb8b86a83d3c009614557e..77576eb9452aa4519ec01787e3922c442dde9510 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.168.2.8 2008-05-30 01:36:06 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.168.2.9 2008-09-22 20:16:01 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -636,6 +636,17 @@ static const char rcsid[] _U_ =
  */
 #define LINKTYPE_X2E_XORAYA            214
 
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
+ * of 0 as preamble, one octet of SFD, one octet of frame length+
+ * reserved bit, and then the MAC-layer data, starting with the
+ * frame control field).
+ *
+ * Requested by Max Filippov <[email protected]>.
+ */
+#define LINKTYPE_IEEE802_15_4_NONASK_PHY       215
+
 
 static struct linktype_map {
        int     dlt;
@@ -938,6 +949,9 @@ static struct linktype_map {
        /* X2E-private for Xoraya data logger family */
        { DLT_X2E_XORAYA,       LINKTYPE_X2E_XORAYA },
 
+       /* IEEE 802.15.4 with PHY data for non-ASK PHYs */
+       { DLT_IEEE802_15_4_NONASK_PHY, LINKTYPE_IEEE802_15_4_NONASK_PHY },
+
        { -1,                   -1 }
 };