Lines Matching defs:sp
385 /* sp points to IAC byte */
387 telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print)
392 #define FETCH(c, sp, length) \
396 ND_TCHECK(*sp); \
397 c = *sp++; \
401 osp = sp;
403 FETCH(c, sp, length);
406 FETCH(c, sp, length);
424 FETCH(x, sp, length);
435 p = sp;
436 while (length > (u_int)(p + 1 - sp)) {
446 if (p <= sp)
448 FETCH(c, sp, length);
451 if (p <= sp)
453 FETCH(c, sp, length);
458 if (p <= sp)
460 FETCH(c, sp, length);
463 if (p <= sp)
465 FETCH(c, sp, length);
470 if (p <= sp)
472 FETCH(c, sp, length);
477 while (p > sp) {
478 FETCH(x, sp, length);
485 sp += 2;
494 return sp - osp;
504 telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
510 osp = sp;
512 while (length > 0 && *sp == IAC) {
517 l = telnet_parse(ndo, sp, length, 0);
527 hex_print_with_offset(ndo, "\n", sp, l, sp - osp);
535 (void)telnet_parse(ndo, sp, length, 1);
538 sp += l;