X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e2982e7f6f0b624a773ec5a58885ee80fab46d34..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-resp.c diff --git a/print-resp.c b/print-resp.c index bec3858e..47f1eb3d 100644 --- a/print-resp.c +++ b/print-resp.c @@ -30,10 +30,10 @@ /* \summary: REdis Serialization Protocol (RESP) printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include "netdissect.h" #include #include @@ -42,7 +42,6 @@ #include "extract.h" -static const char tstr[] = " [|RESP]"; /* * For information regarding RESP, see: http://redis.io/topics/protocol @@ -136,7 +135,7 @@ static int resp_get_length(netdissect_options *, const u_char *, int, const u_ch /* \ * Have we hit the end of data? \ */ \ - if (_len == 0 || !ND_TTEST(*_ptr)) { \ + if (_len == 0 || !ND_TTEST_1(_ptr)) {\ /* \ * Yes. Have we seen a \r \ * or \n? \ @@ -205,7 +204,7 @@ static int resp_get_length(netdissect_options *, const u_char *, int, const u_ch */ #define RESP_PRINT_SEGMENT(_ndo, _bp, _len) \ ND_PRINT(" \""); \ - if (fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \ + if (nd_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \ goto trunc; \ fn_print_char(_ndo, '"'); @@ -214,6 +213,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length) { int ret_len = 0, length_cur = length; + ndo->ndo_protocol = "resp"; if(!bp || length <= 0) return; @@ -237,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