New DLT_IEEE802_15_4_NOFCS for 802.15.4 without FCS.
Requested by Jon Smirl.
This commit is contained in:
parent
e04170f756
commit
6cb3ad9219
11
gencode.c
11
gencode.c
|
@ -1588,6 +1588,16 @@ init_linktype(p)
|
||||||
off_nl = 0;
|
off_nl = 0;
|
||||||
off_nl_nosnap = -1;
|
off_nl_nosnap = -1;
|
||||||
return;
|
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);
|
bpf_error("unknown data link type %d", linktype);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
@ -3511,6 +3521,7 @@ gen_linktype(proto)
|
||||||
case DLT_IEEE802_15_4:
|
case DLT_IEEE802_15_4:
|
||||||
case DLT_IEEE802_15_4_LINUX:
|
case DLT_IEEE802_15_4_LINUX:
|
||||||
case DLT_IEEE802_15_4_NONASK_PHY:
|
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");
|
bpf_error("IEEE 802.15.4 link-layer type filtering not implemented");
|
||||||
|
|
||||||
case DLT_IEEE802_16_MAC_CPS_RADIO:
|
case DLT_IEEE802_16_MAC_CPS_RADIO:
|
||||||
|
|
|
@ -728,6 +728,13 @@ static const char rcsid[] _U_ =
|
||||||
#define LINKTYPE_IPV4 228
|
#define LINKTYPE_IPV4 228
|
||||||
#define LINKTYPE_IPV6 229
|
#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 {
|
static struct linktype_map {
|
||||||
int dlt;
|
int dlt;
|
||||||
|
@ -976,7 +983,7 @@ static struct linktype_map {
|
||||||
/* Juniper Voice ISM */
|
/* Juniper Voice ISM */
|
||||||
{ DLT_JUNIPER_ISM, LINKTYPE_JUNIPER_ISM },
|
{ DLT_JUNIPER_ISM, LINKTYPE_JUNIPER_ISM },
|
||||||
|
|
||||||
/* IEEE 802.15.4 exactly as it appears in the spec */
|
/* IEEE 802.15.4 exactly as it appears in the spec, with FCS */
|
||||||
{ DLT_IEEE802_15_4, LINKTYPE_IEEE802_15_4 },
|
{ DLT_IEEE802_15_4, LINKTYPE_IEEE802_15_4 },
|
||||||
|
|
||||||
/* Various link-layer types for SITA */
|
/* Various link-layer types for SITA */
|
||||||
|
@ -1074,6 +1081,9 @@ static struct linktype_map {
|
||||||
{ DLT_IPV4, LINKTYPE_IPV4 },
|
{ DLT_IPV4, LINKTYPE_IPV4 },
|
||||||
{ DLT_IPV6, LINKTYPE_IPV6 },
|
{ 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 }
|
{ -1, -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
3
pcap.c
3
pcap.c
|
@ -653,7 +653,7 @@ static struct dlt_choice dlt_choices[] = {
|
||||||
DLT_CHOICE(DLT_PPI, "Per-Packet Information"),
|
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_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_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_SITA, "SITA pseudo-header"),
|
||||||
DLT_CHOICE(DLT_ERF, "Endace ERF header"),
|
DLT_CHOICE(DLT_ERF, "Endace ERF header"),
|
||||||
DLT_CHOICE(DLT_RAIF1, "Ethernet with u10 Networks pseudo-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_CAN_SOCKETCAN, "CAN-bus with SocketCAN headers"),
|
||||||
DLT_CHOICE(DLT_IPV4, "Raw IPv4"),
|
DLT_CHOICE(DLT_IPV4, "Raw IPv4"),
|
||||||
DLT_CHOICE(DLT_IPV6, "Raw IPv6"),
|
DLT_CHOICE(DLT_IPV6, "Raw IPv6"),
|
||||||
|
DLT_CHOICE(DLT_IEEE802_15_4_NOFCS, "IEEE 802.15.4 without FCS"),
|
||||||
DLT_CHOICE_SENTINEL
|
DLT_CHOICE_SENTINEL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -697,6 +697,8 @@ struct bpf_version {
|
||||||
/*
|
/*
|
||||||
* IEEE 802.15.4, exactly as it appears in the spec (no padding, no
|
* IEEE 802.15.4, exactly as it appears in the spec (no padding, no
|
||||||
* nothing); requested by Mikko Saarnivala <mikko.saarnivala@sensinode.com>.
|
* 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
|
#define DLT_IEEE802_15_4 195
|
||||||
|
|
||||||
|
@ -960,6 +962,13 @@ struct bpf_version {
|
||||||
#define DLT_IPV4 228
|
#define DLT_IPV4 228
|
||||||
#define DLT_IPV6 229
|
#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
|
* 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
|
* a member of that class. A class value of 0 indicates a regular
|
||||||
|
|
Reference in New Issue