summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tcpdump/print-domain.c')
-rw-r--r--contrib/tcpdump/print-domain.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/contrib/tcpdump/print-domain.c b/contrib/tcpdump/print-domain.c
index 4e2d378..d0b6996 100644
--- a/contrib/tcpdump/print-domain.c
+++ b/contrib/tcpdump/print-domain.c
@@ -17,24 +17,24 @@
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * $FreeBSD$
*/
-#define NETDISSECT_REWORKED
+/* \summary: Domain Name System (DNS) printer */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
#include "nameser.h"
#include <string.h>
-#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",
@@ -397,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 {
@@ -483,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;
}
@@ -517,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, " "));
@@ -526,12 +523,11 @@ ns_rprint(netdissect_options *ndo,
}
break;
}
-#endif /*INET6*/
case T_OPT:
ND_PRINT((ndo, " UDPsize=%u", class));
if (opt_flags & 0x8000)
- ND_PRINT((ndo, " OK"));
+ ND_PRINT((ndo, " DO"));
break;
case T_UNSPECA: /* One long string */
@@ -668,7 +664,7 @@ ns_print(netdissect_options *ndo,
DNS_CD(np) ? "%" : ""));
/* any weirdness? */
- b2 = EXTRACT_16BITS(((u_short *)np)+1);
+ b2 = EXTRACT_16BITS(((const u_short *)np)+1);
if (b2 & 0x6cf)
ND_PRINT((ndo, " [b2&3=0x%x]", b2));
OpenPOWER on IntegriCloud