Go to the documentation of this file.
18 #ifdef HAVE_NETINET_IN_H
19 # include <netinet/in.h>
24 #ifdef HAVE_ARPA_INET_H
25 # include <arpa/inet.h>
52 unsigned char *abuf,
int alen);
54 struct hostent *host);
63 if (family != AF_INET && family !=
AF_INET6)
69 if ((family == AF_INET && addrlen !=
sizeof(aquery->
addr.addrV4)) ||
70 (family ==
AF_INET6 && addrlen !=
sizeof(aquery->
addr.addrV6)))
83 if (family == AF_INET)
101 struct hostent *host;
131 unsigned char *abuf,
int alen)
134 struct hostent *host;
142 addrlen =
sizeof(aquery->
addr.addrV4);
144 (
int)addrlen, AF_INET, &host);
148 addrlen =
sizeof(aquery->
addr.addrV6);
161 struct hostent *host)
187 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
188 &hkeyHosts) == ERROR_SUCCESS)
190 DWORD dwLength = MAX_PATH;
191 RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)
tmp,
194 RegCloseKey(hkeyHosts);
204 #elif defined(WATT32)
221 DEBUGF(fprintf(
stderr,
"fopen() failed with error: %d %s\n",
231 if (
addr->family != (*host)->h_addrtype)
236 if (
addr->family == AF_INET)
238 if (memcmp((*host)->h_addr, &
addr->addrV4,
239 sizeof(
addr->addrV4)) == 0)
244 if (memcmp((*host)->h_addr, &
addr->addrV6,
245 sizeof(
addr->addrV6)) == 0)
260 if (
addr->family == AF_INET)
262 unsigned long laddr = ntohl(
addr->addrV4.s_addr);
263 unsigned long a1 = (laddr >> 24UL) & 0xFFUL;
264 unsigned long a2 = (laddr >> 16UL) & 0xFFUL;
265 unsigned long a3 = (laddr >> 8UL) & 0xFFUL;
266 unsigned long a4 = laddr & 0xFFUL;
267 sprintf(
name,
"%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3,
a2,
a1);
271 unsigned char *
bytes = (
unsigned char *)&
addr->addrV6;
275 "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
281 "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
CARES_EXTERN void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
void(* ares_host_callback)(void *arg, int status, int timeouts, struct hostent *hostent)
static void next_lookup(struct addr_query *aquery)
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg)
static void addr_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
const char * remaining_lookups
ares_host_callback callback
CARES_EXTERN void ares_free_hostent(struct hostent *host)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
wrapped_grpc_channel * channel
void *(* ares_malloc)(size_t size)=default_malloc
static void end_aquery(struct addr_query *aquery, int status, struct hostent *host)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host)
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
static int file_lookup(struct ares_addr *addr, struct hostent **host)
static void ptr_rr_name(char *name, const struct ares_addr *addr)
void(* ares_free)(void *ptr)=default_free
#define ARES_EDESTRUCTION
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:43