From: Francois-Xavier Le Bail Date: Fri, 7 Feb 2020 16:51:01 +0000 (+0100) Subject: SunATM DLPI: Update the link-layer dissector to a void function X-Git-Tag: tcpdump-4.99-bp~529 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/5cea888d12b8ca4009baff3207a3d5712c58acc7 SunATM DLPI: 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 3e49bc90..3d521537 100644 --- a/netdissect.h +++ b/netdissect.h @@ -519,7 +519,7 @@ 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; extern u_int sll2_if_print IF_PRINTER_ARGS; -extern u_int sunatm_if_print IF_PRINTER_ARGS; +extern void sunatm_if_print IF_PRINTER_ARGS; extern void symantec_if_print IF_PRINTER_ARGS; extern u_int token_if_print IF_PRINTER_ARGS; extern void usb_linux_48_byte_if_print IF_PRINTER_ARGS; diff --git a/print-sunatm.c b/print-sunatm.c index 0e8fe57d..27f63c3d 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -59,7 +59,7 @@ * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -u_int +void sunatm_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { @@ -69,11 +69,13 @@ sunatm_if_print(netdissect_options *ndo, u_char vpi; u_int traftype; - ndo->ndo_protocol = "sunatm_if"; + ndo->ndo_protocol = "sunatm"; if (caplen < PKT_BEGIN_POS) { + ndo->ndo_ll_header_length += caplen; nd_print_trunc(ndo); - return (caplen); + return; } + ndo->ndo_ll_header_length += PKT_BEGIN_POS; if (ndo->ndo_eflag) { ND_PRINT(GET_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: "); @@ -102,5 +104,5 @@ sunatm_if_print(netdissect_options *ndo, length -= PKT_BEGIN_POS; atm_print(ndo, vpi, vci, traftype, p, length, caplen); - return (PKT_BEGIN_POS); + return; } diff --git a/print.c b/print.c index c0d9e890..1465c07d 100644 --- a/print.c +++ b/print.c @@ -138,9 +138,6 @@ static const struct uint_printer uint_printers[] = { { mfr_if_print, DLT_MFR }, #endif { atm_if_print, DLT_ATM_RFC1483 }, -#ifdef DLT_SUNATM - { sunatm_if_print, DLT_SUNATM }, -#endif #ifdef DLT_ENC { enc_if_print, DLT_ENC }, #endif @@ -246,6 +243,9 @@ static const struct void_printer void_printers[] = { #ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR { bt_if_print, DLT_BLUETOOTH_HCI_H4_WITH_PHDR}, #endif +#ifdef DLT_SUNATM + { sunatm_if_print, DLT_SUNATM }, +#endif #ifdef DLT_SYMANTEC_FIREWALL { symantec_if_print, DLT_SYMANTEC_FIREWALL }, #endif