]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-domain.c
Force -t on in TESTonce.
[tcpdump] / print-domain.c
index 1d99f14247930da8d1d98f9b2fad6277912f08c0..d0b6996fda2f047ed451e76a23b91467153e49aa 100644 (file)
@@ -19,6 +19,8 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: Domain Name System (DNS) printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -31,6 +33,7 @@
 
 #include "netdissect.h"
 #include "addrtoname.h"
+#include "addrtostr.h"
 #include "extract.h"
 
 static const char *ns_ops[] = {
@@ -394,7 +397,7 @@ ns_rprint(netdissect_options *ndo,
        } else if (ndo->ndo_vflag > 2) {
                /* print ttl */
                ND_PRINT((ndo, " ["));
-               relts_print(ndo, EXTRACT_32BITS(cp));
+               unsigned_relts_print(ndo, EXTRACT_32BITS(cp));
                ND_PRINT((ndo, "]"));
                cp += 4;
        } else {
@@ -480,17 +483,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 +514,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 +523,6 @@ ns_rprint(netdissect_options *ndo,
                }
                break;
            }
-#endif /*INET6*/
 
        case T_OPT:
                ND_PRINT((ndo, " UDPsize=%u", class));