2 * Copyright (c) 2005-2011 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 _SCNETWORKCONFIGURATIONPRIVATE_H
25 #define _SCNETWORKCONFIGURATIONPRIVATE_H
27 #include <Availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32 #include <SystemConfiguration/SCValidation.h>
33 #include <IOKit/IOKitLib.h>
36 @header SCNetworkConfigurationPrivate
43 @group Interface configuration
47 #pragma mark SCNetworkInterface configuration (typedefs, consts, enums)
50 @const kSCNetworkInterfaceTypeBridge
52 extern const CFStringRef kSCNetworkInterfaceTypeBridge
__OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
55 @const kSCNetworkInterfaceTypeLoopback
57 extern const CFStringRef kSCNetworkInterfaceTypeLoopback
__OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
60 @const kSCNetworkInterfaceLoopback
61 @discussion A network interface representing the loopback
64 extern const SCNetworkInterfaceRef kSCNetworkInterfaceLoopback
__OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
67 @const kSCNetworkInterfaceTypeVPN
69 extern const CFStringRef kSCNetworkInterfaceTypeVPN
__OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
72 @group Interface configuration (Bridge)
76 @typedef SCBridgeInterfaceRef
77 @discussion This is the type of a reference to an object that represents
80 typedef SCNetworkInterfaceRef SCBridgeInterfaceRef
;
83 kSCNetworkServicePrimaryRankDefault
= 0,
84 kSCNetworkServicePrimaryRankFirst
= 1,
85 kSCNetworkServicePrimaryRankLast
= 2,
86 kSCNetworkServicePrimaryRankNever
= 3
88 typedef uint32_t SCNetworkServicePrimaryRank
;
91 #pragma mark SCNetworkInterface configuration (SPI)
94 @group Interface configuration
97 static __inline__ CFTypeRef
98 isA_SCNetworkInterface(CFTypeRef obj
)
100 return (isA_CFType(obj
, SCNetworkInterfaceGetTypeID()));
103 static __inline__ CFTypeRef
104 isA_SCBondInterface(CFTypeRef obj
)
106 CFStringRef interfaceType
;
108 if (!isA_SCNetworkInterface(obj
)) {
109 // if not an SCNetworkInterface
113 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
114 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBond
)) {
122 static __inline__ CFTypeRef
123 isA_SCBridgeInterface(CFTypeRef obj
)
125 CFStringRef interfaceType
;
127 if (!isA_SCNetworkInterface(obj
)) {
128 // if not an SCNetworkInterface
132 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
133 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBridge
)) {
141 static __inline__ CFTypeRef
142 isA_SCVLANInterface(CFTypeRef obj
)
144 CFStringRef interfaceType
;
146 if (!isA_SCNetworkInterface(obj
)) {
147 // if not an SCNetworkInterface
151 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
152 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeVLAN
)) {
161 @function _SCNetworkInterfaceCompare
162 @discussion Compares two SCNetworkInterface objects.
163 @param val1 The SCNetworkInterface object.
164 @param val2 The SCNetworkInterface object.
165 @param context Not used.
166 @result A comparison result.
169 _SCNetworkInterfaceCompare (const void *val1
,
171 void *context
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
174 @function _SCNetworkInterfaceCopyActive
175 @discussion Creates an SCNetworkInterface and associated with interface name
176 and SCDynamicStoreRef
177 @param the interface name
178 @param the SCDynamicStoreRef
179 @result the SCNetworkInterface
181 SCNetworkInterfaceRef
182 _SCNetworkInterfaceCopyActive (SCDynamicStoreRef store
,
183 CFStringRef bsdName
) __OSX_AVAILABLE_STARTING(__MAC_10_8
,__IPHONE_5_0
);
186 @function _SCNetworkInterfaceCopyAllWithPreferences
187 Returns all network capable interfaces on the system.
188 @param prefs The "preferences" session.
189 @result The list of interfaces on the system.
190 You must release the returned value.
192 CFArrayRef
/* of SCNetworkInterfaceRef's */
193 _SCNetworkInterfaceCopyAllWithPreferences (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
/*SPI*/);
196 @function _SCNetworkInterfaceCopySlashDevPath
197 @discussion Returns the /dev pathname for the interface.
198 @param interface The network interface.
199 @result The /dev pathname associated with the interface (e.g. "/dev/modem");
200 NULL if no path is available.
203 _SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_3_0
);
205 #define kIncludeNoVirtualInterfaces 0x0
206 #define kIncludeVLANInterfaces 0x1
207 #define kIncludeBondInterfaces 0x2
208 #define kIncludeBridgeInterfaces 0x4
209 #define kIncludeAllVirtualInterfaces 0xffffffff
212 @function _SCNetworkInterfaceCreateWithBSDName
213 @discussion Create a new network interface associated with the provided
214 BSD interface name. This API supports Ethernet, FireWire, and
215 IEEE 802.11 interfaces.
216 @param bsdName The BSD interface name.
217 @param flags Indicates whether virtual (Bond, Bridge, VLAN)
218 network interfaces should be included.
219 @result A reference to the new SCNetworkInterface.
220 You must release the returned value.
222 SCNetworkInterfaceRef
223 _SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator
,
225 UInt32 flags
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
228 @function _SCNetworkInterfaceCreateWithEntity
229 @discussion Create a new network interface associated with the provided
230 SCDynamicStore service entity dictionary.
231 @param interface_entity The entity dictionary.
232 @param service The network service.
233 @result A reference to the new SCNetworkInterface.
234 You must release the returned value.
236 SCNetworkInterfaceRef
237 _SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator
,
238 CFDictionaryRef interface_entity
,
239 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
242 @function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
243 @discussion Create a new network interface associated with the provided
244 IORegistry "IONetworkInterface" object.
245 @param if_obj The IONetworkInterface object.
246 @result A reference to the new SCNetworkInterface.
247 You must release the returned value.
249 SCNetworkInterfaceRef
250 _SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
253 @function SCNetworkInterfaceGetPrimaryRank
254 @discussion We allow caller to retrieve the rank on an interface.
255 The key is stored in State:/Network/Interface/<ifname>/Service
256 @param the interface to get the rank
257 @result SCNetworkServicePrimaryRank
259 SCNetworkServicePrimaryRank
260 SCNetworkInterfaceGetPrimaryRank (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_8
,__IPHONE_5_0
);
263 @function SCNetworkInterfaceSetPrimaryRank
264 @discussion We allow caller to set an assertion on an interface.
265 @param the interface to set the rank assertion
266 @param the new rank to be set
267 @result TRUE if operation is successful; FALSE if an error was encountered.
270 SCNetworkInterfaceSetPrimaryRank (SCNetworkInterfaceRef interface
,
271 SCNetworkServicePrimaryRank newRank
) __OSX_AVAILABLE_STARTING(__MAC_10_8
,__IPHONE_5_0
);
273 #define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
274 #define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
275 #define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
276 #define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
278 #define kSCNetworkInterfaceNetworkConfigurationOverridesKey CFSTR("NetworkConfigurationOverrides")
279 #define kSCNetworkInterfaceHiddenConfigurationKey CFSTR("HiddenConfiguration")
280 #define kSCNetworkInterfaceHiddenPortKey CFSTR("HiddenPort")
282 // IORegistry property to indicate that a [WWAN] interface is not yet ready
283 #define kSCNetworkInterfaceInitializingKey CFSTR("Initializing")
286 @function _SCNetworkInterfaceCopyInterfaceInfo
287 @discussion Returns interface details
288 @param interface The network interface.
289 @result A dictionary with details about the network interface.
292 _SCNetworkInterfaceCopyInterfaceInfo (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_3_0
);
295 @function _SCNetworkInterfaceGetConfigurationAction
296 @discussion Returns a user-notification / auto-configuration action for the interface.
297 @param interface The network interface.
298 @result The user-notification / auto-configuration action;
299 NULL if the default action should be used.
302 _SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_2_0
);
305 @function _SCNetworkInterfaceGetHardwareAddress
306 @discussion Returns a link layer address for the interface.
307 @param interface The network interface.
308 @result The hardware (MAC) address for the interface.
309 NULL if no hardware address is available.
312 _SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
315 @function _SCNetworkInterfaceGetIOInterfaceType
316 @discussion Returns the IOInterfaceType for the interface.
317 @param interface The network interface.
318 @result The IOInterfaceType associated with the interface
321 _SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
324 @function _SCNetworkInterfaceGetIOInterfaceUnit
325 @discussion Returns the IOInterfaceUnit for the interface.
326 @param interface The network interface.
327 @result The IOInterfaceUnit associated with the interface;
328 NULL if no IOLocation is available.
331 _SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
334 @function _SCNetworkInterfaceGetIOPath
335 @discussion Returns the IOPath for the interface.
336 @param interface The network interface.
337 @result The IOPath associated with the interface;
338 NULL if no IOPath is available.
341 _SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
344 @function _SCNetworkInterfaceGetIORegistryEntryID
345 @discussion Returns the IORegistry entry ID for the interface.
346 @param interface The network interface.
347 @result The IORegistry entry ID associated with the interface;
348 Zero if no entry ID is available.
351 _SCNetworkInterfaceGetIORegistryEntryID (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_8
,__IPHONE_5_0
);
354 @function _SCNetworkInterfaceIsBluetoothPAN
355 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
356 @param interface The network interface.
357 @result TRUE if the interface is a Bluetooth PAN device.
360 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_3_0
);
363 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
364 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
365 @param interface The network interface.
366 @result TRUE if the interface is a Bluetooth PAN-NAP device.
369 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
);
372 @function _SCNetworkInterfaceIsBluetoothP2P
373 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
374 @param interface The network interface.
375 @result TRUE if the interface is a Bluetooth P2P device.
378 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
);
381 @function _SCNetworkInterfaceIsBuiltin
382 @discussion Identifies if a network interface is "built-in".
383 @param interface The network interface.
384 @result TRUE if the interface is "built-in".
387 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
390 @function _SCNetworkInterfaceIsHiddenConfiguration
391 @discussion Identifies if the configuration of a network interface should be
392 hidden from any user interface (e.g. the "Network" pref pane).
393 @param interface The network interface.
394 @result TRUE if the interface configuration should be hidden.
397 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
);
400 @function _SCNetworkInterfaceIsModemV92
401 @discussion Identifies if a modem network interface supports
403 @param interface The network interface.
404 @result TRUE if the interface is "v.92" modem.
407 _SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
410 @function _SCNetworkInterfaceIsTethered
411 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
412 @param interface The network interface.
413 @result TRUE if the interface is a tethered device.
416 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_3_0
);
419 @function _SCNetworkInterfaceIsPhysicalEthernet
420 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
421 @param interface The network interface.
422 @result TRUE if the interface is a real ethernet interface.
425 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
);
428 @function _SCNetworkInterfaceForceConfigurationRefresh
429 @discussion Forces a configuration refresh of the
431 @param ifName Network interface name.
432 @result TRUE if the refresh was successfully posted.
435 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
438 @function SCNetworkInterfaceCopyCapability
439 @discussion For the specified network interface, returns information
440 about the currently requested capabilities, the active capabilities,
441 and the capabilities which are available.
442 @param interface The desired network interface.
443 @param capability The desired capability.
444 @result a CFTypeRef representing the current value of requested
446 NULL if the capability is not available for this
447 interface or if an error was encountered.
448 You must release the returned value.
451 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface
,
452 CFStringRef capability
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
/*SPI*/);
455 @function SCNetworkInterfaceSetCapability
456 @discussion For the specified network interface, sets the requested
458 @param interface The desired network interface.
459 @param capability The desired capability.
460 @param newValue The new requested setting for the capability;
461 NULL to restore the default setting.
462 @result TRUE if the configuration was updated; FALSE if an error was encountered.
465 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface
,
466 CFStringRef capability
,
467 CFTypeRef newValue
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_5_0
/*SPI*/);
470 #pragma mark SCBondInterface configuration (SPIs)
473 @function _SCBondInterfaceCopyActive
474 @discussion Returns all Ethernet Bond interfaces on the system.
475 @result The list of SCBondInterface interfaces on the system.
476 You must release the returned value.
479 _SCBondInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
482 @function _SCBondInterfaceUpdateConfiguration
483 @discussion Updates the bond interface configuration.
484 @param prefs The "preferences" session.
485 @result TRUE if the bond interface configuration was updated.; FALSE if the
486 an error was encountered.
489 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
492 @function SCBondInterfaceGetMode
493 @discussion Return the mode for the given bond interface.
494 @param bond The bond interface to get the mode from.
495 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
498 SCBondInterfaceGetMode (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
501 @function SCBondInterfaceSetMode
502 @discussion Set the mode on the bond interface.
503 @param bond The bond interface on which to adjust the mode.
504 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
505 @result TRUE if operation succeeded.
508 SCBondInterfaceSetMode (SCBondInterfaceRef bond
,
509 CFNumberRef mode
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
512 #pragma mark SCBridgeInterface configuration (SPIs)
515 @function SCBridgeInterfaceCopyAll
516 @discussion Returns all bridge interfaces on the system.
517 @param prefs The "preferences" session.
518 @result The list of bridge interfaces on the system.
519 You must release the returned value.
521 CFArrayRef
/* of SCBridgeInterfaceRef's */
522 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
525 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
526 @discussion Returns all network capable devices on the system
527 that can be added to an bridge interface.
528 @param prefs The "preferences" session.
529 @result The list of interfaces.
530 You must release the returned value.
532 CFArrayRef
/* of SCNetworkInterfaceRef's */
533 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
536 @function SCBridgeInterfaceCreate
537 @discussion Create a new SCBridgeInterface interface.
538 @param prefs The "preferences" session.
539 @result A reference to the new SCBridgeInterface.
540 You must release the returned value.
543 SCBridgeInterfaceCreate (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
546 @function SCBridgeInterfaceRemove
547 @discussion Removes the SCBridgeInterface from the configuration.
548 @param bridge The SCBridgeInterface interface.
549 @result TRUE if the interface was removed; FALSE if an error was encountered.
552 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
555 @function SCBridgeInterfaceGetMemberInterfaces
556 @discussion Returns the member interfaces for the specified bridge interface.
557 @param bridge The SCBridgeInterface interface.
558 @result The list of interfaces.
560 CFArrayRef
/* of SCNetworkInterfaceRef's */
561 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
564 @function SCBridgeInterfaceGetOptions
565 @discussion Returns the configuration settings associated with a bridge interface.
566 @param bridge The SCBridgeInterface interface.
567 @result The configuration settings associated with the bridge interface;
568 NULL if no changes to the default configuration have been saved.
571 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
574 @function SCBridgeInterfaceSetMemberInterfaces
575 @discussion Sets the member interfaces for the specified bridge interface.
576 @param bridge The SCBridgeInterface interface.
577 @param members The desired member interfaces.
578 @result TRUE if the configuration was stored; FALSE if an error was encountered.
581 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge
,
582 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
583 __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
586 @function SCBridgeInterfaceSetLocalizedDisplayName
587 @discussion Sets the localized display name for the specified bridge interface.
588 @param bridge The SCBridgeInterface interface.
589 @param newName The new display name.
590 @result TRUE if the configuration was stored; FALSE if an error was encountered.
593 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge
,
594 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
597 @function SCBridgeInterfaceSetOptions
598 @discussion Sets the configuration settings for the specified bridge interface.
599 @param bridge The SCBridgeInterface interface.
600 @param newOptions The new configuration settings.
601 @result TRUE if the configuration was stored; FALSE if an error was encountered.
604 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge
,
605 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
610 @function _SCBridgeInterfaceCopyActive
611 @discussion Returns all bridge interfaces on the system.
612 @result The list of SCBridgeInterface interfaces on the system.
613 You must release the returned value.
616 _SCBridgeInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
619 @function _SCBridgeInterfaceUpdateConfiguration
620 @discussion Updates the bridge interface configuration.
621 @param prefs The "preferences" session.
622 @result TRUE if the bridge interface configuration was updated.; FALSE if the
623 an error was encountered.
626 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
/*SPI*/);
630 #pragma mark SCVLANInterface configuration (SPIs)
633 @function _SCVLANInterfaceCopyActive
634 @discussion Returns all VLAN interfaces on the system.
635 @result The list of SCVLANInterface interfaces on the system.
636 You must release the returned value.
639 _SCVLANInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
642 @function _SCVLANInterfaceUpdateConfiguration
643 @discussion Updates the VLAN interface configuration.
644 @param prefs The "preferences" session.
645 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
646 an error was encountered.
649 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
653 #pragma mark SCNetworkInterface Password SPIs
657 kSCNetworkInterfacePasswordTypePPP
= 1,
658 kSCNetworkInterfacePasswordTypeIPSecSharedSecret
,
659 kSCNetworkInterfacePasswordTypeEAPOL
,
660 kSCNetworkInterfacePasswordTypeIPSecXAuth
,
661 kSCNetworkInterfacePasswordTypeVPN
,
663 typedef uint32_t SCNetworkInterfacePasswordType
;
666 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface
,
667 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
670 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface
,
671 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
674 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface
,
675 SCNetworkInterfacePasswordType passwordType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
678 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface
,
679 SCNetworkInterfacePasswordType passwordType
,
681 CFDictionaryRef options
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
685 #pragma mark SCNetworkProtocol configuration (SPI)
689 @group Protocol configuration
693 static __inline__ CFTypeRef
694 isA_SCNetworkProtocol(CFTypeRef obj
)
696 return (isA_CFType(obj
, SCNetworkProtocolGetTypeID()));
701 #pragma mark SCNetworkService configuration (SPI)
705 @group Service configuration
709 static __inline__ CFTypeRef
710 isA_SCNetworkService(CFTypeRef obj
)
712 return (isA_CFType(obj
, SCNetworkServiceGetTypeID()));
716 @function _SCNetworkServiceCompare
717 @discussion Compares two SCNetworkService objects.
718 @param val1 The SCNetworkService object.
719 @param val2 The SCNetworkService object.
720 @param context The service order (from SCNetworkSetGetServiceOrder).
721 @result A comparison result.
724 _SCNetworkServiceCompare (const void *val1
,
726 void *context
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
);
729 @function _SCNetworkServiceCopyActive
730 @discussion Returns the network service with the specified identifier.
732 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
733 API in that queries and operations interact with the "active" service
734 represented in the SCDynamicStore. Only a limited subset of the
735 SCNetworkService APIs are supported.
736 @param prefs The dynamic store session.
737 @param serviceID The unique identifier for the service.
738 @result A reference to the SCNetworkService represented in the SCDynamicStore;
739 NULL if the serviceID does not exist in the SCDynamicStore or if an
740 error was encountered.
741 You must release the returned value.
744 _SCNetworkServiceCopyActive (SCDynamicStoreRef store
,
745 CFStringRef serviceID
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_2_1
);
748 @function SCNetworkServiceGetPrimaryRank
749 @discussion Returns the primary service rank associated with a service.
750 @param service The network service.
751 @result The primary service rank associated with the specified application;
752 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
753 application or an error was encountered.
755 SCNetworkServicePrimaryRank
756 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_2_0
);
759 @function SCNetworkServiceSetPrimaryRank
760 @discussion Updates the the primary service rank associated with a service.
761 @param service The network service.
762 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
763 if the default service rank should be used.
764 @result TRUE if the rank was stored; FALSE if an error was encountered.
766 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
767 values can only valid as a transient setting.
770 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service
,
771 SCNetworkServicePrimaryRank newRank
) __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_2_0
);
774 @function _SCNetworkServiceIsVPN
775 @discussion Identifies a VPN service.
776 @param service The network service.
777 @result TRUE if the service is a VPN.
780 _SCNetworkServiceIsVPN (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
);
783 #pragma mark SCNetworkSet configuration (SPI)
787 @group Set configuration
791 static __inline__ CFTypeRef
792 isA_SCNetworkSet(CFTypeRef obj
)
794 return (isA_CFType(obj
, SCNetworkSetGetTypeID()));
799 @function SCNetworkSetEstablishDefaultConfiguration
800 @discussion Updates a network set by adding services for
801 any network interface that is not currently
803 If the provided set contains one (or more) services, new
804 services will only be added for those interfaces that are
805 not represented in *any* set.
806 Otherwise, new services will be added for those interfaces
807 that are not represented in the provided set.
808 The new services are established with "default" configuration
810 @param set The network set.
811 @result TRUE if the configuration was updated; FALSE if no
812 changes were required or if an error was encountered.
815 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
818 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
819 @discussion Updates a network set by adding services for
820 the specified network interface if is not currently
822 If the provided set contains one (or more) services, new
823 services will only be added for interfaces that are not
824 represented in *any* set.
825 Otherwise, new services will be added for interfaces that
826 are not represented in the provided set.
827 The new services are established with "default" configuration
829 @param set The network set.
830 @param interface The network interface.
831 @result TRUE if the configuration was updated; FALSE if no
832 changes were required or if an error was encountered.
835 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set
,
836 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
);
839 @function SCNetworkSetCopySelectedVPNService
840 @discussion On the iPhone we only allow a single VPN network service
841 to be selected at any given time. This API will identify
842 the selected VPN service.
843 @param set The network set.
844 @result The selected VPN service; NULL if no service has been
846 You must release the returned value.
849 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
);
852 @function SCNetworkSetSetSelectedVPNService
853 @discussion On the iPhone we only allow a single VPN network service
854 to be selected at any given time. This API should be used to
855 select a VPN service.
856 @param set The network set.
857 @param service The VPN service to be selected.
858 @result TRUE if the name was saved; FALSE if an error was encountered.
861 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set
,
862 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_4_0
);
865 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */