]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-vtp.c
Fix spaces
[tcpdump] / print-vtp.c
index a2dee70d525b7906a2956019b85c1c7ca0201d9e..2718d2ac57a1113a840dc8ce87292409936fc80d 100644 (file)
 /* \summary: Cisco VLAN Trunking Protocol (VTP) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "addrtoname.h"
@@ -116,13 +116,14 @@ static const struct tok vtp_stp_type_values[] = {
 };
 
 void
-vtp_print (netdissect_options *ndo,
-           const u_char *pptr, u_int length)
+vtp_print(netdissect_options *ndo,
+          const u_char *pptr, u_int length)
 {
     u_int type, len, name_len, tlv_len, tlv_value, mgmtd_len;
     const u_char *tptr;
     const struct vtp_vlan_ *vtp_vlan;
 
+    ndo->ndo_protocol = "vtp";
     if (length < VTP_HEADER_LEN)
         goto trunc;
 
@@ -149,7 +150,7 @@ vtp_print (netdissect_options *ndo,
        ND_PRINT(" [invalid MgmtD Len %u]", mgmtd_len);
        return;
     }
-    fn_printzp(ndo, tptr + 4, mgmtd_len, NULL);
+    nd_printzp(ndo, tptr + 4, mgmtd_len, NULL);
     ND_PRINT(", %s: %u",
           tok2str(vtp_header_values, "Unknown", type),
           EXTRACT_U_1(tptr + 2));
@@ -266,7 +267,7 @@ vtp_print (netdissect_options *ndo,
            if (len < 4*((name_len + 3)/4))
                goto trunc;
            ND_TCHECK_LEN(tptr, name_len);
-           fn_printzp(ndo, tptr, name_len, NULL);
+           nd_printzp(ndo, tptr, name_len, NULL);
 
            /*
             * Vlan names are aligned to 32-bit boundaries.
@@ -393,12 +394,5 @@ vtp_print (netdissect_options *ndo,
     return;
 
  trunc:
-    ND_PRINT("[|vtp]");
+    nd_print_trunc(ndo);
 }
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 4
- * End:
- */