2 * Copyright (c) 2005-2020 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 SCNetworkConfiguration (SPI)
99 _SCNetworkConfigurationBypassSystemInterfaces (SCPreferencesRef prefs
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
102 _SCNetworkConfigurationSetBypassSystemInterfaces (SCPreferencesRef prefs
,
103 Boolean shouldBypass
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
106 __SCNetworkConfigurationClean (SCPreferencesRef prefs
,
107 SCPreferencesRef ni_prefs
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
110 __SCNetworkConfigurationSaveModel (SCPreferencesRef prefs
,
111 CFStringRef model
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
114 __SCNetworkConfigurationUpgrade (SCPreferencesRef
*prefs
,
115 SCPreferencesRef
*ni_prefs
,
116 Boolean commit
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
120 #pragma mark SCNetworkInterface configuration (SPI)
123 @group Interface configuration
126 static __inline__ CFTypeRef
127 isA_SCNetworkInterface(CFTypeRef obj
)
129 return (isA_CFType(obj
, SCNetworkInterfaceGetTypeID()));
132 static __inline__ CFTypeRef
133 isA_SCBondInterface(CFTypeRef obj
)
135 CFStringRef interfaceType
;
137 if (!isA_SCNetworkInterface(obj
)) {
138 // if not an SCNetworkInterface
142 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
143 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBond
)) {
151 static __inline__ CFTypeRef
152 isA_SCBridgeInterface(CFTypeRef obj
)
154 CFStringRef interfaceType
;
156 if (!isA_SCNetworkInterface(obj
)) {
157 // if not an SCNetworkInterface
161 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
162 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeBridge
)) {
170 static __inline__ CFTypeRef
171 isA_SCVLANInterface(CFTypeRef obj
)
173 CFStringRef interfaceType
;
175 if (!isA_SCNetworkInterface(obj
)) {
176 // if not an SCNetworkInterface
180 interfaceType
= SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef
)obj
);
181 if (!CFEqual(interfaceType
, kSCNetworkInterfaceTypeVLAN
)) {
190 @function _SCNetworkInterfaceCompare
191 @discussion Compares two SCNetworkInterface objects.
192 @param val1 The SCNetworkInterface object.
193 @param val2 The SCNetworkInterface object.
194 @param context Not used.
195 @result A comparison result.
198 _SCNetworkInterfaceCompare (const void *val1
,
200 void *context
) API_AVAILABLE(macos(10.5), ios(2.0));
203 @function _SCNetworkInterfaceCopyActive
204 @discussion Creates an SCNetworkInterface and associated with interface name
205 and SCDynamicStoreRef
206 @param store The SCDynamicStoreRef
207 @param bsdName The interface name
208 @result the SCNetworkInterface
210 SCNetworkInterfaceRef
211 _SCNetworkInterfaceCopyActive (SCDynamicStoreRef store
,
212 CFStringRef bsdName
) API_AVAILABLE(macos(10.8), ios(5.0));
215 @function _SCNetworkInterfaceCopyAllWithPreferences
216 Returns all network capable interfaces on the system.
217 @param prefs The "preferences" session.
218 @result The list of interfaces on the system.
219 You must release the returned value.
221 CFArrayRef
/* of SCNetworkInterfaceRef's */
222 _SCNetworkInterfaceCopyAllWithPreferences (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
225 @function _SCNetworkInterfaceCopyBTPANInterface
226 @discussion Returns the SCNetworkInterface associated with the BT-PAN interface
227 @result The BT-PAN interface; NULL if the interface is not (yet) known.
229 SCNetworkInterfaceRef
230 _SCNetworkInterfaceCopyBTPANInterface (void) API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
233 @function _SCNetworkInterfaceCopySlashDevPath
234 @discussion Returns the /dev pathname for the interface.
235 @param interface The network interface.
236 @result The /dev pathname associated with the interface (e.g. "/dev/modem");
237 NULL if no path is available.
240 _SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
243 _SCNetworkServiceCreatePreconfigured (SCPreferencesRef prefs
,
244 SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.15.4), ios(13.4), tvos(13.4), watchos(6.2), bridgeos(4.0));
246 #define kIncludeNoVirtualInterfaces 0x0
247 #define kIncludeVLANInterfaces 0x1
248 #define kIncludeBondInterfaces 0x2
249 #define kIncludeBridgeInterfaces 0x4
250 #define kIncludeAllVirtualInterfaces 0xffffffff
253 @function _SCNetworkInterfaceCreateWithBSDName
254 @discussion Create a new network interface associated with the provided
255 BSD interface name. This API supports Ethernet, FireWire, and
256 IEEE 802.11 interfaces.
257 @param bsdName The BSD interface name.
258 @param flags Indicates whether virtual (Bond, Bridge, VLAN)
259 network interfaces should be included.
260 @result A reference to the new SCNetworkInterface.
261 You must release the returned value.
263 SCNetworkInterfaceRef
264 _SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator
,
266 UInt32 flags
) API_AVAILABLE(macos(10.5), ios(2.0));
269 @function _SCNetworkInterfaceCreateWithEntity
270 @discussion Create a new network interface associated with the provided
271 SCDynamicStore service entity dictionary.
272 @param interface_entity The entity dictionary.
273 @param service The network service.
274 @result A reference to the new SCNetworkInterface.
275 You must release the returned value.
277 SCNetworkInterfaceRef
278 _SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator
,
279 CFDictionaryRef interface_entity
,
280 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.5), ios(2.0));
283 @function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
284 @discussion Create a new network interface associated with the provided
285 IORegistry "IONetworkInterface" object.
286 @param if_obj The IONetworkInterface object.
287 @result A reference to the new SCNetworkInterface.
288 You must release the returned value.
290 SCNetworkInterfaceRef
291 _SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj
) API_AVAILABLE(macos(10.5), ios(2.0));
294 @function SCNetworkInterfaceGetPrimaryRank
295 @discussion We allow caller to retrieve the rank on an interface.
296 @param interface The interface to get the rank
297 @result SCNetworkServicePrimaryRank
299 SCNetworkServicePrimaryRank
300 SCNetworkInterfaceGetPrimaryRank (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(5.0));
303 @function SCNetworkInterfaceSetPrimaryRank
304 @discussion We allow caller to set an assertion on an interface.
305 The rank assertion lives as long as the SCNetworkInterfaceRef
307 @param interface The interface to set the rank assertion
308 @param newRank The new rank to be set
309 @result TRUE if operation is successful; FALSE if an error was encountered.
312 SCNetworkInterfaceSetPrimaryRank (SCNetworkInterfaceRef interface
,
313 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.8), ios(5.0));
316 ** SCNetworkInterfaceAdvisory
319 typedef CF_ENUM(uint32_t, SCNetworkInterfaceAdvisory
) {
320 kSCNetworkInterfaceAdvisoryNone
= 0,
321 kSCNetworkInterfaceAdvisoryLinkLayerIssue
= 1,
322 kSCNetworkInterfaceAdvisoryUplinkIssue
= 2,
326 @function SCNetworkInterfaceSetAdvisory
327 @discussion Advise the system of some condition on the network interface
328 that warrants changing how the interface is used for IP networking,
329 and to clear a previously set advisory.
330 Calling this function requires root or having the boolean entitlement
331 "com.apple.SystemConfiguration.SCNetworkInterfaceSetAdvisory" = true.
332 @param interface The interface to assert the advisory on.
333 @param advisory The advisory to indicate on the interface, use
334 kSCNetworkInterfaceAdvisoryNone to clear advisory.
335 @param reason A string indicating the reason for setting the advisory,
336 used to aid debugging.
337 @result TRUE if the advisory change was successful; FALSE otherwise.
340 SCNetworkInterfaceSetAdvisory(SCNetworkInterfaceRef interface
,
341 SCNetworkInterfaceAdvisory advisory
,
343 API_AVAILABLE(macos(10.14), ios(12.0));
346 @function SCNetworkInterfaceAdvisoryIsSet
347 @discussion Find out if there is an advisory set on the interface.
348 @param interface The interface to check for an advisory.
349 @result TRUE if an advisory is set; FALSE otherwise.
352 SCNetworkInterfaceAdvisoryIsSet(SCNetworkInterfaceRef interface
)
353 API_AVAILABLE(macos(10.14), ios(12.0));
356 @function SCNetworkInterfaceCopyAdvisoryNotificationKey
357 @discussion Get the SCDynamicStore notication key for advisory changes
358 made on the interface.
359 @param interface The interface for which to get the notification key.
360 @result Key used to receive advisory change notifications on the
364 SCNetworkInterfaceCopyAdvisoryNotificationKey(SCNetworkInterfaceRef interface
)
365 API_AVAILABLE(macos(10.14), ios(12.0));
368 #define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
369 #define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
370 #define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
371 #define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
373 #define kSCNetworkInterfaceNetworkConfigurationOverridesKey CFSTR("NetworkConfigurationOverrides")
374 #define kSCNetworkInterfaceHiddenConfigurationKey CFSTR("HiddenConfiguration")
375 #define kSCNetworkInterfaceHiddenPortKey CFSTR("HiddenPort") /* for serial ports */
376 #define kSCNetworkInterfaceHiddenInterfaceKey CFSTR("HiddenInterface") /* for network interfaces */
378 // IORegistry property to indicate that a [WWAN] interface is not yet ready
379 #define kSCNetworkInterfaceInitializingKey CFSTR("Initializing")
381 // IORegistry property to indicate that the attached host should be trusted before use
382 #define kSCNetworkInterfaceTrustRequiredKey CFSTR("TrustRequired")
385 @function _SCNetworkInterfaceCopyInterfaceInfo
386 @discussion Returns interface details
387 @param interface The network interface.
388 @result A dictionary with details about the network interface.
391 _SCNetworkInterfaceCopyInterfaceInfo (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
394 @function _SCNetworkInterfaceGetConfigurationAction
395 @discussion Returns a user-notification / auto-configuration action for the interface.
396 @param interface The network interface.
397 @result The user-notification / auto-configuration action;
398 NULL if the default action should be used.
401 _SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(2.0));
404 @function _SCNetworkInterfaceGetFamilyType
405 @discussion Returns the family type for the interface.
406 @param interface The network interface.
407 @result The family type (ift_family) associated with the interface;
408 NULL if no family type is available.
411 _SCNetworkInterfaceGetFamilyType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
414 @function _SCNetworkInterfaceGetFamilySubType
415 @discussion Returns the family subtype for the interface.
416 @param interface The network interface.
417 @result The family subtype (ift_subfamily) associated with the interface;
418 NULL if no family subtype is available.
421 _SCNetworkInterfaceGetFamilySubType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
424 @function _SCNetworkInterfaceGetHardwareAddress
425 @discussion Returns a link layer address for the interface.
426 @param interface The network interface.
427 @result The hardware (MAC) address for the interface.
428 NULL if no hardware address is available.
431 _SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
434 @function _SCNetworkInterfaceGetIOInterfaceNamePrefix
435 @discussion Returns the IOInterfaceNamePrefix for the interface.
436 @param interface The network interface.
437 @result The IOInterfaceNamePrefix associated with the interface;
438 NULL if no IOInterfaceNamePrefix is available.
441 _SCNetworkInterfaceGetIOInterfaceNamePrefix (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(6.0));
444 @function _SCNetworkInterfaceGetIOInterfaceType
445 @discussion Returns the IOInterfaceType for the interface.
446 @param interface The network interface.
447 @result The IOInterfaceType associated with the interface
450 _SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
453 @function _SCNetworkInterfaceGetIOInterfaceUnit
454 @discussion Returns the IOInterfaceUnit for the interface.
455 @param interface The network interface.
456 @result The IOInterfaceUnit associated with the interface;
457 NULL if no IOInterfaceUnit is available.
460 _SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
463 @function _SCNetworkInterfaceGetIOPath
464 @discussion Returns the IOPath for the interface.
465 @param interface The network interface.
466 @result The IOPath associated with the interface;
467 NULL if no IOPath is available.
470 _SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
473 @function _SCNetworkInterfaceGetIORegistryEntryID
474 @discussion Returns the IORegistry entry ID for the interface.
475 @param interface The network interface.
476 @result The IORegistry entry ID associated with the interface;
477 Zero if no entry ID is available.
480 _SCNetworkInterfaceGetIORegistryEntryID (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.8), ios(5.0));
483 @function _SCNetworkInterfaceIsApplePreconfigured
484 @discussion Identifies if a network interface is internal/pre-configured.
485 @param interface The network interface.
486 @result TRUE if the interface is an internal/pre-configured.
489 _SCNetworkInterfaceIsApplePreconfigured (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.12), ios(10.0));
492 @function _SCNetworkInterfaceIsBluetoothPAN
493 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
494 @param interface The network interface.
495 @result TRUE if the interface is a Bluetooth PAN device.
498 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
501 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
502 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
503 @param interface The network interface.
504 @result TRUE if the interface is a Bluetooth PAN-NAP device.
507 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
510 @function _SCNetworkInterfaceIsBluetoothP2P
511 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
512 @param interface The network interface.
513 @result TRUE if the interface is a Bluetooth P2P device.
516 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
519 @function _SCNetworkInterfaceIsBuiltin
520 @discussion Identifies if a network interface is "built-in".
521 @param interface The network interface.
522 @result TRUE if the interface is "built-in".
525 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
528 @function _SCNetworkInterfaceIsCarPlay
529 @discussion Identifies if a network interface is a CarPlay device.
530 @param interface The network interface.
531 @result TRUE if the interface is a CarPlay device.
534 _SCNetworkInterfaceIsCarPlay (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.15), ios(13.0));
537 @function _SCNetworkInterfaceIsHiddenConfiguration
538 @discussion Identifies if the configuration of a network interface should be
539 hidden from any user interface (e.g. the "Network" pref pane).
540 @param interface The network interface.
541 @result TRUE if the interface configuration should be hidden.
544 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(4.0));
547 @function _SCNetworkInterfaceIsTethered
548 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
549 @param interface The network interface.
550 @result TRUE if the interface is a tethered device.
553 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
556 @function _SCNetworkInterfaceIsThunderbolt
557 @discussion Identifies if a network interface is a Thunderbolt device
558 @param interface The network interface.
559 @result TRUE if the interface is a Thunderbolt device.
562 _SCNetworkInterfaceIsThunderbolt (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.9), ios(7.0));
565 @function _SCNetworkInterfaceIsTrustRequired
566 @discussion Identifies if a network interface requires that the
567 associated host be trusted.
568 @param interface The network interface.
569 @result TRUE if the interface requires trust.
572 _SCNetworkInterfaceIsTrustRequired (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.14)) API_AVAILABLE(ios(12.0));
575 @function _SCNetworkInterfaceIsPhysicalEthernet
576 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
577 @param interface The network interface.
578 @result TRUE if the interface is a real ethernet interface.
581 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
584 @function _SCNetworkInterfaceForceConfigurationRefresh
585 @discussion Forces a configuration refresh of the
587 @param ifName Network interface name.
588 @result TRUE if the refresh was successfully posted.
591 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName
) API_AVAILABLE(macos(10.5), ios(2.0));
594 @function SCNetworkInterfaceCopyCapability
595 @discussion For the specified network interface, returns information
596 about the currently requested capabilities, the active capabilities,
597 and the capabilities which are available.
598 @param interface The desired network interface.
599 @param capability The desired capability;
600 NULL to return a CFDictionary of all capabilities.
601 @result a CFTypeRef representing the current value of requested
603 NULL if the capability is not available for this
604 interface or if an error was encountered.
605 You must release the returned value.
608 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface
,
609 CFStringRef capability
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
612 @function SCNetworkInterfaceSetCapability
613 @discussion For the specified network interface, sets the requested
615 @param interface The desired network interface.
616 @param capability The desired capability.
617 @param newValue The new requested setting for the capability;
618 NULL to restore the default setting.
619 @result TRUE if the configuration was updated; FALSE if an error was encountered.
622 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface
,
623 CFStringRef capability
,
624 CFTypeRef newValue
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
627 __SCNetworkInterfaceSetDisableUntilNeededValue (SCNetworkInterfaceRef interface
,
628 CFTypeRef disable
) API_AVAILABLE(macos(10.11)) SPI_AVAILABLE(ios(9.0), tvos(9.0), watchos(2.0), bridgeos(2.0));
632 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
634 CFDictionaryRef capability_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
637 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
638 CFDictionaryRef media_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
642 #pragma mark SCBondInterface configuration (SPIs)
645 @function _SCBondInterfaceCopyActive
646 @discussion Returns all Ethernet Bond interfaces on the system.
647 @result The list of SCBondInterface interfaces on the system.
648 You must release the returned value.
651 _SCBondInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
654 @function _SCBondInterfaceUpdateConfiguration
655 @discussion Updates the bond interface configuration.
656 @param prefs The "preferences" session.
657 @result TRUE if the bond interface configuration was updated.; FALSE if the
658 an error was encountered.
661 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
664 @function SCBondInterfaceGetMode
665 @discussion Return the mode for the given bond interface.
666 @param bond The bond interface to get the mode from.
667 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
670 SCBondInterfaceGetMode (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
673 @function SCBondInterfaceSetMode
674 @discussion Set the mode on the bond interface.
675 @param bond The bond interface on which to adjust the mode.
676 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
677 @result TRUE if operation succeeded.
680 SCBondInterfaceSetMode (SCBondInterfaceRef bond
,
681 CFNumberRef mode
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
684 #pragma mark SCBridgeInterface configuration (SPIs)
687 @function SCBridgeInterfaceCopyAll
688 @discussion Returns all bridge interfaces on the system.
689 @param prefs The "preferences" session.
690 @result The list of bridge interfaces on the system.
691 You must release the returned value.
693 CFArrayRef
/* of SCBridgeInterfaceRef's */
694 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
697 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
698 @discussion Returns all network capable devices on the system
699 that can be added to an bridge interface.
700 @param prefs The "preferences" session.
701 @result The list of interfaces.
702 You must release the returned value.
704 CFArrayRef
/* of SCNetworkInterfaceRef's */
705 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
708 @function SCBridgeInterfaceCreate
709 @discussion Create a new SCBridgeInterface interface.
710 @param prefs The "preferences" session.
711 @result A reference to the new SCBridgeInterface.
712 You must release the returned value.
715 SCBridgeInterfaceCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
718 @function SCBridgeInterfaceRemove
719 @discussion Removes the SCBridgeInterface from the configuration.
720 @param bridge The SCBridgeInterface interface.
721 @result TRUE if the interface was removed; FALSE if an error was encountered.
724 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
727 @function SCBridgeInterfaceGetMemberInterfaces
728 @discussion Returns the member interfaces for the specified bridge interface.
729 @param bridge The SCBridgeInterface interface.
730 @result The list of interfaces.
732 CFArrayRef
/* of SCNetworkInterfaceRef's */
733 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
736 @function SCBridgeInterfaceGetOptions
737 @discussion Returns the configuration settings associated with a bridge interface.
738 @param bridge The SCBridgeInterface interface.
739 @result The configuration settings associated with the bridge interface;
740 NULL if no changes to the default configuration have been saved.
743 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
746 @function SCBridgeInterfaceSetMemberInterfaces
747 @discussion Sets the member interfaces for the specified bridge interface.
748 @param bridge The SCBridgeInterface interface.
749 @param members The desired member interfaces.
750 @result TRUE if the configuration was stored; FALSE if an error was encountered.
753 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge
,
754 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
755 API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
758 @function SCBridgeInterfaceSetLocalizedDisplayName
759 @discussion Sets the localized display name for the specified bridge interface.
760 @param bridge The SCBridgeInterface interface.
761 @param newName The new display name.
762 @result TRUE if the configuration was stored; FALSE if an error was encountered.
765 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge
,
766 CFStringRef newName
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
769 @function SCBridgeInterfaceSetOptions
770 @discussion Sets the configuration settings for the specified bridge interface.
771 @param bridge The SCBridgeInterface interface.
772 @param newOptions The new configuration settings.
773 @result TRUE if the configuration was stored; FALSE if an error was encountered.
776 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge
,
777 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
782 @function _SCBridgeInterfaceCopyActive
783 @discussion Returns all bridge interfaces on the system.
784 @result The list of SCBridgeInterface interfaces on the system.
785 You must release the returned value.
788 _SCBridgeInterfaceCopyActive (void) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
791 @function _SCBridgeInterfaceUpdateConfiguration
792 @discussion Updates the bridge interface configuration.
793 @param prefs The "preferences" session.
794 @result TRUE if the bridge interface configuration was updated.; FALSE if the
795 an error was encountered.
798 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
802 #pragma mark SCVLANInterface configuration (SPIs)
805 @function _SCVLANInterfaceCopyActive
806 @discussion Returns all VLAN interfaces on the system.
807 @result The list of SCVLANInterface interfaces on the system.
808 You must release the returned value.
811 _SCVLANInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
814 @function _SCVLANInterfaceUpdateConfiguration
815 @discussion Updates the VLAN interface configuration.
816 @param prefs The "preferences" session.
817 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
818 an error was encountered.
821 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
825 #pragma mark SCNetworkInterface Password SPIs
829 kSCNetworkInterfacePasswordTypePPP
= 1,
830 kSCNetworkInterfacePasswordTypeIPSecSharedSecret
,
831 kSCNetworkInterfacePasswordTypeEAPOL
,
832 kSCNetworkInterfacePasswordTypeIPSecXAuth
,
833 kSCNetworkInterfacePasswordTypeVPN
,
835 typedef uint32_t SCNetworkInterfacePasswordType
;
838 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface
,
839 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
842 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface
,
843 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
846 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface
,
847 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
850 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface
,
851 SCNetworkInterfacePasswordType passwordType
,
853 CFDictionaryRef options
) API_AVAILABLE(macos(10.5), ios(2.0));
857 SCNetworkInterfaceGetDisableUntilNeeded (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.11), ios(9.0));
860 SCNetworkInterfaceSetDisableUntilNeeded (SCNetworkInterfaceRef interface
,
861 Boolean disable
) API_AVAILABLE(macos(10.11), ios(9.0));
865 SCNetworkInterfaceGetQoSMarkingPolicy (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.13), ios(10.0));
868 SCNetworkInterfaceSetQoSMarkingPolicy (SCNetworkInterfaceRef interface
,
869 CFDictionaryRef policy
) API_AVAILABLE(macos(10.13), ios(10.0));
873 #pragma mark SCNetworkProtocol configuration (SPI)
877 @group Protocol configuration
881 static __inline__ CFTypeRef
882 isA_SCNetworkProtocol(CFTypeRef obj
)
884 return (isA_CFType(obj
, SCNetworkProtocolGetTypeID()));
888 @function _SCNetworkProtocolCompare
889 @discussion Compares two SCNetworkProtocol objects.
890 @param val1 The SCNetworkProtocol object.
891 @param val2 The SCNetworkProtocol object.
892 @param context Not used.
893 @result A comparison result.
896 _SCNetworkProtocolCompare (const void *val1
,
898 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
902 #pragma mark SCNetworkService configuration (SPI)
906 @group Service configuration
910 static __inline__ CFTypeRef
911 isA_SCNetworkService(CFTypeRef obj
)
913 return (isA_CFType(obj
, SCNetworkServiceGetTypeID()));
917 @function _SCNetworkServiceCompare
918 @discussion Compares two SCNetworkService objects.
919 @param val1 The SCNetworkService object.
920 @param val2 The SCNetworkService object.
921 @param context The service order (from SCNetworkSetGetServiceOrder).
922 @result A comparison result.
925 _SCNetworkServiceCompare (const void *val1
,
927 void *context
) API_AVAILABLE(macos(10.7), ios(4.0));
930 @function _SCNetworkServiceCopyActive
931 @discussion Returns the network service with the specified identifier.
933 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
934 API in that queries and operations interact with the "active" service
935 represented in the SCDynamicStore. Only a limited subset of the
936 SCNetworkService APIs are supported.
937 @param store The dynamic store session.
938 @param serviceID The unique identifier for the service.
939 @result A reference to the SCNetworkService represented in the SCDynamicStore;
940 NULL if the serviceID does not exist in the SCDynamicStore or if an
941 error was encountered.
942 You must release the returned value.
945 _SCNetworkServiceCopyActive (SCDynamicStoreRef store
,
946 CFStringRef serviceID
) API_AVAILABLE(macos(10.6), ios(2.1));
949 @function SCNetworkServiceGetPrimaryRank
950 @discussion Returns the primary service rank associated with a service.
951 @param service The network service.
952 @result The primary service rank associated with the specified application;
953 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
954 application or an error was encountered.
956 SCNetworkServicePrimaryRank
957 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.6), ios(2.0));
960 @function SCNetworkServiceSetPrimaryRank
961 @discussion Updates the the primary service rank associated with a service.
962 @param service The network service.
963 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
964 if the default service rank should be used.
965 @result TRUE if the rank was stored; FALSE if an error was encountered.
967 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
968 values can only valid as a transient setting.
971 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service
,
972 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.6), ios(2.0));
975 @function _SCNetworkServiceIsVPN
976 @discussion Identifies a VPN service.
977 @param service The network service.
978 @result TRUE if the service is a VPN.
981 _SCNetworkServiceIsVPN (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
984 @function SCNetworkServiceSetExternalID
985 @discussion Set the external identifier for a network service.
986 @param service A reference to the network service.
987 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to set.
988 @param identifier The new external identifier to assign to the network service.
989 @result Returns TRUE if the external identifier was set successfully, FALSE if an error occurred.
992 SCNetworkServiceSetExternalID (SCNetworkServiceRef service
,
993 CFStringRef identifierDomain
,
994 CFStringRef identifier
);
997 @function SCNetworkServiceCopyExternalID
998 @discussion Copy the external identifier for a network service.
999 @param service The network service.
1000 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to copy.
1001 @result Returns the service's external identifier, or NULL if the service does not have an external identifier in the given domain.
1004 SCNetworkServiceCopyExternalID (SCNetworkServiceRef service
,
1005 CFStringRef identifierDomain
);
1008 @function _SCNetworkServiceSetServiceID
1009 @discussion Sets serviceID of the service to a different value provided.
1010 @param service The network service
1011 @param newServiceID The new service ID
1012 @result TRUE if new service ID is set successfully.
1015 _SCNetworkServiceSetServiceID (SCNetworkServiceRef service
,
1016 CFStringRef newServiceID
) API_AVAILABLE(macos(10.10), ios(8.0));
1019 #pragma mark SCNetworkSet configuration (SPI)
1023 @group Set configuration
1027 static __inline__ CFTypeRef
1028 isA_SCNetworkSet(CFTypeRef obj
)
1030 return (isA_CFType(obj
, SCNetworkSetGetTypeID()));
1035 @function _SCNetworkSetCompare
1036 @discussion Compares two SCNetworkSet objects.
1037 @param val1 The SCNetworkSet object.
1038 @param val2 The SCNetworkSet object.
1039 @param context Not used.
1040 @result A comparison result.
1043 _SCNetworkSetCompare (const void *val1
,
1045 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
1048 @function SCNetworkSetCopyAvailableInterfaces
1049 @discussion Returns all available interfaces for the set.
1050 The interfaces excludes those of bond and bridge members.
1051 @param set The network set.
1052 @result The list of SCNetworkInterfaces.
1053 You must release the returned value.
1056 SCNetworkSetCopyAvailableInterfaces (SCNetworkSetRef set
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1059 @function _SCNetworkSetCreateDefault
1060 @discussion Create a new [default] set in the configuration.
1061 @param prefs The "preferences" session.
1062 @result A reference to the new SCNetworkSet.
1063 You must release the returned value.
1066 _SCNetworkSetCreateDefault (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.12)) SPI_AVAILABLE(ios(10.0), tvos(10.0), watchos(3.0), bridgeos(3.0));
1069 @function SCNetworkSetEstablishDefaultConfiguration
1070 @discussion Updates a network set by adding services for
1071 any network interface that is not currently
1073 If the provided set contains one (or more) services, new
1074 services will only be added for those interfaces that are
1075 not represented in *any* set.
1076 Otherwise, new services will be added for those interfaces
1077 that are not represented in the provided set.
1078 The new services are established with "default" configuration
1080 @param set The network set.
1081 @result TRUE if the configuration was updated; FALSE if no
1082 changes were required or if an error was encountered.
1085 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set
) API_AVAILABLE(macos(10.5), ios(2.0));
1088 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
1089 @discussion Updates a network set by adding services for
1090 the specified network interface if is not currently
1092 If the provided set contains one (or more) services, new
1093 services will only be added for interfaces that are not
1094 represented in *any* set.
1095 Otherwise, new services will be added for interfaces that
1096 are not represented in the provided set.
1097 The new services are established with "default" configuration
1099 @param set The network set.
1100 @param interface The network interface.
1101 @result TRUE if the configuration was updated; FALSE if no
1102 changes were required or if an error was encountered.
1105 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set
,
1106 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
1109 @function SCNetworkSetCopySelectedVPNService
1110 @discussion On the iPhone we only allow a single VPN network service
1111 to be selected at any given time. This API will identify
1112 the selected VPN service.
1113 @param set The network set.
1114 @result The selected VPN service; NULL if no service has been
1116 You must release the returned value.
1119 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set
) API_AVAILABLE(macos(10.7), ios(4.0));
1122 @function SCNetworkSetSetSelectedVPNService
1123 @discussion On the iPhone we only allow a single VPN network service
1124 to be selected at any given time. This API should be used to
1125 select a VPN service.
1126 @param set The network set.
1127 @param service The VPN service to be selected.
1128 @result TRUE if the name was saved; FALSE if an error was encountered.
1131 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set
,
1132 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
1135 _SCNetworkSetSetSetID (SCNetworkSetRef set
,
1136 CFStringRef setID
) API_AVAILABLE(macos(10.10), ios(8.0));
1139 @group VPN Service configuration
1143 #pragma mark VPN Service configuration
1145 typedef SCNetworkServiceRef VPNServiceRef
;
1148 @function VPNServiceCopyAllMatchingExternalID
1149 @discussion Copy the VPN services with the given external identifier.
1150 @param prefs A reference to the prefs where the VPN services are stored.
1151 @param identifierDomain A service can have multiple external identifiers. This string specifies which one to match with the given identifier.
1152 @param identifier The external identifier of the desired services.
1153 @result A array of references to the VPN services with the given identifier, or NULL if no such service exists
1156 VPNServiceCopyAllMatchingExternalID (SCPreferencesRef prefs
,
1157 CFStringRef identifierDomain
,
1158 CFStringRef identifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1161 @function VPNServiceCopyAll
1162 @discussion Copy all VPN services.
1163 @param prefs A reference to the prefs where the VPN services are stored.
1164 @result An array containing VPNServiceRefs for all the VPN services.
1167 VPNServiceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1170 @function VPNServiceCopyAppRuleIDs
1171 @discussion Copy all the app rule identifiers for a VPN service.
1172 @param service A reference to the VPN service.
1173 @result An array of CFStringRefs, each string containing the identifier of a app rule in the given service.
1176 VPNServiceCopyAppRuleIDs (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1179 @function VPNServiceSetAppRule
1180 @discussion Add or modify an app rule in a VPN service. The ruleSettings dictionary must contain one of the following keys:
1181 <pre>kSCValNetVPNAppRuleExecutableMatch</pre>
1182 <pre>kSCValNetVPNAppRuleAccountIdentifierMatch</pre>
1183 The ruleSettings dictionary may also contain the following keys:
1184 <pre>kSCValNetVPNAppRuleDNSDomainMatch</pre>
1185 See SCSchemaDefinitionsPrivate.h for more details.
1186 @param service A reference to the VPN service.
1187 @param ruleIdentifier The identifier of the new app rule.
1188 @param ruleSettings The settings for the new app rule. See the dictionary keys defined above.
1189 @result TRUE if the app rule was set successfully, FALSE if an error occurred.
1192 VPNServiceSetAppRule (VPNServiceRef service
,
1193 CFStringRef ruleIdentifier
,
1194 CFDictionaryRef ruleSettings
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1197 @function VPNServiceCopyAppRule
1198 @discussion Copy the settings for a app rule in a VPN service.
1199 @param service The app tunnel service.
1200 @param ruleIdentifier The ID of the app rule.
1201 @result The rule settings, or NULL if the app rule could not be found.
1204 VPNServiceCopyAppRule (VPNServiceRef service
,
1205 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1208 @function VPNServiceRemoveAppRule
1209 @discussion Remove an app rule from a VPN service.
1210 @param service The VPN service.
1211 @param ruleIdentifier The ID of the app rule to remove.
1212 @result Returns TRUE if the app rule was removed successfully; FALSE otherwise.
1215 VPNServiceRemoveAppRule (VPNServiceRef service
,
1216 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1219 @function VPNServiceIsManagedAppVPN
1220 @discussion Check to see if a VPN service is a managed App VPN service
1221 @param service The VPN servie.
1222 @result Returns TRUE if the service is a managed App VPN service; FALSE otherwise.
1225 VPNServiceIsManagedAppVPN (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1228 @group Migration SPI
1231 #pragma mark Migration SPI
1233 extern const CFStringRef kSCNetworkConfigurationRepair
/* CFBoolean */ API_AVAILABLE(macos(10.10), ios(8.0));
1235 extern const CFStringRef kSCNetworkConfigurationMigrationActionKey
/* CFNumber */ API_AVAILABLE(macos(10.10), ios(8.0));
1237 typedef CF_ENUM(uint32_t, SCNetworkConfigurationMigrationAction
) {
1238 kSCNetworkConfigurationMigrationAction_CleanInstall
= 0,
1239 kSCNetworkConfigurationMigrationAction_Upgrade
= 1,
1240 kSCNetworkConfigurationMigrationAction_Restore
= 2,
1244 @function _SCNetworkConfigurationCopyMigrationPaths
1245 @result Returns an array of paths that we would need from the source
1248 _SCNetworkConfigurationCopyMigrationPaths(CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1251 @function _SCNetworkConfigurationPerformMigration
1252 @discussion Updates the network configuration of the target system with
1253 configurations from previous system. Both sourceDir and targetDir
1254 cannot be NULL, since NULL indicates API to look at the local system
1255 @param sourceDir A reference which points to the root of a directory populated
1256 with the list of requested directories/path from the "source" volume. Passing NULL
1257 will indicate that sourceDir should point to local system
1258 @param currentDir A reference which points to the root of a directory populated
1259 with the list of requested directories/path from the "destination" volume. Passing
1260 NULL will indicate that currentDir should point to local system.
1261 @param targetDir A reference which points to the root of a directory that we
1262 will populate (update) with new configuration. Passing NULL will mean that we want to
1263 migrate to the currentDir. If not NULL, then this path should exist.
1264 @param options Argument which will tell us what action we are supposed to take
1265 (clean-install, upgrade, migrate/restore settings from another system, ...)
1266 @result Returns array which would consist of those paths that should be moved
1267 from the "targetDir" directory to destination volume. You must release the returned value.
1272 _SCNetworkConfigurationPerformMigration (CFURLRef sourceDir
,
1273 CFURLRef currentDir
,
1275 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1279 @function _SCNetworkConfigurationCheckValidity
1280 @discussion Verifies whether the configuration files present in the specified
1281 directory have valid mappings or not
1282 @param configDir A reference which points to the directory where the configuration
1284 @result TRUE if valid configurations are found
1289 _SCNetworkConfigurationCheckValidity (CFURLRef configDir
,
1290 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1294 @function _SCNetworkConfigurationCheckValidityWithPreferences
1295 @discussion Validates the specified preferences.plist against NetworkInterfaces.plist
1296 @param prefs the preferences ref pointing to the said preferences.plist
1297 @param ni_prefs the preferences ref pointing to the said NetworkInterfaces.plist
1298 @result TRUE if the configurations are valid against each other
1303 _SCNetworkConfigurationCheckValidityWithPreferences
1304 (SCPreferencesRef prefs
,
1305 SCPreferencesRef ni_prefs
,
1306 CFDictionaryRef options
) API_AVAILABLE(macos(10.11), ios(9.0));
1310 @function _SCNetworkMigrationAreConfigurationsIdentical
1311 @discussion Compares the migration output between network configurations
1312 with the expected output.
1313 @param configurationURL A URL pointing to the top-level directory of the
1314 configuration to compare. This directory is expected to have
1315 a Library/Preferences/SystemConfiguration subdirectoy.
1316 @param expectedConfigurationURL A URL pointing to the top-level directory of
1317 the expected configuration. This directory is expected to have
1318 a Library/Preferences/SystemConfiguration subdirectoy.
1319 @result TRUE if configurations match with the expected configurations
1324 _SCNetworkMigrationAreConfigurationsIdentical (CFURLRef configurationURL
,
1325 CFURLRef expectedConfigurationURL
) API_AVAILABLE(macos(10.10), ios(8.0));
1328 @function _SCNetworkConfigurationCopyMigrationRemovePaths
1329 @discussion List of paths to files which we want to be removed from the target filesystem after migration
1330 @param targetPaths the CFArray returned by _SCNetworkConfigurationPerformMigration
1331 @param targetDir the CFURL passed to _SCNetworkConfigurationPerformMigration
1332 @result An array of CFURL's; NULL if no paths need to be removed from the target filesystem
1336 CFArrayRef
// of CFURLRef's
1337 _SCNetworkConfigurationCopyMigrationRemovePaths (CFArrayRef targetPaths
,
1338 CFURLRef targetDir
) API_AVAILABLE(macos(10.10), ios(8.0));
1342 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */