Lines Matching refs:ndo

57 ns_nskip(netdissect_options *ndo,  in ns_nskip()  argument
90 blabel_print(netdissect_options *ndo, in blabel_print() argument
105 ND_PRINT((ndo, "\\[x")); in blabel_print()
108 ND_PRINT((ndo, "%02x", *bitp)); in blabel_print()
113 ND_PRINT((ndo, "%02x", tc & (0xff << (8 - b)))); in blabel_print()
117 ND_PRINT((ndo, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b)))); in blabel_print()
119 ND_PRINT((ndo, "/%d]", bitlen)); in blabel_print()
122 ND_PRINT((ndo, ".../%d]", bitlen)); in blabel_print()
127 labellen(netdissect_options *ndo, in labellen() argument
138 ND_PRINT((ndo, "<ELT %d>", elt)); in labellen()
151 ns_nprint(netdissect_options *ndo, in ns_nprint() argument
159 int data_size = ndo->ndo_snapend - bp; in ns_nprint()
161 if ((l = labellen(ndo, cp)) == (u_int)-1) in ns_nprint()
172 while (i && cp < ndo->ndo_snapend) { in ns_nprint()
181 if ((l = labellen(ndo, cp)) == (u_int)-1) in ns_nprint()
195 ND_PRINT((ndo, "<LOOP>")); in ns_nprint()
204 if (blabel_print(ndo, cp) == NULL) in ns_nprint()
209 ND_PRINT((ndo, "<ELT %d>", elt)); in ns_nprint()
213 if (fn_printn(ndo, cp, l, ndo->ndo_snapend)) in ns_nprint()
219 ND_PRINT((ndo, ".")); in ns_nprint()
220 if ((l = labellen(ndo, cp)) == (u_int)-1) in ns_nprint()
230 ND_PRINT((ndo, ".")); in ns_nprint()
236 ns_cprint(netdissect_options *ndo, in ns_cprint() argument
244 if (fn_printn(ndo, cp, i, ndo->ndo_snapend)) in ns_cprint()
325 ns_qprint(netdissect_options *ndo, in ns_qprint() argument
331 cp = ns_nskip(ndo, cp); in ns_qprint()
339 ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%d", i))); in ns_qprint()
348 ND_PRINT((ndo, " %s", tok2str(ns_class2str, "(Class %d)", class))); in ns_qprint()
350 ND_PRINT((ndo, i & C_QU ? " (QU)" : " (QM)")); in ns_qprint()
353 ND_PRINT((ndo, "? ")); in ns_qprint()
354 cp = ns_nprint(ndo, np, bp); in ns_qprint()
360 ns_rprint(netdissect_options *ndo, in ns_rprint() argument
367 if (ndo->ndo_vflag) { in ns_rprint()
368 ND_PRINT((ndo, " ")); in ns_rprint()
369 if ((cp = ns_nprint(ndo, cp, bp)) == NULL) in ns_rprint()
372 cp = ns_nskip(ndo, cp); in ns_rprint()
375 return (ndo->ndo_snapend); in ns_rprint()
388 ND_PRINT((ndo, " %s", tok2str(ns_class2str, "(Class %d)", class))); in ns_rprint()
391 ND_PRINT((ndo, " (Cache flush)")); in ns_rprint()
400 } else if (ndo->ndo_vflag > 2) { in ns_rprint()
402 ND_PRINT((ndo, " [")); in ns_rprint()
403 relts_print(ndo, EXTRACT_32BITS(cp)); in ns_rprint()
404 ND_PRINT((ndo, "]")); in ns_rprint()
416 ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%d", typ))); in ns_rprint()
417 if (rp > ndo->ndo_snapend) in ns_rprint()
424 ND_PRINT((ndo, " %s", intoa(htonl(EXTRACT_32BITS(cp))))); in ns_rprint()
433 ND_PRINT((ndo, " ")); in ns_rprint()
434 if (ns_nprint(ndo, cp, bp) == NULL) in ns_rprint()
439 if (!ndo->ndo_vflag) in ns_rprint()
441 ND_PRINT((ndo, " ")); in ns_rprint()
442 if ((cp = ns_nprint(ndo, cp, bp)) == NULL) in ns_rprint()
444 ND_PRINT((ndo, " ")); in ns_rprint()
445 if ((cp = ns_nprint(ndo, cp, bp)) == NULL) in ns_rprint()
449 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp))); in ns_rprint()
451 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp))); in ns_rprint()
453 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp))); in ns_rprint()
455 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp))); in ns_rprint()
457 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp))); in ns_rprint()
461 ND_PRINT((ndo, " ")); in ns_rprint()
464 if (ns_nprint(ndo, cp + 2, bp) == NULL) in ns_rprint()
466 ND_PRINT((ndo, " %d", EXTRACT_16BITS(cp))); in ns_rprint()
471 ND_PRINT((ndo, " \"")); in ns_rprint()
472 cp = ns_cprint(ndo, cp); in ns_rprint()
475 ND_PRINT((ndo, "\"")); in ns_rprint()
480 ND_PRINT((ndo, " ")); in ns_rprint()
483 if (ns_nprint(ndo, cp + 6, bp) == NULL) in ns_rprint()
485 ND_PRINT((ndo, ":%d %d %d", EXTRACT_16BITS(cp + 4), in ns_rprint()
498 ND_PRINT((ndo, " %s", in ns_rprint()
515 ND_PRINT((ndo, " %u(bad plen)", pbit)); in ns_rprint()
522 ND_PRINT((ndo, " %u %s", pbit, in ns_rprint()
526 ND_PRINT((ndo, " ")); in ns_rprint()
527 if (ns_nprint(ndo, cp + 1 + sizeof(a) - pbyte, bp) == NULL) in ns_rprint()
535 ND_PRINT((ndo, " UDPsize=%u", class)); in ns_rprint()
537 ND_PRINT((ndo, " OK")); in ns_rprint()
543 if (fn_printn(ndo, cp, len, ndo->ndo_snapend)) in ns_rprint()
549 if (cp + len > ndo->ndo_snapend) in ns_rprint()
551 if (!ndo->ndo_vflag) in ns_rprint()
553 ND_PRINT((ndo, " ")); in ns_rprint()
554 if ((cp = ns_nprint(ndo, cp, bp)) == NULL) in ns_rprint()
559 ND_PRINT((ndo, " fudge=%u", EXTRACT_16BITS(cp))); in ns_rprint()
563 ND_PRINT((ndo, " maclen=%u", EXTRACT_16BITS(cp))); in ns_rprint()
567 ND_PRINT((ndo, " origid=%u", EXTRACT_16BITS(cp))); in ns_rprint()
571 ND_PRINT((ndo, " error=%u", EXTRACT_16BITS(cp))); in ns_rprint()
575 ND_PRINT((ndo, " otherlen=%u", EXTRACT_16BITS(cp))); in ns_rprint()
583 ns_print(netdissect_options *ndo, in ns_print() argument
601 ND_PRINT((ndo, "%d%s%s%s%s%s%s", in ns_print()
611 ND_PRINT((ndo, " [%dq]", qdcount)); in ns_print()
616 ND_PRINT((ndo, ",")); in ns_print()
617 if (ndo->ndo_vflag > 1) { in ns_print()
618 ND_PRINT((ndo, " q:")); in ns_print()
619 if ((cp = ns_qprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
622 if ((cp = ns_nskip(ndo, cp)) == NULL) in ns_print()
627 ND_PRINT((ndo, " %d/%d/%d", ancount, nscount, arcount)); in ns_print()
629 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
631 while (cp < ndo->ndo_snapend && ancount--) { in ns_print()
632 ND_PRINT((ndo, ",")); in ns_print()
633 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
640 if (ndo->ndo_vflag > 1) { in ns_print()
641 if (cp < ndo->ndo_snapend && nscount--) { in ns_print()
642 ND_PRINT((ndo, " ns:")); in ns_print()
643 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
645 while (cp < ndo->ndo_snapend && nscount--) { in ns_print()
646 ND_PRINT((ndo, ",")); in ns_print()
647 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
653 if (cp < ndo->ndo_snapend && arcount--) { in ns_print()
654 ND_PRINT((ndo, " ar:")); in ns_print()
655 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
657 while (cp < ndo->ndo_snapend && arcount--) { in ns_print()
658 ND_PRINT((ndo, ",")); in ns_print()
659 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
669 ND_PRINT((ndo, "%d%s%s%s", EXTRACT_16BITS(&np->id), ns_ops[DNS_OPCODE(np)], in ns_print()
676 ND_PRINT((ndo, " [b2&3=0x%x]", b2)); in ns_print()
680 ND_PRINT((ndo, " [%dq]", qdcount)); in ns_print()
682 ND_PRINT((ndo, " [%da]", ancount)); in ns_print()
686 ND_PRINT((ndo, " [%da]", ancount)); in ns_print()
688 ND_PRINT((ndo, " [%dq]", qdcount)); in ns_print()
691 ND_PRINT((ndo, " [%dn]", nscount)); in ns_print()
693 ND_PRINT((ndo, " [%dau]", arcount)); in ns_print()
697 cp = ns_qprint(ndo, cp, (const u_char *)np, is_mdns); in ns_print()
700 while (cp < ndo->ndo_snapend && qdcount--) { in ns_print()
701 cp = ns_qprint(ndo, (const u_char *)cp, in ns_print()
712 if (ndo->ndo_vflag > 1) { in ns_print()
714 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
716 while (cp < ndo->ndo_snapend && ancount--) { in ns_print()
717 ND_PRINT((ndo, ",")); in ns_print()
718 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
724 if (cp < ndo->ndo_snapend && nscount--) { in ns_print()
725 ND_PRINT((ndo, " ns:")); in ns_print()
726 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
728 while (nscount-- && cp < ndo->ndo_snapend) { in ns_print()
729 ND_PRINT((ndo, ",")); in ns_print()
730 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
736 if (cp < ndo->ndo_snapend && arcount--) { in ns_print()
737 ND_PRINT((ndo, " ar:")); in ns_print()
738 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
740 while (cp < ndo->ndo_snapend && arcount--) { in ns_print()
741 ND_PRINT((ndo, ",")); in ns_print()
742 if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) in ns_print()
750 ND_PRINT((ndo, " (%d)", length)); in ns_print()
754 ND_PRINT((ndo, "[|domain]")); in ns_print()