summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-02-07 17:51:01 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-02-07 20:36:26 +0100
commit5cea888d12b8ca4009baff3207a3d5712c58acc7 (patch)
tree4aebb84b26b20ce9dc0a9607e1448b7f7752c949
parent65577c96191eba7bc33b8bf3a79df7419b465c10 (diff)
downloadtcpdump-5cea888d12b8ca4009baff3207a3d5712c58acc7.tar.gz
SunATM DLPI: Update the link-layer dissector to a void function
Moreover: Remove trailing "_if" from protocol name.
-rw-r--r--netdissect.h2
-rw-r--r--print-sunatm.c10
-rw-r--r--print.c6
3 files changed, 10 insertions, 8 deletions
diff --git a/netdissect.h b/netdissect.h
index 3e49bc90..3d521537 100644
--- a/netdissect.h
+++ b/netdissect.h
@@ -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;
diff --git a/print-sunatm.c b/print-sunatm.c
index 0e8fe57d..27f63c3d 100644
--- a/print-sunatm.c
+++ b/print-sunatm.c
@@ -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 c0d9e890..1465c07d 100644
--- 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