]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConnectionPrivate.h
configd-453.16.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 Boolean
72 SCNetworkConnectionSetClientInfo (SCNetworkConnectionRef connection,
73 mach_port_t client_audit_session,
74 uid_t client_uid,
75 gid_t client_gid,
76 pid_t client_pid) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_0);
77
78
79 #pragma mark -
80 #pragma mark SCNetworkConnection "VPN on Demand" SPIs
81
82
83 /* VPN On Demand
84 *
85 * in the SCDynamicStore we will have :
86 *
87 * <key>State:/Network/Global/OnDemand</key>
88 * <dict>
89 * <key>Triggers</key>
90 * <array>
91 * <dict>
92 * <key>ServiceID</key>
93 * <string>A740678C-1983-492B-BF64-B825AAE7101E</string>
94 * <key>Status</key>
95 * <integer>8</integer>
96 * <key>RemoteAddress</key>
97 * <string>vpn.mycompany.com</string>
98 * <key>OnDemandMatchDomainsAlways</key>
99 * <array>
100 * <string>internal.mycompany.com</string>
101 * </array>
102 * <key>OnDemandMatchDomainsOnRetry</key>
103 * <array>
104 * <string>mycompany.com</string>
105 * </array>
106 * <key>kSCNetworkConnectionOnDemandMatchDomainsNever</key>
107 * <array>
108 * <string>external.mycompany.com</string>
109 * </array>
110 * </dict>
111 * </array>
112 * </dict>
113 */
114
115 // notify(3) key
116 #define kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY "com.apple.system.SCNetworkConnectionOnDemand"
117
118 // a CFArray[CFDictionary] of VPN on Demand "trigger" configurations
119 #define kSCNetworkConnectionOnDemandTriggers CFSTR("Triggers")
120
121 // VPN service ID
122 #define kSCNetworkConnectionOnDemandServiceID CFSTR("ServiceID")
123
124 // VPN service status (idle, connecting, connected, disconnecting)
125 #define kSCNetworkConnectionOnDemandStatus CFSTR("Status")
126
127 // VPN server address
128 #define kSCNetworkConnectionOnDemandRemoteAddress CFSTR("RemoteAddress")
129
130 // a CFArray[CFString] representing those domain (or host) names that, if
131 // matched to a target hostname, should result in our first establishing
132 // the VPN connection before any DNS queries are issued.
133 #define kSCNetworkConnectionOnDemandMatchDomainsAlways CFSTR("OnDemandMatchDomainsAlways")
134
135 // a CFArray[CFString] representing those domain (or host) names that, if
136 // matched to a target hostname, should result in a DNS query regardless of
137 // whether the VPN connection has been established. If the DNS query returns
138 // an [EAI_NONAME] error then we should establish the VPN connection and
139 // re-issue / retry the query.
140 #define kSCNetworkConnectionOnDemandMatchDomainsOnRetry CFSTR("OnDemandMatchDomainsOnRetry")
141
142 // a CFArray[CFString] representing those domain (or host) names that should
143 // be excluded from those that would be used to establish tje VPN connection.
144 #define kSCNetworkConnectionOnDemandMatchDomainsNever CFSTR("OnDemandMatchDomainsNever")
145
146
147 Boolean
148 __SCNetworkConnectionCopyOnDemandInfoWithName (SCDynamicStoreRef *storeP,
149 CFStringRef nodeName,
150 Boolean onDemandRetry,
151 CFStringRef *connectionServiceID,
152 SCNetworkConnectionStatus *connectionStatus,
153 CFStringRef *vpnRemoteAddress) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
154
155
156 #pragma mark -
157 #pragma mark SCUserPreferences SPIs
158
159
160 Boolean
161 SCUserPreferencesRemove (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
162
163 Boolean
164 SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
165
166 CFStringRef
167 SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
168
169 CFTypeID
170 SCUserPreferencesGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
171
172 CFStringRef
173 SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
174
175 Boolean
176 SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
177
178 Boolean
179 SCUserPreferencesSetName (SCUserPreferencesRef userPreferences,
180 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
181
182 Boolean
183 SCNetworkConnectionStartWithUserPreferences (SCNetworkConnectionRef connection,
184 SCUserPreferencesRef userPreferences,
185 Boolean linger) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
186
187 CFDictionaryRef
188 SCUserPreferencesCopyInterfaceConfiguration (SCUserPreferencesRef userPreferences,
189 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
190
191 Boolean
192 SCUserPreferencesSetInterfaceConfiguration (SCUserPreferencesRef userPreferences,
193 SCNetworkInterfaceRef interface,
194 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
195
196 CFDictionaryRef
197 SCUserPreferencesCopyExtendedInterfaceConfiguration
198 (SCUserPreferencesRef userPreferences,
199 SCNetworkInterfaceRef interface,
200 CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
201
202 Boolean
203 SCUserPreferencesSetExtendedInterfaceConfiguration
204 (SCUserPreferencesRef userPreferences,
205 SCNetworkInterfaceRef interface,
206 CFStringRef extendedType,
207 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
208
209
210 #pragma mark -
211 #pragma mark SCUserPreferences + SCNetworkInterface Password SPIs
212
213
214 Boolean
215 SCUserPreferencesCheckInterfacePassword (SCUserPreferencesRef userPreferences,
216 SCNetworkInterfaceRef interface,
217 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
218
219 CFDataRef
220 SCUserPreferencesCopyInterfacePassword (SCUserPreferencesRef userPreferences,
221 SCNetworkInterfaceRef interface,
222 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
223
224 Boolean
225 SCUserPreferencesRemoveInterfacePassword (SCUserPreferencesRef userPreferences,
226 SCNetworkInterfaceRef interface,
227 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
228
229 Boolean
230 SCUserPreferencesSetInterfacePassword (SCUserPreferencesRef userPreferences,
231 SCNetworkInterfaceRef interface,
232 SCNetworkInterfacePasswordType passwordType,
233 CFDataRef password,
234 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
235
236 __END_DECLS
237
238 #endif /* _SCNETWORKCONNECTIONPRIVATE_H */