1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 14:05:03 -05:00

Alexey Simak made adig support NAPTR records

This commit is contained in:
Daniel Stenberg 2008-04-04 20:24:41 +00:00
parent b50a96982e
commit 592697583d
2 changed files with 38 additions and 0 deletions

View File

@ -4,6 +4,8 @@
- Eino Tuominen improved the code when a file is used to seed the randomizer. - 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) * December 11 2007 (Gisle Vanem)
- Added another sample application; acountry.c which converts an - Added another sample application; acountry.c which converts an

View File

@ -110,6 +110,7 @@ static const struct nv types[] = {
{ "AXFR", T_AXFR }, { "AXFR", T_AXFR },
{ "MAILB", T_MAILB }, { "MAILB", T_MAILB },
{ "MAILA", T_MAILA }, { "MAILA", T_MAILA },
{ "NAPTR", T_NAPTR },
{ "ANY", T_ANY } { "ANY", T_ANY }
}; };
static const int ntypes = sizeof(types) / sizeof(types[0]); 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); ares_free_string(name);
break; 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: default:
printf("\t[Unknown RR; cannot parse]"); printf("\t[Unknown RR; cannot parse]");
break; break;