Go to the documentation of this file.
19 #ifdef HAVE_NETINET_IN_H
20 # include <netinet/in.h>
25 #ifdef HAVE_ARPA_INET_H
26 # include <arpa/inet.h>
60 unsigned char *abuf,
int alen);
62 struct hostent *host);
65 static int file_lookup(
const char *
name,
int family,
struct hostent **host);
67 const struct apattern *sortlist,
int nsort);
69 const struct apattern *sortlist,
int nsort);
71 const struct apattern *sortlist,
int nsort);
73 const struct apattern *sortlist,
int nsort);
130 struct hostent *host;
174 unsigned char *abuf,
int alen)
178 struct hostent *host = NULL;
233 struct hostent *host)
248 struct hostent hostent;
249 char *aliases[1] = { NULL };
255 if (family == AF_INET || family == AF_UNSPEC)
258 int numdots = 0,
valid = 1;
265 }
else if (*
p ==
'.') {
273 if (numdots != 3 || !
valid) {
291 if (family == AF_INET)
293 hostent.h_length = (
int)
sizeof(
struct in_addr);
294 addrs[0] = (
char *)&
in;
299 addrs[0] = (
char *)&in6;
311 hostent.h_aliases = aliases;
313 hostent.h_addr_list = addrs;
322 int family,
struct hostent **host)
366 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
367 &hkeyHosts) == ERROR_SUCCESS)
369 DWORD dwLength = MAX_PATH;
370 RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)
tmp,
373 RegCloseKey(hkeyHosts);
383 #elif defined(WATT32)
405 DEBUGF(fprintf(
stderr,
"fopen() failed with error: %d %s\n",
417 for (alias = (*host)->h_aliases; *alias; alias++)
435 const struct apattern *sortlist,
int nsort)
437 struct in_addr
a1,
a2;
438 int i1,
i2, ind1, ind2;
445 for (
i1 = 0; host->h_addr_list[
i1];
i1++)
447 memcpy(&
a1, host->h_addr_list[
i1],
sizeof(
struct in_addr));
451 memcpy(&
a2, host->h_addr_list[
i2],
sizeof(
struct in_addr));
455 memcpy(host->h_addr_list[
i2 + 1], &
a2,
sizeof(
struct in_addr));
457 memcpy(host->h_addr_list[
i2 + 1], &
a1,
sizeof(
struct in_addr));
470 for (
i = 0;
i < nsort;
i++)
472 if (sortlist[
i].family != AF_INET)
477 == sortlist[
i].addrV4.s_addr)
491 const struct apattern *sortlist,
int nsort)
494 int i1,
i2, ind1, ind2;
501 for (
i1 = 0; host->h_addr_list[
i1];
i1++)
526 for (
i = 0;
i < nsort;
i++)
static int get6_address_index(const struct ares_in6_addr *addr, const struct apattern *sortlist, int nsort)
static void end_hquery(struct host_query *hquery, int status, struct hostent *host)
CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst)
static void next_lookup(struct host_query *hquery, int status_code)
static int get_address_index(const struct in_addr *addr, const struct apattern *sortlist, int nsort)
ares_host_callback callback
int ares__bitncmp(const void *l, const void *r, int n)
char * ares_strdup(const char *s1)
int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host)
void(* ares_host_callback)(void *arg, int status, int timeouts, struct hostent *hostent)
union apattern::@388 mask
int ares__is_onion_domain(const char *name)
CARES_EXTERN void ares_free_hostent(struct hostent *host)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void host_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
const char * remaining_lookups
wrapped_grpc_channel * channel
void *(* ares_malloc)(size_t size)=default_malloc
short aresx_sitoss(int sinum)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
#define ARES_ECONNREFUSED
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist, int nsort)
CARES_EXTERN void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
static int file_lookup(const char *name, int family, struct hostent **host)
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls)
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
void(* ares_free)(void *ptr)=default_free
static void sort_addresses(struct hostent *host, const struct apattern *sortlist, int nsort)
void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg)
ares_addrinfo_callback callback
#define ARES_EDESTRUCTION
#define strcasecmp(p1, p2)
static int fake_hostent(const char *name, int family, ares_host_callback callback, void *arg)
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:43