X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3e3e6d2ef4c1b120077378fe32dc0a88ee81f38e..cda9bf8c5f842fc7110fbbf2234bcc898f78c0bd:/print-resp.c diff --git a/print-resp.c b/print-resp.c index cb6a011e..beeec1ce 100644 --- a/print-resp.c +++ b/print-resp.c @@ -42,7 +42,6 @@ #include "extract.h" -static const char tstr[] = " [|RESP]"; /* * For information regarding RESP, see: http://redis.io/topics/protocol @@ -238,7 +237,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length) return; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); } static int @@ -249,7 +248,7 @@ resp_parse(netdissect_options *ndo, const u_char *bp, int length) LCHECK2(length, 1); ND_TCHECK_1(bp); - op = EXTRACT_U_1(bp); + op = GET_U_1(bp); /* bp now points to the op, so these routines must skip it */ switch(op) { @@ -435,7 +434,7 @@ resp_print_inline(netdissect_options *ndo, const u_char *bp, int length) { /* * Found it; bp_ptr points to the \r or \n, so bp_ptr - bp is the - * Length of the line text that preceeds it. Print it. + * Length of the line text that precedes it. Print it. */ len = (bp_ptr - bp); RESP_PRINT_SEGMENT(ndo, bp, len); @@ -468,7 +467,7 @@ resp_get_length(netdissect_options *ndo, const u_char *bp, int len, const u_char ND_TCHECK_1(bp); too_large = 0; neg = 0; - if (EXTRACT_U_1(bp) == '-') { + if (GET_U_1(bp) == '-') { neg = 1; bp++; len--; @@ -480,7 +479,7 @@ resp_get_length(netdissect_options *ndo, const u_char *bp, int len, const u_char if (len == 0) goto trunc; ND_TCHECK_1(bp); - c = EXTRACT_U_1(bp); + c = GET_U_1(bp); if (!(c >= '0' && c <= '9')) { if (!saw_digit) { bp++; @@ -509,7 +508,7 @@ resp_get_length(netdissect_options *ndo, const u_char *bp, int len, const u_char * OK, we found a non-digit character. It should be a \r, followed * by a \n. */ - if (EXTRACT_U_1(bp) != '\r') { + if (GET_U_1(bp) != '\r') { bp++; goto invalid; } @@ -518,7 +517,7 @@ resp_get_length(netdissect_options *ndo, const u_char *bp, int len, const u_char if (len == 0) goto trunc; ND_TCHECK_1(bp); - if (EXTRACT_U_1(bp) != '\n') { + if (GET_U_1(bp) != '\n') { bp++; goto invalid; }