From 2c2e2d839e61e44dd6ddbff45a5ba49329c0602a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 24 Mar 2011 20:25:49 +0100 Subject: adig: RFC4034 resource record type detection Can be tested with: adig -s 8.8.8.8 -t ANY example.com --- adig.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'adig.c') 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]"); -- cgit v1.2.3