]> The Tcpdump Group git mirrors - tcpdump/commitdiff
SunATM DLPI: Update the link-layer dissector to a void function
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 7 Feb 2020 16:51:01 +0000 (17:51 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 7 Feb 2020 19:36:26 +0000 (20:36 +0100)
Moreover:
Remove trailing "_if" from protocol name.

netdissect.h
print-sunatm.c
print.c

index 3e49bc907f02d75983932c49312c2e335f763ee9..3d521537171abd0cfc9bfe72d8e27f6339056a5c 100644 (file)
@@ -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;
index 0e8fe57d5d6825fb1ef2d917d5324d5be2c4a5ae..27f63c3db8cd611262ec954f99265870471e663a 100644 (file)
@@ -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 c0d9e890d4e90f83160fb9cfdef733e8f82a38d9..1465c07ddf050eb24f757f07d13b3f3b1ba11c48 100644 (file)
--- 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