X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/8485de9970b8d74aa61436454b7c3d02331af4db..refs/pull/482/head:/print-domain.c?ds=sidebyside diff --git a/print-domain.c b/print-domain.c index a6a6d3a2..c3066f7d 100644 --- a/print-domain.c +++ b/print-domain.c @@ -23,15 +23,16 @@ #include "config.h" #endif -#include +#include #include "nameser.h" #include -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" -#include "extract.h" /* must come after interface.h */ +#include "addrtostr.h" +#include "extract.h" static const char *ns_ops[] = { "", " inv_q", " stat", " op3", " notify", " update", " op6", " op7", @@ -480,17 +481,14 @@ ns_rprint(netdissect_options *ndo, EXTRACT_16BITS(cp), EXTRACT_16BITS(cp + 2))); break; -#ifdef INET6 case T_AAAA: { - struct in6_addr addr; char ntop_buf[INET6_ADDRSTRLEN]; if (!ND_TTEST2(*cp, sizeof(struct in6_addr))) return(NULL); - memcpy(&addr, cp, sizeof(struct in6_addr)); ND_PRINT((ndo, " %s", - inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf)))); + addrtostr6(cp, ntop_buf, sizeof(ntop_buf)))); break; } @@ -514,7 +512,7 @@ ns_rprint(netdissect_options *ndo, memset(&a, 0, sizeof(a)); memcpy(&a.s6_addr[pbyte], cp + 1, sizeof(a) - pbyte); ND_PRINT((ndo, " %u %s", pbit, - inet_ntop(AF_INET6, &a, ntop_buf, sizeof(ntop_buf)))); + addrtostr6(&a, ntop_buf, sizeof(ntop_buf)))); } if (pbit > 0) { ND_PRINT((ndo, " ")); @@ -523,7 +521,6 @@ ns_rprint(netdissect_options *ndo, } break; } -#endif /*INET6*/ case T_OPT: ND_PRINT((ndo, " UDPsize=%u", class));