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:
1
ahost.1
1
ahost.1
@ -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
|
||||
|
||||
4
ahost.c
4
ahost.c
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user