- register const struct ether_header *ep;
- uint16_t ether_type;
-
- ep = (const struct ether_header *)bp;
-
- ND_PRINT((ndo, "%s > %s",
- etheraddr_string(ndo, ESRC(ep)),
- etheraddr_string(ndo, EDST(ep))));
-
- ether_type = EXTRACT_16BITS(&ep->ether_type);
- if (!ndo->ndo_qflag) {
- if (ether_type <= ETHERMTU)
- ND_PRINT((ndo, ", 802.3"));
- else
- ND_PRINT((ndo, ", ethertype %s (0x%04x)",
- tok2str(ethertype_values,"Unknown", ether_type),
- ether_type));
- } else {
- if (ether_type <= ETHERMTU)
- ND_PRINT((ndo, ", 802.3"));
- else
- ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type)));
- }
-
- ND_PRINT((ndo, ", length %u: ", length));
+ ND_PRINT("%s > %s, ",
+ GET_MAC48_STRING(src), GET_MAC48_STRING(dst));
+}
+
+static void
+ether_type_print(netdissect_options *ndo, uint16_t type)
+{
+ if (!ndo->ndo_qflag)
+ ND_PRINT("ethertype %s (0x%04x)",
+ tok2str(ethertype_values, "Unknown", type), type);
+ else
+ ND_PRINT("%s",
+ tok2str(ethertype_values, "Unknown Ethertype (0x%04x)", type));