X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e2f14ebc87586ecad6901c09a1cb7e371baf2ea1..9d046ee0503d4c8cbfcb200c88986de876f6cae7:/print-ether.c?ds=sidebyside diff --git a/print-ether.c b/print-ether.c index d7bc1b40..74479ccf 100644 --- a/print-ether.c +++ b/print-ether.c @@ -100,6 +100,7 @@ const struct tok ethertype_values[] = { { ETHERTYPE_GEONET, "GeoNet"}, { ETHERTYPE_CALM_FAST, "CALM FAST"}, { ETHERTYPE_AOE, "AoE" }, + { ETHERTYPE_PTP, "PTP" }, { ETHERTYPE_ARISTA, "Arista Vendor Specific Protocol" }, { 0, NULL} }; @@ -109,7 +110,7 @@ ether_addresses_print(netdissect_options *ndo, const u_char *src, const u_char *dst) { ND_PRINT("%s > %s, ", - etheraddr_string(ndo, src), etheraddr_string(ndo, dst)); + GET_ETHERADDR_STRING(src), GET_ETHERADDR_STRING(dst)); } static void @@ -289,7 +290,7 @@ recurse: * It's a type field, with the type for Alteon jumbo frames. * See * - * http://tools.ietf.org/html/draft-ietf-isis-ext-eth-01 + * https://tools.ietf.org/html/draft-ietf-isis-ext-eth-01 * * which indicates that, following the type field, * there's an LLC header and payload. @@ -303,34 +304,34 @@ recurse: llc_hdrlen = -llc_hdrlen; } hdrlen += llc_hdrlen; - } else if (length_type == ETHERTYPE_ARISTA) { - if (caplen < 2) { - ND_PRINT("[|arista]"); - return (hdrlen + caplen); - } - if (length < 2) { - ND_PRINT("[|arista]"); - return (hdrlen + length); - } - ether_type_print(ndo, length_type); - ND_PRINT(", length %u: ", orig_length); - int bytesConsumed = arista_print_ethertype(ndo, p, length); - if (bytesConsumed > 0) { - p += bytesConsumed; - length -= bytesConsumed; - caplen -= bytesConsumed; - hdrlen += bytesConsumed; - goto recurse; - } else { - /* subtype/version not known, print raw packet */ - if (!ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL) { - ether_addresses_print(ndo, src.addr, dst.addr); - ether_type_print(ndo, length_type); - ND_PRINT(", length %u: ", orig_length); - } - if (!ndo->ndo_suppress_default_print) - ND_DEFAULTPRINT(p, caplen); + } else if (length_type == ETHERTYPE_ARISTA) { + if (caplen < 2) { + ND_PRINT("[|arista]"); + return (hdrlen + caplen); + } + if (length < 2) { + ND_PRINT("[|arista]"); + return (hdrlen + length); + } + ether_type_print(ndo, length_type); + ND_PRINT(", length %u: ", orig_length); + int bytesConsumed = arista_ethertype_print(ndo, p, length); + if (bytesConsumed > 0) { + p += bytesConsumed; + length -= bytesConsumed; + caplen -= bytesConsumed; + hdrlen += bytesConsumed; + goto recurse; + } else { + /* subtype/version not known, print raw packet */ + if (!ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL) { + ether_addresses_print(ndo, src.addr, dst.addr); + ether_type_print(ndo, length_type); + ND_PRINT(", length %u: ", orig_length); } + if (!ndo->ndo_suppress_default_print) + ND_DEFAULTPRINT(p, caplen); + } } else { /* * It's a type field with some other value. @@ -600,6 +601,10 @@ ethertype_print(netdissect_options *ndo, aoe_print(ndo, p, length); return (1); + case ETHERTYPE_PTP: + ptp_print(ndo, p, length); + return (1); + case ETHERTYPE_LAT: case ETHERTYPE_SCA: case ETHERTYPE_MOPRC: