tcpdump mailing list archives

Re: DLT for IEEE802.15.4 no FCS frames


From: Jon Smirl <jonsmirl () gmail com>
Date: Fri, 6 Aug 2010 17:34:40 -0400

Thanks for adding the DLT.

Do I need this bit about LINKTYPE?

I need the ARPHRD_IEEE802154 part for sure.

commit a3e97e61f82acca21ed9f987a1c03c9a1b09724a
Author: Jon Smirl <jonsmirl () gmail com>
Date:   Fri Aug 6 09:17:25 2010 -0400

    Add support for the DLT_IEEE802_15_4_NOFCS DLT type

diff --git a/pcap-common.c b/pcap-common.c
index 5f6a929..7b8e2e0 100644
--- a/pcap-common.c
+++ b/pcap-common.c
@@ -664,6 +664,9 @@ static const char rcsid[] _U_ =
  */
 #define LINKTYPE_FC_2_WITH_FRAME_DELIMS                225

+/* Native IEEE 802.15.4 packets with no FCS */
+#define  LINKTYPE_IEEE802_15_4_NOFCS           230
+
 /*
  * Solaris ipnet pseudo-header; requested by Darren Reed <Darren.Reed () Sun COM>.
  *
@@ -881,6 +884,9 @@ static struct linktype_map {
        { DLT_IBM_SP,           LINKTYPE_IBM_SP },
        { DLT_IBM_SN,           LINKTYPE_IBM_SN },

+       /* IEEE 802.15.4 no fcs */
+       {  DLT_IEEE802_15_4_NOFCS, LINKTYPE_IEEE802_15_4_NOFCS },
+
        /* 802.11 plus AVS radio header */
        { DLT_IEEE802_11_RADIO_AVS, LINKTYPE_IEEE802_11_RADIO_AVS },

diff --git a/pcap-linux.c b/pcap-linux.c
index 70068b5..4d109ad 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -2637,6 +2637,13 @@ static void map_arphrd_to_dlt(pcap_t *handle,
int arptype, int cooked_ok)
                handle->linktype = DLT_LINUX_LAPD;
                break;

+#ifndef ARPHRD_IEEE802154
+#define ARPHRD_IEEE802154      804
+#endif
+       case ARPHRD_IEEE802154:
+               handle->linktype =  DLT_IEEE802_15_4_NOFCS;
+               break;
+
 #ifndef ARPHRD_NONE
 #define ARPHRD_NONE    0xFFFE
 #endif

-- 
Jon Smirl
jonsmirl () gmail com
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: