X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b036fcb3774637c33e1bc7a1a8769a0fab0aef12..f5c79aedbe9c52dad10a196d805718f55a2be17a:/print-lcp.c diff --git a/print-lcp.c b/print-lcp.c index 95c4696a..06346025 100644 --- a/print-lcp.c +++ b/print-lcp.c @@ -21,25 +21,19 @@ #ifndef lint static const char rcsid[] = -"@(#) $Header: /tcpdump/master/tcpdump/Attic/print-lcp.c,v 1.1 1999-11-21 03:54:24 assar Exp $ (LBL)"; +"@(#) $Header: /tcpdump/master/tcpdump/Attic/print-lcp.c,v 1.9 2000-10-06 04:23:12 guy Exp $ (LBL)"; +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #include #include #include -#if __STDC__ -struct mbuf; -struct rtentry; -#endif -#include - #include -#include -#ifdef HAVE_MEMORY_H -#include -#endif #include #include @@ -122,7 +116,7 @@ static struct tok lcpchap2str[] = { }; void -lcp_print(register const u_char *bp, u_int length, u_int caplen) +lcp_print(register const u_char *bp, u_int length) { u_short lcp_code, lcp_id, lcp_length; const u_char *lcp_data; @@ -140,7 +134,7 @@ lcp_print(register const u_char *bp, u_int length, u_int caplen) printf("LCP %s id=0x%x", tok2str(lcpcode2str, "LCP-#%d", lcp_code), lcp_id); - switch(lcp_code) { + switch (lcp_code) { case LCP_CONFREQ: case LCP_CONFACK: case LCP_CONFNAK: @@ -153,7 +147,7 @@ lcp_print(register const u_char *bp, u_int length, u_int caplen) lcpopt_type = p[0]; lcpopt_length = p[1]; p+=2; - printf(" <%s ",tok2str(lcpoption2str, "option-#%d", lcpopt_type), lcpopt_length); + printf(" <%s ",tok2str(lcpoption2str, "option-#%d", lcpopt_type)); if (lcpopt_length) switch (lcpopt_type) { case LCP_MRU: @@ -177,7 +171,7 @@ lcp_print(register const u_char *bp, u_int length, u_int caplen) case LCP_ASYNCMAP: case LCP_MAGICNUM: if (snapend < p+4) return; - printf("%#x",ntohl(*(u_long*)p)); + printf("%#x", (unsigned)ntohl(*(u_long*)p)); if (lcpopt_length != 6) printf(" len=%d!",lcpopt_length); break; case LCP_PCOMP: @@ -198,7 +192,7 @@ lcp_print(register const u_char *bp, u_int length, u_int caplen) case LCP_ECHOREP: case LCP_DISCARD: if (snapend < lcp_data+4) return; - printf(" magic=%#x", ntohl(*(u_long *) lcp_data)); + printf(" magic=%#x", (unsigned)ntohl(*(u_long *) lcp_data)); lcp_data +=4; break; case LCP_PROTREJ: @@ -209,8 +203,7 @@ lcp_print(register const u_char *bp, u_int length, u_int caplen) case LCP_CODEREJ: if (snapend < lcp_data+4) return; printf(" "); - /* XXX What's caplen? (lcp_print doesn't use it so it doesn't matter here) */ - lcp_print(lcp_data, (lcp_length+lcp_data > snapend ? snapend-lcp_data : lcp_length), 0); + lcp_print(lcp_data, (lcp_length+lcp_data > snapend ? snapend-lcp_data : lcp_length)); break; case LCP_TERMREQ: case LCP_TERMACK: