Go to the documentation of this file.
29 #if (defined(_WIN32) || defined(__WIN32__)) && \
30 !defined(WIN32) && !defined(__SYMBIAN32__)
34 #include <sys/types.h>
39 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
40 defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
41 defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
42 defined(__QNXNTO__) || defined(__MVS__)
43 #include <sys/select.h>
45 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
46 #include <sys/bsdskt.h>
50 # include <netinet/in.h>
51 # include <sys/socket.h>
53 #elif defined(_WIN32_WCE)
54 # ifndef WIN32_LEAN_AND_MEAN
55 # define WIN32_LEAN_AND_MEAN
60 # ifndef WIN32_LEAN_AND_MEAN
61 # define WIN32_LEAN_AND_MEAN
64 # include <winsock2.h>
65 # include <ws2tcpip.h>
67 # include <sys/socket.h>
68 # include <netinet/in.h>
71 #if defined(ANDROID) || defined(__ANDROID__)
83 #ifdef CARES_STATICLIB
85 #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
86 # if defined(CARES_BUILDING_LIBRARY)
87 # define CARES_EXTERN __declspec(dllexport)
89 # define CARES_EXTERN __declspec(dllimport)
91 #elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
92 # define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
98 #define ARES_SUCCESS 0
101 #define ARES_ENODATA 1
102 #define ARES_EFORMERR 2
103 #define ARES_ESERVFAIL 3
104 #define ARES_ENOTFOUND 4
105 #define ARES_ENOTIMP 5
106 #define ARES_EREFUSED 6
109 #define ARES_EBADQUERY 7
110 #define ARES_EBADNAME 8
111 #define ARES_EBADFAMILY 9
112 #define ARES_EBADRESP 10
113 #define ARES_ECONNREFUSED 11
114 #define ARES_ETIMEOUT 12
116 #define ARES_EFILE 14
117 #define ARES_ENOMEM 15
118 #define ARES_EDESTRUCTION 16
119 #define ARES_EBADSTR 17
122 #define ARES_EBADFLAGS 18
125 #define ARES_ENONAME 19
126 #define ARES_EBADHINTS 20
129 #define ARES_ENOTINITIALIZED 21
132 #define ARES_ELOADIPHLPAPI 22
133 #define ARES_EADDRGETNETWORKPARAMS 23
136 #define ARES_ECANCELLED 24
139 #define ARES_ESERVICE 25
142 #define ARES_FLAG_USEVC (1 << 0)
143 #define ARES_FLAG_PRIMARY (1 << 1)
144 #define ARES_FLAG_IGNTC (1 << 2)
145 #define ARES_FLAG_NORECURSE (1 << 3)
146 #define ARES_FLAG_STAYOPEN (1 << 4)
147 #define ARES_FLAG_NOSEARCH (1 << 5)
148 #define ARES_FLAG_NOALIASES (1 << 6)
149 #define ARES_FLAG_NOCHECKRESP (1 << 7)
150 #define ARES_FLAG_EDNS (1 << 8)
153 #define ARES_OPT_FLAGS (1 << 0)
154 #define ARES_OPT_TIMEOUT (1 << 1)
155 #define ARES_OPT_TRIES (1 << 2)
156 #define ARES_OPT_NDOTS (1 << 3)
157 #define ARES_OPT_UDP_PORT (1 << 4)
158 #define ARES_OPT_TCP_PORT (1 << 5)
159 #define ARES_OPT_SERVERS (1 << 6)
160 #define ARES_OPT_DOMAINS (1 << 7)
161 #define ARES_OPT_LOOKUPS (1 << 8)
162 #define ARES_OPT_SOCK_STATE_CB (1 << 9)
163 #define ARES_OPT_SORTLIST (1 << 10)
164 #define ARES_OPT_SOCK_SNDBUF (1 << 11)
165 #define ARES_OPT_SOCK_RCVBUF (1 << 12)
166 #define ARES_OPT_TIMEOUTMS (1 << 13)
167 #define ARES_OPT_ROTATE (1 << 14)
168 #define ARES_OPT_EDNSPSZ (1 << 15)
169 #define ARES_OPT_NOROTATE (1 << 16)
170 #define ARES_OPT_RESOLVCONF (1 << 17)
173 #define ARES_NI_NOFQDN (1 << 0)
174 #define ARES_NI_NUMERICHOST (1 << 1)
175 #define ARES_NI_NAMEREQD (1 << 2)
176 #define ARES_NI_NUMERICSERV (1 << 3)
177 #define ARES_NI_DGRAM (1 << 4)
178 #define ARES_NI_TCP 0
179 #define ARES_NI_UDP ARES_NI_DGRAM
180 #define ARES_NI_SCTP (1 << 5)
181 #define ARES_NI_DCCP (1 << 6)
182 #define ARES_NI_NUMERICSCOPE (1 << 7)
183 #define ARES_NI_LOOKUPHOST (1 << 8)
184 #define ARES_NI_LOOKUPSERVICE (1 << 9)
186 #define ARES_NI_IDN (1 << 10)
187 #define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
188 #define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
191 #define ARES_AI_CANONNAME (1 << 0)
192 #define ARES_AI_NUMERICHOST (1 << 1)
193 #define ARES_AI_PASSIVE (1 << 2)
194 #define ARES_AI_NUMERICSERV (1 << 3)
195 #define ARES_AI_V4MAPPED (1 << 4)
196 #define ARES_AI_ALL (1 << 5)
197 #define ARES_AI_ADDRCONFIG (1 << 6)
198 #define ARES_AI_NOSORT (1 << 7)
199 #define ARES_AI_ENVHOSTS (1 << 8)
201 #define ARES_AI_IDN (1 << 10)
202 #define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
203 #define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
204 #define ARES_AI_CANONIDN (1 << 13)
206 #define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
207 ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
209 #define ARES_GETSOCK_MAXNUM 16
211 #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
212 #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
213 ARES_GETSOCK_MAXNUM)))
216 #define ARES_LIB_INIT_NONE (0)
217 #define ARES_LIB_INIT_WIN32 (1 << 0)
218 #define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
225 #ifndef ares_socket_typedef
228 #define ARES_SOCKET_BAD INVALID_SOCKET
231 #define ARES_SOCKET_BAD -1
233 #define ares_socket_typedef
300 struct hostent *hostent);
324 void *(*amalloc)(
size_t size),
325 void (*afree)(
void *
ptr),
326 void *(*arealloc)(
void *
ptr,
size_t size));
328 #if defined(ANDROID) || defined(__ANDROID__)
330 CARES_EXTERN int ares_library_init_android(jobject connectivity_manager);
331 CARES_EXTERN int ares_library_android_initialized(
void);
367 const unsigned char* local_ip6);
371 const char* local_dev_name);
382 const char *sortstr);
415 const unsigned char *
qbuf,
443 struct hostent **host);
453 const struct sockaddr *sa,
454 ares_socklen_t salen,
497 const unsigned char *abuf,
503 const unsigned char *abuf,
639 struct hostent **host,
645 struct hostent **host,
658 struct hostent **host);
662 struct hostent **host);
733 ares_socklen_t
size);
CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
void(* ares_sock_state_cb)(void *data, ares_socket_t socket_fd, int readable, int writable)
int(* ares_sock_config_callback)(ares_socket_t socket_fd, int type, void *data)
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)
ares_socklen_t ai_addrlen
struct ares_mx_reply * next
CARES_EXTERN void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, ares_callback callback, void *arg)
CARES_EXTERN void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
CARES_EXTERN int ares_library_init(int flags)
struct apattern * sortlist
CARES_EXTERN void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
CARES_EXTERN void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback callback, void *user_data)
struct ares_caa_reply * next
ares_ssize_t(* asendv)(ares_socket_t, const struct iovec *, int, void *)
CARES_EXTERN void ares_set_local_ip6(ares_channel channel, const unsigned char *local_ip6)
CARES_EXTERN void ares_free_string(void *str)
void(* ares_callback)(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
CARES_EXTERN int ares_parse_naptr_reply(const unsigned char *abuf, int alen, struct ares_naptr_reply **naptr_out)
void(* ares_addrinfo_callback)(void *arg, int status, int timeouts, struct ares_addrinfo *res)
union ares_addr_port_node::@383 addr
struct sockaddr * ai_addr
CARES_EXTERN int ares_init(ares_channel *channelptr)
union ares_addr_node::@382 addr
CARES_EXTERN int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int alen, unsigned char **s, long *enclen)
CARES_EXTERN int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
void(* ares_host_callback)(void *arg, int status, int timeouts, struct hostent *hostent)
CARES_EXTERN void ares_destroy_options(struct ares_options *options)
CARES_EXTERN int ares_parse_mx_reply(const unsigned char *abuf, int alen, struct ares_mx_reply **mx_out)
struct ares_in6_addr addr6
struct ares_addr_node * next
CARES_EXTERN int ares_set_servers_csv(ares_channel channel, const char *servers)
CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel, const char *servers)
CARES_EXTERN int ares_library_initialized(void)
CARES_EXTERN int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen)
void(* ares_nameinfo_callback)(void *arg, int status, int timeouts, char *node, char *service)
CARES_EXTERN int ares_create_query(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen, int max_udp_size)
ares_sock_state_cb sock_state_cb
CARES_EXTERN int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen)
CARES_EXTERN void ares_free_hostent(struct hostent *host)
CARES_EXTERN int ares_library_init_mem(int flags, void *(*amalloc)(size_t size), void(*afree)(void *ptr), void *(*arealloc)(void *ptr, size_t size))
CARES_EXTERN void ares_set_socket_functions(ares_channel channel, const struct ares_socket_functions *funcs, void *user_data)
wrapped_grpc_channel * channel
CARES_EXTERN void ares_cancel(ares_channel channel)
CARES_EXTERN void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg)
CARES_EXTERN int ares_dup(ares_channel *dest, ares_channel src)
int(* aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *)
const CARES_EXTERN char * ares_version(int *version)
struct ares_in6_addr ip6addr
CARES_EXTERN int ares_set_sortlist(ares_channel channel, const char *sortstr)
struct ares_naptr_reply * next
struct ares_in6_addr addr6
unsigned char record_start
struct ares_channeldata * ares_channel
CARES_EXTERN int ares_parse_txt_reply(const unsigned char *abuf, int alen, struct ares_txt_reply **txt_out)
ares_ssize_t(* arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
CARES_EXTERN int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host)
struct ares_txt_reply * next
void * sock_state_cb_data
struct ares_srv_reply * next
const CARES_EXTERN char * ares_strerror(int code)
CARES_EXTERN int ares_set_servers(ares_channel channel, struct ares_addr_node *servers)
struct ares_addrinfo_cname * next
CARES_EXTERN int ares_getsock(ares_channel channel, ares_socket_t *socks, int numsocks)
CARES_EXTERN int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask)
struct ares_addrinfo_node * nodes
struct ares_txt_ext * next
CARES_EXTERN void ares_free_data(void *dataptr)
CARES_EXTERN int ares_set_servers_ports(ares_channel channel, struct ares_addr_port_node *servers)
struct ares_addrinfo_cname * cnames
ares_socket_t(* asocket)(int, int, int, void *)
CARES_EXTERN int ares_get_servers_ports(ares_channel channel, struct ares_addr_port_node **servers)
int socket_send_buffer_size
CARES_EXTERN int ares_parse_caa_reply(const unsigned char *abuf, int alen, struct ares_caa_reply **caa_out)
CARES_EXTERN void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo *ai)
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host)
CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel, ares_sock_config_callback callback, void *user_data)
CARES_EXTERN void ares_library_cleanup(void)
CARES_EXTERN void ares_set_local_dev(ares_channel channel, const char *local_dev_name)
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls)
struct ares_addr_port_node * next
CARES_EXTERN void ares_destroy(ares_channel channel)
CARES_EXTERN struct timeval * ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tv)
int socket_receive_buffer_size
struct ares_addrinfo_node * ai_next
CARES_EXTERN int ares_get_servers(ares_channel channel, struct ares_addr_node **servers)
CARES_EXTERN int ares_parse_soa_reply(const unsigned char *abuf, int alen, struct ares_soa_reply **soa_out)
CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, struct ares_txt_ext **txt_out)
CARES_EXTERN int ares_parse_srv_reply(const unsigned char *abuf, int alen, struct ares_srv_reply **srv_out)
int(* ares_sock_create_callback)(ares_socket_t socket_fd, int type, void *data)
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_parse_ns_reply(const unsigned char *abuf, int alen, struct hostent **host)
CARES_EXTERN int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask)
int(* aclose)(ares_socket_t, void *)
CARES_EXTERN void ares_getaddrinfo(ares_channel channel, const char *node, const char *service, const struct ares_addrinfo_hints *hints, ares_addrinfo_callback callback, void *arg)
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t
unsigned short preference
CARES_EXTERN void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg)
CARES_EXTERN void ares_process_fd(ares_channel channel, ares_socket_t read_fd, ares_socket_t write_fd)
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls)
union ares_in6_addr::@381 _S6_un
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:43