summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-domain.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2000-01-30 00:45:58 +0000
committerfenner <fenner@FreeBSD.org>2000-01-30 00:45:58 +0000
commit54c4a9c9f2aca2e032cbf41f5eb012e2e9628dd4 (patch)
treed25e1fd8c818bfce397a4c7e3f2c66229c814b2a /contrib/tcpdump/print-domain.c
parent0c669098d078c88cf703bade2263846b39e01d83 (diff)
downloadFreeBSD-src-54c4a9c9f2aca2e032cbf41f5eb012e2e9628dd4.zip
FreeBSD-src-54c4a9c9f2aca2e032cbf41f5eb012e2e9628dd4.tar.gz
Virgin import of tcpdump.org tcpdump v3.5
Diffstat (limited to 'contrib/tcpdump/print-domain.c')
-rw-r--r--contrib/tcpdump/print-domain.c60
1 files changed, 57 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-domain.c b/contrib/tcpdump/print-domain.c
index c96fb07..5d66b8d 100644
--- a/contrib/tcpdump/print-domain.c
+++ b/contrib/tcpdump/print-domain.c
@@ -21,7 +21,11 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: print-domain.c,v 1.39 97/06/13 12:56:28 leres Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.42 1999/11/21 09:36:50 fenner Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
#include <sys/param.h>
@@ -42,7 +46,6 @@ struct rtentry;
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/tcp.h>
-#include <netinet/tcpip.h>
#ifdef NOERROR
#undef NOERROR /* Solaris sucks */
@@ -53,6 +56,7 @@ struct rtentry;
#include <arpa/nameser.h>
#include <stdio.h>
+#include <string.h>
#include "interface.h"
#include "addrtoname.h"
@@ -101,6 +105,27 @@ struct rtentry;
#ifndef T_LOC
#define T_LOC 29 /* Location Information */
#endif
+#ifndef T_NXT
+#define T_NXT 30 /* Next Valid Name in Zone */
+#endif
+#ifndef T_EID
+#define T_EID 31 /* Endpoint identifier */
+#endif
+#ifndef T_NIMLOC
+#define T_NIMLOC 32 /* Nimrod locator */
+#endif
+#ifndef T_SRV
+#define T_SRV 33 /* Server selection */
+#endif
+#ifndef T_ATMA
+#define T_ATMA 34 /* ATM Address */
+#endif
+#ifndef T_NAPTR
+#define T_NAPTR 35 /* Naming Authority PoinTeR */
+#endif
+#ifndef T_A6
+#define T_A6 38 /* IP6 address (ipngwg-dns-lookups) */
+#endif
#ifndef T_UNSPEC
#define T_UNSPEC 103 /* Unspecified format (binary data) */
@@ -219,7 +244,14 @@ static struct tok type2str[] = {
{ T_PX, "PX" },
{ T_GPOS, "GPOS" },
{ T_AAAA, "AAAA" },
- { T_LOC , "LOC " },
+ { T_LOC, "LOC " },
+ { T_NXT, "NXT " },
+ { T_EID, "EID " },
+ { T_NIMLOC, "NIMLOC " },
+ { T_SRV, "SRV " },
+ { T_ATMA, "ATMA " },
+ { T_NAPTR, "NAPTR " },
+ { T_A6, "A6 " },
#ifndef T_UINFO
#define T_UINFO 100
#endif
@@ -317,6 +349,9 @@ ns_rprint(register const u_char *cp, register const u_char *bp)
case T_NS:
case T_CNAME:
case T_PTR:
+#ifdef T_DNAME
+ case T_DNAME: /*XXX not checked as there's no server support yet*/
+#endif
putchar(' ');
(void)ns_nprint(cp, bp);
break;
@@ -332,6 +367,25 @@ ns_rprint(register const u_char *cp, register const u_char *bp)
(void)ns_cprint(cp, bp);
break;
+#ifdef INET6
+ case T_AAAA:
+ printf(" %s", ip6addr_string(cp));
+ break;
+
+ case T_A6: /*XXX not checked as there's no server support yet*/
+ {
+ struct in6_addr a;
+ int pbyte;
+
+ pbyte = (*cp + 7) / 8;
+ memset(&a, 0, sizeof(a));
+ memcpy(&a, cp + 1, pbyte);
+ printf(" %u %s ", *cp, ip6addr_string(&a));
+ (void)ns_nprint(cp + 1 + pbyte, bp);
+ break;
+ }
+#endif /*INET6*/
+
case T_UNSPECA: /* One long string */
printf(" %.*s", len, cp);
break;
OpenPOWER on IntegriCloud