Go to the documentation of this file.
19 #if !defined(WIN32) || defined(WATT32)
20 #include <netinet/in.h>
21 #include <arpa/inet.h>
37 # define strdup(ptr) ares_strdup(ptr)
40 #ifndef HAVE_STRCASECMP
42 # define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
45 #ifndef HAVE_STRNCASECMP
47 # define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
51 static void usage(
void);
54 int main(
int argc,
char **argv)
59 int status, nfds,
c, addr_family = AF_INET;
60 fd_set read_fds, write_fds;
66 WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
68 WSAStartup(wVersionRequested, &wsaData);
93 options.ndomains *
sizeof(
char *));
98 addr_family = AF_INET;
102 addr_family = AF_UNSPEC;
131 for ( ; *argv; argv++)
159 res = select(nfds, &read_fds, &write_fds, NULL, tvp);
188 for (
p = host->h_addr_list; *
p;
p++)
190 char addr_buf[46] =
"??";
193 printf(
"%-32s\t%s", host->h_name, addr_buf);
195 if (host->h_aliases[0])
200 for (
i = 0; host->h_aliases[
i];
i++)
201 printf(
"%s ", host->h_aliases[
i]);
210 fprintf(
stderr,
"usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n");
217 printf(
"usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n\n"
218 " d : Print some extra debugging output.\n"
219 " h : Display this help and exit.\n\n"
220 " s domain : Specify the domain to search instead of \n"
221 " using the default values from \n"
222 " /etc/resolv.conf. This option only has an \n"
223 " effect on platforms that use /etc/resolv.conf\n"
224 " for DNS configuration; it has no effect on other\n"
225 " platforms (such as Win32 or Android).\n"
226 " t type : If type is \"a\", print the A record (default).\n"
227 " If type is \"aaaa\", print the AAAA record. If\n"
228 " type is \"u\", look for either AAAA or A record\n"
229 " (in that order).\n\n");
const CARES_EXTERN char * ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst)
CARES_EXTERN void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
CARES_EXTERN int ares_library_init(int flags)
return memset(p, 0, total)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static void print_help_info_ahost(void)
CARES_EXTERN int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
#define ARES_LIB_INIT_ALL
wrapped_grpc_channel * channel
int main(int argc, char **argv)
static struct sockaddr_in6 addr6
#define strcasecmp(p1, p2)
const CARES_EXTERN char * ares_strerror(int code)
static struct sockaddr_in addr4
int ares_getopt(int nargc, char *const nargv[], const char *ostr)
CARES_EXTERN void ares_library_cleanup(void)
CARES_EXTERN void ares_destroy(ares_channel channel)
CARES_EXTERN struct timeval * ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tv)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
CARES_EXTERN void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg)
CARES_EXTERN int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask)
CARES_EXTERN void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:40