X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3f3f2505f2a02fcc471f7baba884959ccb2233c9..96afbce6fc40e89e4f215db5838ae00979185e11:/print-rx.c diff --git a/print-rx.c b/print-rx.c index 3f3eea1a..d4ca5094 100644 --- a/print-rx.c +++ b/print-rx.c @@ -526,15 +526,15 @@ static int is_ubik(uint32_t); void rx_print(netdissect_options *ndo, - register const u_char *bp, u_int length, u_int sport, u_int dport, + const u_char *bp, u_int length, u_int sport, u_int dport, const u_char *bp2) { - register const struct rx_header *rxh; + const struct rx_header *rxh; uint32_t i; uint8_t type, flags; uint32_t opcode; - if (!ND_TTEST2(*bp, sizeof (struct rx_header))) { + if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) { ND_PRINT((ndo, " [|rx] (%u)", length)); return; } @@ -753,7 +753,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, */ #define FIDOUT() { uint32_t n1, n2, n3; \ - ND_TCHECK2(bp[0], sizeof(uint32_t) * 3); \ + ND_TCHECK_LEN(bp, sizeof(uint32_t) * 3); \ n1 = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ n2 = EXTRACT_BE_U_4(bp); \ @@ -764,7 +764,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define STROUT(MAX) { uint32_t _i; \ - ND_TCHECK2(bp[0], sizeof(uint32_t)); \ + ND_TCHECK_LEN(bp, sizeof(uint32_t)); \ _i = EXTRACT_BE_U_4(bp); \ if (_i > (MAX)) \ goto trunc; \ @@ -791,7 +791,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define UINT64OUT() { uint64_t _i; \ - ND_TCHECK2(bp[0], sizeof(uint64_t)); \ + ND_TCHECK_LEN(bp, sizeof(uint64_t)); \ _i = EXTRACT_BE_U_8(bp); \ bp += sizeof(uint64_t); \ ND_PRINT((ndo, " %" PRIu64, _i)); \ @@ -807,7 +807,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define STOREATTROUT() { uint32_t mask, _i; \ - ND_TCHECK2(bp[0], (sizeof(uint32_t)*6)); \ + ND_TCHECK_LEN(bp, (sizeof(uint32_t) * 6)); \ mask = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ if (mask) ND_PRINT((ndo, " StoreStatus")); \ if (mask & 1) { ND_PRINT((ndo, " date")); DATEOUT(); } \ @@ -825,7 +825,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define UBIK_VERSIONOUT() {uint32_t epoch; uint32_t counter; \ - ND_TCHECK2(bp[0], sizeof(uint32_t) * 2); \ + ND_TCHECK_LEN(bp, sizeof(uint32_t) * 2); \ epoch = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ counter = EXTRACT_BE_U_4(bp); \ @@ -834,7 +834,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define AFSUUIDOUT() {uint32_t temp; int _i; \ - ND_TCHECK2(bp[0], 11*sizeof(uint32_t)); \ + ND_TCHECK_LEN(bp, 11 * sizeof(uint32_t)); \ temp = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ ND_PRINT((ndo, " %08x", temp)); \ @@ -860,7 +860,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, uint32_t k; \ if ((MAX) + 1 > sizeof(s)) \ goto trunc; \ - ND_TCHECK2(bp[0], (MAX) * sizeof(uint32_t)); \ + ND_TCHECK_LEN(bp, (MAX) * sizeof(uint32_t)); \ sp = s; \ for (k = 0; k < (MAX); k++) { \ *sp++ = (u_char) EXTRACT_BE_U_4(bp); \ @@ -873,7 +873,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, } #define DESTSERVEROUT() { uint32_t n1, n2, n3; \ - ND_TCHECK2(bp[0], sizeof(uint32_t) * 3); \ + ND_TCHECK_LEN(bp, sizeof(uint32_t) * 3); \ n1 = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ n2 = EXTRACT_BE_U_4(bp); \ @@ -889,7 +889,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, static void fs_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t fs_op; uint32_t i; @@ -957,7 +957,7 @@ fs_print(netdissect_options *ndo, ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_TCHECK2(bp[0], i); + ND_TCHECK_LEN(bp, i); i = min(AFSOPAQUEMAX, i); strncpy(a, (const char *) bp, i); a[i] = '\0'; @@ -1059,7 +1059,7 @@ trunc: static void fs_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { uint32_t i; const struct rx_header *rxh; @@ -1092,7 +1092,7 @@ fs_reply_print(netdissect_options *ndo, ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_TCHECK2(bp[0], i); + ND_TCHECK_LEN(bp, i); i = min(AFSOPAQUEMAX, i); strncpy(a, (const char *) bp, i); a[i] = '\0'; @@ -1224,7 +1224,7 @@ finish: static void cb_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t cb_op; uint32_t i; @@ -1305,7 +1305,7 @@ trunc: static void cb_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -1357,7 +1357,7 @@ trunc: static void prot_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t i; uint32_t pt_op; @@ -1498,7 +1498,7 @@ trunc: static void prot_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -1613,7 +1613,7 @@ trunc: static void vldb_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t vldb_op; uint32_t i; @@ -1704,7 +1704,7 @@ trunc: static void vldb_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -1773,7 +1773,7 @@ vldb_reply_print(netdissect_options *ndo, ND_PRINT((ndo, " %u", j)); bp += sizeof(uint32_t); } - ND_TCHECK2(bp[0], 8 * sizeof(uint32_t)); + ND_TCHECK_LEN(bp, 8 * sizeof(uint32_t)); bp += 8 * sizeof(uint32_t); ND_PRINT((ndo, " rwvol")); UINTOUT(); @@ -1820,7 +1820,7 @@ vldb_reply_print(netdissect_options *ndo, ND_PRINT((ndo, " %u", j)); bp += sizeof(uint32_t); } - ND_TCHECK2(bp[0], 13 * sizeof(uint32_t)); + ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t)); bp += 13 * sizeof(uint32_t); ND_PRINT((ndo, " rwvol")); UINTOUT(); @@ -1845,11 +1845,11 @@ vldb_reply_print(netdissect_options *ndo, ND_PRINT((ndo, " afsuuid")); AFSUUIDOUT(); } else { - ND_TCHECK2(bp[0], 44); + ND_TCHECK_LEN(bp, 44); bp += 44; } } - ND_TCHECK2(bp[0], 4 * 13); + ND_TCHECK_LEN(bp, 4 * 13); bp += 4 * 13; ND_PRINT((ndo, " partitions")); for (i = 0; i < 13; i++) { @@ -1861,7 +1861,7 @@ vldb_reply_print(netdissect_options *ndo, ND_PRINT((ndo, " %u", j)); bp += sizeof(uint32_t); } - ND_TCHECK2(bp[0], 13 * sizeof(uint32_t)); + ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t)); bp += 13 * sizeof(uint32_t); ND_PRINT((ndo, " rwvol")); UINTOUT(); @@ -1894,7 +1894,7 @@ trunc: static void kauth_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t kauth_op; @@ -1951,7 +1951,7 @@ kauth_print(netdissect_options *ndo, ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_TCHECK2(bp[0], i); + ND_TCHECK_LEN(bp, i); bp += i; ND_PRINT((ndo, " principal")); STROUT(KANAMEMAX); @@ -1985,7 +1985,7 @@ trunc: static void kauth_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -2039,7 +2039,7 @@ trunc: static void vol_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t vol_op; @@ -2238,7 +2238,7 @@ trunc: static void vol_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -2375,7 +2375,7 @@ trunc: static void bos_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { uint32_t bos_op; @@ -2464,7 +2464,7 @@ trunc: static void bos_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -2525,7 +2525,7 @@ is_ubik(uint32_t opcode) static void ubik_print(netdissect_options *ndo, - register const u_char *bp) + const u_char *bp) { uint32_t ubik_op; uint32_t temp; @@ -2640,7 +2640,7 @@ trunc: static void ubik_reply_print(netdissect_options *ndo, - register const u_char *bp, u_int length, uint32_t opcode) + const u_char *bp, u_int length, uint32_t opcode) { const struct rx_header *rxh; uint8_t type; @@ -2706,7 +2706,7 @@ trunc: static void rx_ack_print(netdissect_options *ndo, - register const u_char *bp, u_int length) + const u_char *bp, u_int length) { const struct rx_ackPacket *rxa; uint8_t nAcks; @@ -2718,7 +2718,7 @@ rx_ack_print(netdissect_options *ndo, bp += sizeof(struct rx_header); - ND_TCHECK2(bp[0], sizeof(struct rx_ackPacket)); + ND_TCHECK_LEN(bp, sizeof(struct rx_ackPacket)); rxa = (const struct rx_ackPacket *) bp; bp += sizeof(struct rx_ackPacket); @@ -2759,7 +2759,7 @@ rx_ack_print(netdissect_options *ndo, nAcks = EXTRACT_U_1(rxa->nAcks); if (nAcks != 0) { - ND_TCHECK2(bp[0], nAcks); + ND_TCHECK_LEN(bp, nAcks); /* * Sigh, this is gross, but it seems to work to collapse