X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/f9b3c51da6c9454af79601666b5afe705901c126..c91ffeae22ab1c7d6714f0935a51030d088a5f5c:/print-ether.c diff --git a/print-ether.c b/print-ether.c index a092c47e..efbb8cfd 100644 --- a/print-ether.c +++ b/print-ether.c @@ -26,8 +26,6 @@ #include -#include - #include "interface.h" #include "extract.h" #include "addrtoname.h" @@ -95,26 +93,26 @@ ether_hdr_print(netdissect_options *ndo, ep = (const struct ether_header *)bp; - (void)ND_PRINT((ndo, "%s > %s", + ND_PRINT((ndo, "%s > %s", etheraddr_string(ESRC(ep)), etheraddr_string(EDST(ep)))); ether_type = EXTRACT_16BITS(&ep->ether_type); if (!ndo->ndo_qflag) { if (ether_type <= ETHERMTU) - (void)ND_PRINT((ndo, ", 802.3")); + ND_PRINT((ndo, ", 802.3")); else - (void)ND_PRINT((ndo, ", ethertype %s (0x%04x)", + ND_PRINT((ndo, ", ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", ether_type), ether_type)); } else { if (ether_type <= ETHERMTU) - (void)ND_PRINT((ndo, ", 802.3")); + ND_PRINT((ndo, ", 802.3")); else - (void)ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type))); + ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type))); } - (void)ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT((ndo, ", length %u: ", length)); } /* @@ -158,7 +156,7 @@ recurse: */ if (ether_type <= ETHERMTU) { /* Try to print the LLC-layer header & higher layers */ - if (llc_print(p, length, caplen, ESRC(ep), EDST(ep), + if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep), &extracted_ether_type) == 0) { /* ether_type not known, print raw packet */ if (!ndo->ndo_eflag) { @@ -168,7 +166,7 @@ recurse: } if (!ndo->ndo_suppress_default_print) - ndo->ndo_default_print(ndo, p, caplen); + ND_DEFAULTPRINT(p, caplen); } } else if (ether_type == ETHERTYPE_8021Q || ether_type == ETHERTYPE_8021Q9100 || @@ -209,7 +207,7 @@ recurse: * there's an LLC header and payload. */ /* Try to print the LLC-layer header & higher layers */ - if (llc_print(p, length, caplen, ESRC(ep), EDST(ep), + if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep), &extracted_ether_type) == 0) { /* ether_type not known, print raw packet */ if (!ndo->ndo_eflag) { @@ -219,7 +217,7 @@ recurse: } if (!ndo->ndo_suppress_default_print) - ndo->ndo_default_print(ndo, p, caplen); + ND_DEFAULTPRINT(p, caplen); } } else { if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) { @@ -231,7 +229,7 @@ recurse: } if (!ndo->ndo_suppress_default_print) - ndo->ndo_default_print(ndo, p, caplen); + ND_DEFAULTPRINT(p, caplen); } } } @@ -268,7 +266,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, * Fail if we don't have enough data for the Hilscher pseudo-header. */ if (h->len < 4 || h->caplen < 4) { - printf("[|netanalyzer]"); + ND_PRINT((ndo, "[|netanalyzer]")); return (h->caplen); } @@ -298,7 +296,7 @@ netanalyzer_transparent_if_print(netdissect_options *ndo, * preamble, and SOF. */ if (h->len < 12 || h->caplen < 12) { - printf("[|netanalyzer-transparent]"); + ND_PRINT((ndo, "[|netanalyzer-transparent]")); return (h->caplen); } @@ -343,7 +341,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_ATALK: if (ndo->ndo_vflag) - fputs("et1 ", stdout); + ND_PRINT((ndo, "et1 ")); atalk_print(/*ndo,*/p, length); return (1); @@ -377,7 +375,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_PPP: if (length) { - printf(": "); + ND_PRINT((ndo, ": ")); ppp_print(/*ndo,*/p, length); } return (1); @@ -387,7 +385,7 @@ ethertype_print(netdissect_options *ndo, return (1); case ETHERTYPE_SLOW: - slow_print(/*ndo,*/p, length); + slow_print(ndo, p, length); return (1); case ETHERTYPE_CFM: