]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cdp.c
Fix spaces
[tcpdump] / print-cdp.c
index 1f0f07cd1df0a92182508a5ad7454e72315481d3..79d7046c7367c0ca41b72bf1c7ae25fe23655f35 100644 (file)
 /* \summary: Cisco Discovery Protocol (CDP) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include <string.h>
 
@@ -39,7 +39,6 @@
 #include "extract.h"
 #include "nlpid.h"
 
-static const char tstr[] = "[|cdp]";
 
 #define CDP_HEADER_LEN             4
 #define CDP_HEADER_VERSION_OFFSET  0
@@ -97,8 +96,9 @@ cdp_print(netdissect_options *ndo,
        u_int type, len, i, j;
        const u_char *tptr;
 
+       ndo->ndo_protocol = "cdp";
        if (caplen < CDP_HEADER_LEN) {
-               ND_PRINT("%s", tstr);
+               nd_print_trunc(ndo);
                return;
        }
 
@@ -148,7 +148,7 @@ cdp_print(netdissect_options *ndo,
                        if (!ndo->ndo_vflag)
                            ND_PRINT(", Device-ID ");
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x02: /* Address */
@@ -157,7 +157,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x03: /* Port-ID */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x04: /* Capabilities */
@@ -180,7 +180,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x06: /* Platform */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x07: /* Prefixes */
@@ -191,7 +191,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x09: /* VTP Mgmt Domain  - CDPv2 */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x0a: /* Native VLAN ID - CDPv2 */
@@ -250,7 +250,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x14: /* System Name - not documented */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x16: /* System Object ID - not documented */
@@ -263,7 +263,7 @@ cdp_print(netdissect_options *ndo,
                        ND_PRINT("0x%02x", EXTRACT_U_1(tptr));
                        if (len > 1) {
                                ND_PRINT("/");
-                               (void)fn_printn(ndo, tptr + 1, len - 1, NULL);
+                               (void)nd_printn(ndo, tptr + 1, len - 1, NULL);
                        }
                        break;
                    default:
@@ -278,7 +278,7 @@ cdp_print(netdissect_options *ndo,
 
        return;
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 /*