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_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:
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
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_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
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -960,6 +962,13 @@ struct bpf_version {
|
|||
#define DLT_IPV4 228
|
||||
#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
|
||||
|
|
Reference in New Issue