X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1a90fd99d279d63242419a30ba3e0720872bff75..009bd798b51d25d1b7f0dc7629fe7350eff9cf73:/print-sunatm.c diff --git a/print-sunatm.c b/print-sunatm.c index eaa7125d..e1686d83 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -33,13 +33,10 @@ /* \summary: SunATM DLPI capture printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include - -struct mbuf; -struct rtentry; +#include "netdissect-stdinc.h" #include "netdissect.h" #include "extract.h" @@ -72,16 +69,17 @@ sunatm_if_print(netdissect_options *ndo, u_char vpi; u_int traftype; + ndo->ndo_protocol = "sunatm_if"; if (caplen < PKT_BEGIN_POS) { - ND_PRINT((ndo, "[|atm]")); + nd_print_trunc(ndo); return (caplen); } if (ndo->ndo_eflag) { - ND_PRINT((ndo, EXTRACT_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: ")); + ND_PRINT(EXTRACT_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: "); } - switch (p[DIR_POS] & 0x0f) { + switch (EXTRACT_U_1(p + DIR_POS) & 0x0f) { case PT_LANE: traftype = ATM_LANE; @@ -97,7 +95,7 @@ sunatm_if_print(netdissect_options *ndo, } vci = EXTRACT_BE_U_2(p + VCI_POS); - vpi = p[VPI_POS]; + vpi = EXTRACT_U_1(p + VPI_POS); p += PKT_BEGIN_POS; caplen -= PKT_BEGIN_POS;