X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/91942a9cb63f69da45f5c6d838594e3547a82ae2..39d15607cad1b4b463794c1a67873f6182dc52f7:/print-cdp.c diff --git a/print-cdp.c b/print-cdp.c index 7bc617a9..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; } @@ -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