]> git.saurik.com Git - apple/configd.git/blob - dnsinfo/dnsinfo_create.h
configd-289.tar.gz
[apple/configd.git] / dnsinfo / dnsinfo_create.h
1 /*
2 * Copyright (c) 2004-2006, 2008, 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef __DNSINFO_CREATE_H__
25 #define __DNSINFO_CREATE_H__
26
27 /*
28 * These routines provide access to the systems DNS configuration
29 */
30
31 #include <TargetConditionals.h>
32 #include <Availability.h>
33 #include <sys/cdefs.h>
34 #include <stdint.h>
35 #include <sys/types.h>
36 #include <sys/socket.h>
37 #include <netinet/in.h>
38
39 #include <dnsinfo.h>
40
41 typedef const struct __dns_create_config * dns_create_config_t;
42 typedef const struct __dns_create_resolver * dns_create_resolver_t;
43
44 #if !TARGET_OS_IPHONE
45 #ifndef _PATH_RESOLVER_DIR
46 #define _PATH_RESOLVER_DIR "/etc/resolver"
47 #endif
48 #endif /* !TARGET_OS_IPHONE */
49
50 __BEGIN_DECLS
51
52 /*
53 * NOTE: __private_extern__ and __OSX_AVAILABLE_STARTING() cannot be mixed
54 * due to a "visibility" conflict
55 */
56
57 /*
58 * DNS configuration creation APIs
59 */
60 __private_extern__
61 dns_create_config_t
62 _dns_configuration_create (void) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
63
64 __private_extern__
65 void
66 _dns_configuration_add_resolver (dns_create_config_t *_config,
67 dns_create_resolver_t _resolver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
68
69 __private_extern__
70 _Bool
71 _dns_configuration_store (dns_create_config_t *_config) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
72
73 __private_extern__
74 void
75 _dns_configuration_free (dns_create_config_t *_config) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
76
77 /*
78 * DNS [resolver] configuration creation APIs
79 */
80 __private_extern__
81 dns_create_resolver_t
82 _dns_resolver_create (void) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
83
84 __private_extern__
85 void
86 _dns_resolver_set_domain (dns_create_resolver_t *_resolver,
87 const char *domain) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
88
89 __private_extern__
90 void
91 _dns_resolver_add_nameserver (dns_create_resolver_t *_resolver,
92 struct sockaddr *nameserver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
93
94 __private_extern__
95 void
96 _dns_resolver_set_port (dns_create_resolver_t *_resolver,
97 uint16_t port) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/; // host byte order
98
99 __private_extern__
100 void
101 _dns_resolver_add_search (dns_create_resolver_t *_resolver,
102 const char *search) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
103
104 __private_extern__
105 void
106 _dns_resolver_add_sortaddr (dns_create_resolver_t *_resolver,
107 dns_sortaddr_t *sortaddr) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
108
109 __private_extern__
110 void
111 _dns_resolver_set_options (dns_create_resolver_t *_resolver,
112 const char *options) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
113
114 __private_extern__
115 void
116 _dns_resolver_set_timeout (dns_create_resolver_t *_resolver,
117 uint32_t timeout) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
118
119 __private_extern__
120 void
121 _dns_resolver_set_order (dns_create_resolver_t *_resolver,
122 uint32_t order) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
123
124 __private_extern__
125 void
126 _dns_resolver_free (dns_create_resolver_t *_resolver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
127
128 #if !TARGET_OS_IPHONE
129 /*
130 * DNS [resolver] flat-file configuration creation APIs
131 */
132 __private_extern__
133 void
134 _dnsinfo_flatfile_add_resolvers (dns_create_config_t *config) /*__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA)*/;
135 #endif // !TARGET_OS_IPHONE
136
137 __END_DECLS
138
139 #endif /* __DNSINFO_CREATE_H__ */