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 _SCNetworkInterfaceIsCarPlay
497 @discussion Identifies if a network interface is a CarPlay device.
498 @param interface The network interface.
499 @result TRUE if the interface is a CarPlay device.
502 _SCNetworkInterfaceIsCarPlay (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.15), ios(13.0));
505 @function _SCNetworkInterfaceIsHiddenConfiguration
506 @discussion Identifies if the configuration of a network interface should be
507 hidden from any user interface (e.g. the "Network" pref pane).
508 @param interface The network interface.
509 @result TRUE if the interface configuration should be hidden.
512 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(4.0));
515 @function _SCNetworkInterfaceIsTethered
516 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
517 @param interface The network interface.
518 @result TRUE if the interface is a tethered device.
521 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
524 @function _SCNetworkInterfaceIsThunderbolt
525 @discussion Identifies if a network interface is a Thunderbolt device
526 @param interface The network interface.
527 @result TRUE if the interface is a Thunderbolt device.
530 _SCNetworkInterfaceIsThunderbolt (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.9), ios(7.0));
533 @function _SCNetworkInterfaceIsTrustRequired
534 @discussion Identifies if a network interface requires that the
535 associated host be trusted.
536 @param interface The network interface.
537 @result TRUE if the interface requires trust.
540 _SCNetworkInterfaceIsTrustRequired (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.14)) API_AVAILABLE(ios(12.0));
543 @function _SCNetworkInterfaceIsPhysicalEthernet
544 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
545 @param interface The network interface.
546 @result TRUE if the interface is a real ethernet interface.
549 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
552 @function _SCNetworkInterfaceForceConfigurationRefresh
553 @discussion Forces a configuration refresh of the
555 @param ifName Network interface name.
556 @result TRUE if the refresh was successfully posted.
559 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName
) API_AVAILABLE(macos(10.5), ios(2.0));
562 @function SCNetworkInterfaceCopyCapability
563 @discussion For the specified network interface, returns information
564 about the currently requested capabilities, the active capabilities,
565 and the capabilities which are available.
566 @param interface The desired network interface.
567 @param capability The desired capability;
568 NULL to return a CFDictionary of all capabilities.
569 @result a CFTypeRef representing the current value of requested
571 NULL if the capability is not available for this
572 interface or if an error was encountered.
573 You must release the returned value.
576 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface
,
577 CFStringRef capability
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
580 @function SCNetworkInterfaceSetCapability
581 @discussion For the specified network interface, sets the requested
583 @param interface The desired network interface.
584 @param capability The desired capability.
585 @param newValue The new requested setting for the capability;
586 NULL to restore the default setting.
587 @result TRUE if the configuration was updated; FALSE if an error was encountered.
590 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface
,
591 CFStringRef capability
,
592 CFTypeRef newValue
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
595 __SCNetworkInterfaceSetDisableUntilNeededValue (SCNetworkInterfaceRef interface
,
596 CFTypeRef disable
) API_AVAILABLE(macos(10.11)) SPI_AVAILABLE(ios(9.0), tvos(9.0), watchos(2.0), bridgeos(2.0));
600 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
602 CFDictionaryRef capability_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
605 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
606 CFDictionaryRef media_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
610 #pragma mark SCBondInterface configuration (SPIs)
613 @function _SCBondInterfaceCopyActive
614 @discussion Returns all Ethernet Bond interfaces on the system.
615 @result The list of SCBondInterface interfaces on the system.
616 You must release the returned value.
619 _SCBondInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
622 @function _SCBondInterfaceUpdateConfiguration
623 @discussion Updates the bond interface configuration.
624 @param prefs The "preferences" session.
625 @result TRUE if the bond interface configuration was updated.; FALSE if the
626 an error was encountered.
629 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
632 @function SCBondInterfaceGetMode
633 @discussion Return the mode for the given bond interface.
634 @param bond The bond interface to get the mode from.
635 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
638 SCBondInterfaceGetMode (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
641 @function SCBondInterfaceSetMode
642 @discussion Set the mode on the bond interface.
643 @param bond The bond interface on which to adjust the mode.
644 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
645 @result TRUE if operation succeeded.
648 SCBondInterfaceSetMode (SCBondInterfaceRef bond
,
649 CFNumberRef mode
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
652 #pragma mark SCBridgeInterface configuration (SPIs)
655 @function SCBridgeInterfaceCopyAll
656 @discussion Returns all bridge interfaces on the system.
657 @param prefs The "preferences" session.
658 @result The list of bridge interfaces on the system.
659 You must release the returned value.
661 CFArrayRef
/* of SCBridgeInterfaceRef's */
662 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
665 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
666 @discussion Returns all network capable devices on the system
667 that can be added to an bridge interface.
668 @param prefs The "preferences" session.
669 @result The list of interfaces.
670 You must release the returned value.
672 CFArrayRef
/* of SCNetworkInterfaceRef's */
673 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
676 @function SCBridgeInterfaceCreate
677 @discussion Create a new SCBridgeInterface interface.
678 @param prefs The "preferences" session.
679 @result A reference to the new SCBridgeInterface.
680 You must release the returned value.
683 SCBridgeInterfaceCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
686 @function SCBridgeInterfaceRemove
687 @discussion Removes the SCBridgeInterface from the configuration.
688 @param bridge The SCBridgeInterface interface.
689 @result TRUE if the interface was removed; FALSE if an error was encountered.
692 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
695 @function SCBridgeInterfaceGetMemberInterfaces
696 @discussion Returns the member interfaces for the specified bridge interface.
697 @param bridge The SCBridgeInterface interface.
698 @result The list of interfaces.
700 CFArrayRef
/* of SCNetworkInterfaceRef's */
701 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
704 @function SCBridgeInterfaceGetOptions
705 @discussion Returns the configuration settings associated with a bridge interface.
706 @param bridge The SCBridgeInterface interface.
707 @result The configuration settings associated with the bridge interface;
708 NULL if no changes to the default configuration have been saved.
711 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
714 @function SCBridgeInterfaceSetMemberInterfaces
715 @discussion Sets the member interfaces for the specified bridge interface.
716 @param bridge The SCBridgeInterface interface.
717 @param members The desired member interfaces.
718 @result TRUE if the configuration was stored; FALSE if an error was encountered.
721 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge
,
722 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
723 API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
726 @function SCBridgeInterfaceSetLocalizedDisplayName
727 @discussion Sets the localized display name for the specified bridge interface.
728 @param bridge The SCBridgeInterface interface.
729 @param newName The new display name.
730 @result TRUE if the configuration was stored; FALSE if an error was encountered.
733 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge
,
734 CFStringRef newName
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
737 @function SCBridgeInterfaceSetOptions
738 @discussion Sets the configuration settings for the specified bridge interface.
739 @param bridge The SCBridgeInterface interface.
740 @param newOptions The new configuration settings.
741 @result TRUE if the configuration was stored; FALSE if an error was encountered.
744 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge
,
745 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
750 @function _SCBridgeInterfaceCopyActive
751 @discussion Returns all bridge interfaces on the system.
752 @result The list of SCBridgeInterface interfaces on the system.
753 You must release the returned value.
756 _SCBridgeInterfaceCopyActive (void) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
759 @function _SCBridgeInterfaceUpdateConfiguration
760 @discussion Updates the bridge interface configuration.
761 @param prefs The "preferences" session.
762 @result TRUE if the bridge interface configuration was updated.; FALSE if the
763 an error was encountered.
766 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
770 #pragma mark SCVLANInterface configuration (SPIs)
773 @function _SCVLANInterfaceCopyActive
774 @discussion Returns all VLAN interfaces on the system.
775 @result The list of SCVLANInterface interfaces on the system.
776 You must release the returned value.
779 _SCVLANInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
782 @function _SCVLANInterfaceUpdateConfiguration
783 @discussion Updates the VLAN interface configuration.
784 @param prefs The "preferences" session.
785 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
786 an error was encountered.
789 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
793 #pragma mark SCNetworkInterface Password SPIs
797 kSCNetworkInterfacePasswordTypePPP
= 1,
798 kSCNetworkInterfacePasswordTypeIPSecSharedSecret
,
799 kSCNetworkInterfacePasswordTypeEAPOL
,
800 kSCNetworkInterfacePasswordTypeIPSecXAuth
,
801 kSCNetworkInterfacePasswordTypeVPN
,
803 typedef uint32_t SCNetworkInterfacePasswordType
;
806 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface
,
807 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
810 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface
,
811 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
814 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface
,
815 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
818 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface
,
819 SCNetworkInterfacePasswordType passwordType
,
821 CFDictionaryRef options
) API_AVAILABLE(macos(10.5), ios(2.0));
825 SCNetworkInterfaceGetDisableUntilNeeded (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.11), ios(9.0));
828 SCNetworkInterfaceSetDisableUntilNeeded (SCNetworkInterfaceRef interface
,
829 Boolean disable
) API_AVAILABLE(macos(10.11), ios(9.0));
833 SCNetworkInterfaceGetQoSMarkingPolicy (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.13), ios(10.0));
836 SCNetworkInterfaceSetQoSMarkingPolicy (SCNetworkInterfaceRef interface
,
837 CFDictionaryRef policy
) API_AVAILABLE(macos(10.13), ios(10.0));
841 #pragma mark SCNetworkProtocol configuration (SPI)
845 @group Protocol configuration
849 static __inline__ CFTypeRef
850 isA_SCNetworkProtocol(CFTypeRef obj
)
852 return (isA_CFType(obj
, SCNetworkProtocolGetTypeID()));
856 @function _SCNetworkProtocolCompare
857 @discussion Compares two SCNetworkProtocol objects.
858 @param val1 The SCNetworkProtocol object.
859 @param val2 The SCNetworkProtocol object.
860 @param context Not used.
861 @result A comparison result.
864 _SCNetworkProtocolCompare (const void *val1
,
866 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
870 #pragma mark SCNetworkService configuration (SPI)
874 @group Service configuration
878 static __inline__ CFTypeRef
879 isA_SCNetworkService(CFTypeRef obj
)
881 return (isA_CFType(obj
, SCNetworkServiceGetTypeID()));
885 @function _SCNetworkServiceCompare
886 @discussion Compares two SCNetworkService objects.
887 @param val1 The SCNetworkService object.
888 @param val2 The SCNetworkService object.
889 @param context The service order (from SCNetworkSetGetServiceOrder).
890 @result A comparison result.
893 _SCNetworkServiceCompare (const void *val1
,
895 void *context
) API_AVAILABLE(macos(10.7), ios(4.0));
898 @function _SCNetworkServiceCopyActive
899 @discussion Returns the network service with the specified identifier.
901 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
902 API in that queries and operations interact with the "active" service
903 represented in the SCDynamicStore. Only a limited subset of the
904 SCNetworkService APIs are supported.
905 @param store The dynamic store session.
906 @param serviceID The unique identifier for the service.
907 @result A reference to the SCNetworkService represented in the SCDynamicStore;
908 NULL if the serviceID does not exist in the SCDynamicStore or if an
909 error was encountered.
910 You must release the returned value.
913 _SCNetworkServiceCopyActive (SCDynamicStoreRef store
,
914 CFStringRef serviceID
) API_AVAILABLE(macos(10.6), ios(2.1));
917 @function SCNetworkServiceGetPrimaryRank
918 @discussion Returns the primary service rank associated with a service.
919 @param service The network service.
920 @result The primary service rank associated with the specified application;
921 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
922 application or an error was encountered.
924 SCNetworkServicePrimaryRank
925 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.6), ios(2.0));
928 @function SCNetworkServiceSetPrimaryRank
929 @discussion Updates the the primary service rank associated with a service.
930 @param service The network service.
931 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
932 if the default service rank should be used.
933 @result TRUE if the rank was stored; FALSE if an error was encountered.
935 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
936 values can only valid as a transient setting.
939 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service
,
940 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.6), ios(2.0));
943 @function _SCNetworkServiceIsVPN
944 @discussion Identifies a VPN service.
945 @param service The network service.
946 @result TRUE if the service is a VPN.
949 _SCNetworkServiceIsVPN (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
952 @function SCNetworkServiceSetExternalID
953 @discussion Set the external identifier for a network service.
954 @param service A reference to the network service.
955 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to set.
956 @param identifier The new external identifier to assign to the network service.
957 @result Returns TRUE if the external identifier was set successfully, FALSE if an error occurred.
960 SCNetworkServiceSetExternalID (SCNetworkServiceRef service
,
961 CFStringRef identifierDomain
,
962 CFStringRef identifier
);
965 @function SCNetworkServiceCopyExternalID
966 @discussion Copy the external identifier for a network service.
967 @param service The network service.
968 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to copy.
969 @result Returns the service's external identifier, or NULL if the service does not have an external identifier in the given domain.
972 SCNetworkServiceCopyExternalID (SCNetworkServiceRef service
,
973 CFStringRef identifierDomain
);
976 @function _SCNetworkServiceSetServiceID
977 @discussion Sets serviceID of the service to a different value provided.
978 @param service The network service
979 @param newServiceID The new service ID
980 @result TRUE if new service ID is set successfully.
983 _SCNetworkServiceSetServiceID (SCNetworkServiceRef service
,
984 CFStringRef newServiceID
) API_AVAILABLE(macos(10.10), ios(8.0));
987 #pragma mark SCNetworkSet configuration (SPI)
991 @group Set configuration
995 static __inline__ CFTypeRef
996 isA_SCNetworkSet(CFTypeRef obj
)
998 return (isA_CFType(obj
, SCNetworkSetGetTypeID()));
1003 @function _SCNetworkSetCompare
1004 @discussion Compares two SCNetworkSet objects.
1005 @param val1 The SCNetworkSet object.
1006 @param val2 The SCNetworkSet object.
1007 @param context Not used.
1008 @result A comparison result.
1011 _SCNetworkSetCompare (const void *val1
,
1013 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
1016 @function SCNetworkSetCopyAvailableInterfaces
1017 @discussion Returns all available interfaces for the set.
1018 The interfaces excludes those of bond and bridge members.
1019 @param set The network set.
1020 @result The list of SCNetworkInterfaces.
1021 You must release the returned value.
1024 SCNetworkSetCopyAvailableInterfaces (SCNetworkSetRef set
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1027 @function _SCNetworkSetCreateDefault
1028 @discussion Create a new [default] set in the configuration.
1029 @param prefs The "preferences" session.
1030 @result A reference to the new SCNetworkSet.
1031 You must release the returned value.
1034 _SCNetworkSetCreateDefault (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.12)) SPI_AVAILABLE(ios(10.0), tvos(10.0), watchos(3.0), bridgeos(3.0));
1037 @function SCNetworkSetEstablishDefaultConfiguration
1038 @discussion Updates a network set by adding services for
1039 any network interface that is not currently
1041 If the provided set contains one (or more) services, new
1042 services will only be added for those interfaces that are
1043 not represented in *any* set.
1044 Otherwise, new services will be added for those interfaces
1045 that are not represented in the provided set.
1046 The new services are established with "default" configuration
1048 @param set The network set.
1049 @result TRUE if the configuration was updated; FALSE if no
1050 changes were required or if an error was encountered.
1053 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set
) API_AVAILABLE(macos(10.5), ios(2.0));
1056 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
1057 @discussion Updates a network set by adding services for
1058 the specified network interface if is not currently
1060 If the provided set contains one (or more) services, new
1061 services will only be added for interfaces that are not
1062 represented in *any* set.
1063 Otherwise, new services will be added for interfaces that
1064 are not represented in the provided set.
1065 The new services are established with "default" configuration
1067 @param set The network set.
1068 @param interface The network interface.
1069 @result TRUE if the configuration was updated; FALSE if no
1070 changes were required or if an error was encountered.
1073 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set
,
1074 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
1077 @function SCNetworkSetCopySelectedVPNService
1078 @discussion On the iPhone we only allow a single VPN network service
1079 to be selected at any given time. This API will identify
1080 the selected VPN service.
1081 @param set The network set.
1082 @result The selected VPN service; NULL if no service has been
1084 You must release the returned value.
1087 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set
) API_AVAILABLE(macos(10.7), ios(4.0));
1090 @function SCNetworkSetSetSelectedVPNService
1091 @discussion On the iPhone we only allow a single VPN network service
1092 to be selected at any given time. This API should be used to
1093 select a VPN service.
1094 @param set The network set.
1095 @param service The VPN service to be selected.
1096 @result TRUE if the name was saved; FALSE if an error was encountered.
1099 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set
,
1100 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
1103 _SCNetworkSetSetSetID (SCNetworkSetRef set
,
1104 CFStringRef setID
) API_AVAILABLE(macos(10.10), ios(8.0));
1107 @group VPN Service configuration
1111 #pragma mark VPN Service configuration
1113 typedef SCNetworkServiceRef VPNServiceRef
;
1116 @function VPNServiceCopyAllMatchingExternalID
1117 @discussion Copy the VPN services with the given external identifier.
1118 @param prefs A reference to the prefs where the VPN services are stored.
1119 @param identifierDomain A service can have multiple external identifiers. This string specifies which one to match with the given identifier.
1120 @param identifier The external identifier of the desired services.
1121 @result A array of references to the VPN services with the given identifier, or NULL if no such service exists
1124 VPNServiceCopyAllMatchingExternalID (SCPreferencesRef prefs
,
1125 CFStringRef identifierDomain
,
1126 CFStringRef identifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1129 @function VPNServiceCopyAll
1130 @discussion Copy all VPN services.
1131 @param prefs A reference to the prefs where the VPN services are stored.
1132 @result An array containing VPNServiceRefs for all the VPN services.
1135 VPNServiceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1138 @function VPNServiceCopyAppRuleIDs
1139 @discussion Copy all the app rule identifiers for a VPN service.
1140 @param service A reference to the VPN service.
1141 @result An array of CFStringRefs, each string containing the identifier of a app rule in the given service.
1144 VPNServiceCopyAppRuleIDs (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1147 @function VPNServiceSetAppRule
1148 @discussion Add or modify an app rule in a VPN service. The ruleSettings dictionary must contain one of the following keys:
1149 <pre>kSCValNetVPNAppRuleExecutableMatch</pre>
1150 <pre>kSCValNetVPNAppRuleAccountIdentifierMatch</pre>
1151 The ruleSettings dictionary may also contain the following keys:
1152 <pre>kSCValNetVPNAppRuleDNSDomainMatch</pre>
1153 See SCSchemaDefinitionsPrivate.h for more details.
1154 @param service A reference to the VPN service.
1155 @param ruleIdentifier The identifier of the new app rule.
1156 @param ruleSettings The settings for the new app rule. See the dictionary keys defined above.
1157 @result TRUE if the app rule was set successfully, FALSE if an error occurred.
1160 VPNServiceSetAppRule (VPNServiceRef service
,
1161 CFStringRef ruleIdentifier
,
1162 CFDictionaryRef ruleSettings
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1165 @function VPNServiceCopyAppRule
1166 @discussion Copy the settings for a app rule in a VPN service.
1167 @param service The app tunnel service.
1168 @param ruleIdentifier The ID of the app rule.
1169 @result The rule settings, or NULL if the app rule could not be found.
1172 VPNServiceCopyAppRule (VPNServiceRef service
,
1173 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1176 @function VPNServiceRemoveAppRule
1177 @discussion Remove an app rule from a VPN service.
1178 @param service The VPN service.
1179 @param ruleIdentifier The ID of the app rule to remove.
1180 @result Returns TRUE if the app rule was removed successfully; FALSE otherwise.
1183 VPNServiceRemoveAppRule (VPNServiceRef service
,
1184 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1187 @function VPNServiceIsManagedAppVPN
1188 @discussion Check to see if a VPN service is a managed App VPN service
1189 @param service The VPN servie.
1190 @result Returns TRUE if the service is a managed App VPN service; FALSE otherwise.
1193 VPNServiceIsManagedAppVPN (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1196 @group Migration SPI
1199 #pragma mark Migration SPI
1201 extern const CFStringRef kSCNetworkConfigurationRepair
/* CFBoolean */ API_AVAILABLE(macos(10.10), ios(8.0));
1203 extern const CFStringRef kSCNetworkConfigurationMigrationActionKey
/* CFNumber */ API_AVAILABLE(macos(10.10), ios(8.0));
1205 typedef CF_ENUM(uint32_t, SCNetworkConfigurationMigrationAction
) {
1206 kSCNetworkConfigurationMigrationAction_CleanInstall
= 0,
1207 kSCNetworkConfigurationMigrationAction_Upgrade
= 1,
1208 kSCNetworkConfigurationMigrationAction_Restore
= 2,
1212 @function _SCNetworkConfigurationCopyMigrationPaths
1213 @result Returns an array of paths that we would need from the source
1216 _SCNetworkConfigurationCopyMigrationPaths(CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1219 @function _SCNetworkConfigurationPerformMigration
1220 @discussion Updates the network configuration of the target system with
1221 configurations from previous system. Both sourceDir and targetDir
1222 cannot be NULL, since NULL indicates API to look at the local system
1223 @param sourceDir A reference which points to the root of a directory populated
1224 with the list of requested directories/path from the "source" volume. Passing NULL
1225 will indicate that sourceDir should point to local system
1226 @param currentDir A reference which points to the root of a directory populated
1227 with the list of requested directories/path from the "destination" volume. Passing
1228 NULL will indicate that currentDir should point to local system.
1229 @param targetDir A reference which points to the root of a directory that we
1230 will populate (update) with new configuration. Passing NULL will mean that we want to
1231 migrate to the currentDir. If not NULL, then this path should exist.
1232 @param options Argument which will tell us what action we are supposed to take
1233 (clean-install, upgrade, migrate/restore settings from another system, ...)
1234 @result Returns array which would consist of those paths that should be moved
1235 from the "targetDir" directory to destination volume. You must release the returned value.
1240 _SCNetworkConfigurationPerformMigration (CFURLRef sourceDir
,
1241 CFURLRef currentDir
,
1243 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1247 @function _SCNetworkConfigurationCheckValidity
1248 @discussion Verifies whether the configuration files present in the specified
1249 directory have valid mappings or not
1250 @param configDir A reference which points to the directory where the configuration
1252 @result TRUE if valid configurations are found
1257 _SCNetworkConfigurationCheckValidity (CFURLRef configDir
,
1258 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1262 @function _SCNetworkConfigurationCheckValidityWithPreferences
1263 @discussion Validates the specified preferences.plist against NetworkInterfaces.plist
1264 @param prefs the preferences ref pointing to the said preferences.plist
1265 @param ni_prefs the preferences ref pointing to the said NetworkInterfaces.plist
1266 @result TRUE if the configurations are valid against each other
1271 _SCNetworkConfigurationCheckValidityWithPreferences
1272 (SCPreferencesRef prefs
,
1273 SCPreferencesRef ni_prefs
,
1274 CFDictionaryRef options
) API_AVAILABLE(macos(10.11), ios(9.0));
1278 @function _SCNetworkMigrationAreConfigurationsIdentical
1279 @discussion Compares the migration output between network configurations
1280 with the expected output.
1281 @param configurationURL A URL pointing to the top-level directory of the
1282 configuration to compare. This directory is expected to have
1283 a Library/Preferences/SystemConfiguration subdirectoy.
1284 @param expectedConfigurationURL A URL pointing to the top-level directory of
1285 the expected configuration. This directory is expected to have
1286 a Library/Preferences/SystemConfiguration subdirectoy.
1287 @result TRUE if configurations match with the expected configurations
1292 _SCNetworkMigrationAreConfigurationsIdentical (CFURLRef configurationURL
,
1293 CFURLRef expectedConfigurationURL
) API_AVAILABLE(macos(10.10), ios(8.0));
1296 @function _SCNetworkConfigurationCopyMigrationRemovePaths
1297 @discussion List of paths to files which we want to be removed from the target filesystem after migration
1298 @param targetPaths the CFArray returned by _SCNetworkConfigurationPerformMigration
1299 @param targetDir the CFURL passed to _SCNetworkConfigurationPerformMigration
1300 @result An array of CFURL's; NULL if no paths need to be removed from the target filesystem
1304 CFArrayRef
// of CFURLRef's
1305 _SCNetworkConfigurationCopyMigrationRemovePaths (CFArrayRef targetPaths
,
1306 CFURLRef targetDir
) API_AVAILABLE(macos(10.10), ios(8.0));
1310 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */