aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-08-06 14:12:16 -0700
committerGuy Harris <guy@alum.mit.edu>2010-08-06 14:12:16 -0700
commit6cb3ad9219fec9c8d3c59d294c3e89c54602e4cd (patch)
tree14031d589dc5f2aecc9a7402a2d060629a2daff2
parente04170f756cd5268bec283f359a13ad924b5795c (diff)
New DLT_IEEE802_15_4_NOFCS for 802.15.4 without FCS.
Requested by Jon Smirl.
-rw-r--r--gencode.c11
-rw-r--r--pcap-common.c14
-rw-r--r--pcap.c3
-rw-r--r--pcap/bpf.h9
4 files changed, 34 insertions, 3 deletions
diff --git a/gencode.c b/gencode.c
index fa68122..f66492e 100644
--- a/gencode.c
+++ b/gencode.c
@@ -1588,6 +1588,16 @@ init_linktype(p)
off_nl = 0;
off_nl_nosnap = -1;
return;
+
+ case DLT_IEEE802_15_4_NOFCS:
+ /*
+ * 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 */
@@ -3511,6 +3521,7 @@ gen_linktype(proto)
case DLT_IEEE802_15_4:
case DLT_IEEE802_15_4_LINUX:
case DLT_IEEE802_15_4_NONASK_PHY:
+ case DLT_IEEE802_15_4_NOFCS:
bpf_error("IEEE 802.15.4 link-layer type filtering not implemented");
case DLT_IEEE802_16_MAC_CPS_RADIO:
diff --git a/pcap-common.c b/pcap-common.c
index 979b5e3..5f6a929 100644
--- a/pcap-common.c
+++ b/pcap-common.c
@@ -728,6 +728,13 @@ static const char rcsid[] _U_ =
#define LINKTYPE_IPV4 228
#define LINKTYPE_IPV6 229
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), and with no FCS at the end of the frame; requested by
+ * Jon Smirl <jonsmirl@gmail.com>.
+ */
+#define LINKTYPE_IEEE802_15_4_NOFCS 230
+
static struct linktype_map {
int dlt;
@@ -976,8 +983,8 @@ static struct linktype_map {
/* Juniper Voice ISM */
{ DLT_JUNIPER_ISM, LINKTYPE_JUNIPER_ISM },
- /* IEEE 802.15.4 exactly as it appears in the spec */
- { DLT_IEEE802_15_4, LINKTYPE_IEEE802_15_4 },
+ /* IEEE 802.15.4 exactly as it appears in the spec, with FCS */
+ { DLT_IEEE802_15_4, LINKTYPE_IEEE802_15_4 },
/* Various link-layer types for SITA */
{ DLT_SITA, LINKTYPE_SITA },
@@ -1074,6 +1081,9 @@ static struct linktype_map {
{ DLT_IPV4, LINKTYPE_IPV4 },
{ DLT_IPV6, LINKTYPE_IPV6 },
+ /* IEEE 802.15.4 exactly as it appears in the spec, without FCS */
+ { DLT_IEEE802_15_4_NOFCS, LINKTYPE_IEEE802_15_4_NOFCS },
+
{ -1, -1 }
};
diff --git a/pcap.c b/pcap.c
index 8c5959f..7c94f8b 100644
--- a/pcap.c
+++ b/pcap.c
@@ -653,7 +653,7 @@ static struct dlt_choice dlt_choices[] = {
DLT_CHOICE(DLT_PPI, "Per-Packet Information"),
DLT_CHOICE(DLT_IEEE802_16_MAC_CPS_RADIO, "IEEE 802.16 MAC Common Part Sublayer plus radiotap header"),
DLT_CHOICE(DLT_JUNIPER_ISM, "Juniper Integrated Service Module"),
- DLT_CHOICE(DLT_IEEE802_15_4, "IEEE 802.15.4"),
+ DLT_CHOICE(DLT_IEEE802_15_4, "IEEE 802.15.4 with FCS"),
DLT_CHOICE(DLT_SITA, "SITA pseudo-header"),
DLT_CHOICE(DLT_ERF, "Endace ERF header"),
DLT_CHOICE(DLT_RAIF1, "Ethernet with u10 Networks pseudo-header"),
@@ -673,6 +673,7 @@ static struct dlt_choice dlt_choices[] = {
DLT_CHOICE(DLT_CAN_SOCKETCAN, "CAN-bus with SocketCAN headers"),
DLT_CHOICE(DLT_IPV4, "Raw IPv4"),
DLT_CHOICE(DLT_IPV6, "Raw IPv6"),
+ DLT_CHOICE(DLT_IEEE802_15_4_NOFCS, "IEEE 802.15.4 without FCS"),
DLT_CHOICE_SENTINEL
};
diff --git a/pcap/bpf.h b/pcap/bpf.h
index eff892c..6048fff 100644
--- a/pcap/bpf.h
+++ b/pcap/bpf.h
@@ -697,6 +697,8 @@ struct bpf_version {
/*
* IEEE 802.15.4, exactly as it appears in the spec (no padding, no
* nothing); requested by Mikko Saarnivala <mikko.saarnivala@sensinode.com>.
+ * For this one, we expect the FCS to be present at the end of the frame;
+ * if the frame has no FCS, DLT_IEEE802_15_4_NOFCS should be used.
*/
#define DLT_IEEE802_15_4 195
@@ -961,6 +963,13 @@ struct bpf_version {
#define DLT_IPV6 229
/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), and with no FCS at the end of the frame; requested by
+ * Jon Smirl <jonsmirl@gmail.com>.
+ */
+#define DLT_IEEE802_15_4_NOFCS 230
+
+/*
* DLT and savefile link type values are split into a class and
* a member of that class. A class value of 0 indicates a regular
* DLT_/LINKTYPE_ value.