/* \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>
#include "extract.h"
#include "nlpid.h"
-static const char tstr[] = "[|cdp]";
#define CDP_HEADER_LEN 4
#define CDP_HEADER_VERSION_OFFSET 0
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;
}
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 */
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 */
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 */
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 */
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 */
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:
return;
trunc:
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
}
/*