X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fe3253b9b8fad9e75f863157eba0780418182f17..ebb51ef0e725737ca8c1d618da6527a58660d2bf:/print-sunatm.c diff --git a/print-sunatm.c b/print-sunatm.c index 12975d96..a587e509 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -30,24 +30,21 @@ * POSSIBILITY OF SUCH DAMAGE. */ +/* \summary: SunATM DLPI capture printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include struct mbuf; struct rtentry; -#include -#include - -#include "interface.h" +#include "netdissect.h" #include "extract.h" -#include "addrtoname.h" #include "atm.h" -#include "atmuni31.h" /* SunATM header for ATM packet */ #define DIR_POS 0 /* Direction (0x80 = transmit, 0x00 = receive) */ @@ -66,7 +63,8 @@ struct rtentry; * is the number of bytes actually captured. */ u_int -sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p) +sunatm_if_print(netdissect_options *ndo, + const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; @@ -75,15 +73,12 @@ sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p) u_int traftype; if (caplen < PKT_BEGIN_POS) { - printf("[|atm]"); + ND_PRINT((ndo, "[|atm]")); return (caplen); } - if (eflag) { - if (p[DIR_POS] & 0x80) - printf("Tx: "); - else - printf("Rx: "); + if (ndo->ndo_eflag) { + ND_PRINT((ndo, p[DIR_POS] & 0x80 ? "Tx: " : "Rx: ")); } switch (p[DIR_POS] & 0x0f) { @@ -107,7 +102,7 @@ sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p) p += PKT_BEGIN_POS; caplen -= PKT_BEGIN_POS; length -= PKT_BEGIN_POS; - atm_print(vpi, vci, traftype, p, length, caplen); + atm_print(ndo, vpi, vci, traftype, p, length, caplen); return (PKT_BEGIN_POS); }