From: Francois-Xavier Le Bail Date: Thu, 6 Aug 2020 14:23:30 +0000 (+0200) Subject: AppleTalk: Update the link-layer dissector to a void function X-Git-Tag: tcpdump-4.99-bp~287 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/b846e244235904990a66bb7fcee7b028cf83ab2c AppleTalk: 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 0eb57371..e39191a6 100644 --- a/netdissect.h +++ b/netdissect.h @@ -503,7 +503,7 @@ extern void juniper_ppp_if_print IF_PRINTER_ARGS; extern void juniper_pppoe_atm_if_print IF_PRINTER_ARGS; extern void juniper_pppoe_if_print IF_PRINTER_ARGS; extern void juniper_services_if_print IF_PRINTER_ARGS; -extern u_int ltalk_if_print IF_PRINTER_ARGS; +extern void ltalk_if_print IF_PRINTER_ARGS; extern void mfr_if_print IF_PRINTER_ARGS; extern void netanalyzer_if_print IF_PRINTER_ARGS; extern void netanalyzer_transparent_if_print IF_PRINTER_ARGS; diff --git a/print-atalk.c b/print-atalk.c index ae342069..398e9a41 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -72,19 +72,20 @@ static const char *ddpskt_string(netdissect_options *, u_int); /* * Print LLAP packets received on a physical LocalTalk interface. */ -u_int +void ltalk_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int hdrlen; - ndo->ndo_protocol = "ltalk_if"; + ndo->ndo_protocol = "ltalk"; hdrlen = llap_print(ndo, p, h->len); if (hdrlen == 0) { /* Cut short by the snapshot length. */ - return (h->caplen); + ndo->ndo_ll_hdr_len += h->caplen; + return; } - return (hdrlen); + ndo->ndo_ll_hdr_len += hdrlen; } /* diff --git a/print.c b/print.c index 4f5273d0..6b8931e0 100644 --- a/print.c +++ b/print.c @@ -55,9 +55,6 @@ struct void_printer { static const struct uint_printer uint_printers[] = { #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) { pflog_if_print, DLT_PFLOG }, -#endif -#ifdef DLT_LTALK - { ltalk_if_print, DLT_LTALK }, #endif { NULL, 0 }, }; @@ -181,6 +178,9 @@ static const struct void_printer void_printers[] = { #ifdef DLT_JUNIPER_SERVICES { juniper_services_if_print, DLT_JUNIPER_SERVICES }, #endif +#ifdef DLT_LTALK + { ltalk_if_print, DLT_LTALK }, +#endif #ifdef DLT_MFR { mfr_if_print, DLT_MFR }, #endif