diff options
Diffstat (limited to 'contrib/tcpdump/print-bootp.c')
-rw-r--r-- | contrib/tcpdump/print-bootp.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/contrib/tcpdump/print-bootp.c b/contrib/tcpdump/print-bootp.c index c8d9ca4..c80ccd7 100644 --- a/contrib/tcpdump/print-bootp.c +++ b/contrib/tcpdump/print-bootp.c @@ -24,7 +24,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.60 2001/09/17 21:57:56 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.60.4.2 2002/06/01 23:51:11 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -35,9 +35,6 @@ static const char rcsid[] = #include <sys/time.h> #include <sys/socket.h> -struct mbuf; -struct rtentry; - #include <netinet/in.h> #include <ctype.h> @@ -351,13 +348,14 @@ static struct tok arp2str[] = { static void rfc1048_print(register const u_char *bp) { - register u_char tag; + register u_int16_t tag; register u_int len, size; register const char *cp; register char c; int first; u_int32_t ul; - u_short us; + u_int16_t us; + u_int8_t uc; printf(" vend-rfc1048"); @@ -378,9 +376,9 @@ rfc1048_print(register const u_char *bp) * preclude overlap of 1-byte and 2-byte spaces. * If not, we need to offset tag after this step. */ - cp = tok2str(xtag2str, "?xT%d", tag); + cp = tok2str(xtag2str, "?xT%u", tag); } else - cp = tok2str(tag2str, "?T%d", tag); + cp = tok2str(tag2str, "?T%u", tag); c = *cp++; printf(" %s:", cp); @@ -396,8 +394,8 @@ rfc1048_print(register const u_char *bp) } if (tag == TAG_DHCP_MESSAGE && len == 1) { - c = *bp++; - switch (c) { + uc = *bp++; + switch (uc) { case DHCPDISCOVER: printf("DISCOVER"); break; case DHCPOFFER: printf("OFFER"); break; case DHCPREQUEST: printf("REQUEST"); break; @@ -406,7 +404,7 @@ rfc1048_print(register const u_char *bp) case DHCPNAK: printf("NACK"); break; case DHCPRELEASE: printf("RELEASE"); break; case DHCPINFORM: printf("INFORM"); break; - default: printf("%u", c); break; + default: printf("%u", uc); break; } continue; } @@ -414,8 +412,8 @@ rfc1048_print(register const u_char *bp) if (tag == TAG_PARM_REQUEST) { first = 1; while (len-- > 0) { - c = *bp++; - cp = tok2str(tag2str, "?T%d", c); + uc = *bp++; + cp = tok2str(tag2str, "?T%u", uc); if (!first) putchar('+'); printf("%s", cp + 1); @@ -427,9 +425,9 @@ rfc1048_print(register const u_char *bp) first = 1; while (len > 1) { len -= 2; - c = EXTRACT_16BITS(bp); + us = EXTRACT_16BITS(bp); bp += 2; - cp = tok2str(xtag2str, "?xT%d", c); + cp = tok2str(xtag2str, "?xT%u", us); if (!first) putchar('+'); printf("%s", cp + 1); @@ -504,7 +502,7 @@ rfc1048_print(register const u_char *bp) if (!first) putchar(','); us = EXTRACT_16BITS(bp); - printf("%d", us); + printf("%u", us); bp += sizeof(us); size -= sizeof(us); first = 0; @@ -524,7 +522,7 @@ rfc1048_print(register const u_char *bp) putchar('Y'); break; default: - printf("%d?", *bp); + printf("%u?", *bp); break; } ++bp; @@ -543,7 +541,7 @@ rfc1048_print(register const u_char *bp) if (c == 'x') printf("%02x", *bp); else - printf("%d", *bp); + printf("%u", *bp); ++bp; --size; first = 0; @@ -570,7 +568,7 @@ rfc1048_print(register const u_char *bp) if (*bp++) printf("[svrreg]"); if (*bp) - printf("%d/%d/", *bp, *(bp+1)); + printf("%u/%u/", *bp, *(bp+1)); bp += 2; putchar('"'); (void)fn_printn(bp, size - 3, NULL); @@ -602,7 +600,7 @@ rfc1048_print(register const u_char *bp) } default: - printf("[unknown special tag %d, size %d]", + printf("[unknown special tag %u, size %u]", tag, size); bp += size; size = 0; @@ -612,7 +610,7 @@ rfc1048_print(register const u_char *bp) } /* Data left over? */ if (size) - printf("[len %d]", len); + printf("[len %u]", len); } return; trunc: |