summaryrefslogtreecommitdiff
path: root/adig.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-04-04 20:24:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-04-04 20:24:41 +0000
commitb1c3cc0cfed090d95862039d638387df66f05417 (patch)
tree71170c38c33530207f69642d36381aeca1b2896e /adig.c
parentcb4a169f7551f1a2a3dfbdab045f9430aee1fc22 (diff)
downloadc-ares-b1c3cc0cfed090d95862039d638387df66f05417.tar.gz
c-ares-b1c3cc0cfed090d95862039d638387df66f05417.tar.bz2
c-ares-b1c3cc0cfed090d95862039d638387df66f05417.zip
Alexey Simak made adig support NAPTR records
Diffstat (limited to 'adig.c')
-rw-r--r--adig.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/adig.c b/adig.c
index b4fd205..3a8b1f7 100644
--- a/adig.c
+++ b/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;