]> The Tcpdump Group git mirrors - tcpdump/commitdiff
AppleTalk: Update the link-layer dissector to a void function
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 6 Aug 2020 14:23:30 +0000 (16:23 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 6 Aug 2020 14:27:24 +0000 (16:27 +0200)
Moreover:
Remove trailing "_if" from the protocol name.

netdissect.h
print-atalk.c
print.c

index 0eb573710eb83dd7eb7e037a809daaf741d04307..e39191a6dedd9313ec3c2cfe2f3ed3b6d9fddd98 100644 (file)
@@ -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;
index ae342069cf4f2886bd54375bfc7391f54f955895..398e9a41533998dad008f474f18ac3a57bac7852 100644 (file)
@@ -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 4f5273d06367ede10fa3612fee87f625f0bdcf55..6b8931e0caf59ee2a80eee825bf23681a902ab25 100644 (file)
--- 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