]> git.saurik.com Git - apple/libresolv.git/blob - dns_private.h
libresolv-19.tar.gz
[apple/libresolv.git] / dns_private.h
1 #ifndef __DNS_PRIVATE_H__
2 #define __DNS_PRIVATE_H__
3
4 #include <sys/cdefs.h>
5
6 #define DNS_FLAG_DEBUG 0x00000001
7 #define DNS_FLAG_CHECK_RESOLVER_DIR 0x00000002
8 #define DNS_FLAG_HAVE_IPV6_SERVER 0x00000004
9 #define DNS_FLAG_OK_TO_SKIP_AAAA 0x00000008
10 #define DNS_FLAG_DEFAULT_RESOLVER 0x00000010
11 #define DNS_FLAG_FORWARD_TO_MDNSRESPONDER 0x00000020
12
13 typedef struct
14 {
15 res_state res;
16 char *source;
17 char *name;
18 uint32_t search_count;
19 char **search_list;
20 uint16_t port;
21 uint32_t flags;
22 uint32_t total_timeout;
23 uint32_t send_timeout;
24 uint32_t search_order;
25 uint32_t reserved1;
26 void *reserved_pointer1;
27 } pdns_handle_t;
28
29 typedef struct
30 {
31 pdns_handle_t *pdns_primary;
32 uint32_t client_count;
33 pdns_handle_t **client;
34 uint32_t modtime;
35 uint32_t stattime;
36 uint32_t stat_latency;
37 uint32_t flags;
38 int notify_sys_config_token;
39 int notify_dir_token;
40 int notify_delay_token;
41 time_t dns_delay;
42 uint32_t reserved1;
43 void *reserved_pointer1;
44 } sdns_handle_t;
45
46 typedef struct __dns_handle_private_struct
47 {
48 uint32_t handle_type;
49 sdns_handle_t *sdns;
50 pdns_handle_t *pdns;
51 char *recvbuf;
52 uint32_t recvsize;
53 uint32_t reserved1;
54 uint32_t reserved2;
55 void *reserved_pointer1;
56 void *reserved_pointer2;
57 } dns_private_handle_t;
58
59
60 __BEGIN_DECLS
61
62 /*
63 * Returns the number of nameserver addresses available to the input
64 * DNS client. Returns zero if the input handle is a "Super" DNS handle.
65 */
66 extern uint32_t dns_server_list_count(dns_handle_t d);
67
68 /*
69 * Returns the nameserver address at the given index. Returns NULL
70 * if the index is out of range. Caller should free the returned sockaddr.
71 */
72 extern struct sockaddr *dns_server_list_address(dns_handle_t d, uint32_t i);
73
74 /*
75 * Returns a list of all server addresses for all clients.
76 * Caller must free each list entry, and the returned list.
77 */
78 extern void dns_all_server_addrs(dns_handle_t d, struct sockaddr ***addrs, uint32_t *count);
79
80 /*
81 * Returns the number of names in the search list.
82 */
83 uint32_t dns_search_list_count(dns_handle_t d);
84
85 __END_DECLS
86
87 #endif /* __DNS_PRIVATE_H__ */