summaryrefslogtreecommitdiff
path: root/adig.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-03-24 20:25:49 +0100
committerYang Tse <yangsita@gmail.com>2011-03-24 20:25:49 +0100
commit2c2e2d839e61e44dd6ddbff45a5ba49329c0602a (patch)
tree6cb884238adff773eb8c58c1f8302bf1bd2f473f /adig.c
parentebc9a9d958855967cf4b80100ad9567355652cbe (diff)
downloadc-ares-2c2e2d839e61e44dd6ddbff45a5ba49329c0602a.tar.gz
c-ares-2c2e2d839e61e44dd6ddbff45a5ba49329c0602a.tar.bz2
c-ares-2c2e2d839e61e44dd6ddbff45a5ba49329c0602a.zip
adig: RFC4034 resource record type detection
Can be tested with: adig -s 8.8.8.8 -t ANY example.com
Diffstat (limited to 'adig.c')
-rw-r--r--adig.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/adig.c b/adig.c
index 21bd8ad..8b5c883 100644
--- a/adig.c
+++ b/adig.c
@@ -77,14 +77,26 @@
#undef WIN32 /* Redefined in MingW headers */
#endif
-/* Mac OS X portability check */
#ifndef T_SRV
-#define T_SRV 33 /* server selection */
+# define T_SRV 33 /* Server selection */
#endif
-
-/* AIX portability check */
#ifndef T_NAPTR
-#define T_NAPTR 35 /* naming authority pointer */
+# define T_NAPTR 35 /* Naming authority pointer */
+#endif
+#ifndef T_DS
+# define T_DS 43 /* Delegation Signer (RFC4034) */
+#endif
+#ifndef T_SSHFP
+# define T_SSHFP 44 /* SSH Key Fingerprint (RFC4255) */
+#endif
+#ifndef T_RRSIG
+# define T_RRSIG 46 /* Resource Record Signature (RFC4034) */
+#endif
+#ifndef T_NSEC
+# define T_NSEC 47 /* Next Secure (RFC4034) */
+#endif
+#ifndef T_DNSKEY
+# define T_DNSKEY 48 /* DNS Public Key (RFC4034) */
#endif
struct nv {
@@ -145,6 +157,11 @@ static const struct nv types[] = {
{ "MAILB", T_MAILB },
{ "MAILA", T_MAILA },
{ "NAPTR", T_NAPTR },
+ { "DS", T_DS },
+ { "SSHFP", T_SSHFP },
+ { "RRSIG", T_RRSIG },
+ { "NSEC", T_NSEC },
+ { "DNSKEY", T_DNSKEY },
{ "ANY", T_ANY }
};
static const int ntypes = sizeof(types) / sizeof(types[0]);
@@ -750,6 +767,13 @@ static const unsigned char *display_rr(const unsigned char *aptr,
ares_free_string(name.as_char);
break;
+ case T_DS:
+ case T_SSHFP:
+ case T_RRSIG:
+ case T_NSEC:
+ case T_DNSKEY:
+ printf("\t[RR type parsing unavailable]");
+ break;
default:
printf("\t[Unknown RR; cannot parse]");