2 * Copyright (c) 2005-2018 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 <os/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
API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
56 @const kSCNetworkInterfaceTypeLoopback
58 extern const CFStringRef kSCNetworkInterfaceTypeLoopback
API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
61 @const kSCNetworkInterfaceLoopback
62 @discussion A network interface representing the loopback
65 extern const SCNetworkInterfaceRef kSCNetworkInterfaceLoopback
API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
68 @const kSCNetworkInterfaceTypeVPN
70 extern const CFStringRef kSCNetworkInterfaceTypeVPN
API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
73 @group Interface configuration (Bridge)
77 @typedef SCBridgeInterfaceRef
78 @discussion This is the type of a reference to an object that represents
81 typedef SCNetworkInterfaceRef SCBridgeInterfaceRef
;
83 typedef CF_ENUM(uint32_t, SCNetworkServicePrimaryRank
) {
84 kSCNetworkServicePrimaryRankDefault
= 0,
85 kSCNetworkServicePrimaryRankFirst
= 1,
86 kSCNetworkServicePrimaryRankLast
= 2,
87 kSCNetworkServicePrimaryRankNever
= 3,
88 kSCNetworkServicePrimaryRankScoped
= 4
92 #pragma mark SCNetworkInterface configuration (SPI)
95 @group Interface configuration
98 static __inline__ CFTypeRef
99 isA_SCNetworkInterface(CFTypeRef obj
)
101 return (isA_CFType(obj
, SCNetworkInterfaceGetTypeID()));
104 static __inline__ CFTypeRef
105 isA_SCBondInterface(CFTypeRef obj
)
107 CFStringRef interfaceType
;
109 if (!isA_SCNetworkInterface(obj
)) {
110 // if not an SCNetworkInterface
114 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
115 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBond
)) {
123 static __inline__ CFTypeRef
124 isA_SCBridgeInterface(CFTypeRef obj
)
126 CFStringRef interfaceType
;
128 if (!isA_SCNetworkInterface(obj
)) {
129 // if not an SCNetworkInterface
133 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
134 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBridge
)) {
142 static __inline__ CFTypeRef
143 isA_SCVLANInterface(CFTypeRef obj
)
145 CFStringRef interfaceType
;
147 if (!isA_SCNetworkInterface(obj
)) {
148 // if not an SCNetworkInterface
152 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
153 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeVLAN
)) {
162 @function _SCNetworkInterfaceCompare
163 @discussion Compares two SCNetworkInterface objects.
164 @param val1 The SCNetworkInterface object.
165 @param val2 The SCNetworkInterface object.
166 @param context Not used.
167 @result A comparison result.
170 _SCNetworkInterfaceCompare (const void *val1
,
172 void *context
) API_AVAILABLE(macos(10.5), ios(2.0));
175 @function _SCNetworkInterfaceCopyActive
176 @discussion Creates an SCNetworkInterface and associated with interface name
177 and SCDynamicStoreRef
178 @param store The SCDynamicStoreRef
179 @param bsdName The interface name
180 @result the SCNetworkInterface
182 SCNetworkInterfaceRef
183 _SCNetworkInterfaceCopyActive (SCDynamicStoreRef store
,
184 CFStringRef bsdName
) API_AVAILABLE(macos(10.8), ios(5.0));
187 @function _SCNetworkInterfaceCopyAllWithPreferences
188 Returns all network capable interfaces on the system.
189 @param prefs The "preferences" session.
190 @result The list of interfaces on the system.
191 You must release the returned value.
193 CFArrayRef
/* of SCNetworkInterfaceRef's */
194 _SCNetworkInterfaceCopyAllWithPreferences (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
197 @function _SCNetworkInterfaceCopyBTPANInterface
198 @discussion Returns the SCNetworkInterface associated with the BT-PAN interface
199 @result The BT-PAN interface; NULL if the interface is not (yet) known.
201 SCNetworkInterfaceRef
202 _SCNetworkInterfaceCopyBTPANInterface (void) API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
205 @function _SCNetworkInterfaceCopySlashDevPath
206 @discussion Returns the /dev pathname for the interface.
207 @param interface The network interface.
208 @result The /dev pathname associated with the interface (e.g. "/dev/modem");
209 NULL if no path is available.
212 _SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
214 #define kIncludeNoVirtualInterfaces 0x0
215 #define kIncludeVLANInterfaces 0x1
216 #define kIncludeBondInterfaces 0x2
217 #define kIncludeBridgeInterfaces 0x4
218 #define kIncludeAllVirtualInterfaces 0xffffffff
221 @function _SCNetworkInterfaceCreateWithBSDName
222 @discussion Create a new network interface associated with the provided
223 BSD interface name. This API supports Ethernet, FireWire, and
224 IEEE 802.11 interfaces.
225 @param bsdName The BSD interface name.
226 @param flags Indicates whether virtual (Bond, Bridge, VLAN)
227 network interfaces should be included.
228 @result A reference to the new SCNetworkInterface.
229 You must release the returned value.
231 SCNetworkInterfaceRef
232 _SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator
,
234 UInt32 flags
) API_AVAILABLE(macos(10.5), ios(2.0));
237 @function _SCNetworkInterfaceCreateWithEntity
238 @discussion Create a new network interface associated with the provided
239 SCDynamicStore service entity dictionary.
240 @param interface_entity The entity dictionary.
241 @param service The network service.
242 @result A reference to the new SCNetworkInterface.
243 You must release the returned value.
245 SCNetworkInterfaceRef
246 _SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator
,
247 CFDictionaryRef interface_entity
,
248 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.5), ios(2.0));
251 @function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
252 @discussion Create a new network interface associated with the provided
253 IORegistry "IONetworkInterface" object.
254 @param if_obj The IONetworkInterface object.
255 @result A reference to the new SCNetworkInterface.
256 You must release the returned value.
258 SCNetworkInterfaceRef
259 _SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj
) API_AVAILABLE(macos(10.5), ios(2.0));
262 @function SCNetworkInterfaceGetPrimaryRank
263 @discussion We allow caller to retrieve the rank on an interface.
264 @param interface The interface to get the rank
265 @result SCNetworkServicePrimaryRank
267 SCNetworkServicePrimaryRank
268 SCNetworkInterfaceGetPrimaryRank (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(5.0));
271 @function SCNetworkInterfaceSetPrimaryRank
272 @discussion We allow caller to set an assertion on an interface.
273 The rank assertion lives as long as the SCNetworkInterfaceRef
275 @param interface The interface to set the rank assertion
276 @param newRank The new rank to be set
277 @result TRUE if operation is successful; FALSE if an error was encountered.
280 SCNetworkInterfaceSetPrimaryRank (SCNetworkInterfaceRef interface
,
281 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.8), ios(5.0));
284 ** SCNetworkInterfaceAdvisory
287 typedef CF_ENUM(uint32_t, SCNetworkInterfaceAdvisory
) {
288 kSCNetworkInterfaceAdvisoryNone
= 0,
289 kSCNetworkInterfaceAdvisoryLinkLayerIssue
= 1,
290 kSCNetworkInterfaceAdvisoryUplinkIssue
= 2,
294 @function SCNetworkInterfaceSetAdvisory
295 @discussion Advise the system of some condition on the network interface
296 that warrants changing how the interface is used for IP networking,
297 and to clear a previously set advisory.
298 Calling this function requires root or having the boolean entitlement
299 "com.apple.SystemConfiguration.SCNetworkInterfaceSetAdvisory" = true.
300 @param interface The interface to assert the advisory on.
301 @param advisory The advisory to indicate on the interface, use
302 kSCNetworkInterfaceAdvisoryNone to clear advisory.
303 @param reason A string indicating the reason for setting the advisory,
304 used to aid debugging.
305 @result TRUE if the advisory change was successful; FALSE otherwise.
308 SCNetworkInterfaceSetAdvisory(SCNetworkInterfaceRef interface
,
309 SCNetworkInterfaceAdvisory advisory
,
311 API_AVAILABLE(macos(10.14), ios(12.0));
314 @function SCNetworkInterfaceAdvisoryIsSet
315 @discussion Find out if there is an advisory set on the interface.
316 @param interface The interface to check for an advisory.
317 @result TRUE if an advisory is set; FALSE otherwise.
320 SCNetworkInterfaceAdvisoryIsSet(SCNetworkInterfaceRef interface
)
321 API_AVAILABLE(macos(10.14), ios(12.0));
324 @function SCNetworkInterfaceCopyAdvisoryNotificationKey
325 @discussion Get the SCDynamicStore notication key for advisory changes
326 made on the interface.
327 @param interface The interface for which to get the notification key.
328 @result Key used to receive advisory change notifications on the
332 SCNetworkInterfaceCopyAdvisoryNotificationKey(SCNetworkInterfaceRef interface
)
333 API_AVAILABLE(macos(10.14), ios(12.0));
336 #define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
337 #define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
338 #define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
339 #define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
341 #define kSCNetworkInterfaceNetworkConfigurationOverridesKey CFSTR("NetworkConfigurationOverrides")
342 #define kSCNetworkInterfaceHiddenConfigurationKey CFSTR("HiddenConfiguration")
343 #define kSCNetworkInterfaceHiddenPortKey CFSTR("HiddenPort") /* for serial ports */
344 #define kSCNetworkInterfaceHiddenInterfaceKey CFSTR("HiddenInterface") /* for network interfaces */
346 // IORegistry property to indicate that a [WWAN] interface is not yet ready
347 #define kSCNetworkInterfaceInitializingKey CFSTR("Initializing")
349 // IORegistry property to indicate that the attached host should be trusted before use
350 #define kSCNetworkInterfaceTrustRequiredKey CFSTR("TrustRequired")
353 @function _SCNetworkInterfaceCopyInterfaceInfo
354 @discussion Returns interface details
355 @param interface The network interface.
356 @result A dictionary with details about the network interface.
359 _SCNetworkInterfaceCopyInterfaceInfo (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
362 @function _SCNetworkInterfaceGetConfigurationAction
363 @discussion Returns a user-notification / auto-configuration action for the interface.
364 @param interface The network interface.
365 @result The user-notification / auto-configuration action;
366 NULL if the default action should be used.
369 _SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(2.0));
372 @function _SCNetworkInterfaceGetFamilyType
373 @discussion Returns the family type for the interface.
374 @param interface The network interface.
375 @result The family type (ift_family) associated with the interface;
376 NULL if no family type is available.
379 _SCNetworkInterfaceGetFamilyType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
382 @function _SCNetworkInterfaceGetFamilySubType
383 @discussion Returns the family subtype for the interface.
384 @param interface The network interface.
385 @result The family subtype (ift_subfamily) associated with the interface;
386 NULL if no family subtype is available.
389 _SCNetworkInterfaceGetFamilySubType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
392 @function _SCNetworkInterfaceGetHardwareAddress
393 @discussion Returns a link layer address for the interface.
394 @param interface The network interface.
395 @result The hardware (MAC) address for the interface.
396 NULL if no hardware address is available.
399 _SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
402 @function _SCNetworkInterfaceGetIOInterfaceNamePrefix
403 @discussion Returns the IOInterfaceNamePrefix for the interface.
404 @param interface The network interface.
405 @result The IOInterfaceNamePrefix associated with the interface;
406 NULL if no IOInterfaceNamePrefix is available.
409 _SCNetworkInterfaceGetIOInterfaceNamePrefix (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(6.0));
412 @function _SCNetworkInterfaceGetIOInterfaceType
413 @discussion Returns the IOInterfaceType for the interface.
414 @param interface The network interface.
415 @result The IOInterfaceType associated with the interface
418 _SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
421 @function _SCNetworkInterfaceGetIOInterfaceUnit
422 @discussion Returns the IOInterfaceUnit for the interface.
423 @param interface The network interface.
424 @result The IOInterfaceUnit associated with the interface;
425 NULL if no IOInterfaceUnit is available.
428 _SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
431 @function _SCNetworkInterfaceGetIOPath
432 @discussion Returns the IOPath for the interface.
433 @param interface The network interface.
434 @result The IOPath associated with the interface;
435 NULL if no IOPath is available.
438 _SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
441 @function _SCNetworkInterfaceGetIORegistryEntryID
442 @discussion Returns the IORegistry entry ID for the interface.
443 @param interface The network interface.
444 @result The IORegistry entry ID associated with the interface;
445 Zero if no entry ID is available.
448 _SCNetworkInterfaceGetIORegistryEntryID (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(5.0));
451 @function _SCNetworkInterfaceIsApplePreconfigured
452 @discussion Identifies if a network interface is internal/pre-configured.
453 @param interface The network interface.
454 @result TRUE if the interface is an internal/pre-configured.
457 _SCNetworkInterfaceIsApplePreconfigured (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
460 @function _SCNetworkInterfaceIsBluetoothPAN
461 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
462 @param interface The network interface.
463 @result TRUE if the interface is a Bluetooth PAN device.
466 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
469 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
470 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
471 @param interface The network interface.
472 @result TRUE if the interface is a Bluetooth PAN-NAP device.
475 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
478 @function _SCNetworkInterfaceIsBluetoothP2P
479 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
480 @param interface The network interface.
481 @result TRUE if the interface is a Bluetooth P2P device.
484 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
487 @function _SCNetworkInterfaceIsBuiltin
488 @discussion Identifies if a network interface is "built-in".
489 @param interface The network interface.
490 @result TRUE if the interface is "built-in".
493 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
496 @function _SCNetworkInterfaceIsHiddenConfiguration
497 @discussion Identifies if the configuration of a network interface should be
498 hidden from any user interface (e.g. the "Network" pref pane).
499 @param interface The network interface.
500 @result TRUE if the interface configuration should be hidden.
503 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(4.0));
506 @function _SCNetworkInterfaceIsTethered
507 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
508 @param interface The network interface.
509 @result TRUE if the interface is a tethered device.
512 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
515 @function _SCNetworkInterfaceIsThunderbolt
516 @discussion Identifies if a network interface is a Thunderbolt device
517 @param interface The network interface.
518 @result TRUE if the interface is a Thunderbolt device.
521 _SCNetworkInterfaceIsThunderbolt (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.9), ios(7.0));
524 @function _SCNetworkInterfaceIsTrustRequired
525 @discussion Identifies if a network interface requires that the
526 associated host be trusted.
527 @param interface The network interface.
528 @result TRUE if the interface requires trust.
531 _SCNetworkInterfaceIsTrustRequired (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.14)) API_AVAILABLE(ios(12.0));
534 @function _SCNetworkInterfaceIsPhysicalEthernet
535 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
536 @param interface The network interface.
537 @result TRUE if the interface is a real ethernet interface.
540 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
543 @function _SCNetworkInterfaceForceConfigurationRefresh
544 @discussion Forces a configuration refresh of the
546 @param ifName Network interface name.
547 @result TRUE if the refresh was successfully posted.
550 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName
) API_AVAILABLE(macos(10.5), ios(2.0));
553 @function SCNetworkInterfaceCopyCapability
554 @discussion For the specified network interface, returns information
555 about the currently requested capabilities, the active capabilities,
556 and the capabilities which are available.
557 @param interface The desired network interface.
558 @param capability The desired capability;
559 NULL to return a CFDictionary of all capabilities.
560 @result a CFTypeRef representing the current value of requested
562 NULL if the capability is not available for this
563 interface or if an error was encountered.
564 You must release the returned value.
567 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface
,
568 CFStringRef capability
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
571 @function SCNetworkInterfaceSetCapability
572 @discussion For the specified network interface, sets the requested
574 @param interface The desired network interface.
575 @param capability The desired capability.
576 @param newValue The new requested setting for the capability;
577 NULL to restore the default setting.
578 @result TRUE if the configuration was updated; FALSE if an error was encountered.
581 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface
,
582 CFStringRef capability
,
583 CFTypeRef newValue
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
586 __SCNetworkInterfaceSetDisableUntilNeededValue (SCNetworkInterfaceRef interface
,
587 CFTypeRef disable
) API_AVAILABLE(macos(10.11)) SPI_AVAILABLE(ios(9.0), tvos(9.0), watchos(2.0), bridgeos(2.0));
591 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
593 CFDictionaryRef capability_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
596 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
597 CFDictionaryRef media_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
601 #pragma mark SCBondInterface configuration (SPIs)
604 @function _SCBondInterfaceCopyActive
605 @discussion Returns all Ethernet Bond interfaces on the system.
606 @result The list of SCBondInterface interfaces on the system.
607 You must release the returned value.
610 _SCBondInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
613 @function _SCBondInterfaceUpdateConfiguration
614 @discussion Updates the bond interface configuration.
615 @param prefs The "preferences" session.
616 @result TRUE if the bond interface configuration was updated.; FALSE if the
617 an error was encountered.
620 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
623 @function SCBondInterfaceGetMode
624 @discussion Return the mode for the given bond interface.
625 @param bond The bond interface to get the mode from.
626 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
629 SCBondInterfaceGetMode (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
632 @function SCBondInterfaceSetMode
633 @discussion Set the mode on the bond interface.
634 @param bond The bond interface on which to adjust the mode.
635 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
636 @result TRUE if operation succeeded.
639 SCBondInterfaceSetMode (SCBondInterfaceRef bond
,
640 CFNumberRef mode
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
643 #pragma mark SCBridgeInterface configuration (SPIs)
646 @function SCBridgeInterfaceCopyAll
647 @discussion Returns all bridge interfaces on the system.
648 @param prefs The "preferences" session.
649 @result The list of bridge interfaces on the system.
650 You must release the returned value.
652 CFArrayRef
/* of SCBridgeInterfaceRef's */
653 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
656 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
657 @discussion Returns all network capable devices on the system
658 that can be added to an bridge interface.
659 @param prefs The "preferences" session.
660 @result The list of interfaces.
661 You must release the returned value.
663 CFArrayRef
/* of SCNetworkInterfaceRef's */
664 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
667 @function SCBridgeInterfaceCreate
668 @discussion Create a new SCBridgeInterface interface.
669 @param prefs The "preferences" session.
670 @result A reference to the new SCBridgeInterface.
671 You must release the returned value.
674 SCBridgeInterfaceCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
677 @function SCBridgeInterfaceRemove
678 @discussion Removes the SCBridgeInterface from the configuration.
679 @param bridge The SCBridgeInterface interface.
680 @result TRUE if the interface was removed; FALSE if an error was encountered.
683 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
686 @function SCBridgeInterfaceGetMemberInterfaces
687 @discussion Returns the member interfaces for the specified bridge interface.
688 @param bridge The SCBridgeInterface interface.
689 @result The list of interfaces.
691 CFArrayRef
/* of SCNetworkInterfaceRef's */
692 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
695 @function SCBridgeInterfaceGetOptions
696 @discussion Returns the configuration settings associated with a bridge interface.
697 @param bridge The SCBridgeInterface interface.
698 @result The configuration settings associated with the bridge interface;
699 NULL if no changes to the default configuration have been saved.
702 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
705 @function SCBridgeInterfaceSetMemberInterfaces
706 @discussion Sets the member interfaces for the specified bridge interface.
707 @param bridge The SCBridgeInterface interface.
708 @param members The desired member interfaces.
709 @result TRUE if the configuration was stored; FALSE if an error was encountered.
712 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge
,
713 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
714 API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
717 @function SCBridgeInterfaceSetLocalizedDisplayName
718 @discussion Sets the localized display name for the specified bridge interface.
719 @param bridge The SCBridgeInterface interface.
720 @param newName The new display name.
721 @result TRUE if the configuration was stored; FALSE if an error was encountered.
724 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge
,
725 CFStringRef newName
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
728 @function SCBridgeInterfaceSetOptions
729 @discussion Sets the configuration settings for the specified bridge interface.
730 @param bridge The SCBridgeInterface interface.
731 @param newOptions The new configuration settings.
732 @result TRUE if the configuration was stored; FALSE if an error was encountered.
735 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge
,
736 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
741 @function _SCBridgeInterfaceCopyActive
742 @discussion Returns all bridge interfaces on the system.
743 @result The list of SCBridgeInterface interfaces on the system.
744 You must release the returned value.
747 _SCBridgeInterfaceCopyActive (void) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
750 @function _SCBridgeInterfaceUpdateConfiguration
751 @discussion Updates the bridge interface configuration.
752 @param prefs The "preferences" session.
753 @result TRUE if the bridge interface configuration was updated.; FALSE if the
754 an error was encountered.
757 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
761 #pragma mark SCVLANInterface configuration (SPIs)
764 @function _SCVLANInterfaceCopyActive
765 @discussion Returns all VLAN interfaces on the system.
766 @result The list of SCVLANInterface interfaces on the system.
767 You must release the returned value.
770 _SCVLANInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
773 @function _SCVLANInterfaceUpdateConfiguration
774 @discussion Updates the VLAN interface configuration.
775 @param prefs The "preferences" session.
776 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
777 an error was encountered.
780 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
784 #pragma mark SCNetworkInterface Password SPIs
788 kSCNetworkInterfacePasswordTypePPP
= 1,
789 kSCNetworkInterfacePasswordTypeIPSecSharedSecret
,
790 kSCNetworkInterfacePasswordTypeEAPOL
,
791 kSCNetworkInterfacePasswordTypeIPSecXAuth
,
792 kSCNetworkInterfacePasswordTypeVPN
,
794 typedef uint32_t SCNetworkInterfacePasswordType
;
797 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface
,
798 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
801 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface
,
802 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
805 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface
,
806 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
809 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface
,
810 SCNetworkInterfacePasswordType passwordType
,
812 CFDictionaryRef options
) API_AVAILABLE(macos(10.5), ios(2.0));
816 SCNetworkInterfaceGetDisableUntilNeeded (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.11), ios(9.0));
819 SCNetworkInterfaceSetDisableUntilNeeded (SCNetworkInterfaceRef interface
,
820 Boolean disable
) API_AVAILABLE(macos(10.11), ios(9.0));
824 SCNetworkInterfaceGetQoSMarkingPolicy (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.13), ios(10.0));
827 SCNetworkInterfaceSetQoSMarkingPolicy (SCNetworkInterfaceRef interface
,
828 CFDictionaryRef policy
) API_AVAILABLE(macos(10.13), ios(10.0));
832 #pragma mark SCNetworkProtocol configuration (SPI)
836 @group Protocol configuration
840 static __inline__ CFTypeRef
841 isA_SCNetworkProtocol(CFTypeRef obj
)
843 return (isA_CFType(obj
, SCNetworkProtocolGetTypeID()));
847 @function _SCNetworkProtocolCompare
848 @discussion Compares two SCNetworkProtocol objects.
849 @param val1 The SCNetworkProtocol object.
850 @param val2 The SCNetworkProtocol object.
851 @param context Not used.
852 @result A comparison result.
855 _SCNetworkProtocolCompare (const void *val1
,
857 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
861 #pragma mark SCNetworkService configuration (SPI)
865 @group Service configuration
869 static __inline__ CFTypeRef
870 isA_SCNetworkService(CFTypeRef obj
)
872 return (isA_CFType(obj
, SCNetworkServiceGetTypeID()));
876 @function _SCNetworkServiceCompare
877 @discussion Compares two SCNetworkService objects.
878 @param val1 The SCNetworkService object.
879 @param val2 The SCNetworkService object.
880 @param context The service order (from SCNetworkSetGetServiceOrder).
881 @result A comparison result.
884 _SCNetworkServiceCompare (const void *val1
,
886 void *context
) API_AVAILABLE(macos(10.7), ios(4.0));
889 @function _SCNetworkServiceCopyActive
890 @discussion Returns the network service with the specified identifier.
892 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
893 API in that queries and operations interact with the "active" service
894 represented in the SCDynamicStore. Only a limited subset of the
895 SCNetworkService APIs are supported.
896 @param store The dynamic store session.
897 @param serviceID The unique identifier for the service.
898 @result A reference to the SCNetworkService represented in the SCDynamicStore;
899 NULL if the serviceID does not exist in the SCDynamicStore or if an
900 error was encountered.
901 You must release the returned value.
904 _SCNetworkServiceCopyActive (SCDynamicStoreRef store
,
905 CFStringRef serviceID
) API_AVAILABLE(macos(10.6), ios(2.1));
908 @function SCNetworkServiceGetPrimaryRank
909 @discussion Returns the primary service rank associated with a service.
910 @param service The network service.
911 @result The primary service rank associated with the specified application;
912 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
913 application or an error was encountered.
915 SCNetworkServicePrimaryRank
916 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.6), ios(2.0));
919 @function SCNetworkServiceSetPrimaryRank
920 @discussion Updates the the primary service rank associated with a service.
921 @param service The network service.
922 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
923 if the default service rank should be used.
924 @result TRUE if the rank was stored; FALSE if an error was encountered.
926 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
927 values can only valid as a transient setting.
930 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service
,
931 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.6), ios(2.0));
934 @function _SCNetworkServiceIsVPN
935 @discussion Identifies a VPN service.
936 @param service The network service.
937 @result TRUE if the service is a VPN.
940 _SCNetworkServiceIsVPN (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
943 @function SCNetworkServiceSetExternalID
944 @discussion Set the external identifier for a network service.
945 @param service A reference to the network service.
946 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to set.
947 @param identifier The new external identifier to assign to the network service.
948 @result Returns TRUE if the external identifier was set successfully, FALSE if an error occurred.
951 SCNetworkServiceSetExternalID (SCNetworkServiceRef service
,
952 CFStringRef identifierDomain
,
953 CFStringRef identifier
);
956 @function SCNetworkServiceCopyExternalID
957 @discussion Copy the external identifier for a network service.
958 @param service The network service.
959 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to copy.
960 @result Returns the service's external identifier, or NULL if the service does not have an external identifier in the given domain.
963 SCNetworkServiceCopyExternalID (SCNetworkServiceRef service
,
964 CFStringRef identifierDomain
);
967 @function _SCNetworkServiceSetServiceID
968 @discussion Sets serviceID of the service to a different value provided.
969 @param service The network service
970 @param newServiceID The new service ID
971 @result TRUE if new service ID is set successfully.
974 _SCNetworkServiceSetServiceID (SCNetworkServiceRef service
,
975 CFStringRef newServiceID
) API_AVAILABLE(macos(10.10), ios(8.0));
978 #pragma mark SCNetworkSet configuration (SPI)
982 @group Set configuration
986 static __inline__ CFTypeRef
987 isA_SCNetworkSet(CFTypeRef obj
)
989 return (isA_CFType(obj
, SCNetworkSetGetTypeID()));
994 @function _SCNetworkSetCompare
995 @discussion Compares two SCNetworkSet objects.
996 @param val1 The SCNetworkSet object.
997 @param val2 The SCNetworkSet object.
998 @param context Not used.
999 @result A comparison result.
1002 _SCNetworkSetCompare (const void *val1
,
1004 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
1007 @function SCNetworkSetCopyAvailableInterfaces
1008 @discussion Returns all available interfaces for the set.
1009 The interfaces excludes those of bond and bridge members.
1010 @param set The network set.
1011 @result The list of SCNetworkInterfaces.
1012 You must release the returned value.
1015 SCNetworkSetCopyAvailableInterfaces (SCNetworkSetRef set
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1018 @function _SCNetworkSetCreateDefault
1019 @discussion Create a new [default] set in the configuration.
1020 @param prefs The "preferences" session.
1021 @result A reference to the new SCNetworkSet.
1022 You must release the returned value.
1025 _SCNetworkSetCreateDefault (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.12)) SPI_AVAILABLE(ios(10.0), tvos(10.0), watchos(3.0), bridgeos(3.0));
1028 @function SCNetworkSetEstablishDefaultConfiguration
1029 @discussion Updates a network set by adding services for
1030 any network interface that is not currently
1032 If the provided set contains one (or more) services, new
1033 services will only be added for those interfaces that are
1034 not represented in *any* set.
1035 Otherwise, new services will be added for those interfaces
1036 that are not represented in the provided set.
1037 The new services are established with "default" configuration
1039 @param set The network set.
1040 @result TRUE if the configuration was updated; FALSE if no
1041 changes were required or if an error was encountered.
1044 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set
) API_AVAILABLE(macos(10.5), ios(2.0));
1047 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
1048 @discussion Updates a network set by adding services for
1049 the specified network interface if is not currently
1051 If the provided set contains one (or more) services, new
1052 services will only be added for interfaces that are not
1053 represented in *any* set.
1054 Otherwise, new services will be added for interfaces that
1055 are not represented in the provided set.
1056 The new services are established with "default" configuration
1058 @param set The network set.
1059 @param interface The network interface.
1060 @result TRUE if the configuration was updated; FALSE if no
1061 changes were required or if an error was encountered.
1064 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set
,
1065 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
1068 @function SCNetworkSetCopySelectedVPNService
1069 @discussion On the iPhone we only allow a single VPN network service
1070 to be selected at any given time. This API will identify
1071 the selected VPN service.
1072 @param set The network set.
1073 @result The selected VPN service; NULL if no service has been
1075 You must release the returned value.
1078 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set
) API_AVAILABLE(macos(10.7), ios(4.0));
1081 @function SCNetworkSetSetSelectedVPNService
1082 @discussion On the iPhone we only allow a single VPN network service
1083 to be selected at any given time. This API should be used to
1084 select a VPN service.
1085 @param set The network set.
1086 @param service The VPN service to be selected.
1087 @result TRUE if the name was saved; FALSE if an error was encountered.
1090 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set
,
1091 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
1094 _SCNetworkSetSetSetID (SCNetworkSetRef set
,
1095 CFStringRef setID
) API_AVAILABLE(macos(10.10), ios(8.0));
1098 @group VPN Service configuration
1102 #pragma mark VPN Service configuration
1104 typedef SCNetworkServiceRef VPNServiceRef
;
1107 @function VPNServiceCopyAllMatchingExternalID
1108 @discussion Copy the VPN services with the given external identifier.
1109 @param prefs A reference to the prefs where the VPN services are stored.
1110 @param identifierDomain A service can have multiple external identifiers. This string specifies which one to match with the given identifier.
1111 @param identifier The external identifier of the desired services.
1112 @result A array of references to the VPN services with the given identifier, or NULL if no such service exists
1115 VPNServiceCopyAllMatchingExternalID (SCPreferencesRef prefs
,
1116 CFStringRef identifierDomain
,
1117 CFStringRef identifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1120 @function VPNServiceCopyAll
1121 @discussion Copy all VPN services.
1122 @param prefs A reference to the prefs where the VPN services are stored.
1123 @result An array containing VPNServiceRefs for all the VPN services.
1126 VPNServiceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1129 @function VPNServiceCopyAppRuleIDs
1130 @discussion Copy all the app rule identifiers for a VPN service.
1131 @param service A reference to the VPN service.
1132 @result An array of CFStringRefs, each string containing the identifier of a app rule in the given service.
1135 VPNServiceCopyAppRuleIDs (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1138 @function VPNServiceSetAppRule
1139 @discussion Add or modify an app rule in a VPN service. The ruleSettings dictionary must contain one of the following keys:
1140 <pre>kSCValNetVPNAppRuleExecutableMatch</pre>
1141 <pre>kSCValNetVPNAppRuleAccountIdentifierMatch</pre>
1142 The ruleSettings dictionary may also contain the following keys:
1143 <pre>kSCValNetVPNAppRuleDNSDomainMatch</pre>
1144 See SCSchemaDefinitionsPrivate.h for more details.
1145 @param service A reference to the VPN service.
1146 @param ruleIdentifier The identifier of the new app rule.
1147 @param ruleSettings The settings for the new app rule. See the dictionary keys defined above.
1148 @result TRUE if the app rule was set successfully, FALSE if an error occurred.
1151 VPNServiceSetAppRule (VPNServiceRef service
,
1152 CFStringRef ruleIdentifier
,
1153 CFDictionaryRef ruleSettings
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1156 @function VPNServiceCopyAppRule
1157 @discussion Copy the settings for a app rule in a VPN service.
1158 @param service The app tunnel service.
1159 @param ruleIdentifier The ID of the app rule.
1160 @result The rule settings, or NULL if the app rule could not be found.
1163 VPNServiceCopyAppRule (VPNServiceRef service
,
1164 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1167 @function VPNServiceRemoveAppRule
1168 @discussion Remove an app rule from a VPN service.
1169 @param service The VPN service.
1170 @param ruleIdentifier The ID of the app rule to remove.
1171 @result Returns TRUE if the app rule was removed successfully; FALSE otherwise.
1174 VPNServiceRemoveAppRule (VPNServiceRef service
,
1175 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1178 @function VPNServiceIsManagedAppVPN
1179 @discussion Check to see if a VPN service is a managed App VPN service
1180 @param service The VPN servie.
1181 @result Returns TRUE if the service is a managed App VPN service; FALSE otherwise.
1184 VPNServiceIsManagedAppVPN (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1187 @group Migration SPI
1190 #pragma mark Migration SPI
1192 extern const CFStringRef kSCNetworkConfigurationRepair
/* CFBoolean */ API_AVAILABLE(macos(10.10), ios(8.0));
1194 extern const CFStringRef kSCNetworkConfigurationMigrationActionKey
/* CFNumber */ API_AVAILABLE(macos(10.10), ios(8.0));
1196 typedef CF_ENUM(uint32_t, SCNetworkConfigurationMigrationAction
) {
1197 kSCNetworkConfigurationMigrationAction_CleanInstall
= 0,
1198 kSCNetworkConfigurationMigrationAction_Upgrade
= 1,
1199 kSCNetworkConfigurationMigrationAction_Restore
= 2,
1203 @function _SCNetworkConfigurationCopyMigrationPaths
1204 @result Returns an array of paths that we would need from the source
1207 _SCNetworkConfigurationCopyMigrationPaths(CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1210 @function _SCNetworkConfigurationPerformMigration
1211 @discussion Updates the network configuration of the target system with
1212 configurations from previous system. Both sourceDir and targetDir
1213 cannot be NULL, since NULL indicates API to look at the local system
1214 @param sourceDir A reference which points to the root of a directory populated
1215 with the list of requested directories/path from the "source" volume. Passing NULL
1216 will indicate that sourceDir should point to local system
1217 @param currentDir A reference which points to the root of a directory populated
1218 with the list of requested directories/path from the "destination" volume. Passing
1219 NULL will indicate that currentDir should point to local system.
1220 @param targetDir A reference which points to the root of a directory that we
1221 will populate (update) with new configuration. Passing NULL will mean that we want to
1222 migrate to the currentDir. If not NULL, then this path should exist.
1223 @param options Argument which will tell us what action we are supposed to take
1224 (clean-install, upgrade, migrate/restore settings from another system, ...)
1225 @result Returns array which would consist of those paths that should be moved
1226 from the "targetDir" directory to destination volume. You must release the returned value.
1231 _SCNetworkConfigurationPerformMigration (CFURLRef sourceDir
,
1232 CFURLRef currentDir
,
1234 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1238 @function _SCNetworkConfigurationCheckValidity
1239 @discussion Verifies whether the configuration files present in the specified
1240 directory have valid mappings or not
1241 @param configDir A reference which points to the directory where the configuration
1243 @result TRUE if valid configurations are found
1248 _SCNetworkConfigurationCheckValidity (CFURLRef configDir
,
1249 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1253 @function _SCNetworkConfigurationCheckValidityWithPreferences
1254 @discussion Validates the specified preferences.plist against NetworkInterfaces.plist
1255 @param prefs the preferences ref pointing to the said preferences.plist
1256 @param ni_prefs the preferences ref pointing to the said NetworkInterfaces.plist
1257 @result TRUE if the configurations are valid against each other
1262 _SCNetworkConfigurationCheckValidityWithPreferences
1263 (SCPreferencesRef prefs
,
1264 SCPreferencesRef ni_prefs
,
1265 CFDictionaryRef options
) API_AVAILABLE(macos(10.11), ios(9.0));
1269 @function _SCNetworkMigrationAreConfigurationsIdentical
1270 @discussion Compares the migration output between network configurations
1271 with the expected output.
1272 @param configurationURL A URL pointing to the top-level directory of the
1273 configuration to compare. This directory is expected to have
1274 a Library/Preferences/SystemConfiguration subdirectoy.
1275 @param expectedConfigurationURL A URL pointing to the top-level directory of
1276 the expected configuration. This directory is expected to have
1277 a Library/Preferences/SystemConfiguration subdirectoy.
1278 @result TRUE if configurations match with the expected configurations
1283 _SCNetworkMigrationAreConfigurationsIdentical (CFURLRef configurationURL
,
1284 CFURLRef expectedConfigurationURL
) API_AVAILABLE(macos(10.10), ios(8.0));
1287 @function _SCNetworkConfigurationCopyMigrationRemovePaths
1288 @discussion List of paths to files which we want to be removed from the target filesystem after migration
1289 @param targetPaths the CFArray returned by _SCNetworkConfigurationPerformMigration
1290 @param targetDir the CFURL passed to _SCNetworkConfigurationPerformMigration
1291 @result An array of CFURL's; NULL if no paths need to be removed from the target filesystem
1295 CFArrayRef
// of CFURLRef's
1296 _SCNetworkConfigurationCopyMigrationRemovePaths (CFArrayRef targetPaths
,
1297 CFURLRef targetDir
) API_AVAILABLE(macos(10.10), ios(8.0));
1301 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */