Lines Matching defs:bp

208 resp_print(netdissect_options *ndo, const u_char *bp, u_int length)
222 * In order to handle this case, we must try and parse 'bp' until
225 ret_len = resp_parse(ndo, bp, length);
227 bp += ret_len;
238 resp_parse(netdissect_options *ndo, const u_char *bp, int length)
244 op = GET_U_1(bp);
246 /* bp now points to the op, so these routines must skip it */
248 case RESP_SIMPLE_STRING: ret_len = resp_print_simple_string(ndo, bp, length); break;
249 case RESP_INTEGER: ret_len = resp_print_integer(ndo, bp, length); break;
250 case RESP_ERROR: ret_len = resp_print_error(ndo, bp, length); break;
251 case RESP_BULK_STRING: ret_len = resp_print_bulk_string(ndo, bp, length); break;
252 case RESP_ARRAY: ret_len = resp_print_bulk_array(ndo, bp, length); break;
253 default: ret_len = resp_print_inline(ndo, bp, length); break;
268 resp_print_simple_string(netdissect_options *ndo, const u_char *bp, int length) {
269 return resp_print_string_error_integer(ndo, bp, length);
273 resp_print_integer(netdissect_options *ndo, const u_char *bp, int length) {
274 return resp_print_string_error_integer(ndo, bp, length);
278 resp_print_error(netdissect_options *ndo, const u_char *bp, int length) {
279 return resp_print_string_error_integer(ndo, bp, length);
283 resp_print_string_error_integer(netdissect_options *ndo, const u_char *bp, int length) {
287 /* bp points to the op; skip it */
288 SKIP_OPCODE(bp, length_cur);
289 bp_ptr = bp;
292 * bp now prints past the (+-;) opcode, so it's pointing to the first
303 * bp_ptr points to the \r\n, so bp_ptr - bp is the length of text
307 len = ND_BYTES_BETWEEN(bp, bp_ptr);
308 RESP_PRINT_SEGMENT(ndo, bp, len);
318 resp_print_bulk_string(netdissect_options *ndo, const u_char *bp, int length) {
321 /* bp points to the op; skip it */
322 SKIP_OPCODE(bp, length_cur);
325 GET_LENGTH(ndo, length_cur, bp, string_len);
328 /* Byte string of length string_len, starting at bp */
333 ND_TCHECK_LEN(bp, string_len);
334 RESP_PRINT_SEGMENT(ndo, bp, string_len);
335 bp += string_len;
344 FIND_CRLF(bp, length_cur);
345 CONSUME_CRLF(bp, length_cur);
364 resp_print_bulk_array(netdissect_options *ndo, const u_char *bp, int length) {
368 /* bp points to the op; skip it */
369 SKIP_OPCODE(bp, length_cur);
372 GET_LENGTH(ndo, length_cur, bp, array_len);
377 ret_len = resp_parse(ndo, bp, length_cur);
381 bp += ret_len;
403 resp_print_inline(netdissect_options *ndo, const u_char *bp, int length) {
420 CONSUME_CR_OR_LF(bp, length_cur);
421 bp_ptr = bp;
429 * Found it; bp_ptr points to the \r or \n, so bp_ptr - bp is the
432 len = ND_BYTES_BETWEEN(bp, bp_ptr);
433 RESP_PRINT_SEGMENT(ndo, bp, len);
450 resp_get_length(netdissect_options *ndo, const u_char *bp, int len, const u_char **endp)
462 if (GET_U_1(bp) == '-') {
464 bp++;
473 c = GET_U_1(bp);
476 bp++;
493 bp++;
502 if (GET_U_1(bp) != '\r') {
503 bp++;
506 bp++;
510 if (GET_U_1(bp) != '\n') {
511 bp++;
514 bp++;
516 *endp = bp;
526 *endp = bp;
530 *endp = bp;