From: Francois-Xavier Le Bail Date: Fri, 7 Feb 2020 17:05:05 +0000 (+0100) Subject: Raw IP: Update the link-layer dissector to a void function X-Git-Tag: tcpdump-4.99-bp~528 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/92a263b1b36bd33612baa63b9e9ed0a41e07f05f Raw IP: Update the link-layer dissector to a void function Moreover: Remove trailing "_if" from protocol name. --- diff --git a/netdissect.h b/netdissect.h index 3d521537..4b42f4a1 100644 --- a/netdissect.h +++ b/netdissect.h @@ -514,7 +514,7 @@ extern u_int ppp_hdlc_if_print IF_PRINTER_ARGS; extern u_int ppp_if_print IF_PRINTER_ARGS; extern u_int pppoe_if_print IF_PRINTER_ARGS; extern u_int prism_if_print IF_PRINTER_ARGS; -extern u_int raw_if_print IF_PRINTER_ARGS; +extern void raw_if_print IF_PRINTER_ARGS; extern u_int sl_bsdos_if_print IF_PRINTER_ARGS; extern u_int sl_if_print IF_PRINTER_ARGS; extern u_int sll_if_print IF_PRINTER_ARGS; diff --git a/print-raw.c b/print-raw.c index 8d27a06a..ff1ca2d5 100644 --- a/print-raw.c +++ b/print-raw.c @@ -33,14 +33,15 @@ * The DLT_RAW packet has no header. It contains a raw IP packet. */ -u_int +void raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { - ndo->ndo_protocol = "raw_if"; + ndo->ndo_protocol = "raw"; + ndo->ndo_ll_header_length += 0; if (ndo->ndo_eflag) ND_PRINT("ip: "); ipN_print(ndo, p, h->len); - return (0); + return; } diff --git a/print.c b/print.c index 1465c07d..e82c631f 100644 --- a/print.c +++ b/print.c @@ -97,13 +97,6 @@ static const struct uint_printer uint_printers[] = { { arcnet_if_print, DLT_ARCNET }, #ifdef DLT_ARCNET_LINUX { arcnet_linux_if_print, DLT_ARCNET_LINUX }, -#endif - { raw_if_print, DLT_RAW }, -#ifdef DLT_IPV4 - { raw_if_print, DLT_IPV4 }, -#endif -#ifdef DLT_IPV6 - { raw_if_print, DLT_IPV6 }, #endif #ifdef DLT_IPOIB { ipoib_if_print, DLT_IPOIB }, @@ -242,6 +235,13 @@ static const struct void_printer void_printers[] = { #endif #ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR { bt_if_print, DLT_BLUETOOTH_HCI_H4_WITH_PHDR}, +#endif + { raw_if_print, DLT_RAW }, +#ifdef DLT_IPV4 + { raw_if_print, DLT_IPV4 }, +#endif +#ifdef DLT_IPV6 + { raw_if_print, DLT_IPV6 }, #endif #ifdef DLT_SUNATM { sunatm_if_print, DLT_SUNATM },