X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/cbe647350e454cb90dfeaf34cd8c6a297ef6cb59..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-cdp.c diff --git a/print-cdp.c b/print-cdp.c index 1f0f07cd..79d7046c 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -27,10 +27,10 @@ /* \summary: Cisco Discovery Protocol (CDP) printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include @@ -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); } /*