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 _SCNetworkInterfaceIsHiddenInterface
548 @discussion Identifies if this is a [fully] hidden network interface.
549 @param interface The network interface.
550 @result TRUE if this is a hidden interface.
553 _SCNetworkInterfaceIsHiddenInterface (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0));
557 @function _SCNetworkInterfaceIsQoSMarkingProfileInstalled
558 @discussion Identifies if a network interface has a QoSMarking profile installed
559 @param interface The network interface.
560 @result TRUE if the interface is a tethered device.
563 _SCNetworkInterfaceIsQoSMarkingProfileInstalled (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0));
566 @function _SCNetworkInterfaceIsTethered
567 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
568 @param interface The network interface.
569 @result TRUE if the interface is a tethered device.
572 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.6), ios(3.0));
575 @function _SCNetworkInterfaceIsThunderbolt
576 @discussion Identifies if a network interface is a Thunderbolt device
577 @param interface The network interface.
578 @result TRUE if the interface is a Thunderbolt device.
581 _SCNetworkInterfaceIsThunderbolt (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.9), ios(7.0));
584 @function _SCNetworkInterfaceIsTrustRequired
585 @discussion Identifies if a network interface requires that the
586 associated host be trusted.
587 @param interface The network interface.
588 @result TRUE if the interface requires trust.
591 _SCNetworkInterfaceIsTrustRequired (SCNetworkInterfaceRef interface
) SPI_AVAILABLE(macos(10.14)) API_AVAILABLE(ios(12.0));
594 @function _SCNetworkInterfaceIsPhysicalEthernet
595 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
596 @param interface The network interface.
597 @result TRUE if the interface is a real ethernet interface.
600 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.7), ios(5.0));
603 @function _SCNetworkInterfaceForceConfigurationRefresh
604 @discussion Forces a configuration refresh of the
606 @param ifName Network interface name.
607 @result TRUE if the refresh was successfully posted.
610 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName
) API_AVAILABLE(macos(10.5), ios(2.0));
613 @function SCNetworkInterfaceCopyCapability
614 @discussion For the specified network interface, returns information
615 about the currently requested capabilities, the active capabilities,
616 and the capabilities which are available.
617 @param interface The desired network interface.
618 @param capability The desired capability;
619 NULL to return a CFDictionary of all capabilities.
620 @result a CFTypeRef representing the current value of requested
622 NULL if the capability is not available for this
623 interface or if an error was encountered.
624 You must release the returned value.
627 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface
,
628 CFStringRef capability
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
631 @function SCNetworkInterfaceSetCapability
632 @discussion For the specified network interface, sets the requested
634 @param interface The desired network interface.
635 @param capability The desired capability.
636 @param newValue The new requested setting for the capability;
637 NULL to restore the default setting.
638 @result TRUE if the configuration was updated; FALSE if an error was encountered.
641 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface
,
642 CFStringRef capability
,
643 CFTypeRef newValue
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
646 __SCNetworkInterfaceSetDisableUntilNeededValue (SCNetworkInterfaceRef interface
,
647 CFTypeRef disable
) API_AVAILABLE(macos(10.11)) SPI_AVAILABLE(ios(9.0), tvos(9.0), watchos(2.0), bridgeos(2.0));
651 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
653 CFDictionaryRef capability_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
656 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
657 CFDictionaryRef media_options
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(5.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
661 #pragma mark SCBondInterface configuration (SPIs)
664 @function _SCBondInterfaceCopyActive
665 @discussion Returns all Ethernet Bond interfaces on the system.
666 @result The list of SCBondInterface interfaces on the system.
667 You must release the returned value.
670 _SCBondInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
673 @function _SCBondInterfaceUpdateConfiguration
674 @discussion Updates the bond interface configuration.
675 @param prefs The "preferences" session.
676 @result TRUE if the bond interface configuration was updated.; FALSE if the
677 an error was encountered.
680 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
683 @function SCBondInterfaceGetMode
684 @discussion Return the mode for the given bond interface.
685 @param bond The bond interface to get the mode from.
686 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
689 SCBondInterfaceGetMode (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
692 @function SCBondInterfaceSetMode
693 @discussion Set the mode on the bond interface.
694 @param bond The bond interface on which to adjust the mode.
695 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
696 @result TRUE if operation succeeded.
699 SCBondInterfaceSetMode (SCBondInterfaceRef bond
,
700 CFNumberRef mode
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
703 #pragma mark SCBridgeInterface configuration (SPIs)
706 @function SCBridgeInterfaceCopyAll
707 @discussion Returns all bridge interfaces on the system.
708 @param prefs The "preferences" session.
709 @result The list of bridge interfaces on the system.
710 You must release the returned value.
712 CFArrayRef
/* of SCBridgeInterfaceRef's */
713 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
716 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
717 @discussion Returns all network capable devices on the system
718 that can be added to an bridge interface.
719 @param prefs The "preferences" session.
720 @result The list of interfaces.
721 You must release the returned value.
723 CFArrayRef
/* of SCNetworkInterfaceRef's */
724 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
727 @function SCBridgeInterfaceCreate
728 @discussion Create a new SCBridgeInterface interface.
729 @param prefs The "preferences" session.
730 @result A reference to the new SCBridgeInterface.
731 You must release the returned value.
734 SCBridgeInterfaceCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
737 @function SCBridgeInterfaceRemove
738 @discussion Removes the SCBridgeInterface from the configuration.
739 @param bridge The SCBridgeInterface interface.
740 @result TRUE if the interface was removed; FALSE if an error was encountered.
743 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
746 @function SCBridgeInterfaceGetMemberInterfaces
747 @discussion Returns the member interfaces for the specified bridge interface.
748 @param bridge The SCBridgeInterface interface.
749 @result The list of interfaces.
751 CFArrayRef
/* of SCNetworkInterfaceRef's */
752 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
755 @function SCBridgeInterfaceGetOptions
756 @discussion Returns the configuration settings associated with a bridge interface.
757 @param bridge The SCBridgeInterface interface.
758 @result The configuration settings associated with the bridge interface;
759 NULL if no changes to the default configuration have been saved.
762 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
765 @function SCBridgeInterfaceSetMemberInterfaces
766 @discussion Sets the member interfaces for the specified bridge interface.
767 @param bridge The SCBridgeInterface interface.
768 @param members The desired member interfaces.
769 @result TRUE if the configuration was stored; FALSE if an error was encountered.
772 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge
,
773 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
774 API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
777 @function SCBridgeInterfaceSetLocalizedDisplayName
778 @discussion Sets the localized display name for the specified bridge interface.
779 @param bridge The SCBridgeInterface interface.
780 @param newName The new display name.
781 @result TRUE if the configuration was stored; FALSE if an error was encountered.
784 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge
,
785 CFStringRef newName
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
788 @function SCBridgeInterfaceSetOptions
789 @discussion Sets the configuration settings for the specified bridge interface.
790 @param bridge The SCBridgeInterface interface.
791 @param newOptions The new configuration settings.
792 @result TRUE if the configuration was stored; FALSE if an error was encountered.
795 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge
,
796 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
801 @function _SCBridgeInterfaceCopyActive
802 @discussion Returns all bridge interfaces on the system.
803 @result The list of SCBridgeInterface interfaces on the system.
804 You must release the returned value.
807 _SCBridgeInterfaceCopyActive (void) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
810 @function _SCBridgeInterfaceUpdateConfiguration
811 @discussion Updates the bridge interface configuration.
812 @param prefs The "preferences" session.
813 @result TRUE if the bridge interface configuration was updated.; FALSE if the
814 an error was encountered.
817 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.7)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
821 #pragma mark SCVLANInterface configuration (SPIs)
824 @function _SCVLANInterfaceCopyActive
825 @discussion Returns all VLAN interfaces on the system.
826 @result The list of SCVLANInterface interfaces on the system.
827 You must release the returned value.
830 _SCVLANInterfaceCopyActive (void) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
833 @function _SCVLANInterfaceUpdateConfiguration
834 @discussion Updates the VLAN interface configuration.
835 @param prefs The "preferences" session.
836 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
837 an error was encountered.
840 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
844 #pragma mark SCNetworkInterface Password SPIs
848 kSCNetworkInterfacePasswordTypePPP
= 1,
849 kSCNetworkInterfacePasswordTypeIPSecSharedSecret
,
850 kSCNetworkInterfacePasswordTypeEAPOL
,
851 kSCNetworkInterfacePasswordTypeIPSecXAuth
,
852 kSCNetworkInterfacePasswordTypeVPN
,
854 typedef uint32_t SCNetworkInterfacePasswordType
;
857 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface
,
858 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
861 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface
,
862 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
865 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface
,
866 SCNetworkInterfacePasswordType passwordType
) API_AVAILABLE(macos(10.5), ios(2.0));
869 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface
,
870 SCNetworkInterfacePasswordType passwordType
,
872 CFDictionaryRef options
) API_AVAILABLE(macos(10.5), ios(2.0));
876 SCNetworkInterfaceGetDisableUntilNeeded (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.11), ios(9.0));
879 SCNetworkInterfaceSetDisableUntilNeeded (SCNetworkInterfaceRef interface
,
880 Boolean disable
) API_AVAILABLE(macos(10.11), ios(9.0));
884 SCNetworkInterfaceGetQoSMarkingPolicy (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.13), ios(10.0));
887 SCNetworkInterfaceSetQoSMarkingPolicy (SCNetworkInterfaceRef interface
,
888 CFDictionaryRef policy
) API_AVAILABLE(macos(10.13), ios(10.0));
892 #pragma mark SCNetworkProtocol configuration (SPI)
896 @group Protocol configuration
900 static __inline__ CFTypeRef
901 isA_SCNetworkProtocol(CFTypeRef obj
)
903 return (isA_CFType(obj
, SCNetworkProtocolGetTypeID()));
907 @function _SCNetworkProtocolCompare
908 @discussion Compares two SCNetworkProtocol objects.
909 @param val1 The SCNetworkProtocol object.
910 @param val2 The SCNetworkProtocol object.
911 @param context Not used.
912 @result A comparison result.
915 _SCNetworkProtocolCompare (const void *val1
,
917 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
921 #pragma mark SCNetworkService configuration (SPI)
925 @group Service configuration
929 static __inline__ CFTypeRef
930 isA_SCNetworkService(CFTypeRef obj
)
932 return (isA_CFType(obj
, SCNetworkServiceGetTypeID()));
936 @function _SCNetworkServiceCompare
937 @discussion Compares two SCNetworkService objects.
938 @param val1 The SCNetworkService object.
939 @param val2 The SCNetworkService object.
940 @param context The service order (from SCNetworkSetGetServiceOrder).
941 @result A comparison result.
944 _SCNetworkServiceCompare (const void *val1
,
946 void *context
) API_AVAILABLE(macos(10.7), ios(4.0));
949 @function _SCNetworkServiceCopyActive
950 @discussion Returns the network service with the specified identifier.
952 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
953 API in that queries and operations interact with the "active" service
954 represented in the SCDynamicStore. Only a limited subset of the
955 SCNetworkService APIs are supported.
956 @param store The dynamic store session.
957 @param serviceID The unique identifier for the service.
958 @result A reference to the SCNetworkService represented in the SCDynamicStore;
959 NULL if the serviceID does not exist in the SCDynamicStore or if an
960 error was encountered.
961 You must release the returned value.
964 _SCNetworkServiceCopyActive (SCDynamicStoreRef store
,
965 CFStringRef serviceID
) API_AVAILABLE(macos(10.6), ios(2.1));
968 @function SCNetworkServiceGetPrimaryRank
969 @discussion Returns the primary service rank associated with a service.
970 @param service The network service.
971 @result The primary service rank associated with the specified application;
972 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
973 application or an error was encountered.
975 SCNetworkServicePrimaryRank
976 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.6), ios(2.0));
979 @function SCNetworkServiceSetPrimaryRank
980 @discussion Updates the the primary service rank associated with a service.
981 @param service The network service.
982 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
983 if the default service rank should be used.
984 @result TRUE if the rank was stored; FALSE if an error was encountered.
986 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
987 values can only valid as a transient setting.
990 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service
,
991 SCNetworkServicePrimaryRank newRank
) API_AVAILABLE(macos(10.6), ios(2.0));
994 @function _SCNetworkServiceIsVPN
995 @discussion Identifies a VPN service.
996 @param service The network service.
997 @result TRUE if the service is a VPN.
1000 _SCNetworkServiceIsVPN (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
1003 @function SCNetworkServiceSetExternalID
1004 @discussion Set the external identifier for a network service.
1005 @param service A reference to the network service.
1006 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to set.
1007 @param identifier The new external identifier to assign to the network service.
1008 @result Returns TRUE if the external identifier was set successfully, FALSE if an error occurred.
1011 SCNetworkServiceSetExternalID (SCNetworkServiceRef service
,
1012 CFStringRef identifierDomain
,
1013 CFStringRef identifier
);
1016 @function SCNetworkServiceCopyExternalID
1017 @discussion Copy the external identifier for a network service.
1018 @param service The network service.
1019 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to copy.
1020 @result Returns the service's external identifier, or NULL if the service does not have an external identifier in the given domain.
1023 SCNetworkServiceCopyExternalID (SCNetworkServiceRef service
,
1024 CFStringRef identifierDomain
);
1027 @function _SCNetworkServiceSetServiceID
1028 @discussion Sets serviceID of the service to a different value provided.
1029 @param service The network service
1030 @param newServiceID The new service ID
1031 @result TRUE if new service ID is set successfully.
1034 _SCNetworkServiceSetServiceID (SCNetworkServiceRef service
,
1035 CFStringRef newServiceID
) API_AVAILABLE(macos(10.10), ios(8.0));
1038 #pragma mark SCNetworkSet configuration (SPI)
1042 @group Set configuration
1046 static __inline__ CFTypeRef
1047 isA_SCNetworkSet(CFTypeRef obj
)
1049 return (isA_CFType(obj
, SCNetworkSetGetTypeID()));
1054 @function _SCNetworkSetCompare
1055 @discussion Compares two SCNetworkSet objects.
1056 @param val1 The SCNetworkSet object.
1057 @param val2 The SCNetworkSet object.
1058 @param context Not used.
1059 @result A comparison result.
1062 _SCNetworkSetCompare (const void *val1
,
1064 void *context
) API_AVAILABLE(macos(10.13), ios(11.0));
1067 @function SCNetworkSetCopyAvailableInterfaces
1068 @discussion Returns all available interfaces for the set.
1069 The interfaces excludes those of bond and bridge members.
1070 @param set The network set.
1071 @result The list of SCNetworkInterfaces.
1072 You must release the returned value.
1075 SCNetworkSetCopyAvailableInterfaces (SCNetworkSetRef set
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1078 @function _SCNetworkSetCreateDefault
1079 @discussion Create a new [default] set in the configuration.
1080 @param prefs The "preferences" session.
1081 @result A reference to the new SCNetworkSet.
1082 You must release the returned value.
1085 _SCNetworkSetCreateDefault (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.12)) SPI_AVAILABLE(ios(10.0), tvos(10.0), watchos(3.0), bridgeos(3.0));
1088 @function SCNetworkSetEstablishDefaultConfiguration
1089 @discussion Updates a network set by adding services for
1090 any network interface that is not currently
1092 If the provided set contains one (or more) services, new
1093 services will only be added for those interfaces that are
1094 not represented in *any* set.
1095 Otherwise, new services will be added for those interfaces
1096 that are not represented in the provided set.
1097 The new services are established with "default" configuration
1099 @param set The network set.
1100 @result TRUE if the configuration was updated; FALSE if no
1101 changes were required or if an error was encountered.
1104 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set
) API_AVAILABLE(macos(10.5), ios(2.0));
1107 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
1108 @discussion Updates a network set by adding services for
1109 the specified network interface if is not currently
1111 If the provided set contains one (or more) services, new
1112 services will only be added for interfaces that are not
1113 represented in *any* set.
1114 Otherwise, new services will be added for interfaces that
1115 are not represented in the provided set.
1116 The new services are established with "default" configuration
1118 @param set The network set.
1119 @param interface The network interface.
1120 @result TRUE if the configuration was updated; FALSE if no
1121 changes were required or if an error was encountered.
1124 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set
,
1125 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5), ios(2.0));
1128 @function SCNetworkSetCopySelectedVPNService
1129 @discussion On the iPhone we only allow a single VPN network service
1130 to be selected at any given time. This API will identify
1131 the selected VPN service.
1132 @param set The network set.
1133 @result The selected VPN service; NULL if no service has been
1135 You must release the returned value.
1138 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set
) API_AVAILABLE(macos(10.7), ios(4.0));
1141 @function SCNetworkSetSetSelectedVPNService
1142 @discussion On the iPhone we only allow a single VPN network service
1143 to be selected at any given time. This API should be used to
1144 select a VPN service.
1145 @param set The network set.
1146 @param service The VPN service to be selected.
1147 @result TRUE if the name was saved; FALSE if an error was encountered.
1150 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set
,
1151 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.7), ios(4.0));
1154 _SCNetworkSetSetSetID (SCNetworkSetRef set
,
1155 CFStringRef setID
) API_AVAILABLE(macos(10.10), ios(8.0));
1158 @group VPN Service configuration
1162 #pragma mark VPN Service configuration
1164 typedef SCNetworkServiceRef VPNServiceRef
;
1167 @function VPNServiceCopyAllMatchingExternalID
1168 @discussion Copy the VPN services with the given external identifier.
1169 @param prefs A reference to the prefs where the VPN services are stored.
1170 @param identifierDomain A service can have multiple external identifiers. This string specifies which one to match with the given identifier.
1171 @param identifier The external identifier of the desired services.
1172 @result A array of references to the VPN services with the given identifier, or NULL if no such service exists
1175 VPNServiceCopyAllMatchingExternalID (SCPreferencesRef prefs
,
1176 CFStringRef identifierDomain
,
1177 CFStringRef identifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1180 @function VPNServiceCopyAll
1181 @discussion Copy all VPN services.
1182 @param prefs A reference to the prefs where the VPN services are stored.
1183 @result An array containing VPNServiceRefs for all the VPN services.
1186 VPNServiceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1189 @function VPNServiceCopyAppRuleIDs
1190 @discussion Copy all the app rule identifiers for a VPN service.
1191 @param service A reference to the VPN service.
1192 @result An array of CFStringRefs, each string containing the identifier of a app rule in the given service.
1195 VPNServiceCopyAppRuleIDs (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1198 @function VPNServiceSetAppRule
1199 @discussion Add or modify an app rule in a VPN service. The ruleSettings dictionary must contain one of the following keys:
1200 <pre>kSCValNetVPNAppRuleExecutableMatch</pre>
1201 <pre>kSCValNetVPNAppRuleAccountIdentifierMatch</pre>
1202 The ruleSettings dictionary may also contain the following keys:
1203 <pre>kSCValNetVPNAppRuleDNSDomainMatch</pre>
1204 See SCSchemaDefinitionsPrivate.h for more details.
1205 @param service A reference to the VPN service.
1206 @param ruleIdentifier The identifier of the new app rule.
1207 @param ruleSettings The settings for the new app rule. See the dictionary keys defined above.
1208 @result TRUE if the app rule was set successfully, FALSE if an error occurred.
1211 VPNServiceSetAppRule (VPNServiceRef service
,
1212 CFStringRef ruleIdentifier
,
1213 CFDictionaryRef ruleSettings
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1216 @function VPNServiceCopyAppRule
1217 @discussion Copy the settings for a app rule in a VPN service.
1218 @param service The app tunnel service.
1219 @param ruleIdentifier The ID of the app rule.
1220 @result The rule settings, or NULL if the app rule could not be found.
1223 VPNServiceCopyAppRule (VPNServiceRef service
,
1224 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1227 @function VPNServiceRemoveAppRule
1228 @discussion Remove an app rule from a VPN service.
1229 @param service The VPN service.
1230 @param ruleIdentifier The ID of the app rule to remove.
1231 @result Returns TRUE if the app rule was removed successfully; FALSE otherwise.
1234 VPNServiceRemoveAppRule (VPNServiceRef service
,
1235 CFStringRef ruleIdentifier
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1238 @function VPNServiceIsManagedAppVPN
1239 @discussion Check to see if a VPN service is a managed App VPN service
1240 @param service The VPN servie.
1241 @result Returns TRUE if the service is a managed App VPN service; FALSE otherwise.
1244 VPNServiceIsManagedAppVPN (VPNServiceRef service
) API_AVAILABLE(macos(10.9)) SPI_AVAILABLE(ios(7.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1247 @group Migration SPI
1250 #pragma mark Migration SPI
1252 extern const CFStringRef kSCNetworkConfigurationRepair
/* CFBoolean */ API_AVAILABLE(macos(10.10), ios(8.0));
1254 extern const CFStringRef kSCNetworkConfigurationMigrationActionKey
/* CFNumber */ API_AVAILABLE(macos(10.10), ios(8.0));
1256 typedef CF_ENUM(uint32_t, SCNetworkConfigurationMigrationAction
) {
1257 kSCNetworkConfigurationMigrationAction_CleanInstall
= 0,
1258 kSCNetworkConfigurationMigrationAction_Upgrade
= 1,
1259 kSCNetworkConfigurationMigrationAction_Restore
= 2,
1263 @function _SCNetworkConfigurationCopyMigrationPaths
1264 @result Returns an array of paths that we would need from the source
1267 _SCNetworkConfigurationCopyMigrationPaths(CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1270 @function _SCNetworkConfigurationPerformMigration
1271 @discussion Updates the network configuration of the target system with
1272 configurations from previous system. Both sourceDir and targetDir
1273 cannot be NULL, since NULL indicates API to look at the local system
1274 @param sourceDir A reference which points to the root of a directory populated
1275 with the list of requested directories/path from the "source" volume. Passing NULL
1276 will indicate that sourceDir should point to local system
1277 @param currentDir A reference which points to the root of a directory populated
1278 with the list of requested directories/path from the "destination" volume. Passing
1279 NULL will indicate that currentDir should point to local system.
1280 @param targetDir A reference which points to the root of a directory that we
1281 will populate (update) with new configuration. Passing NULL will mean that we want to
1282 migrate to the currentDir. If not NULL, then this path should exist.
1283 @param options Argument which will tell us what action we are supposed to take
1284 (clean-install, upgrade, migrate/restore settings from another system, ...)
1285 @result Returns array which would consist of those paths that should be moved
1286 from the "targetDir" directory to destination volume. You must release the returned value.
1291 _SCNetworkConfigurationPerformMigration (CFURLRef sourceDir
,
1292 CFURLRef currentDir
,
1294 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1298 @function _SCNetworkConfigurationCheckValidity
1299 @discussion Verifies whether the configuration files present in the specified
1300 directory have valid mappings or not
1301 @param configDir A reference which points to the directory where the configuration
1303 @result TRUE if valid configurations are found
1308 _SCNetworkConfigurationCheckValidity (CFURLRef configDir
,
1309 CFDictionaryRef options
) API_AVAILABLE(macos(10.10), ios(8.0));
1313 @function _SCNetworkConfigurationCheckValidityWithPreferences
1314 @discussion Validates the specified preferences.plist against NetworkInterfaces.plist
1315 @param prefs the preferences ref pointing to the said preferences.plist
1316 @param ni_prefs the preferences ref pointing to the said NetworkInterfaces.plist
1317 @result TRUE if the configurations are valid against each other
1322 _SCNetworkConfigurationCheckValidityWithPreferences
1323 (SCPreferencesRef prefs
,
1324 SCPreferencesRef ni_prefs
,
1325 CFDictionaryRef options
) API_AVAILABLE(macos(10.11), ios(9.0));
1329 @function _SCNetworkMigrationAreConfigurationsIdentical
1330 @discussion Compares the migration output between network configurations
1331 with the expected output.
1332 @param configurationURL A URL pointing to the top-level directory of the
1333 configuration to compare. This directory is expected to have
1334 a Library/Preferences/SystemConfiguration subdirectoy.
1335 @param expectedConfigurationURL A URL pointing to the top-level directory of
1336 the expected configuration. This directory is expected to have
1337 a Library/Preferences/SystemConfiguration subdirectoy.
1338 @result TRUE if configurations match with the expected configurations
1343 _SCNetworkMigrationAreConfigurationsIdentical (CFURLRef configurationURL
,
1344 CFURLRef expectedConfigurationURL
) API_AVAILABLE(macos(10.10), ios(8.0));
1347 @function _SCNetworkConfigurationCopyMigrationRemovePaths
1348 @discussion List of paths to files which we want to be removed from the target filesystem after migration
1349 @param targetPaths the CFArray returned by _SCNetworkConfigurationPerformMigration
1350 @param targetDir the CFURL passed to _SCNetworkConfigurationPerformMigration
1351 @result An array of CFURL's; NULL if no paths need to be removed from the target filesystem
1355 CFArrayRef
// of CFURLRef's
1356 _SCNetworkConfigurationCopyMigrationRemovePaths (CFArrayRef targetPaths
,
1357 CFURLRef targetDir
) API_AVAILABLE(macos(10.10), ios(8.0));
1361 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */