]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-vrrp.c
Fix spaces
[tcpdump] / print-vrrp.c
index d6ef7afd5bd364c2221aa9286a6e47754d44c408..71f70f0cf1b62a90637ae4b2b959fe3065cc0d3f 100644 (file)
 /* \summary: Virtual Router Redundancy Protocol (VRRP) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "extract.h"
@@ -110,6 +110,7 @@ vrrp_print(netdissect_options *ndo,
        int version, type, auth_type = VRRP_AUTH_NONE; /* keep compiler happy */
        const char *type_s;
 
+       ndo->ndo_protocol = "vrrp";
        ND_TCHECK_1(bp);
        version = (EXTRACT_U_1(bp) & 0xf0) >> 4;
        type = EXTRACT_U_1(bp) & 0x0f;
@@ -133,8 +134,8 @@ vrrp_print(netdissect_options *ndo,
        }
 
        if (ndo->ndo_vflag) {
-               int naddrs = EXTRACT_U_1(bp + 3);
-               int i;
+               u_int naddrs = EXTRACT_U_1(bp + 3);
+               u_int i;
                char c;
 
                if (version == 2 && ND_TTEST_LEN(bp, len)) {
@@ -157,7 +158,7 @@ vrrp_print(netdissect_options *ndo,
 
                ND_PRINT(", addrs");
                if (naddrs > 1)
-                       ND_PRINT("(%d)", naddrs);
+                       ND_PRINT("(%u)", naddrs);
                ND_PRINT(":");
                c = ' ';
                bp += 8;
@@ -170,7 +171,7 @@ vrrp_print(netdissect_options *ndo,
                if (version == 2 && auth_type == VRRP_AUTH_SIMPLE) { /* simple text password */
                        ND_TCHECK_1(bp + 7);
                        ND_PRINT(" auth \"");
-                       if (fn_printn(ndo, bp, 8, ndo->ndo_snapend)) {
+                       if (nd_printn(ndo, bp, 8, ndo->ndo_snapend)) {
                                ND_PRINT("\"");
                                goto trunc;
                        }
@@ -179,5 +180,5 @@ vrrp_print(netdissect_options *ndo,
        }
        return;
 trunc:
-       ND_PRINT("[|vrrp]");
+       nd_print_trunc(ndo);
 }