From: James Ko Date: Mon, 18 Feb 2019 01:21:16 +0000 (-0800) Subject: Add DLT_/LINKTYPE_ values for IEEE802_15_4_TAP X-Git-Tag: libpcap-1.10-bp~535^2 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/4b119b436b1b58c8c5bd5257844a507df076feca Add DLT_/LINKTYPE_ values for IEEE802_15_4_TAP --- diff --git a/gencode.c b/gencode.c index 0841fb86..96344962 100644 --- a/gencode.c +++ b/gencode.c @@ -3580,6 +3580,7 @@ gen_linktype(compiler_state_t *cstate, bpf_u_int32 ll_proto) case DLT_IEEE802_15_4_LINUX: case DLT_IEEE802_15_4_NONASK_PHY: case DLT_IEEE802_15_4_NOFCS: + case DLT_IEEE802_15_4_TAP: bpf_error(cstate, "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 5b45f58d..0ed34114 100644 --- a/pcap-common.c +++ b/pcap-common.c @@ -1147,7 +1147,15 @@ #define LINKTYPE_DSA_TAG_BRCM 281 #define LINKTYPE_DSA_TAG_BRCM_PREPEND 282 -#define LINKTYPE_MATCHING_MAX 282 /* highest value in the "matching" range */ +/* + * IEEE 802.15.4 with pseudo-header and optional meta-data TLVs, PHY payload + * exactly as it appears in the spec (no padding, no nothing), and FCS if + * specified by FCS Type TLV; requested by James Ko . + * Specification at https://github.com/jkcko/ieee802.15.4-tap + */ +#define LINKTYPE_IEEE802_15_4_TAP 283 + +#define LINKTYPE_MATCHING_MAX 283 /* highest value in the "matching" range */ /* * The DLT_ and LINKTYPE_ values in the "matching" range should be the diff --git a/pcap/dlt.h b/pcap/dlt.h index de01888f..4c8b1178 100644 --- a/pcap/dlt.h +++ b/pcap/dlt.h @@ -1432,6 +1432,14 @@ #define DLT_DSA_TAG_BRCM 281 #define DLT_DSA_TAG_BRCM_PREPEND 282 +/* + * IEEE 802.15.4 with pseudo-header and optional meta-data TLVs, PHY payload + * exactly as it appears in the spec (no padding, no nothing), and FCS if + * specified by FCS Type TLV; requested by James Ko . + * Specification at https://github.com/jkcko/ieee802.15.4-tap + */ +#define DLT_IEEE802_15_4_TAP 283 + /* * In case the code that includes this file (directly or indirectly) * has also included OS files that happen to define DLT_MATCHING_MAX, @@ -1442,7 +1450,7 @@ #ifdef DLT_MATCHING_MAX #undef DLT_MATCHING_MAX #endif -#define DLT_MATCHING_MAX 282 /* highest value in the "matching" range */ +#define DLT_MATCHING_MAX 283 /* highest value in the "matching" range */ /* * DLT and savefile link type values are split into a class and