https://github.com/jkcko/ieee802.15.4-tap
Jacek Tobiasz <Jacek dot Tobiasz at atm dot com dot pl>
Jakob Schlyter <jakob at openbsd dot org>
Jamal Hadi Salim <hadi at cyberus dot ca>
+ James Ko <jck at exegin dot com>
Jan Oravec <wsx at wsx6 dot net>
Jason R. Thorpe <thorpej at netbsd dot org>
Jefferson Ogata <jogata at nodc dot noaa dot gov>
extern u_int ieee802_11_radio_avs_if_print IF_PRINTER_ARGS;
extern u_int ieee802_11_radio_if_print IF_PRINTER_ARGS;
extern u_int ieee802_15_4_if_print IF_PRINTER_ARGS;
+extern u_int ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
extern u_int ipfc_if_print IF_PRINTER_ARGS;
extern u_int ipnet_if_print IF_PRINTER_ARGS;
extern u_int juniper_atm1_if_print IF_PRINTER_ARGS;
ndo->ndo_protocol = "802.15.4_if";
return ieee802_15_4_print(ndo, p, h->caplen);
}
+
+/* For DLT_IEEE802_15_4_TAP */
+/* https://github.com/jkcko/ieee802.15.4-tap */
+u_int
+ieee802_15_4_tap_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ uint8_t version;
+ uint16_t length;
+
+ ndo->ndo_protocol = "802.15.4_tap";
+ if (h->caplen < 4) {
+ nd_print_trunc(ndo);
+ return h->caplen;
+ }
+
+ version = EXTRACT_U_1(p);
+ length = EXTRACT_LE_U_2(p+2);
+ if (version != 0 || length < 4) {
+ nd_print_invalid(ndo);
+ return 0;
+ }
+
+ if (h->caplen < length) {
+ nd_print_trunc(ndo);
+ return h->caplen;
+ }
+
+ return ieee802_15_4_print(ndo, p+length, h->caplen-length) + length;
+}
#ifdef DLT_IEEE802_15_4_NOFCS
{ ieee802_15_4_if_print, DLT_IEEE802_15_4_NOFCS },
#endif
+#ifdef DLT_IEEE802_15_4_TAP
+ { ieee802_15_4_tap_if_print, DLT_IEEE802_15_4_TAP },
+#endif
#ifdef DLT_PPI
{ ppi_if_print, DLT_PPI },
#endif