* http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
*/
-#ifndef lint
-static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.25 2004-10-07 14:53:11 hannes Exp $";
-#endif
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "extract.h" /* must come after interface.h */
#include "nlpid.h"
+static const char tstr[] = "[|cdp]";
+
#define CDP_HEADER_LEN 4
-static struct tok cdp_tlv_values[] = {
+static const struct tok cdp_tlv_values[] = {
{ 0x01, "Device-ID"},
{ 0x02, "Address"},
{ 0x03, "Port-ID"},
{ 0, NULL}
};
-static struct tok cdp_capability_values[] = {
+static const struct tok cdp_capability_values[] = {
{ 0x01, "Router" },
{ 0x02, "Transparent Bridge" },
{ 0x04, "Source Route Bridge" },
const u_char *tptr;
if (caplen < CDP_HEADER_LEN) {
- (void)printf("[|cdp]");
+ printf("%s", tstr);
return;
}
tok2str(cdp_tlv_values,"unknown field type", type),
type,
len,
- len>1 ? "s" : ""); /* plural */
+ PLURAL_SUFFIX(len)); /* plural */
switch (type) {
}
break;
default:
- print_unknown_data(tptr,"\n\t ",len);
+ print_unknown_data(gndo,tptr,"\n\t ",len);
break;
}
}
return;
trunc:
- printf("[|cdp]");
+ printf("%s", tstr);
}
/*
int pt, pl, al, num;
const u_char *endp = p + l;
#ifdef INET6
- static u_char prot_ipv6[] = {
+ static const u_char prot_ipv6[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x86, 0xdd
};
#endif