X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3c8f3e13b03380742c24070f8a7b56fe12c6b8ee..195a4cfd9de46b47ac6794930e19e38ed263b05f:/print-tftp.c diff --git a/print-tftp.c b/print-tftp.c index a47a7847..e0bedc39 100644 --- a/print-tftp.c +++ b/print-tftp.c @@ -89,10 +89,10 @@ static const struct tok err2str[] = { */ void tftp_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { - register const char *cp; - register int opcode; + const char *cp; + int opcode; u_int ui; /* Print length */ @@ -102,7 +102,7 @@ tftp_print(netdissect_options *ndo, if (length < 2) goto trunc; ND_TCHECK_2(bp); - opcode = EXTRACT_BE_16BITS(bp); + opcode = EXTRACT_BE_U_2(bp); cp = tok2str(op2str, "tftp-#%d", opcode); ND_PRINT((ndo, " %s", cp)); /* Bail if bogus opcode */ @@ -139,8 +139,8 @@ tftp_print(netdissect_options *ndo, /* Print options, if any */ while (length != 0) { - ND_TCHECK(*bp); - if (*bp != '\0') + ND_TCHECK_1(bp); + if (EXTRACT_U_1(bp) != '\0') ND_PRINT((ndo, " ")); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); if (ui == 0) @@ -153,8 +153,8 @@ tftp_print(netdissect_options *ndo, case OACK: /* Print options */ while (length != 0) { - ND_TCHECK(*bp); - if (*bp != '\0') + ND_TCHECK_1(bp); + if (EXTRACT_U_1(bp) != '\0') ND_PRINT((ndo, " ")); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); if (ui == 0) @@ -169,7 +169,7 @@ tftp_print(netdissect_options *ndo, if (length < 2) goto trunc; /* no block number */ ND_TCHECK_2(bp); - ND_PRINT((ndo, " block %d", EXTRACT_BE_16BITS(bp))); + ND_PRINT((ndo, " block %d", EXTRACT_BE_U_2(bp))); break; case TFTP_ERROR: @@ -178,7 +178,7 @@ tftp_print(netdissect_options *ndo, goto trunc; /* no error code */ ND_TCHECK_2(bp); ND_PRINT((ndo, " %s", tok2str(err2str, "tftp-err-#%d \"", - EXTRACT_BE_16BITS(bp)))); + EXTRACT_BE_U_2(bp)))); bp += 2; length -= 2; /* Print error message string */