X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b02163ba7df1aeb681f223d70d5ef78108bf2a29..6c78ecd7a8b996bc81cc28d412ed9afa55f0b84c:/print-cdp.c diff --git a/print-cdp.c b/print-cdp.c index bef7f5ea..5383fd50 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -24,11 +24,6 @@ * 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 @@ -43,9 +38,11 @@ static const char rcsid[] _U_ = #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"}, @@ -70,7 +67,7 @@ static struct tok cdp_tlv_values[] = { { 0, NULL} }; -static struct tok cdp_capability_values[] = { +static const struct tok cdp_capability_values[] = { { 0x01, "Router" }, { 0x02, "Transparent Bridge" }, { 0x04, "Source Route Bridge" }, @@ -92,7 +89,7 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen) const u_char *tptr; if (caplen < CDP_HEADER_LEN) { - (void)printf("[|cdp]"); + printf("%s", tstr); return; } @@ -124,7 +121,7 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen) tok2str(cdp_tlv_values,"unknown field type", type), type, len, - len>1 ? "s" : ""); /* plural */ + PLURAL_SUFFIX(len)); /* plural */ switch (type) { @@ -218,7 +215,7 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen) } break; default: - print_unknown_data(tptr,"\n\t ",len); + print_unknown_data(gndo,tptr,"\n\t ",len); break; } } @@ -232,7 +229,7 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen) return; trunc: - printf("[|cdp]"); + printf("%s", tstr); } /* @@ -252,7 +249,7 @@ cdp_print_addr(const u_char * p, int l) 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