#include "netdissect-stdinc.h"
#include "netdissect.h"
#include <limits.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
#include "extract.h"
#define resp_print_length_negative(ndo) ND_PRINT(" length negative and not -1")
#define resp_print_invalid(ndo) ND_PRINT(" invalid")
-void resp_print(netdissect_options *, const u_char *, u_int);
static int resp_parse(netdissect_options *, const u_char *, int);
static int resp_print_string_error_integer(netdissect_options *, const u_char *, int);
static int resp_print_simple_string(netdissect_options *, const u_char *, int);
#define FIND_CRLF(_ptr, _len) \
for (;;) { \
LCHECK2(_len, 2); \
- ND_TCHECK_2(_ptr); \
- if (*_ptr == '\r' && *(_ptr+1) == '\n') \
+ ND_TCHECK_2(_ptr); \
+ if (GET_U_1(_ptr) == '\r' && \
+ GET_U_1(_ptr+1) == '\n') \
break; \
_ptr++; \
_len--; \
#define FIND_CR_OR_LF(_ptr, _len) \
for (;;) { \
LCHECK(_len); \
- ND_TCHECK_1(_ptr); \
- if (*_ptr == '\r' || *_ptr == '\n') \
+ if (GET_U_1(_ptr) == '\r' || \
+ GET_U_1(_ptr) == '\n') \
break; \
_ptr++; \
_len--; \
*/ \
goto trunc; \
} \
- if (*_ptr != '\r' && *_ptr != '\n') \
+ if (GET_U_1(_ptr) != '\r' && \
+ GET_U_1(_ptr) != '\n') \
break; \
_found_cr_or_lf = 1; \
_ptr++; \
int ret_len;
LCHECK2(length, 1);
- ND_TCHECK_1(bp);
op = GET_U_1(bp);
/* bp now points to the op, so these routines must skip it */
if (len == 0)
goto trunc;
- ND_TCHECK_1(bp);
too_large = 0;
neg = 0;
if (GET_U_1(bp) == '-') {
for (;;) {
if (len == 0)
goto trunc;
- ND_TCHECK_1(bp);
c = GET_U_1(bp);
if (!(c >= '0' && c <= '9')) {
if (!saw_digit) {
len--;
if (len == 0)
goto trunc;
- ND_TCHECK_1(bp);
if (GET_U_1(bp) != '\n') {
bp++;
goto invalid;