]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Token Ring: Update the link-layer dissector to a void function
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 2 Aug 2020 11:36:10 +0000 (13:36 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 2 Aug 2020 20:11:51 +0000 (22:11 +0200)
Moreover:
Remove trailing "_if" from the protocol name.

netdissect.h
print-token.c
print.c

index 6b2d2b3c78e82ba4fe22435f292827e22a1b762e..b98c85c8c3d6d026a0d9423db66130333e654910 100644 (file)
@@ -525,7 +525,7 @@ extern void sll_if_print IF_PRINTER_ARGS;
 extern void sll2_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 token_if_print IF_PRINTER_ARGS;
 extern void unsupported_if_print IF_PRINTER_ARGS;
 extern void usb_linux_48_byte_if_print IF_PRINTER_ARGS;
 extern void usb_linux_64_byte_if_print IF_PRINTER_ARGS;
index 6a32330880863ab028dffd61318598e83119769b..38f56eae894c7553e3a71295bbd4d81c1ed23b13 100644 (file)
@@ -242,9 +242,9 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 token_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
-       ndo->ndo_protocol = "token_if";
-       return (token_print(ndo, p, h->len, h->caplen));
+       ndo->ndo_protocol = "token";
+       ndo->ndo_ll_hdr_len += token_print(ndo, p, h->len, h->caplen);
 }
diff --git a/print.c b/print.c
index b783e40d96a4606c62cd974f1f9b0464e87374be..8922b7cea5bc1eb7afabae36ac6db6318334437b 100644 (file)
--- a/print.c
+++ b/print.c
@@ -68,7 +68,6 @@ static const struct uint_printer uint_printers[] = {
 #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H)
        { pflog_if_print,       DLT_PFLOG },
 #endif
-       { token_if_print,       DLT_IEEE802 },
 #ifdef DLT_FR
        { fr_if_print,          DLT_FR },
 #endif
@@ -246,6 +245,7 @@ static const struct void_printer void_printers[] = {
 #ifdef DLT_SYMANTEC_FIREWALL
        { symantec_if_print,    DLT_SYMANTEC_FIREWALL },
 #endif
+       { token_if_print,       DLT_IEEE802 },
 #ifdef DLT_USB_LINUX
        { usb_linux_48_byte_if_print, DLT_USB_LINUX},
 #endif /* DLT_USB_LINUX */