extern void ieee802_11_if_print IF_PRINTER_ARGS;
extern void ieee802_11_radio_avs_if_print IF_PRINTER_ARGS;
extern void 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 void ieee802_15_4_if_print IF_PRINTER_ARGS;
+extern void ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
extern u_int ipfc_if_print IF_PRINTER_ARGS;
extern void ipoib_if_print IF_PRINTER_ARGS;
extern void ipnet_if_print IF_PRINTER_ARGS;
* Main function to print packets.
*/
-u_int
+void
ieee802_15_4_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
ndo->ndo_protocol = "802.15.4_if";
- return ieee802_15_4_print(ndo, p, caplen);
+ ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p, caplen);
}
/* For DLT_IEEE802_15_4_TAP */
/* https://github.com/jkcko/ieee802.15.4-tap */
-u_int
+void
ieee802_15_4_tap_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
ndo->ndo_protocol = "802.15.4_tap";
if (h->caplen < 4) {
nd_print_trunc(ndo);
- return h->caplen;
+ ndo->ndo_ll_hdr_len += h->caplen;
+ return;
}
version = GET_U_1(p);
length = GET_LE_U_2(p + 2);
if (version != 0 || length < 4) {
nd_print_invalid(ndo);
- return 0;
+ return;
}
if (h->caplen < length) {
nd_print_trunc(ndo);
- return h->caplen;
+ ndo->ndo_ll_hdr_len += h->caplen;
+ return;
}
- return ieee802_15_4_print(ndo, p+length, h->caplen-length) + length;
+ ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p+length, h->caplen-length) + length;
}
};
static const struct uint_printer uint_printers[] = {
-#ifdef DLT_IEEE802_15_4
- { ieee802_15_4_if_print, DLT_IEEE802_15_4 },
-#endif
-#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_CIP
{ cip_if_print, DLT_CIP },
#endif
#ifdef DLT_IEEE802_11_RADIO
{ ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO },
#endif
+#ifdef DLT_IEEE802_15_4
+ { ieee802_15_4_if_print, DLT_IEEE802_15_4 },
+#endif
+#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_IPNET
{ ipnet_if_print, DLT_IPNET },
#endif