]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConnectionPrivate.h
configd-395.10.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConnectionPrivate.h
1 /*
2 * Copyright (c) 2006, 2008, 2009, 2011 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 _SCNETWORKCONNECTIONPRIVATE_H
25 #define _SCNETWORKCONNECTIONPRIVATE_H
26
27 #include <Availability.h>
28 #include <sys/cdefs.h>
29 #include <CoreFoundation/CoreFoundation.h>
30 #include <SystemConfiguration/SystemConfiguration.h>
31 #include <SystemConfiguration/SCNetworkConfigurationPrivate.h>
32
33
34 typedef const struct __SCUserPreferencesRef * SCUserPreferencesRef;
35
36
37 __BEGIN_DECLS
38
39
40 #pragma mark -
41 #pragma mark SCNetworkConnection SPIs
42
43
44 CFArrayRef /* of SCNetworkServiceRef's */
45 SCNetworkConnectionCopyAvailableServices (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
46
47 SCNetworkConnectionRef
48 SCNetworkConnectionCreateWithService (CFAllocatorRef allocator,
49 SCNetworkServiceRef service,
50 SCNetworkConnectionCallBack callout,
51 SCNetworkConnectionContext *context) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
52
53 SCNetworkServiceRef
54 SCNetworkConnectionGetService (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
55
56 CFArrayRef /* of SCUserPreferencesRef's */
57 SCNetworkConnectionCopyAllUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
58
59 SCUserPreferencesRef
60 SCNetworkConnectionCopyCurrentUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
61
62 SCUserPreferencesRef
63 SCNetworkConnectionCreateUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
64
65 Boolean
66 SCNetworkConnectionSuspend (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
67
68 Boolean
69 SCNetworkConnectionResume (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
70
71
72 #pragma mark -
73 #pragma mark SCNetworkConnection "VPN on Demand" SPIs
74
75
76 /* VPN On Demand
77 *
78 * in the SCDynamicStore we will have :
79 *
80 * <key>State:/Network/Global/OnDemand</key>
81 * <dict>
82 * <key>Triggers</key>
83 * <array>
84 * <dict>
85 * <key>ServiceID</key>
86 * <string>A740678C-1983-492B-BF64-B825AAE7101E</string>
87 * <key>Status</key>
88 * <integer>8</integer>
89 * <key>RemoteAddress</key>
90 * <string>vpn.mycompany.com</string>
91 * <key>OnDemandMatchDomainsAlways</key>
92 * <array>
93 * <string>internal.mycompany.com</string>
94 * </array>
95 * <key>OnDemandMatchDomainsOnRetry</key>
96 * <array>
97 * <string>mycompany.com</string>
98 * </array>
99 * <key>kSCNetworkConnectionOnDemandMatchDomainsNever</key>
100 * <array>
101 * <string>external.mycompany.com</string>
102 * </array>
103 * </dict>
104 * </array>
105 * </dict>
106 */
107
108 // notify(3) key
109 #define kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY "com.apple.system.SCNetworkConnectionOnDemand"
110
111 // a CFArray[CFDictionary] of VPN on Demand "trigger" configurations
112 #define kSCNetworkConnectionOnDemandTriggers CFSTR("Triggers")
113
114 // VPN service ID
115 #define kSCNetworkConnectionOnDemandServiceID CFSTR("ServiceID")
116
117 // VPN service status (idle, connecting, connected, disconnecting)
118 #define kSCNetworkConnectionOnDemandStatus CFSTR("Status")
119
120 // VPN server address
121 #define kSCNetworkConnectionOnDemandRemoteAddress CFSTR("RemoteAddress")
122
123 // a CFArray[CFString] representing those domain (or host) names that, if
124 // matched to a target hostname, should result in our first establishing
125 // the VPN connection before any DNS queries are issued.
126 #define kSCNetworkConnectionOnDemandMatchDomainsAlways CFSTR("OnDemandMatchDomainsAlways")
127
128 // a CFArray[CFString] representing those domain (or host) names that, if
129 // matched to a target hostname, should result in a DNS query regardless of
130 // whether the VPN connection has been established. If the DNS query returns
131 // an [EAI_NONAME] error then we should establish the VPN connection and
132 // re-issue / retry the query.
133 #define kSCNetworkConnectionOnDemandMatchDomainsOnRetry CFSTR("OnDemandMatchDomainsOnRetry")
134
135 // a CFArray[CFString] representing those domain (or host) names that should
136 // be excluded from those that would be used to establish tje VPN connection.
137 #define kSCNetworkConnectionOnDemandMatchDomainsNever CFSTR("OnDemandMatchDomainsNever")
138
139
140 __private_extern__
141 Boolean
142 __SCNetworkConnectionCopyOnDemandInfoWithName (SCDynamicStoreRef *storeP,
143 CFStringRef nodeName,
144 Boolean onDemandRetry,
145 CFStringRef *connectionServiceID,
146 SCNetworkConnectionStatus *connectionStatus,
147 CFStringRef *vpnRemoteAddress) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
148
149
150 #pragma mark -
151 #pragma mark SCUserPreferences SPIs
152
153
154 Boolean
155 SCUserPreferencesRemove (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
156
157 Boolean
158 SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
159
160 CFStringRef
161 SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
162
163 CFTypeID
164 SCUserPreferencesGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
165
166 CFStringRef
167 SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
168
169 Boolean
170 SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
171
172 Boolean
173 SCUserPreferencesSetName (SCUserPreferencesRef userPreferences,
174 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
175
176 Boolean
177 SCNetworkConnectionStartWithUserPreferences (SCNetworkConnectionRef connection,
178 SCUserPreferencesRef userPreferences,
179 Boolean linger) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
180
181 CFDictionaryRef
182 SCUserPreferencesCopyInterfaceConfiguration (SCUserPreferencesRef userPreferences,
183 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
184
185 Boolean
186 SCUserPreferencesSetInterfaceConfiguration (SCUserPreferencesRef userPreferences,
187 SCNetworkInterfaceRef interface,
188 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
189
190 CFDictionaryRef
191 SCUserPreferencesCopyExtendedInterfaceConfiguration
192 (SCUserPreferencesRef userPreferences,
193 SCNetworkInterfaceRef interface,
194 CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
195
196 Boolean
197 SCUserPreferencesSetExtendedInterfaceConfiguration
198 (SCUserPreferencesRef userPreferences,
199 SCNetworkInterfaceRef interface,
200 CFStringRef extendedType,
201 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
202
203
204 #pragma mark -
205 #pragma mark SCUserPreferences + SCNetworkInterface Password SPIs
206
207
208 Boolean
209 SCUserPreferencesCheckInterfacePassword (SCUserPreferencesRef userPreferences,
210 SCNetworkInterfaceRef interface,
211 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
212
213 CFDataRef
214 SCUserPreferencesCopyInterfacePassword (SCUserPreferencesRef userPreferences,
215 SCNetworkInterfaceRef interface,
216 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
217
218 Boolean
219 SCUserPreferencesRemoveInterfacePassword (SCUserPreferencesRef userPreferences,
220 SCNetworkInterfaceRef interface,
221 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
222
223 Boolean
224 SCUserPreferencesSetInterfacePassword (SCUserPreferencesRef userPreferences,
225 SCNetworkInterfaceRef interface,
226 SCNetworkInterfacePasswordType passwordType,
227 CFDataRef password,
228 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
229
230 __END_DECLS
231
232 #endif /* _SCNETWORKCONNECTIONPRIVATE_H */