From: Daniel Stenberg Date: Fri, 4 Apr 2008 20:24:41 +0000 (+0000) Subject: Alexey Simak made adig support NAPTR records X-Git-Tag: upstream/7.37.1~7935 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=592697583d048b5283aa7289475ec89b7b46f272;p=platform%2Fupstream%2Fcurl.git Alexey Simak made adig support NAPTR records --- diff --git a/ares/CHANGES b/ares/CHANGES index a54ba41..487f7b3 100644 --- a/ares/CHANGES +++ b/ares/CHANGES @@ -4,6 +4,8 @@ - Eino Tuominen improved the code when a file is used to seed the randomizer. +- Alexey Simak made adig support NAPTR records + * December 11 2007 (Gisle Vanem) - Added another sample application; acountry.c which converts an diff --git a/ares/adig.c b/ares/adig.c index b4fd205..3a8b1f7 100644 --- a/ares/adig.c +++ b/ares/adig.c @@ -110,6 +110,7 @@ static const struct nv types[] = { { "AXFR", T_AXFR }, { "MAILB", T_MAILB }, { "MAILA", T_MAILA }, + { "NAPTR", T_NAPTR }, { "ANY", T_ANY } }; static const int ntypes = sizeof(types) / sizeof(types[0]); @@ -603,6 +604,41 @@ static const unsigned char *display_rr(const unsigned char *aptr, ares_free_string(name); break; + case T_NAPTR: + + printf("\t%d", DNS__16BIT(aptr)); // order + printf(" %d\n", DNS__16BIT(aptr + 2)); // preference + + p = aptr + 4; + status = ares_expand_string(p, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return NULL; + printf("\t\t\t\t\t\t%s\n", name); + ares_free_string(name); + p += len; + + status = ares_expand_string(p, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return NULL; + printf("\t\t\t\t\t\t%s\n", name); + ares_free_string(name); + p += len; + + status = ares_expand_string(p, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return NULL; + printf("\t\t\t\t\t\t%s\n", name); + ares_free_string(name); + p += len; + + status = ares_expand_string(p, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return NULL; + printf("\t\t\t\t\t\t%s", name); + ares_free_string(name); + break; + + default: printf("\t[Unknown RR; cannot parse]"); break;