2 * Copyright (c) 2006, 2008, 2009, 2011-2015 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCNETWORKCONNECTIONPRIVATE_H
25 #define _SCNETWORKCONNECTIONPRIVATE_H
27 #include <Availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #if !TARGET_IPHONE_SIMULATOR
31 #include <ne_session.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SystemConfiguration.h>
35 #include <SystemConfiguration/SCNetworkConfigurationPrivate.h>
38 typedef const struct CF_BRIDGED_TYPE(id
) __SCUserPreferencesRef
* SCUserPreferencesRef
;
45 #pragma mark SCNetworkConnection SPIs
47 CFArrayRef
/* of SCNetworkServiceRef's */
48 SCNetworkConnectionCopyAvailableServices (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
50 SCNetworkConnectionRef
51 SCNetworkConnectionCreateWithService (CFAllocatorRef allocator
,
52 SCNetworkServiceRef service
,
53 SCNetworkConnectionCallBack callout
,
54 SCNetworkConnectionContext
*context
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
57 SCNetworkConnectionGetService (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
59 CFArrayRef
/* of SCUserPreferencesRef's */
60 SCNetworkConnectionCopyAllUserPreferences (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
63 SCNetworkConnectionCopyCurrentUserPreferences (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
66 SCNetworkConnectionCreateUserPreferences (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
69 SCNetworkConnectionSuspend (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_3
,__IPHONE_2_0
);
72 SCNetworkConnectionResume (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_3
,__IPHONE_2_0
);
75 SCNetworkConnectionRefreshOnDemandState (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
78 SCNetworkConnectionSetClientInfo (SCNetworkConnectionRef connection
,
79 mach_port_t client_audit_session
,
82 pid_t client_pid
) __OSX_AVAILABLE_STARTING(__MAC_10_8
,__IPHONE_5_0
);
85 @function SCNetworkConnectionCreate
86 @discussion Create a network connection that is not associated with any
88 @param allocator The CFAllocator that should be used to allocate
89 memory for the connection structure. This parameter may be
90 NULL in which case the current default CFAllocator is used.
91 If this reference is not a valid CFAllocator, the behavior
93 @param callout The function to be called when the status
94 of the connection changes. If this parameter is NULL, the
95 application will not receive notifications of status change
96 and will need to poll for updates.
97 @param context The SCNetworkConnectionContext associated with the
99 @return The new SCNetworkConnection object.
101 SCNetworkConnectionRef
102 SCNetworkConnectionCreate (CFAllocatorRef allocator
,
103 SCNetworkConnectionCallBack callout
,
104 SCNetworkConnectionContext
*context
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
107 @function SCNetworkConnectionSetClientAuditInfo
108 @discussion Set audit information for the process that is initiating the network traffic
109 that will be transmitted over this network connection.
110 @param connection The SCNetworkConnection object.
111 @param client_audit_token The audit token of the initiator process.
112 @param audit_session The audit session mach port of the initiator process.
113 @param bootstrap_port The bootstrap port of the initiator process.
114 @param pid The PID of the initiator process.
115 @param uuid The Mach-O UUID of the initiator process.
116 @param bundle_id The CFBundleIdentifier of the initiator process.
117 @return TRUE if the audit token was set successfully, FALSE if an error occurred.
120 SCNetworkConnectionSetClientAuditInfo (SCNetworkConnectionRef connection
,
121 audit_token_t client_audit_token
,
122 mach_port_t audit_session
,
123 mach_port_t bootstrap_port
,
126 const char *bundle_id
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
129 @defined kSCNetworkConnectionSelectionOptionNoUserPrefs
130 @abstract Indicates whether or not SCNetworkConnectionSelectServiceWithOptions
131 should consult the user preferences to find a network service.
133 #define kSCNetworkConnectionSelectionOptionNoUserPrefs CFSTR("NoUserPrefs") /* CFBoolean */
136 @define kSCNetworkConnectionSelectionOptionOnDemandTrafficClass
137 @abstract The traffic class that is attempting to trigger OnDemand.
139 #define kSCNetworkConnectionSelectionOptionOnDemandTrafficClass CFSTR("OnDemandTrafficClass") // CFNumber
140 // __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/)
142 @define kSCNetworkConnectionSelectionOptionOnDemandAccountIdentifier
143 @abstract The account identifier that is attempting to trigger OnDemand.
145 #define kSCNetworkConnectionSelectionOptionOnDemandAccountIdentifier CFSTR("OnDemandAccountIdentifier") /* CFString */
148 @define kSCNetworkConnectionSelectionOptionOnDemandMatchInfo
149 @abstract A dictionary containing information about the On Demand trigger that matched
151 #define kSCNetworkConnectionSelectionOptionOnDemandMatchInfo CFSTR("OnDemandMatchInfo") /* CFDictionary */
154 @define kSCNetworkConnectionOnDemandMatchInfoVPNType
155 @abstract The type of VPN connection associated with the matching trigger.
157 #define kSCNetworkConnectionOnDemandMatchInfoVPNType CFSTR("OnDemandMatchInfoVPNType") /* CFNumber containing a SCNetworkConnectionType */
160 @define kSCNetworkConnectionOnDemandMatchInfoDomain
161 @abstract The specific DNS domain in the trigger's match domains that matched the on demand hostname.
163 #define kSCNetworkConnectionOnDemandMatchInfoDomain CFSTR("OnDemandMatchInfoDomain") /* CFString */
166 @define kSCNetworkConnectionOnDemandMatchInfoAppRuleID
167 @abstract The identifier of the app rule in the matching trigger that matched the calling app.
169 #define kSCNetworkConnectionOnDemandMatchInfoAppRuleID CFSTR("OnDemandMatchInfoAppRuleID") /* CFString */
172 @define kSCNetworkConnectionOnDemandMatchInfoOnRetry
173 @abstract A flag indicating if the on demand hostname matched a domain in the "on retry" match domains.
175 #define kSCNetworkConnectionOnDemandMatchInfoOnRetry CFSTR("OnDemandMatchInfoOnRetry") /* CFString */
179 @function SCNetworkConnectionSelectServiceWithOptions
180 @discussion Associate a network connection with a network service based on some
181 selection options. This function can only be called on connections that are
182 not already associated with a network service.
183 @param connection The SCNetworkConnection object.
184 @param selectionOptions A dictionary containing some options to be used to
185 select the appropriate service.
186 @return TRUE if an appropriate network service was found and was associated with
187 the connection, FALSE otherwise.
190 SCNetworkConnectionSelectServiceWithOptions (SCNetworkConnectionRef connection
,
191 CFDictionaryRef selectionOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
194 @function SCNetworkConnectionOnDemandShouldRetryOnFailure
195 @discussion After SCNetworkConnectionSelectServiceWithOptions returns FALSE, use
196 this function to determine if an On Demand service was indeed matched for
197 On Retry behavior (try resolving/connecting, and start VPN on failure).
198 @param connection The SCNetworkConnection object.
199 @return TRUE if the selected On Demand connection should be retried on DNS or connection
200 failure, FALSE otherwise.
203 SCNetworkConnectionOnDemandShouldRetryOnFailure (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
206 @function SCNetworkConnectionCanTunnelAddress
207 @discussion This function should be called on a connection object selected with
208 SCNetworkConnectionSelectServiceWithOptions. If the address belongs to
209 the connection (the tunnel can be used for the address), the function
210 will return TRUE. If startImmediately is set, the address should not be trusted
211 and the VPN should be brought up before attempting to connect.
212 @param connection The SCNetworkConnection object.
213 @param address The address structure to check.
214 @param startImmediately On return, TRUE indicates that the address is not trusted
215 and the VPN should be started immediately.
216 @return TRUE if the selected VPN connection's tunnel routes match the address.
219 SCNetworkConnectionCanTunnelAddress (SCNetworkConnectionRef connection
,
220 const struct sockaddr
*address
,
221 Boolean
*startImmediately
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
224 @function SCNetworkConnectionIsOnDemandSuspended
225 @discussion Indicates whether the On Demand connection is suspended or not. Call
226 SCNetworkConnectionSelectServiceWithOptions before calling this function.
227 @param connection The SCNetworkConnection object.
228 @return TRUE if the On Demand connection is suspended, FALSE otherwise.
231 SCNetworkConnectionIsOnDemandSuspended (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
234 @function SCNetworkConnectionCopyOnDemandInfo
235 @discussion Indicates whether or not the caller should start the network connection,
236 assuming that the caller has network traffic that needs to use the network connection.
237 @param connection The SCNetworkConnection object.
238 @param onDemandRemoteAddress On return, contains the address of the server providing the
239 network connection. Ownership follows the "Create" rule.
240 @param onDemandConnectionStatus On return, contains the current status of the network
242 @return TRUE if the caller should start the connection upon traffic demand, FALSE otherwise.
245 SCNetworkConnectionCopyOnDemandInfo (SCNetworkConnectionRef connection
,
246 CFStringRef
*onDemandRemoteAddress
,
247 SCNetworkConnectionStatus
*onDemandConnectionStatus
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
250 @function SCNetworkConnectionTriggerOnDemandIfNeeded
251 @discussion Trigger a VPN On Demand connection based on a hostname. This function combines the
252 functionality of calling SCNetworkConnectionCreate, SCNetworkConnectionSelectServiceWithOptions,
253 and SCNetworkConnectionStart. The function blocks until the connection is established,
254 fails, or the timer runs out. Since it blocks, this function should not generally be called on
255 the main runloop. NOTE: This function should only be called from process running
256 in the user's context to ensure that the user's keychain is available.
257 @param hostName The hostname that needs to be resolved and accessed.
258 @param afterDNSFail Pass FALSE if this call is made before trying to resolve the hostname, and
259 TRUE if the hostname resolution already failed.
260 @param timeout Number of seconds to wait for a connection. Passing 0 sets a timeout of forever.
261 @param trafficClass Numeric value of a traffic class. Pass 0 for default traffic class, 'Best Effort'.
262 @return TRUE if the connection was established or was not needed, FALSE otherwise.
265 SCNetworkConnectionTriggerOnDemandIfNeeded (CFStringRef hostName
,
266 Boolean afterDNSFail
,
268 int trafficClass
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
271 @function SCNetworkConnectionGetReachabilityInfo
272 @discussion Get the reachability info of the connection server.
273 @param connection The SCNetworkConnection object.
274 @param reach_flags On return, contains the reachability flags of the connection server.
275 @param reach_if_index On return, contains the index of the interface through which
276 the connection server is reachable.
277 @return TRUE if the reachability information was available for the connection
278 server, FALSE otherwise.
281 SCNetworkConnectionGetReachabilityInfo (SCNetworkConnectionRef connection
,
282 SCNetworkReachabilityFlags
*reach_flags
,
283 unsigned int *reach_if_index
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
287 @enum SCNetworkConnectionType
288 @discussion Type of the network connection.
289 @constant kSCNetworkConnectionTypeUnknown
290 The type of the network connection has not yet been determined.
291 @constant kSCNetworkConnectionTypePPP
292 The network connection is a Point To Point Protocol connection.
293 @constant kSCNetworkConnectionTypeIPLayerVPN
294 The network connection is a IP-layer Virtual Private Network connection.
295 @constant kSCNetworkConnectionTypeAppLayerVPN
296 The network connection is an Application-layer Virtual Private Network connection.
299 kSCNetworkConnectionTypeUnknown
= 0,
300 kSCNetworkConnectionTypePPP
= 1,
301 kSCNetworkConnectionTypeIPLayerVPN
= 2,
302 kSCNetworkConnectionTypeAppLayerVPN
= 3,
305 typedef int SCNetworkConnectionType
;
308 @function SCNetworkConnectionGetType
309 @discussion Get the type of the network connection.
310 @param connection The SCNetworkConnection object.
311 @return The type of the network connection.
313 SCNetworkConnectionType
314 SCNetworkConnectionGetType (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
317 @defined kSCNetworkConnectionFlowPropertyHostName
318 @abstract The host name of the flow's destination server.
320 #define kSCNetworkConnectionFlowPropertyHostName CFSTR("HostName") /* CFString */
323 @defined kSCNetworkConnectionFlowPropertyHostAddress
324 @abstract The address of the flow's destination server.
326 #define kSCNetworkConnectionFlowPropertyHostAddress CFSTR("HostAddress") /* CFData containing a struct sockaddr */
329 @defined kSCNetworkConnectionFlowPropertyHostPort
330 @abstract The port of the flow's destination server.
332 #define kSCNetworkConnectionFlowPropertyHostPort CFSTR("HostPort") /* CFNumber */
335 @function SCNetworkConnectionCopyFlowDivertToken
336 @discussion Copy a token that should be used to activate flow divert on
337 a socket, causing data on the socket to be diverted through the
338 Application-layer VPN provided by the given network connection.
339 @param connection The SCNetworkConnection object.
340 @param flowProperties A dictionary containing properties of the socket
342 @return The flow divert token, or NULL if the flow properties are not valid
343 or the connection does not provide Application-Layer VPN services.
346 SCNetworkConnectionCopyFlowDivertToken (SCNetworkConnectionRef connection
,
347 CFDictionaryRef flowProperties
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
349 #define kSCNetworkConnectionAppPropertyRuleID CFSTR("RuleID")
350 #define kSCNetworkConnectionAppPropertyCodeDirHash CFSTR("CodeDirHash")
351 #define kSCNetworkConnectionAppPropertySigningID CFSTR("SigningID")
352 #define kSCNetworkConnectionAppPropertyAuditToken CFSTR("AuditToken")
353 #define kSCNetworkConnectionAppPropertyPID CFSTR("ProcessID")
354 #define kSCNetworkConnectionAppPropertyUUID CFSTR("UUID")
357 SCNetworkConnectionGetServiceIdentifier (SCNetworkConnectionRef connection
) __OSX_AVAILABLE_STARTING(__MAC_10_9
,__IPHONE_7_0
);
360 #pragma mark SCNetworkConnection "VPN on Demand" SPIs
365 * in the SCDynamicStore we will have :
367 * <key>State:/Network/Global/OnDemand</key>
369 * <key>Triggers</key>
372 * <key>ServiceID</key>
373 * <string>A740678C-1983-492B-BF64-B825AAE7101E</string>
375 * <integer>8</integer>
376 * <key>RemoteAddress</key>
377 * <string>vpn.mycompany.com</string>
378 * <key>OnDemandMatchDomainsAlways</key>
380 * <string>internal.mycompany.com</string>
382 * <key>OnDemandMatchDomainsOnRetry</key>
384 * <string>mycompany.com</string>
386 * <key>kSCNetworkConnectionOnDemandMatchDomainsNever</key>
388 * <string>external.mycompany.com</string>
390 * <key>OnDemandMatchAppEnabled</key>
391 * <integer>0</integer>
398 #define kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY "com.apple.system.SCNetworkConnectionOnDemand"
400 // SCNetworkConnection status
401 // (included in the dictionary returned by SCNetworkConnectionCopyExtendedStatus)
402 #define kSCNetworkConnectionStatus CFSTR("Status") /* CFNumber */
404 // a CFArray[CFDictionary] of VPN on Demand "trigger" configurations
405 #define kSCNetworkConnectionOnDemandTriggers CFSTR("Triggers") /* CFArray[CFDictionary] */
408 #define kSCNetworkConnectionOnDemandServiceID CFSTR("ServiceID") /* CFString */
410 // VPN service status (idle, connecting, connected, disconnecting)
411 #define kSCNetworkConnectionOnDemandStatus CFSTR("Status") /* CFNumber */
413 // VPN server address
414 #define kSCNetworkConnectionOnDemandRemoteAddress CFSTR("RemoteAddress") /* CFString */
416 // Reachability flags for the VPN server
417 #define kSCNetworkConnectionOnDemandReachFlags CFSTR("ReachFlags") /* CFNumber */
419 // Reachability interface index for the VPN server
420 #define kSCNetworkConnectionOnDemandReachInterfaceIndex CFSTR("ReachInterfaceIndex") /* CFNumber */
422 // Network detection has detected DNS Redirecting (like OpenDNS)
423 #define kSCNetworkConnectionOnDemandDNSRedirectDetected CFSTR("DNSRedirectDetected") /* CFBoolean */
425 // a dictionary of address information for known lying results
426 #define kSCNetworkConnectionOnDemandDNSRedirectedAddresses CFSTR("DNSRedirectedAddresses") /* CFDictionary[CFDictionary] */
428 // A dictionary of routes tunneled over this service in the past
429 #define kSCNetworkConnectionOnDemandTunneledNetworks CFSTR("TunneledNetworks") /* CFDictionary[CFDictionary] */
431 // An array of plugin PIDs
432 #define kSCNetworkConnectionOnDemandPluginPIDs CFSTR("PluginPIDs") /* CFArray[CFNumber] */
434 // A dictionary of results, keyed by probe string
435 #define kSCNetworkConnectionOnDemandProbeResults CFSTR("ProbeResults") /* CFDictionary[CFBoolean] */
437 /* The following generic NetworkInfo keys are currently used in the dynamic store as follows:
439 kSCNetworkConnectionOnDemandTunneledNetworks (CFDictionary)
440 - kSCNetworkConnectionNetworkInfoIPv4 (CFDictionary)
441 - kSCNetworkConnectionNetworkInfoIncludedRoutes (CFDictionary)
442 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
443 - kSCNetworkConnectionNetworkInfoMasks (CFData)
444 - kSCNetworkConnectionNetworkInfoExcludedRoutes (CFDictionary)
445 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
446 - kSCNetworkConnectionNetworkInfoMasks (CFData)
447 - kSCNetworkConnectionNetworkInfoIPv6 (CFDictionary)
450 kSCNetworkConnectionOnDemandDNSRedirectedAddresses (CFDictionary)
451 - kSCNetworkConnectionNetworkInfoIPv4 (CFDictionary)
452 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
453 - kSCNetworkConnectionNetworkInfoIPv6 (CFDictionary)
454 - kSCNetworkConnectionNetworkInfoAddresses (CFData)
456 #define kSCNetworkConnectionNetworkInfoIPv4 CFSTR("IPv4") /* CFDictionary[CFType] */
457 #define kSCNetworkConnectionNetworkInfoIPv6 CFSTR("IPv6") /* CFDictionary[CFType] */
458 #define kSCNetworkConnectionNetworkInfoIncludedRoutes CFSTR("IncludedRoutes") /* CFDictionary[CFData] */
459 #define kSCNetworkConnectionNetworkInfoExcludedRoutes CFSTR("ExcludedRoutes") /* CFDictionary[CFData] */
460 #define kSCNetworkConnectionNetworkInfoAddresses CFSTR("Addresses") /* CFData */
461 #define kSCNetworkConnectionNetworkInfoMasks CFSTR("Masks") /* CFData */
463 // a CFArray[CFString] representing those domain (or host) names that, if
464 // matched to a target hostname, should result in our first establishing
465 // the VPN connection before any DNS queries are issued.
466 #define kSCNetworkConnectionOnDemandMatchDomainsAlways CFSTR("OnDemandMatchDomainsAlways") /* CFArray[CFString] */
468 // a CFArray[CFString] representing those domain (or host) names that, if
469 // matched to a target hostname, should result in a DNS query regardless of
470 // whether the VPN connection has been established. If the DNS query returns
471 // an [EAI_NONAME] error then we should establish the VPN connection and
472 // re-issue / retry the query.
473 #define kSCNetworkConnectionOnDemandMatchDomainsOnRetry CFSTR("OnDemandMatchDomainsOnRetry") /* CFArray[CFString] */
475 // a CFArray[CFString] representing those domain (or host) names that should
476 // be excluded from those that would be used to establish tje VPN connection.
477 #define kSCNetworkConnectionOnDemandMatchDomainsNever CFSTR("OnDemandMatchDomainsNever") /* CFArray[CFString] */
479 // A CFNumber (0 or 1) indicating whether or not the App Layer rules should be
480 // used to decide whether or not to establish the tunnel connection.
481 #define kSCNetworkConnectionOnDemandMatchAppEnabled CFSTR("OnDemandMatchAppEnabled") /* CFNumber */
484 __SCNetworkConnectionCopyOnDemandInfoWithName (SCDynamicStoreRef
*storeP
,
485 CFStringRef nodeName
,
486 Boolean onDemandRetry
,
487 CFStringRef
*connectionServiceID
,
488 SCNetworkConnectionStatus
*connectionStatus
,
489 CFStringRef
*vpnRemoteAddress
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_2_0
);
491 #if !TARGET_IPHONE_SIMULATOR
492 SCNetworkConnectionStatus
493 SCNetworkConnectionGetStatusFromNEStatus (ne_session_status_t status
) __OSX_AVAILABLE_STARTING(__MAC_10_10
,__IPHONE_8_0
);
494 #endif /* !TARGET_IPHONE_SIMULATOR */
497 #pragma mark SCUserPreferences SPIs
501 SCUserPreferencesRemove (SCUserPreferencesRef userPreferences
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
504 SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
507 SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
510 SCUserPreferencesGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
513 SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
516 SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
519 SCUserPreferencesSetName (SCUserPreferencesRef userPreferences
,
520 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
523 SCNetworkConnectionStartWithUserPreferences (SCNetworkConnectionRef connection
,
524 SCUserPreferencesRef userPreferences
,
525 Boolean linger
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
528 SCUserPreferencesCopyInterfaceConfiguration (SCUserPreferencesRef userPreferences
,
529 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
532 SCUserPreferencesSetInterfaceConfiguration (SCUserPreferencesRef userPreferences
,
533 SCNetworkInterfaceRef interface
,
534 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
537 SCUserPreferencesCopyExtendedInterfaceConfiguration
538 (SCUserPreferencesRef userPreferences
,
539 SCNetworkInterfaceRef interface
,
540 CFStringRef extendedType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
543 SCUserPreferencesSetExtendedInterfaceConfiguration
544 (SCUserPreferencesRef userPreferences
,
545 SCNetworkInterfaceRef interface
,
546 CFStringRef extendedType
,
547 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
551 #pragma mark SCUserPreferences + SCNetworkInterface Password SPIs
555 SCUserPreferencesCheckInterfacePassword (SCUserPreferencesRef userPreferences
,
556 SCNetworkInterfaceRef interface
,
557 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
560 SCUserPreferencesCopyInterfacePassword (SCUserPreferencesRef userPreferences
,
561 SCNetworkInterfaceRef interface
,
562 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
565 SCUserPreferencesRemoveInterfacePassword (SCUserPreferencesRef userPreferences
,
566 SCNetworkInterfaceRef interface
,
567 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
570 SCUserPreferencesSetInterfacePassword (SCUserPreferencesRef userPreferences
,
571 SCNetworkInterfaceRef interface
,
572 SCNetworkInterfacePasswordType passwordType
,
574 CFDictionaryRef options
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
578 #endif /* _SCNETWORKCONNECTIONPRIVATE_H */