]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConnectionPrivate.h
configd-1061.80.3.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConnectionPrivate.h
1 /*
2 * Copyright (c) 2006, 2008, 2009, 2011-2015, 2018 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 <os/availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #if !TARGET_OS_SIMULATOR
31 #include <ne_session.h>
32 #endif // !TARGET_OS_SIMULATOR
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SystemConfiguration.h>
35 #include <SystemConfiguration/SCNetworkConfigurationPrivate.h>
36
37
38 typedef const struct CF_BRIDGED_TYPE(id) __SCUserPreferencesRef * SCUserPreferencesRef;
39
40
41 __BEGIN_DECLS
42
43
44 #pragma mark -
45 #pragma mark SCNetworkConnection SPIs
46
47 CFArrayRef /* of SCNetworkServiceRef's */
48 SCNetworkConnectionCopyAvailableServices (SCNetworkSetRef set) API_AVAILABLE(macos(10.5), ios(2.0));
49
50 SCNetworkConnectionRef
51 SCNetworkConnectionCreateWithService (CFAllocatorRef allocator,
52 SCNetworkServiceRef service,
53 SCNetworkConnectionCallBack callout,
54 SCNetworkConnectionContext *context) API_AVAILABLE(macos(10.5), ios(2.0));
55
56 SCNetworkServiceRef
57 SCNetworkConnectionGetService (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.5), ios(2.0));
58
59 CFArrayRef /* of SCUserPreferencesRef's */
60 SCNetworkConnectionCopyAllUserPreferences (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.5), ios(2.0));
61
62 SCUserPreferencesRef
63 SCNetworkConnectionCopyCurrentUserPreferences (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.5), ios(2.0));
64
65 SCUserPreferencesRef
66 SCNetworkConnectionCreateUserPreferences (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.5), ios(2.0));
67
68 Boolean
69 SCNetworkConnectionSuspend (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.3), ios(2.0));
70
71 Boolean
72 SCNetworkConnectionResume (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.3), ios(2.0));
73
74 #if !TARGET_OS_SIMULATOR
75 Boolean
76 SCNetworkConnectionRefreshOnDemandState (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.9), ios(7.0));
77 #endif // !TARGET_OS_SIMULATOR
78
79 Boolean
80 SCNetworkConnectionSetClientInfo (SCNetworkConnectionRef connection,
81 mach_port_t client_audit_session,
82 uid_t client_uid,
83 gid_t client_gid,
84 pid_t client_pid) API_AVAILABLE(macos(10.8), ios(5.0));
85
86 /*!
87 @function SCNetworkConnectionCreate
88 @discussion Create a network connection that is not associated with any
89 network service.
90 @param allocator The CFAllocator that should be used to allocate
91 memory for the connection structure. This parameter may be
92 NULL in which case the current default CFAllocator is used.
93 If this reference is not a valid CFAllocator, the behavior
94 is undefined.
95 @param callout The function to be called when the status
96 of the connection changes. If this parameter is NULL, the
97 application will not receive notifications of status change
98 and will need to poll for updates.
99 @param context The SCNetworkConnectionContext associated with the
100 callout.
101 @return The new SCNetworkConnection object.
102 */
103 SCNetworkConnectionRef
104 SCNetworkConnectionCreate (CFAllocatorRef allocator,
105 SCNetworkConnectionCallBack callout,
106 SCNetworkConnectionContext *context) API_AVAILABLE(macos(10.9), ios(7.0));
107
108 /*!
109 @function SCNetworkConnectionSetClientAuditInfo
110 @discussion Set audit information for the process that is initiating the network traffic
111 that will be transmitted over this network connection.
112 @param connection The SCNetworkConnection object.
113 @param client_audit_token The audit token of the initiator process.
114 @param audit_session The audit session mach port of the initiator process.
115 @param bootstrap_port The bootstrap port of the initiator process.
116 @param pid The PID of the initiator process.
117 @param uuid The Mach-O UUID of the initiator process.
118 @param bundle_id The CFBundleIdentifier of the initiator process.
119 @return TRUE if the audit token was set successfully, FALSE if an error occurred.
120 */
121 Boolean
122 SCNetworkConnectionSetClientAuditInfo (SCNetworkConnectionRef connection,
123 audit_token_t client_audit_token,
124 mach_port_t audit_session,
125 mach_port_t bootstrap_port,
126 pid_t pid,
127 const uuid_t uuid,
128 const char *bundle_id) API_AVAILABLE(macos(10.9), ios(7.0));
129
130 /*!
131 @defined kSCNetworkConnectionSelectionOptionNoUserPrefs
132 @abstract Indicates whether or not SCNetworkConnectionSelectServiceWithOptions
133 should consult the user preferences to find a network service.
134 */
135 #define kSCNetworkConnectionSelectionOptionNoUserPrefs CFSTR("NoUserPrefs") /* CFBoolean */
136
137 /*!
138 @define kSCNetworkConnectionSelectionOptionOnDemandTrafficClass
139 @abstract The traffic class that is attempting to trigger OnDemand.
140 */
141 #define kSCNetworkConnectionSelectionOptionOnDemandTrafficClass CFSTR("OnDemandTrafficClass") // CFNumber
142 // API_AVAILABLE(macos(9.0))
143 // SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0))
144
145 /*!
146 @define kSCNetworkConnectionSelectionOptionOnDemandAccountIdentifier
147 @abstract The account identifier that is attempting to trigger OnDemand.
148 */
149 #define kSCNetworkConnectionSelectionOptionOnDemandAccountIdentifier CFSTR("OnDemandAccountIdentifier") /* CFString */
150
151 /*!
152 @define kSCNetworkConnectionSelectionOptionOnDemandMatchInfo
153 @abstract A dictionary containing information about the On Demand trigger that matched
154 */
155 #define kSCNetworkConnectionSelectionOptionOnDemandMatchInfo CFSTR("OnDemandMatchInfo") /* CFDictionary */
156
157 /*!
158 @define kSCNetworkConnectionOnDemandMatchInfoVPNType
159 @abstract The type of VPN connection associated with the matching trigger.
160 */
161 #define kSCNetworkConnectionOnDemandMatchInfoVPNType CFSTR("OnDemandMatchInfoVPNType") /* CFNumber containing a SCNetworkConnectionType */
162
163 /*!
164 @define kSCNetworkConnectionOnDemandMatchInfoDomain
165 @abstract The specific DNS domain in the trigger's match domains that matched the on demand hostname.
166 */
167 #define kSCNetworkConnectionOnDemandMatchInfoDomain CFSTR("OnDemandMatchInfoDomain") /* CFString */
168
169 /*!
170 @define kSCNetworkConnectionOnDemandMatchInfoAppRuleID
171 @abstract The identifier of the app rule in the matching trigger that matched the calling app.
172 */
173 #define kSCNetworkConnectionOnDemandMatchInfoAppRuleID CFSTR("OnDemandMatchInfoAppRuleID") /* CFString */
174
175 /*
176 @define kSCNetworkConnectionOnDemandMatchInfoOnRetry
177 @abstract A flag indicating if the on demand hostname matched a domain in the "on retry" match domains.
178 */
179 #define kSCNetworkConnectionOnDemandMatchInfoOnRetry CFSTR("OnDemandMatchInfoOnRetry") /* CFString */
180
181
182 /*!
183 @function SCNetworkConnectionSelectServiceWithOptions
184 @discussion Associate a network connection with a network service based on some
185 selection options. This function can only be called on connections that are
186 not already associated with a network service.
187 @param connection The SCNetworkConnection object.
188 @param selectionOptions A dictionary containing some options to be used to
189 select the appropriate service.
190 @return TRUE if an appropriate network service was found and was associated with
191 the connection, FALSE otherwise.
192 */
193 Boolean
194 SCNetworkConnectionSelectServiceWithOptions (SCNetworkConnectionRef connection,
195 CFDictionaryRef selectionOptions) API_AVAILABLE(macos(10.9), ios(7.0));
196
197 /*!
198 @function SCNetworkConnectionOnDemandShouldRetryOnFailure
199 @discussion After SCNetworkConnectionSelectServiceWithOptions returns FALSE, use
200 this function to determine if an On Demand service was indeed matched for
201 On Retry behavior (try resolving/connecting, and start VPN on failure).
202 @param connection The SCNetworkConnection object.
203 @return TRUE if the selected On Demand connection should be retried on DNS or connection
204 failure, FALSE otherwise.
205 */
206 Boolean
207 SCNetworkConnectionOnDemandShouldRetryOnFailure (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.9), ios(7.0));
208
209 /*!
210 @function SCNetworkConnectionCanTunnelAddress
211 @discussion This function should be called on a connection object selected with
212 SCNetworkConnectionSelectServiceWithOptions. If the address belongs to
213 the connection (the tunnel can be used for the address), the function
214 will return TRUE. If startImmediately is set, the address should not be trusted
215 and the VPN should be brought up before attempting to connect.
216 @param connection The SCNetworkConnection object.
217 @param address The address structure to check.
218 @param startImmediately On return, TRUE indicates that the address is not trusted
219 and the VPN should be started immediately.
220 @return TRUE if the selected VPN connection's tunnel routes match the address.
221 */
222 Boolean
223 SCNetworkConnectionCanTunnelAddress (SCNetworkConnectionRef connection,
224 const struct sockaddr *address,
225 Boolean *startImmediately) API_AVAILABLE(macos(10.9), ios(7.0));
226
227 /*!
228 @function SCNetworkConnectionIsOnDemandSuspended
229 @discussion Indicates whether the On Demand connection is suspended or not. Call
230 SCNetworkConnectionSelectServiceWithOptions before calling this function.
231 @param connection The SCNetworkConnection object.
232 @return TRUE if the On Demand connection is suspended, FALSE otherwise.
233 */
234 Boolean
235 SCNetworkConnectionIsOnDemandSuspended (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.9), ios(7.0));
236
237 /*!
238 @function SCNetworkConnectionCopyOnDemandInfo
239 @discussion Indicates whether or not the caller should start the network connection,
240 assuming that the caller has network traffic that needs to use the network connection.
241 @param connection The SCNetworkConnection object.
242 @param onDemandRemoteAddress On return, contains the address of the server providing the
243 network connection. Ownership follows the "Create" rule.
244 @param onDemandConnectionStatus On return, contains the current status of the network
245 connection.
246 @return TRUE if the caller should start the connection upon traffic demand, FALSE otherwise.
247 */
248 Boolean
249 SCNetworkConnectionCopyOnDemandInfo (SCNetworkConnectionRef connection,
250 CFStringRef *onDemandRemoteAddress,
251 SCNetworkConnectionStatus *onDemandConnectionStatus) API_AVAILABLE(macos(10.9), ios(7.0));
252
253 /*!
254 @function SCNetworkConnectionTriggerOnDemandIfNeeded
255 @discussion Trigger a VPN On Demand connection based on a hostname. This function combines the
256 functionality of calling SCNetworkConnectionCreate, SCNetworkConnectionSelectServiceWithOptions,
257 and SCNetworkConnectionStart. The function blocks until the connection is established,
258 fails, or the timer runs out. Since it blocks, this function should not generally be called on
259 the main runloop. NOTE: This function should only be called from process running
260 in the user's context to ensure that the user's keychain is available.
261 @param hostName The hostname that needs to be resolved and accessed.
262 @param afterDNSFail Pass FALSE if this call is made before trying to resolve the hostname, and
263 TRUE if the hostname resolution already failed.
264 @param timeout Number of seconds to wait for a connection. Passing 0 sets a timeout of forever.
265 @param trafficClass Numeric value of a traffic class. Pass 0 for default traffic class, 'Best Effort'.
266 @return TRUE if the connection was established or was not needed, FALSE otherwise.
267 */
268 Boolean
269 SCNetworkConnectionTriggerOnDemandIfNeeded (CFStringRef hostName,
270 Boolean afterDNSFail,
271 int timeout,
272 int trafficClass) API_AVAILABLE(macos(10.9), ios(7.0));
273
274 /*!
275 @function SCNetworkConnectionGetReachabilityInfo
276 @discussion Get the reachability info of the connection server.
277 @param connection The SCNetworkConnection object.
278 @param reach_flags On return, contains the reachability flags of the connection server.
279 @param reach_if_index On return, contains the index of the interface through which
280 the connection server is reachable.
281 @return TRUE if the reachability information was available for the connection
282 server, FALSE otherwise.
283 */
284 Boolean
285 SCNetworkConnectionGetReachabilityInfo (SCNetworkConnectionRef connection,
286 SCNetworkReachabilityFlags *reach_flags,
287 unsigned int *reach_if_index) API_AVAILABLE(macos(10.9), ios(7.0));
288
289
290 /*!
291 @enum SCNetworkConnectionType
292 @discussion Type of the network connection.
293 @constant kSCNetworkConnectionTypeUnknown
294 The type of the network connection has not yet been determined.
295 @constant kSCNetworkConnectionTypePPP
296 The network connection is a Point To Point Protocol connection.
297 @constant kSCNetworkConnectionTypeIPLayerVPN
298 The network connection is a IP-layer Virtual Private Network connection.
299 @constant kSCNetworkConnectionTypeAppLayerVPN
300 The network connection is an Application-layer Virtual Private Network connection.
301 */
302 enum {
303 kSCNetworkConnectionTypeUnknown = 0,
304 kSCNetworkConnectionTypePPP = 1,
305 kSCNetworkConnectionTypeIPLayerVPN = 2,
306 kSCNetworkConnectionTypeAppLayerVPN = 3,
307 };
308
309 typedef int SCNetworkConnectionType;
310
311 /*!
312 @function SCNetworkConnectionGetType
313 @discussion Get the type of the network connection.
314 @param connection The SCNetworkConnection object.
315 @return The type of the network connection.
316 */
317 SCNetworkConnectionType
318 SCNetworkConnectionGetType (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.9), ios(7.0));
319
320 /*!
321 @defined kSCNetworkConnectionFlowPropertyHostName
322 @abstract The host name of the flow's destination server.
323 */
324 #define kSCNetworkConnectionFlowPropertyHostName CFSTR("HostName") /* CFString */
325
326 /*!
327 @defined kSCNetworkConnectionFlowPropertyHostAddress
328 @abstract The address of the flow's destination server.
329 */
330 #define kSCNetworkConnectionFlowPropertyHostAddress CFSTR("HostAddress") /* CFData containing a struct sockaddr */
331
332 /*!
333 @defined kSCNetworkConnectionFlowPropertyHostPort
334 @abstract The port of the flow's destination server.
335 */
336 #define kSCNetworkConnectionFlowPropertyHostPort CFSTR("HostPort") /* CFNumber */
337
338 /*!
339 @function SCNetworkConnectionCopyFlowDivertToken
340 @discussion Copy a token that should be used to activate flow divert on
341 a socket, causing data on the socket to be diverted through the
342 Application-layer VPN provided by the given network connection.
343 @param connection The SCNetworkConnection object.
344 @param flowProperties A dictionary containing properties of the socket
345 to be diverted.
346 @return The flow divert token, or NULL if the flow properties are not valid
347 or the connection does not provide Application-Layer VPN services.
348 */
349 CFDataRef
350 SCNetworkConnectionCopyFlowDivertToken (SCNetworkConnectionRef connection,
351 CFDictionaryRef flowProperties) API_AVAILABLE(macos(10.9), ios(7.0));
352
353 #define kSCNetworkConnectionAppPropertyRuleID CFSTR("RuleID")
354 #define kSCNetworkConnectionAppPropertyCodeDirHash CFSTR("CodeDirHash")
355 #define kSCNetworkConnectionAppPropertySigningID CFSTR("SigningID")
356 #define kSCNetworkConnectionAppPropertyAuditToken CFSTR("AuditToken")
357 #define kSCNetworkConnectionAppPropertyPID CFSTR("ProcessID")
358 #define kSCNetworkConnectionAppPropertyUUID CFSTR("UUID")
359
360 int
361 SCNetworkConnectionGetServiceIdentifier (SCNetworkConnectionRef connection) API_AVAILABLE(macos(10.9), ios(7.0));
362
363 #pragma mark -
364 #pragma mark SCNetworkConnection "VPN on Demand" SPIs
365
366
367 /* VPN On Demand
368 *
369 * in the SCDynamicStore we will have :
370 *
371 * <key>State:/Network/Global/OnDemand</key>
372 * <dict>
373 * <key>Triggers</key>
374 * <array>
375 * <dict>
376 * <key>ServiceID</key>
377 * <string>A740678C-1983-492B-BF64-B825AAE7101E</string>
378 * <key>Status</key>
379 * <integer>8</integer>
380 * <key>RemoteAddress</key>
381 * <string>vpn.mycompany.com</string>
382 * <key>OnDemandMatchDomainsAlways</key>
383 * <array>
384 * <string>internal.mycompany.com</string>
385 * </array>
386 * <key>OnDemandMatchDomainsOnRetry</key>
387 * <array>
388 * <string>mycompany.com</string>
389 * </array>
390 * <key>kSCNetworkConnectionOnDemandMatchDomainsNever</key>
391 * <array>
392 * <string>external.mycompany.com</string>
393 * </array>
394 * <key>OnDemandMatchAppEnabled</key>
395 * <integer>0</integer>
396 * </dict>
397 * </array>
398 * </dict>
399 */
400
401 // notify(3) key
402 #define kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY "com.apple.system.SCNetworkConnectionOnDemand"
403
404 // SCNetworkConnection status
405 // (included in the dictionary returned by SCNetworkConnectionCopyExtendedStatus)
406 #define kSCNetworkConnectionStatus CFSTR("Status") /* CFNumber */
407
408 // a CFArray[CFDictionary] of VPN on Demand "trigger" configurations
409 #define kSCNetworkConnectionOnDemandTriggers CFSTR("Triggers") /* CFArray[CFDictionary] */
410
411 // VPN service ID
412 #define kSCNetworkConnectionOnDemandServiceID CFSTR("ServiceID") /* CFString */
413
414 // VPN service status (idle, connecting, connected, disconnecting)
415 #define kSCNetworkConnectionOnDemandStatus CFSTR("Status") /* CFNumber */
416
417 // VPN server address
418 #define kSCNetworkConnectionOnDemandRemoteAddress CFSTR("RemoteAddress") /* CFString */
419
420 // Reachability flags for the VPN server
421 #define kSCNetworkConnectionOnDemandReachFlags CFSTR("ReachFlags") /* CFNumber */
422
423 // Reachability interface index for the VPN server
424 #define kSCNetworkConnectionOnDemandReachInterfaceIndex CFSTR("ReachInterfaceIndex") /* CFNumber */
425
426 // Network detection has detected DNS Redirecting (like OpenDNS)
427 #define kSCNetworkConnectionOnDemandDNSRedirectDetected CFSTR("DNSRedirectDetected") /* CFBoolean */
428
429 // a dictionary of address information for known lying results
430 #define kSCNetworkConnectionOnDemandDNSRedirectedAddresses CFSTR("DNSRedirectedAddresses") /* CFDictionary[CFDictionary] */
431
432 // A dictionary of routes tunneled over this service in the past
433 #define kSCNetworkConnectionOnDemandTunneledNetworks CFSTR("TunneledNetworks") /* CFDictionary[CFDictionary] */
434
435 // An array of plugin PIDs
436 #define kSCNetworkConnectionOnDemandPluginPIDs CFSTR("PluginPIDs") /* CFArray[CFNumber] */
437
438 // A dictionary of results, keyed by probe string
439 #define kSCNetworkConnectionOnDemandProbeResults CFSTR("ProbeResults") /* CFDictionary[CFBoolean] */
440
441 /* The following generic NetworkInfo keys are currently used in the dynamic store as follows:
442
443 kSCNetworkConnectionOnDemandTunneledNetworks (CFDictionary)
444 - kSCNetworkConnectionNetworkInfoIPv4 (CFDictionary)
445 - kSCNetworkConnectionNetworkInfoIncludedRoutes (CFDictionary)
446 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
447 - kSCNetworkConnectionNetworkInfoMasks (CFData)
448 - kSCNetworkConnectionNetworkInfoExcludedRoutes (CFDictionary)
449 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
450 - kSCNetworkConnectionNetworkInfoMasks (CFData)
451 - kSCNetworkConnectionNetworkInfoIPv6 (CFDictionary)
452 [Same as for IPv4]
453
454 kSCNetworkConnectionOnDemandDNSRedirectedAddresses (CFDictionary)
455 - kSCNetworkConnectionNetworkInfoIPv4 (CFDictionary)
456 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
457 - kSCNetworkConnectionNetworkInfoIPv6 (CFDictionary)
458 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
459 */
460 #define kSCNetworkConnectionNetworkInfoIPv4 CFSTR("IPv4") /* CFDictionary[CFType] */
461 #define kSCNetworkConnectionNetworkInfoIPv6 CFSTR("IPv6") /* CFDictionary[CFType] */
462 #define kSCNetworkConnectionNetworkInfoIncludedRoutes CFSTR("IncludedRoutes") /* CFDictionary[CFData] */
463 #define kSCNetworkConnectionNetworkInfoExcludedRoutes CFSTR("ExcludedRoutes") /* CFDictionary[CFData] */
464 #define kSCNetworkConnectionNetworkInfoAddresses CFSTR("Addresses") /* CFData */
465 #define kSCNetworkConnectionNetworkInfoMasks CFSTR("Masks") /* CFData */
466
467 // a CFArray[CFString] representing those domain (or host) names that, if
468 // matched to a target hostname, should result in our first establishing
469 // the VPN connection before any DNS queries are issued.
470 #define kSCNetworkConnectionOnDemandMatchDomainsAlways CFSTR("OnDemandMatchDomainsAlways") /* CFArray[CFString] */
471
472 // a CFArray[CFString] representing those domain (or host) names that, if
473 // matched to a target hostname, should result in a DNS query regardless of
474 // whether the VPN connection has been established. If the DNS query returns
475 // an [EAI_NONAME] error then we should establish the VPN connection and
476 // re-issue / retry the query.
477 #define kSCNetworkConnectionOnDemandMatchDomainsOnRetry CFSTR("OnDemandMatchDomainsOnRetry") /* CFArray[CFString] */
478
479 // a CFArray[CFString] representing those domain (or host) names that should
480 // be excluded from those that would be used to establish tje VPN connection.
481 #define kSCNetworkConnectionOnDemandMatchDomainsNever CFSTR("OnDemandMatchDomainsNever") /* CFArray[CFString] */
482
483 // A CFNumber (0 or 1) indicating whether or not the App Layer rules should be
484 // used to decide whether or not to establish the tunnel connection.
485 #define kSCNetworkConnectionOnDemandMatchAppEnabled CFSTR("OnDemandMatchAppEnabled") /* CFNumber */
486
487 Boolean
488 __SCNetworkConnectionCopyOnDemandInfoWithName (SCDynamicStoreRef *storeP,
489 CFStringRef nodeName,
490 Boolean onDemandRetry,
491 CFStringRef *connectionServiceID,
492 SCNetworkConnectionStatus *connectionStatus,
493 CFStringRef *vpnRemoteAddress) API_AVAILABLE(macos(10.6), ios(2.0));
494
495 #if !TARGET_OS_SIMULATOR
496 SCNetworkConnectionStatus
497 SCNetworkConnectionGetStatusFromNEStatus (ne_session_status_t status) API_AVAILABLE(macos(10.10), ios(8.0));
498 #endif /* !TARGET_OS_SIMULATOR */
499
500 #pragma mark -
501 #pragma mark SCUserPreferences SPIs
502
503
504 Boolean
505 SCUserPreferencesRemove (SCUserPreferencesRef userPreferences) API_AVAILABLE(macos(10.5), ios(2.0));
506
507 Boolean
508 SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences) API_AVAILABLE(macos(10.5), ios(2.0));
509
510 CFStringRef
511 SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences) API_AVAILABLE(macos(10.5), ios(2.0));
512
513 CFTypeID
514 SCUserPreferencesGetTypeID (void) API_AVAILABLE(macos(10.5), ios(2.0));
515
516 CFStringRef
517 SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences) API_AVAILABLE(macos(10.5), ios(2.0));
518
519 Boolean
520 SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences) API_AVAILABLE(macos(10.5), ios(2.0));
521
522 Boolean
523 SCUserPreferencesSetName (SCUserPreferencesRef userPreferences,
524 CFStringRef newName) API_AVAILABLE(macos(10.5), ios(2.0));
525
526 Boolean
527 SCNetworkConnectionStartWithUserPreferences (SCNetworkConnectionRef connection,
528 SCUserPreferencesRef userPreferences,
529 Boolean linger) API_AVAILABLE(macos(10.5), ios(2.0));
530
531 CFDictionaryRef
532 SCUserPreferencesCopyInterfaceConfiguration (SCUserPreferencesRef userPreferences,
533 SCNetworkInterfaceRef interface) API_AVAILABLE(macos(10.5), ios(2.0));
534
535 Boolean
536 SCUserPreferencesSetInterfaceConfiguration (SCUserPreferencesRef userPreferences,
537 SCNetworkInterfaceRef interface,
538 CFDictionaryRef newOptions) API_AVAILABLE(macos(10.5), ios(2.0));
539
540 CFDictionaryRef
541 SCUserPreferencesCopyExtendedInterfaceConfiguration
542 (SCUserPreferencesRef userPreferences,
543 SCNetworkInterfaceRef interface,
544 CFStringRef extendedType) API_AVAILABLE(macos(10.5), ios(2.0));
545
546 Boolean
547 SCUserPreferencesSetExtendedInterfaceConfiguration
548 (SCUserPreferencesRef userPreferences,
549 SCNetworkInterfaceRef interface,
550 CFStringRef extendedType,
551 CFDictionaryRef newOptions) API_AVAILABLE(macos(10.5), ios(2.0));
552
553
554 #pragma mark -
555 #pragma mark SCUserPreferences + SCNetworkInterface Password SPIs
556
557
558 Boolean
559 SCUserPreferencesCheckInterfacePassword (SCUserPreferencesRef userPreferences,
560 SCNetworkInterfaceRef interface,
561 SCNetworkInterfacePasswordType passwordType) API_AVAILABLE(macos(10.5), ios(2.0));
562
563 CFDataRef
564 SCUserPreferencesCopyInterfacePassword (SCUserPreferencesRef userPreferences,
565 SCNetworkInterfaceRef interface,
566 SCNetworkInterfacePasswordType passwordType) API_AVAILABLE(macos(10.5), ios(2.0));
567
568 Boolean
569 SCUserPreferencesRemoveInterfacePassword (SCUserPreferencesRef userPreferences,
570 SCNetworkInterfaceRef interface,
571 SCNetworkInterfacePasswordType passwordType) API_AVAILABLE(macos(10.5), ios(2.0));
572
573 Boolean
574 SCUserPreferencesSetInterfacePassword (SCUserPreferencesRef userPreferences,
575 SCNetworkInterfaceRef interface,
576 SCNetworkInterfacePasswordType passwordType,
577 CFDataRef password,
578 CFDictionaryRef options) API_AVAILABLE(macos(10.5), ios(2.0));
579
580 __END_DECLS
581
582 #endif /* _SCNETWORKCONNECTIONPRIVATE_H */