1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2026-03-19 19:19:40 +00:00

Add -t u option to ahost

Add an option to allow specification of the AF_UNSPEC
address family.
This commit is contained in:
David Drysdale
2014-07-24 11:18:46 +01:00
parent c1fe47f6d9
commit 2bc07b2e74
2 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,7 @@ Display this help and exit.
\fB\-t\fR type
If type is "a", print the A record (default).
If type is "aaaa", print the AAAA record.
If type is "u", look for either AAAA or A record (in that order).
.TP
\fB\-s\fR \fIdomain\fP
Specify the \fIdomain\fP to search instead of using the default values from

View File

@ -96,6 +96,8 @@ int main(int argc, char **argv)
addr_family = AF_INET;
else if (!strcasecmp(optarg,"aaaa"))
addr_family = AF_INET6;
else if (!strcasecmp(optarg,"u"))
addr_family = AF_UNSPEC;
else
usage();
break;
@ -195,6 +197,6 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
static void usage(void)
{
fprintf(stderr, "usage: ahost [-t {a|aaaa}] {host|addr} ...\n");
fprintf(stderr, "usage: ahost [-t {a|aaaa|u}] {host|addr} ...\n");
exit(1);
}