X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fb2479d733dbe8a991d11909b319341f7db62ab1..cc2d4cbd8ca150504127f375d8b51b194958d95b:/print-medsa.c diff --git a/print-medsa.c b/print-medsa.c index 8161012b..655cd01c 100644 --- a/print-medsa.c +++ b/print-medsa.c @@ -32,12 +32,11 @@ #include "addrtoname.h" #include "extract.h" -static const char tstr[] = "[|MEDSA]"; /* * Marvell Extended Distributed Switch Archiecture. * - * A Marvell propriatary header used for passing packets to/from + * A Marvell proprietary header used for passing packets to/from * specific ports of a switch. There is no open specification of this * header, but is documented in the Marvell Switch data sheets. For * background, see: @@ -69,8 +68,8 @@ struct medsa_pkthdr { #define CODE_ARP_MIRROR 4 #define CFI(medsa) (EXTRACT_U_1(medsa->port_trunc_codehi_cfi) & 0x01) #define PRI(medsa) (EXTRACT_U_1(medsa->pri_vidhi_codelo) >> 5) -#define VID(medsa) (((u_short)(EXTRACT_U_1(medsa->pri_vidhi_codelo) & 0xf) << 8 | \ - EXTRACT_U_1(medsa->vidlo))) +#define VID(medsa) ((u_short)(EXTRACT_U_1(medsa->pri_vidhi_codelo) & 0xf) << 8 | \ + EXTRACT_U_1(medsa->vidlo)) static const struct tok tag_values[] = { { TAG_TO_CPU, "To_CPU" }, @@ -147,6 +146,7 @@ medsa_print(netdissect_options *ndo, const struct medsa_pkthdr *medsa; u_short ether_type; + ndo->ndo_protocol = "medsa"; medsa = (const struct medsa_pkthdr *)bp; ND_TCHECK_SIZE(medsa); @@ -188,12 +188,5 @@ medsa_print(netdissect_options *ndo, } return; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); } - -/* - * Local Variables: - * c-style: bsd - * End: - */ -