]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-medsa.c
Update .gitignore for other configurations
[tcpdump] / print-medsa.c
index 5553af06a87a354337765c2fbd3875cf0f9ab5af..b7111ea7a8e8d9f3445c245370e360aa9e8b1073 100644 (file)
@@ -22,7 +22,7 @@
 /* \summary: Marvell Extended Distributed Switch Architecture (MEDSA) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include "netdissect-stdinc.h"
@@ -32,7 +32,6 @@
 #include "addrtoname.h"
 #include "extract.h"
 
-static const char tstr[] = "[|MEDSA]";
 
 /*
  * Marvell Extended Distributed Switch Archiecture.
@@ -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:
- */
-