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