ares.h
Go to the documentation of this file.
1 
2 /* Copyright 1998 by the Massachusetts Institute of Technology.
3  * Copyright (C) 2007-2013 by Daniel Stenberg
4  *
5  * Permission to use, copy, modify, and distribute this
6  * software and its documentation for any purpose and without
7  * fee is hereby granted, provided that the above copyright
8  * notice appear in all copies and that both that copyright
9  * notice and this permission notice appear in supporting
10  * documentation, and that the name of M.I.T. not be used in
11  * advertising or publicity pertaining to distribution of the
12  * software without specific, written prior permission.
13  * M.I.T. makes no representations about the suitability of
14  * this software for any purpose. It is provided "as is"
15  * without express or implied warranty.
16  */
17 
18 #ifndef ARES__H
19 #define ARES__H
20 
21 #include "ares_version.h" /* c-ares version defines */
22 #include "ares_build.h" /* c-ares build definitions */
23 #include "ares_rules.h" /* c-ares rules enforcement */
24 
25 /*
26  * Define WIN32 when build target is Win32 API
27  */
28 
29 #if (defined(_WIN32) || defined(__WIN32__)) && \
30  !defined(WIN32) && !defined(__SYMBIAN32__)
31 # define WIN32
32 #endif
33 
34 #include <sys/types.h>
35 
36 /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
37  libc5-based Linux systems. Only include it on system that are known to
38  require it! */
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>
44 #endif
45 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
46 #include <sys/bsdskt.h>
47 #endif
48 
49 #if defined(WATT32)
50 # include <netinet/in.h>
51 # include <sys/socket.h>
52 # include <tcp.h>
53 #elif defined(_WIN32_WCE)
54 # ifndef WIN32_LEAN_AND_MEAN
55 # define WIN32_LEAN_AND_MEAN
56 # endif
57 # include <windows.h>
58 # include <winsock.h>
59 #elif defined(WIN32)
60 # ifndef WIN32_LEAN_AND_MEAN
61 # define WIN32_LEAN_AND_MEAN
62 # endif
63 # include <windows.h>
64 # include <winsock2.h>
65 # include <ws2tcpip.h>
66 #else
67 # include <sys/socket.h>
68 # include <netinet/in.h>
69 #endif
70 
71 #if defined(ANDROID) || defined(__ANDROID__)
72 #include <jni.h>
73 #endif
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
79 /*
80 ** c-ares external API function linkage decorations.
81 */
82 
83 #ifdef CARES_STATICLIB
84 # define CARES_EXTERN
85 #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
86 # if defined(CARES_BUILDING_LIBRARY)
87 # define CARES_EXTERN __declspec(dllexport)
88 # else
89 # define CARES_EXTERN __declspec(dllimport)
90 # endif
91 #elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
92 # define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
93 #else
94 # define CARES_EXTERN
95 #endif
96 
97 
98 #define ARES_SUCCESS 0
99 
100 /* Server error codes (ARES_ENODATA indicates no relevant answer) */
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
107 
108 /* Locally generated error codes */
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
115 #define ARES_EOF 13
116 #define ARES_EFILE 14
117 #define ARES_ENOMEM 15
118 #define ARES_EDESTRUCTION 16
119 #define ARES_EBADSTR 17
120 
121 /* ares_getnameinfo error codes */
122 #define ARES_EBADFLAGS 18
123 
124 /* ares_getaddrinfo error codes */
125 #define ARES_ENONAME 19
126 #define ARES_EBADHINTS 20
127 
128 /* Uninitialized library error code */
129 #define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
130 
131 /* ares_library_init error codes */
132 #define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
133 #define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
134 
135 /* More error codes */
136 #define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
137 
138 /* More ares_getaddrinfo error codes */
139 #define ARES_ESERVICE 25 /* introduced in 1.?.0 */
140 
141 /* Flag values */
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)
151 
152 /* Option mask values */
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)
171 
172 /* Nameinfo flag values */
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)
185 /* Reserved for future use */
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)
189 
190 /* Addrinfo flag values */
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)
200 /* Reserved for future use */
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)
205 
206 #define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
207  ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
208  ARES_AI_ADDRCONFIG)
209 #define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this
210  many sockets */
211 #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
212 #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
213  ARES_GETSOCK_MAXNUM)))
214 
215 /* c-ares library initialization flag values */
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)
219 
220 
221 /*
222  * Typedef our socket type
223  */
224 
225 #ifndef ares_socket_typedef
226 #ifdef WIN32
227 typedef SOCKET ares_socket_t;
228 #define ARES_SOCKET_BAD INVALID_SOCKET
229 #else
230 typedef int ares_socket_t;
231 #define ARES_SOCKET_BAD -1
232 #endif
233 #define ares_socket_typedef
234 #endif /* ares_socket_typedef */
235 
236 typedef void (*ares_sock_state_cb)(void *data,
237  ares_socket_t socket_fd,
238  int readable,
239  int writable);
240 
241 struct apattern;
242 
243 /* NOTE about the ares_options struct to users and developers.
244 
245  This struct will remain looking like this. It will not be extended nor
246  shrunk in future releases, but all new options will be set by ares_set_*()
247  options instead of with the ares_init_options() function.
248 
249  Eventually (in a galaxy far far away), all options will be settable by
250  ares_set_*() options and the ares_init_options() function will become
251  deprecated.
252 
253  When new options are added to c-ares, they are not added to this
254  struct. And they are not "saved" with the ares_save_options() function but
255  instead we encourage the use of the ares_dup() function. Needless to say,
256  if you add config options to c-ares you need to make sure ares_dup()
257  duplicates this new option.
258 
259  */
260 struct ares_options {
261  int flags;
262  int timeout; /* in seconds or milliseconds, depending on options */
263  int tries;
264  int ndots;
265  unsigned short udp_port;
266  unsigned short tcp_port;
269  struct in_addr *servers;
270  int nservers;
271  char **domains;
272  int ndomains;
273  char *lookups;
277  int nsort;
278  int ednspsz;
279  char *resolvconf_path;
280 };
281 
282 struct hostent;
283 struct timeval;
284 struct sockaddr;
285 struct ares_channeldata;
286 struct ares_addrinfo;
287 struct ares_addrinfo_hints;
288 
289 typedef struct ares_channeldata *ares_channel;
290 
291 typedef void (*ares_callback)(void *arg,
292  int status,
293  int timeouts,
294  unsigned char *abuf,
295  int alen);
296 
297 typedef void (*ares_host_callback)(void *arg,
298  int status,
299  int timeouts,
300  struct hostent *hostent);
301 
302 typedef void (*ares_nameinfo_callback)(void *arg,
303  int status,
304  int timeouts,
305  char *node,
306  char *service);
307 
308 typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
309  int type,
310  void *data);
311 
312 typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
313  int type,
314  void *data);
315 
316 typedef void (*ares_addrinfo_callback)(void *arg,
317  int status,
318  int timeouts,
319  struct ares_addrinfo *res);
320 
322 
324  void *(*amalloc)(size_t size),
325  void (*afree)(void *ptr),
326  void *(*arealloc)(void *ptr, size_t size));
327 
328 #if defined(ANDROID) || defined(__ANDROID__)
329 CARES_EXTERN void ares_library_init_jvm(JavaVM *jvm);
330 CARES_EXTERN int ares_library_init_android(jobject connectivity_manager);
331 CARES_EXTERN int ares_library_android_initialized(void);
332 #endif
333 
335 
337 
338 CARES_EXTERN const char *ares_version(int *version);
339 
340 CARES_EXTERN int ares_init(ares_channel *channelptr);
341 
343  struct ares_options *options,
344  int optmask);
345 
347  struct ares_options *options,
348  int *optmask);
349 
351 
353  ares_channel src);
354 
356 
358 
359 /* These next 3 configure local binding for the out-going socket
360  * connection. Use these to specify source IP and/or network device
361  * on multi-homed systems.
362  */
363 CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip);
364 
365 /* local_ip6 should be 16 bytes in length */
367  const unsigned char* local_ip6);
368 
369 /* local_dev_name should be null terminated. */
371  const char* local_dev_name);
372 
375  void *user_data);
376 
379  void *user_data);
380 
382  const char *sortstr);
383 
385  const char* node,
386  const char* service,
387  const struct ares_addrinfo_hints* hints,
389  void* arg);
390 
392 
393 /*
394  * Virtual function set to have user-managed socket IO.
395  * Note that all functions need to be defined, and when
396  * set, the library will not do any bind nor set any
397  * socket options, assuming the client handles these
398  * through either socket creation or the
399  * ares_sock_config_callback call.
400  */
401 struct iovec;
405  int(*aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
406  ares_ssize_t(*arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *);
407  ares_ssize_t(*asendv)(ares_socket_t, const struct iovec *, int, void *);
408 };
409 
411  const struct ares_socket_functions * funcs,
412  void *user_data);
413 
415  const unsigned char *qbuf,
416  int qlen,
418  void *arg);
419 
421  const char *name,
422  int dnsclass,
423  int type,
425  void *arg);
426 
428  const char *name,
429  int dnsclass,
430  int type,
432  void *arg);
433 
435  const char *name,
436  int family,
438  void *arg);
439 
441  const char *name,
442  int family,
443  struct hostent **host);
444 
446  const void *addr,
447  int addrlen,
448  int family,
450  void *arg);
451 
453  const struct sockaddr *sa,
454  ares_socklen_t salen,
455  int flags,
457  void *arg);
458 
460  fd_set *read_fds,
461  fd_set *write_fds);
462 
464  ares_socket_t *socks,
465  int numsocks);
466 
468  struct timeval *maxtv,
469  struct timeval *tv);
470 
472  fd_set *read_fds,
473  fd_set *write_fds);
474 
476  ares_socket_t read_fd,
477  ares_socket_t write_fd);
478 
479 CARES_EXTERN int ares_create_query(const char *name,
480  int dnsclass,
481  int type,
482  unsigned short id,
483  int rd,
484  unsigned char **buf,
485  int *buflen,
486  int max_udp_size);
487 
488 CARES_EXTERN int ares_mkquery(const char *name,
489  int dnsclass,
490  int type,
491  unsigned short id,
492  int rd,
493  unsigned char **buf,
494  int *buflen);
495 
496 CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
497  const unsigned char *abuf,
498  int alen,
499  char **s,
500  long *enclen);
501 
502 CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
503  const unsigned char *abuf,
504  int alen,
505  unsigned char **s,
506  long *enclen);
507 
508 /*
509  * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
510  * struct below when ares itself was built, but many apps would use this
511  * private version since the header checked a HAVE_* define for it. Starting
512  * with 1.7.0 we always declare and use our own to stop relying on the
513  * system's one.
514  */
515 struct ares_in6_addr {
516  union {
517  unsigned char _S6_u8[16];
518  } _S6_un;
519 };
520 
521 struct ares_addrttl {
522  struct in_addr ipaddr;
523  int ttl;
524 };
525 
528  int ttl;
529 };
530 
533  int critical;
534  unsigned char *property;
535  size_t plength; /* plength excludes null termination */
536  unsigned char *value;
537  size_t length; /* length excludes null termination */
538 };
539 
542  char *host;
543  unsigned short priority;
544  unsigned short weight;
545  unsigned short port;
546 };
547 
550  char *host;
551  unsigned short priority;
552 };
553 
556  unsigned char *txt;
557  size_t length; /* length excludes null termination */
558 };
559 
560 /* NOTE: This structure is a superset of ares_txt_reply
561  */
562 struct ares_txt_ext {
564  unsigned char *txt;
565  size_t length;
566  /* 1 - if start of new record
567  * 0 - if a chunk in the same record */
568  unsigned char record_start;
569 };
570 
573  unsigned char *flags;
574  unsigned char *service;
575  unsigned char *regexp;
576  char *replacement;
577  unsigned short order;
578  unsigned short preference;
579 };
580 
582  char *nsname;
583  char *hostmaster;
584  unsigned int serial;
585  unsigned int refresh;
586  unsigned int retry;
587  unsigned int expire;
588  unsigned int minttl;
589 };
590 
591 /*
592  * Similar to addrinfo, but with extra ttl and missing canonname.
593  */
595  int ai_ttl;
596  int ai_flags;
600  ares_socklen_t ai_addrlen;
601  struct sockaddr *ai_addr;
602  struct ares_addrinfo_node *ai_next;
603 };
604 
605 /*
606  * alias - label of the resource record.
607  * name - value (canonical name) of the resource record.
608  * See RFC2181 10.1.1. CNAME terminology.
609  */
611  int ttl;
612  char *alias;
613  char *name;
614  struct ares_addrinfo_cname *next;
615 };
616 
619  struct ares_addrinfo_node *nodes;
620 };
621 
623  int ai_flags;
626  int ai_protocol;
627 };
628 
629 /*
630 ** Parse the buffer, starting at *abuf and of length alen bytes, previously
631 ** obtained from an ares_search call. Put the results in *host, if nonnull.
632 ** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
633 ** their TTLs in that array, and set *naddrttls to the number of addresses
634 ** so written.
635 */
636 
637 CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
638  int alen,
639  struct hostent **host,
640  struct ares_addrttl *addrttls,
641  int *naddrttls);
642 
643 CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
644  int alen,
645  struct hostent **host,
646  struct ares_addr6ttl *addrttls,
647  int *naddrttls);
648 
649 CARES_EXTERN int ares_parse_caa_reply(const unsigned char* abuf,
650  int alen,
651  struct ares_caa_reply** caa_out);
652 
653 CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
654  int alen,
655  const void *addr,
656  int addrlen,
657  int family,
658  struct hostent **host);
659 
660 CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
661  int alen,
662  struct hostent **host);
663 
664 CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
665  int alen,
666  struct ares_srv_reply** srv_out);
667 
668 CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf,
669  int alen,
670  struct ares_mx_reply** mx_out);
671 
672 CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
673  int alen,
674  struct ares_txt_reply** txt_out);
675 
676 CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf,
677  int alen,
678  struct ares_txt_ext** txt_out);
679 
680 CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf,
681  int alen,
682  struct ares_naptr_reply** naptr_out);
683 
684 CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf,
685  int alen,
686  struct ares_soa_reply** soa_out);
687 
688 CARES_EXTERN void ares_free_string(void *str);
689 
690 CARES_EXTERN void ares_free_hostent(struct hostent *host);
691 
692 CARES_EXTERN void ares_free_data(void *dataptr);
693 
694 CARES_EXTERN const char *ares_strerror(int code);
695 
698  int family;
699  union {
700  struct in_addr addr4;
701  struct ares_in6_addr addr6;
702  } addr;
703 };
704 
707  int family;
708  union {
709  struct in_addr addr4;
710  struct ares_in6_addr addr6;
711  } addr;
712  int udp_port;
713  int tcp_port;
714 };
715 
717  struct ares_addr_node *servers);
719  struct ares_addr_port_node *servers);
720 
721 /* Incomming string format: host[:port][,host[:port]]... */
723  const char* servers);
725  const char* servers);
726 
728  struct ares_addr_node **servers);
730  struct ares_addr_port_node **servers);
731 
732 CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
733  ares_socklen_t size);
734 
735 CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst);
736 
737 
738 #ifdef __cplusplus
739 }
740 #endif
741 
742 #endif /* ARES__H */
xds_interop_client.str
str
Definition: xds_interop_client.py:487
ares_set_local_ip4
CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
Definition: ares_init.c:2568
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
ares_sock_state_cb
void(* ares_sock_state_cb)(void *data, ares_socket_t socket_fd, int readable, int writable)
Definition: ares.h:235
ares_sock_config_callback
int(* ares_sock_config_callback)(ares_socket_t socket_fd, int type, void *data)
Definition: ares.h:311
ares_inet_ntop
const CARES_EXTERN char * ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
Definition: inet_ntop.c:56
dst
static const char dst[]
Definition: test-fs-copyfile.c:37
ares_inet_pton
CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst)
Definition: inet_net_pton.c:418
ares_addr_node::family
int family
Definition: ares.h:697
ares_addrinfo_node
Definition: ares.h:593
ares_addrinfo_node::ai_addrlen
ares_socklen_t ai_addrlen
Definition: ares.h:599
ares_addrinfo_hints::ai_protocol
int ai_protocol
Definition: ares.h:625
ares_mx_reply::next
struct ares_mx_reply * next
Definition: ares.h:548
ares_options::servers
struct in_addr * servers
Definition: ares.h:268
ares_send
CARES_EXTERN void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, ares_callback callback, void *arg)
Definition: ares_send.c:29
ares_soa_reply::minttl
unsigned int minttl
Definition: ares.h:587
ares_options
Definition: ares.h:259
winsock.h
ares_process
CARES_EXTERN void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
Definition: ares_process.c:134
ares_library_init
CARES_EXTERN int ares_library_init(int flags)
Definition: ares_library_init.c:133
ares_addrinfo
Definition: ares.h:616
ares_options::sortlist
struct apattern * sortlist
Definition: ares.h:275
ares_query
CARES_EXTERN void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
Definition: ares_query.c:105
ares_set_socket_callback
CARES_EXTERN void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback callback, void *user_data)
Definition: ares_init.c:2590
ares_caa_reply::next
struct ares_caa_reply * next
Definition: ares.h:531
ares_srv_reply::weight
unsigned short weight
Definition: ares.h:543
ares_addr_node::addr4
struct in_addr addr4
Definition: ares.h:699
ares_socket_functions::asendv
ares_ssize_t(* asendv)(ares_socket_t, const struct iovec *, int, void *)
Definition: ares.h:406
ares_set_local_ip6
CARES_EXTERN void ares_set_local_ip6(ares_channel channel, const unsigned char *local_ip6)
Definition: ares_init.c:2574
ares_options::domains
char ** domains
Definition: ares.h:270
ares_addrinfo_hints
Definition: ares.h:621
ares_addr_port_node
Definition: ares.h:704
ares_free_string
CARES_EXTERN void ares_free_string(void *str)
Definition: ares_free_string.c:22
options
double_dict options[]
Definition: capstone_test.c:55
ares_options::tcp_port
unsigned short tcp_port
Definition: ares.h:265
ares_addr_node
Definition: ares.h:695
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
ares_callback
void(* ares_callback)(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
Definition: ares.h:290
ares_soa_reply::refresh
unsigned int refresh
Definition: ares.h:584
ares_parse_naptr_reply
CARES_EXTERN int ares_parse_naptr_reply(const unsigned char *abuf, int alen, struct ares_naptr_reply **naptr_out)
Definition: ares_parse_naptr_reply.c:38
ares_addrinfo_callback
void(* ares_addrinfo_callback)(void *arg, int status, int timeouts, struct ares_addrinfo *res)
Definition: ares.h:315
ares_addr_port_node::addr
union ares_addr_port_node::@383 addr
ares_addrinfo_node::ai_addr
struct sockaddr * ai_addr
Definition: ares.h:600
ares_init
CARES_EXTERN int ares_init(ares_channel *channelptr)
Definition: ares_init.c:98
ares_options::nsort
int nsort
Definition: ares.h:276
ares_addr_node::addr
union ares_addr_node::@382 addr
ares_addrinfo_cname::alias
char * alias
Definition: ares.h:611
ares_soa_reply::hostmaster
char * hostmaster
Definition: ares.h:582
ares_addrinfo_node::ai_family
int ai_family
Definition: ares.h:596
ares_expand_string
CARES_EXTERN int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int alen, unsigned char **s, long *enclen)
Definition: ares_expand_string.c:33
ares_fds
CARES_EXTERN int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
Definition: ares_fds.c:23
ares_host_callback
void(* ares_host_callback)(void *arg, int status, int timeouts, struct hostent *hostent)
Definition: ares.h:296
ares_destroy_options
CARES_EXTERN void ares_destroy_options(struct ares_options *options)
Definition: ares_destroy.c:25
ares_parse_mx_reply
CARES_EXTERN int ares_parse_mx_reply(const unsigned char *abuf, int alen, struct ares_mx_reply **mx_out)
Definition: ares_parse_mx_reply.c:38
ares_addr_node::addr6
struct ares_in6_addr addr6
Definition: ares.h:700
ares_in6_addr::_S6_u8
unsigned char _S6_u8[16]
Definition: ares.h:516
status
absl::Status status
Definition: rls.cc:251
ares_addr_node::next
struct ares_addr_node * next
Definition: ares.h:696
setup.name
name
Definition: setup.py:542
ares_build.h
ares_set_servers_csv
CARES_EXTERN int ares_set_servers_csv(ares_channel channel, const char *servers)
Definition: ares_options.c:395
version
Definition: version.py:1
ares_caa_reply
Definition: ares.h:530
ares_addr6ttl
Definition: ares.h:525
ares_srv_reply::port
unsigned short port
Definition: ares.h:544
ares_srv_reply
Definition: ares.h:539
ares_set_servers_ports_csv
CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel, const char *servers)
Definition: ares_options.c:401
ares_addrinfo_node::ai_ttl
int ai_ttl
Definition: ares.h:594
ares_library_initialized
CARES_EXTERN int ares_library_initialized(void)
Definition: ares_library_init.c:193
ares_naptr_reply::regexp
unsigned char * regexp
Definition: ares.h:574
ares_mkquery
CARES_EXTERN int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen)
Definition: ares_mkquery.c:20
ares_addrttl::ttl
int ttl
Definition: ares.h:522
ares_caa_reply::critical
int critical
Definition: ares.h:532
ares_caa_reply::property
unsigned char * property
Definition: ares.h:533
ares_nameinfo_callback
void(* ares_nameinfo_callback)(void *arg, int status, int timeouts, char *node, char *service)
Definition: ares.h:301
ares_options::ndots
int ndots
Definition: ares.h:263
ares_txt_ext
Definition: ares.h:561
ares_addrinfo_node::ai_socktype
int ai_socktype
Definition: ares.h:597
ares_create_query
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)
Definition: ares_create_query.c:78
ares_soa_reply::serial
unsigned int serial
Definition: ares.h:583
ares_srv_reply::host
char * host
Definition: ares.h:541
ares_caa_reply::plength
size_t plength
Definition: ares.h:534
ares_options::sock_state_cb
ares_sock_state_cb sock_state_cb
Definition: ares.h:273
ares_expand_name
CARES_EXTERN int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen)
Definition: ares_expand_name.c:203
ares_free_hostent
CARES_EXTERN void ares_free_hostent(struct hostent *host)
Definition: ares_free_hostent.c:26
ares_txt_reply
Definition: ares.h:553
ares_library_init_mem
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))
Definition: ares_library_init.c:156
ares_set_socket_functions
CARES_EXTERN void ares_set_socket_functions(ares_channel channel, const struct ares_socket_functions *funcs, void *user_data)
Definition: ares_init.c:2606
ares_addr_port_node::addr4
struct in_addr addr4
Definition: ares.h:708
ares_addrinfo_hints::ai_family
int ai_family
Definition: ares.h:623
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
ares_rules.h
xds_interop_client.int
int
Definition: xds_interop_client.py:113
ares_soa_reply
Definition: ares.h:580
ares_cancel
CARES_EXTERN void ares_cancel(ares_channel channel)
Definition: ares_cancel.c:26
ares_naptr_reply::service
unsigned char * service
Definition: ares.h:573
ares_getnameinfo
CARES_EXTERN void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg)
Definition: ares_getnameinfo.c:76
ares_options::ednspsz
int ednspsz
Definition: ares.h:277
ares_soa_reply::retry
unsigned int retry
Definition: ares.h:585
ares_dup
CARES_EXTERN int ares_dup(ares_channel *dest, ares_channel src)
Definition: ares_init.c:243
ares_socket_functions::aconnect
int(* aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *)
Definition: ares.h:404
qbuf
static uv_buf_t qbuf
Definition: test-shutdown-eof.c:32
ares_soa_reply::expire
unsigned int expire
Definition: ares.h:586
ares_addrinfo_node::ai_protocol
int ai_protocol
Definition: ares.h:598
ares_version
const CARES_EXTERN char * ares_version(int *version)
Definition: ares_version.c:5
ares_addr6ttl::ip6addr
struct ares_in6_addr ip6addr
Definition: ares.h:526
ares_set_sortlist
CARES_EXTERN int ares_set_sortlist(ares_channel channel, const char *sortstr)
Definition: ares_init.c:2614
ares_naptr_reply::next
struct ares_naptr_reply * next
Definition: ares.h:571
ares_addr_port_node::addr6
struct ares_in6_addr addr6
Definition: ares.h:709
apattern
Definition: ares_private.h:243
ares_txt_ext::record_start
unsigned char record_start
Definition: ares.h:567
ares_addrinfo_hints::ai_socktype
int ai_socktype
Definition: ares.h:624
arg
Definition: cmdline.cc:40
ares_srv_reply::priority
unsigned short priority
Definition: ares.h:542
ares_channel
struct ares_channeldata * ares_channel
Definition: ares.h:288
ares_naptr_reply
Definition: ares.h:570
ares_options::nservers
int nservers
Definition: ares.h:269
ares_txt_reply::txt
unsigned char * txt
Definition: ares.h:555
ares_parse_txt_reply
CARES_EXTERN int ares_parse_txt_reply(const unsigned char *abuf, int alen, struct ares_txt_reply **txt_out)
Definition: ares_parse_txt_reply.c:202
ares_options::udp_port
unsigned short udp_port
Definition: ares.h:264
ares_naptr_reply::flags
unsigned char * flags
Definition: ares.h:572
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
ares_socket_functions::arecvfrom
ares_ssize_t(* arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *)
Definition: ares.h:405
callback
static void callback(void *arg, int status, int timeouts, struct hostent *host)
Definition: acountry.c:224
ares_gethostbyname_file
CARES_EXTERN int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host)
Definition: ares_gethostbyname.c:321
ares_options::resolvconf_path
char * resolvconf_path
Definition: ares.h:278
ares_txt_reply::next
struct ares_txt_reply * next
Definition: ares.h:554
ares_addr_port_node::family
int family
Definition: ares.h:706
ares_options::sock_state_cb_data
void * sock_state_cb_data
Definition: ares.h:274
ares_version.h
tests.qps.qps_worker.dest
dest
Definition: qps_worker.py:45
ares_srv_reply::next
struct ares_srv_reply * next
Definition: ares.h:540
ares_strerror
const CARES_EXTERN char * ares_strerror(int code)
Definition: ares_strerror.c:21
ares_set_servers
CARES_EXTERN int ares_set_servers(ares_channel channel, struct ares_addr_node *servers)
Definition: ares_options.c:143
ares_addrinfo_cname::next
struct ares_addrinfo_cname * next
Definition: ares.h:613
ares_getsock
CARES_EXTERN int ares_getsock(ares_channel channel, ares_socket_t *socks, int numsocks)
Definition: ares_getsock.c:20
ares_save_options
CARES_EXTERN int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask)
Definition: ares_init.c:314
ares_mx_reply::priority
unsigned short priority
Definition: ares.h:550
ares_naptr_reply::order
unsigned short order
Definition: ares.h:576
ares_addrinfo::nodes
struct ares_addrinfo_node * nodes
Definition: ares.h:618
ares_channeldata
Definition: ares_private.h:266
ares_addrinfo_cname
Definition: ares.h:609
iovec
Definition: gsec.h:33
ares_txt_ext::next
struct ares_txt_ext * next
Definition: ares.h:562
ares_free_data
CARES_EXTERN void ares_free_data(void *dataptr)
Definition: ares_data.c:41
ares_set_servers_ports
CARES_EXTERN int ares_set_servers_ports(ares_channel channel, struct ares_addr_port_node *servers)
Definition: ares_options.c:195
ares_addrinfo::cnames
struct ares_addrinfo_cname * cnames
Definition: ares.h:617
ares_socket_functions::asocket
ares_socket_t(* asocket)(int, int, int, void *)
Definition: ares.h:402
ares_get_servers_ports
CARES_EXTERN int ares_get_servers_ports(ares_channel channel, struct ares_addr_port_node **servers)
Definition: ares_options.c:86
ares_options::socket_send_buffer_size
int socket_send_buffer_size
Definition: ares.h:266
ares_parse_caa_reply
CARES_EXTERN int ares_parse_caa_reply(const unsigned char *abuf, int alen, struct ares_caa_reply **caa_out)
Definition: ares_parse_caa_reply.c:41
ares_search
CARES_EXTERN void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
Definition: ares_search.c:47
ares_addrttl::ipaddr
struct in_addr ipaddr
Definition: ares.h:521
ares_options::timeout
int timeout
Definition: ares.h:261
absl::flags_internal
Definition: abseil-cpp/absl/flags/commandlineflag.h:40
ares_freeaddrinfo
CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo *ai)
Definition: ares_freeaddrinfo.c:52
ares_in6_addr
Definition: ares.h:514
ares_parse_ptr_reply
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host)
Definition: ares_parse_ptr_reply.c:37
timeval
Definition: setup_once.h:113
ares_options::flags
int flags
Definition: ares.h:260
ares_set_socket_configure_callback
CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel, ares_sock_config_callback callback, void *user_data)
Definition: ares_init.c:2598
ares_library_cleanup
CARES_EXTERN void ares_library_cleanup(void)
Definition: ares_library_init.c:171
ares_set_local_dev
CARES_EXTERN void ares_set_local_dev(ares_channel channel, const char *local_dev_name)
Definition: ares_init.c:2581
ares_parse_a_reply
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls)
Definition: ares_parse_a_reply.c:44
ares_addr_port_node::next
struct ares_addr_port_node * next
Definition: ares.h:705
ares_mx_reply
Definition: ares.h:547
ares_destroy
CARES_EXTERN void ares_destroy(ares_channel channel)
Definition: ares_destroy.c:43
ares_timeout
CARES_EXTERN struct timeval * ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tv)
Definition: ares_timeout.c:38
ares_socket_t
int ares_socket_t
Definition: ares.h:229
ares_addrinfo_hints::ai_flags
int ai_flags
Definition: ares.h:622
ares_options::socket_receive_buffer_size
int socket_receive_buffer_size
Definition: ares.h:267
ares_addrinfo_cname::ttl
int ttl
Definition: ares.h:610
ares_addrinfo_node::ai_next
struct ares_addrinfo_node * ai_next
Definition: ares.h:601
ares_get_servers
CARES_EXTERN int ares_get_servers(ares_channel channel, struct ares_addr_node **servers)
Definition: ares_options.c:31
arg
struct arg arg
ares_addr6ttl::ttl
int ttl
Definition: ares.h:527
ares_addr_port_node::tcp_port
int tcp_port
Definition: ares.h:712
ares_parse_soa_reply
CARES_EXTERN int ares_parse_soa_reply(const unsigned char *abuf, int alen, struct ares_soa_reply **soa_out)
Definition: ares_parse_soa_reply.c:38
ares_addrttl
Definition: ares.h:520
ares_parse_txt_reply_ext
CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, struct ares_txt_ext **txt_out)
Definition: ares_parse_txt_reply.c:210
ares_options::tries
int tries
Definition: ares.h:262
ares_parse_srv_reply
CARES_EXTERN int ares_parse_srv_reply(const unsigned char *abuf, int alen, struct ares_srv_reply **srv_out)
Definition: ares_parse_srv_reply.c:38
ares_sock_create_callback
int(* ares_sock_create_callback)(ares_socket_t socket_fd, int type, void *data)
Definition: ares.h:307
CARES_EXTERN
#define CARES_EXTERN
Definition: ares.h:94
ares_txt_reply::length
size_t length
Definition: ares.h:556
ares_gethostbyaddr
CARES_EXTERN void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg)
Definition: ares_gethostbyaddr.c:58
ares_caa_reply::length
size_t length
Definition: ares.h:536
ares_parse_ns_reply
CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, int alen, struct hostent **host)
Definition: ares_parse_ns_reply.c:39
ares_txt_ext::length
size_t length
Definition: ares.h:564
ares_txt_ext::txt
unsigned char * txt
Definition: ares.h:563
ares_mx_reply::host
char * host
Definition: ares.h:549
ares_options::lookups
char * lookups
Definition: ares.h:272
ares_init_options
CARES_EXTERN int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask)
Definition: ares_init.c:103
ares_socket_functions::aclose
int(* aclose)(ares_socket_t, void *)
Definition: ares.h:403
ares_getaddrinfo
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)
Definition: ares_getaddrinfo.c:580
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
service
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
Definition: ProtoMethod.h:25
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
ares_addrinfo_cname::name
char * name
Definition: ares.h:612
ares_options::ndomains
int ndomains
Definition: ares.h:271
ares_ssize_t
CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t
Definition: ares_build.h:210
ares_soa_reply::nsname
char * nsname
Definition: ares.h:581
ares_naptr_reply::preference
unsigned short preference
Definition: ares.h:577
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
ares_gethostbyname
CARES_EXTERN void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg)
Definition: ares_gethostbyname.c:75
run_interop_tests.servers
servers
Definition: run_interop_tests.py:1288
ares_addr_port_node::udp_port
int udp_port
Definition: ares.h:711
ares_caa_reply::value
unsigned char * value
Definition: ares.h:535
ares_process_fd
CARES_EXTERN void ares_process_fd(ares_channel channel, ares_socket_t read_fd, ares_socket_t write_fd)
Definition: ares_process.c:142
ares_naptr_reply::replacement
char * replacement
Definition: ares.h:575
ares_addrinfo_node::ai_flags
int ai_flags
Definition: ares.h:595
ares_parse_aaaa_reply
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls)
Definition: ares_parse_aaaa_reply.c:46
ares_socket_functions
Definition: ares.h:401
ares_in6_addr::_S6_un
union ares_in6_addr::@381 _S6_un


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:43