From: Francois-Xavier Le Bail Date: Sun, 2 Aug 2020 11:58:24 +0000 (+0200) Subject: ATM: Update the link-layer dissector to a void function X-Git-Tag: tcpdump-4.99-bp~292 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/b1327f7a884d95b7bf45731ad424e71b5c01690c ATM: Update the link-layer dissector to a void function Moreover: Remove trailing "_if" from the protocol name. --- diff --git a/netdissect.h b/netdissect.h index 34051267..408cff8a 100644 --- a/netdissect.h +++ b/netdissect.h @@ -468,7 +468,7 @@ extern if_printer_t lookup_printer(netdissect_options *, int); extern void ap1394_if_print IF_PRINTER_ARGS; extern void arcnet_if_print IF_PRINTER_ARGS; extern void arcnet_linux_if_print IF_PRINTER_ARGS; -extern u_int atm_if_print IF_PRINTER_ARGS; +extern void atm_if_print IF_PRINTER_ARGS; extern void bt_if_print IF_PRINTER_ARGS; extern void brcm_tag_if_print IF_PRINTER_ARGS; extern void brcm_tag_prepend_if_print IF_PRINTER_ARGS; diff --git a/print-atm.c b/print-atm.c index e6b7caa3..33a5cafa 100644 --- a/print-atm.c +++ b/print-atm.c @@ -243,7 +243,7 @@ atm_llc_print(netdissect_options *ndo, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -u_int +void atm_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { @@ -252,10 +252,11 @@ atm_if_print(netdissect_options *ndo, uint32_t llchdr; u_int hdrlen = 0; - ndo->ndo_protocol = "atm_if"; + ndo->ndo_protocol = "atm"; if (caplen < 1) { nd_print_trunc(ndo); - return (caplen); + ndo->ndo_ll_hdr_len += caplen; + return; } /* Cisco Style NLPID ? */ @@ -263,7 +264,8 @@ atm_if_print(netdissect_options *ndo, if (ndo->ndo_eflag) ND_PRINT("CNLPID "); isoclns_print(ndo, p + 1, length - 1); - return hdrlen; + ndo->ndo_ll_hdr_len += hdrlen; + return; } /* @@ -272,7 +274,8 @@ atm_if_print(netdissect_options *ndo, */ if (caplen < 3) { nd_print_trunc(ndo); - return (caplen); + ndo->ndo_ll_hdr_len += caplen; + return; } /* @@ -304,7 +307,8 @@ atm_if_print(netdissect_options *ndo, */ if (caplen < 20) { nd_print_trunc(ndo); - return (caplen); + ndo->ndo_ll_hdr_len += caplen; + return; } if (ndo->ndo_eflag) ND_PRINT("%08x%08x %08x%08x ", @@ -318,7 +322,7 @@ atm_if_print(netdissect_options *ndo, hdrlen += 20; } hdrlen += atm_llc_print(ndo, p, length, caplen); - return (hdrlen); + ndo->ndo_ll_hdr_len += hdrlen; } /* diff --git a/print.c b/print.c index 14a7f5f0..414a8955 100644 --- a/print.c +++ b/print.c @@ -74,7 +74,6 @@ static const struct uint_printer uint_printers[] = { #ifdef DLT_MFR { mfr_if_print, DLT_MFR }, #endif - { atm_if_print, DLT_ATM_RFC1483 }, #ifdef DLT_LTALK { ltalk_if_print, DLT_LTALK }, #endif @@ -99,6 +98,7 @@ static const struct void_printer void_printers[] = { #ifdef DLT_ARCNET_LINUX { arcnet_linux_if_print, DLT_ARCNET_LINUX }, #endif + { atm_if_print, DLT_ATM_RFC1483 }, #ifdef DLT_DSA_TAG_BRCM { brcm_tag_if_print, DLT_DSA_TAG_BRCM }, #endif