2 * Copyright (c) 2004-2011, 2015, 2016 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 _SCNETWORKCONFIGURATION_H
25 #ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
26 #include <SystemConfiguration/_SCNetworkConfiguration.h>
27 #else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
28 #define _SCNETWORKCONFIGURATION_H
30 #include <Availability.h>
31 #include <TargetConditionals.h>
32 #include <sys/cdefs.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SystemConfiguration.h>
36 CF_IMPLICIT_BRIDGING_ENABLED
37 CF_ASSUME_NONNULL_BEGIN
40 @header SCNetworkConfiguration
41 @discussion The SCNetworkConfiguration API provides access to the
42 stored network configuration. The functions include
43 providing access to the network capable devices on the
44 system, the network sets, network services, and network
47 Note: When using the SCNetworkConfiguraiton APIs you must
48 keep in mind that in order for any of your changes to be
49 committed to permanent storage a call must be made to the
50 SCPreferencesCommitChanges function.
55 @group Interface configuration
59 #pragma mark SCNetworkInterface configuration (typedefs, consts)
62 @typedef SCNetworkInterfaceRef
63 @discussion This is the type of a reference to an object that represents
66 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkInterface
* SCNetworkInterfaceRef
;
69 @const kSCNetworkInterfaceType6to4
71 extern const CFStringRef kSCNetworkInterfaceType6to4
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
74 @const kSCNetworkInterfaceTypeBluetooth
76 extern const CFStringRef kSCNetworkInterfaceTypeBluetooth
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
79 @const kSCNetworkInterfaceTypeBond
81 extern const CFStringRef kSCNetworkInterfaceTypeBond
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_4_0
/*SPI*/);
84 @const kSCNetworkInterfaceTypeEthernet
86 extern const CFStringRef kSCNetworkInterfaceTypeEthernet
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
89 @const kSCNetworkInterfaceTypeFireWire
91 extern const CFStringRef kSCNetworkInterfaceTypeFireWire
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
94 @const kSCNetworkInterfaceTypeIEEE80211
96 extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/); // IEEE 802.11, AirPort
99 @const kSCNetworkInterfaceTypeIPSec
101 extern const CFStringRef kSCNetworkInterfaceTypeIPSec
__OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
104 @const kSCNetworkInterfaceTypeIrDA
106 extern const CFStringRef kSCNetworkInterfaceTypeIrDA
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
109 @const kSCNetworkInterfaceTypeL2TP
111 extern const CFStringRef kSCNetworkInterfaceTypeL2TP
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
114 @const kSCNetworkInterfaceTypeModem
116 extern const CFStringRef kSCNetworkInterfaceTypeModem
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
119 @const kSCNetworkInterfaceTypePPP
121 extern const CFStringRef kSCNetworkInterfaceTypePPP
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
124 @const kSCNetworkInterfaceTypePPTP
126 extern const CFStringRef kSCNetworkInterfaceTypePPTP
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4
,__MAC_10_12
,__IPHONE_2_0
/*SPI*/,__IPHONE_10_0
/*SPI*/);
129 @const kSCNetworkInterfaceTypeSerial
131 extern const CFStringRef kSCNetworkInterfaceTypeSerial
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
134 @const kSCNetworkInterfaceTypeVLAN
136 extern const CFStringRef kSCNetworkInterfaceTypeVLAN
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_4_0
/*SPI*/);
139 @const kSCNetworkInterfaceTypeWWAN
141 extern const CFStringRef kSCNetworkInterfaceTypeWWAN
__OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
143 /* special network interfaces (and types) */
146 @const kSCNetworkInterfaceTypeIPv4
148 extern const CFStringRef kSCNetworkInterfaceTypeIPv4
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
151 @const kSCNetworkInterfaceIPv4
152 @discussion A network interface that can used for layering other
153 interfaces (e.g. 6to4, IPSec, PPTP, L2TP) over an existing
156 extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
159 @group Interface configuration (Bond)
165 @typedef SCBondInterfaceRef
166 @discussion This is the type of a reference to an object that represents
167 an Ethernet Bond interface.
169 typedef SCNetworkInterfaceRef SCBondInterfaceRef
;
172 @typedef SCBondStatusRef
173 @discussion This is the type of a reference to an object that represents
174 the status of an Ethernet Bond interface.
176 typedef const struct CF_BRIDGED_TYPE(id
) __SCBondStatus
* SCBondStatusRef
;
179 @enum Ethernet Bond Aggregation Status (kSCBondStatusDeviceAggregationStatus) codes
180 @discussion Returned status codes.
181 @constant kSCBondStatusOK Enabled, active, running, ...
182 @constant kSCBondStatusLinkInvalid The link state was not valid (i.e. down, half-duplex, wrong speed)
183 @constant kSCBondStatusNoPartner The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled
184 @constant kSCBondStatusNotInActiveGroup We're talking to a partner, but the link aggregation group is different from the one that's active
185 @constant kSCBondStatusUnknown Non-specific failure
188 kSCBondStatusOK
= 0, /* enabled, active, running, ... */
189 kSCBondStatusLinkInvalid
= 1, /* The link state was not valid (i.e. down, half-duplex, wrong speed) */
190 kSCBondStatusNoPartner
= 2, /* The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled */
191 kSCBondStatusNotInActiveGroup
= 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
192 kSCBondStatusUnknown
= 999 /* Non-specific failure */
196 @const kSCBondStatusDeviceAggregationStatus
198 extern const CFStringRef kSCBondStatusDeviceAggregationStatus
/* CFNumber */ __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_4_0
/*SPI*/);
201 @const kSCBondStatusDeviceCollecting
203 extern const CFStringRef kSCBondStatusDeviceCollecting
/* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_4_0
/*SPI*/);
206 @const kSCBondStatusDeviceDistributing
208 extern const CFStringRef kSCBondStatusDeviceDistributing
/* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_4_0
/*SPI*/);
211 @group Interface configuration (VLAN)
217 @typedef SCVLANInterfaceRef
218 @discussion This is the type of a reference to an object that represents
219 a Virtual LAN (VLAN) interface.
221 typedef SCNetworkInterfaceRef SCVLANInterfaceRef
;
225 @group Protocol configuration
229 #pragma mark SCNetworkProtocol configuration (typedefs, consts)
232 @typedef SCNetworkProtocolRef
233 @discussion This is the type of a reference to an object that represents
236 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkProtocol
* SCNetworkProtocolRef
;
238 /* network "protocol" types */
241 @const kSCNetworkProtocolTypeDNS
243 extern const CFStringRef kSCNetworkProtocolTypeDNS
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
246 @const kSCNetworkProtocolTypeIPv4
248 extern const CFStringRef kSCNetworkProtocolTypeIPv4
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
251 @const kSCNetworkProtocolTypeIPv6
253 extern const CFStringRef kSCNetworkProtocolTypeIPv6
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
256 @const kSCNetworkProtocolTypeProxies
258 extern const CFStringRef kSCNetworkProtocolTypeProxies
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
261 @const kSCNetworkProtocolTypeSMB
263 extern const CFStringRef kSCNetworkProtocolTypeSMB
__OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_NA
);
266 @group Service configuration
270 #pragma mark SCNetworkService configuration (typedefs, consts)
273 @typedef SCNetworkServiceRef
274 @discussion This is the type of a reference to an object that represents
277 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkService
* SCNetworkServiceRef
;
281 @group Set configuration
285 #pragma mark SCNetworkSet configuration (typedefs, consts)
288 @typedef SCNetworkSetRef
289 @discussion This is the type of a reference to an object that represents
292 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkSet
* SCNetworkSetRef
;
298 /* --------------------------------------------------------------------------------
300 * -------------------------------------------------------------------------------- */
303 @group Interface configuration
307 #pragma mark SCNetworkInterface configuration (APIs)
310 @function SCNetworkInterfaceGetTypeID
311 @discussion Returns the type identifier of all SCNetworkInterface instances.
314 SCNetworkInterfaceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
317 @function SCNetworkInterfaceCopyAll
318 @discussion Returns all network capable interfaces on the system.
319 @result The list of interfaces on the system.
320 You must release the returned value.
322 CFArrayRef
/* of SCNetworkInterfaceRef's */
323 SCNetworkInterfaceCopyAll (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
326 @function SCNetworkInterfaceGetSupportedInterfaceTypes
327 @discussion Identify all of the network interface types (e.g. PPP) that
328 can be layered on top of this interface.
329 @param interface The network interface.
330 @result The list of SCNetworkInterface types supported by the interface;
331 NULL if no interface types are supported.
333 CFArrayRef
/* of kSCNetworkInterfaceTypeXXX CFStringRef's */ __nullable
334 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
337 @function SCNetworkInterfaceGetSupportedProtocolTypes
338 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
339 can be layered on top of this interface.
340 @param interface The network interface.
341 @result The list of SCNetworkProtocol types supported by the interface;
342 NULL if no protocol types are supported.
344 CFArrayRef
/* of kSCNetworkProtocolTypeXXX CFStringRef's */ __nullable
345 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
348 @function SCNetworkInterfaceCreateWithInterface
349 @discussion Create a new network interface layered on top of another. For
350 example, this function would be used to create a "PPP" interface
352 @param interface The network interface.
353 @param interfaceType The type of SCNetworkInterface to be layered on
354 top of the provided interface.
355 @result A reference to the new SCNetworkInterface.
356 You must release the returned value.
358 SCNetworkInterfaceRef __nullable
359 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface
,
360 CFStringRef interfaceType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
363 @function SCNetworkInterfaceGetBSDName
364 @discussion Returns the BSD interface (en0) or device name (modem)
366 @param interface The network interface.
367 @result The BSD name associated with the interface (e.g. "en0");
368 NULL if no BSD name is available.
370 CFStringRef __nullable
371 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
374 @function SCNetworkInterfaceGetConfiguration
375 @discussion Returns the configuration settings associated with a interface.
376 @param interface The network interface.
377 @result The configuration settings associated with the interface;
378 NULL if no configuration settings are associated with the interface
379 or an error was encountered.
381 CFDictionaryRef __nullable
382 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
385 @function SCNetworkInterfaceGetExtendedConfiguration
386 @discussion Returns the configuration settings associated with a interface.
387 @param interface The network interface.
388 @param extendedType A string representing the type of extended information (e.g. EAPOL).
389 @result The configuration settings associated with the interface;
390 NULL if no configuration settings are associated with the interface
391 or an error was encountered.
393 CFDictionaryRef __nullable
394 SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface
,
395 CFStringRef extendedType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
398 @function SCNetworkInterfaceGetHardwareAddressString
399 @discussion Returns a displayable link layer address for the interface.
400 @param interface The network interface.
401 @result A string representing the hardware (MAC) address for the interface.
403 CFStringRef __nullable
404 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
407 @function SCNetworkInterfaceGetInterface
408 @discussion For layered network interfaces, return the underlying interface.
409 @param interface The network interface.
410 @result The underlying network interface;
411 NULL if this is a leaf interface.
413 SCNetworkInterfaceRef __nullable
414 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
417 @function SCNetworkInterfaceGetInterfaceType
418 @discussion Returns the associated network interface type.
419 @param interface The network interface.
420 @result The interface type.
422 CFStringRef __nullable
423 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
426 @function SCNetworkInterfaceGetLocalizedDisplayName
427 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
429 @param interface The network interface.
430 @result A localized, display name for the interface;
431 NULL if no name is available.
433 CFStringRef __nullable
434 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
437 @function SCNetworkInterfaceSetConfiguration
438 @discussion Stores the configuration settings for the interface.
439 @param interface The network interface.
440 @param config The configuration settings to associate with this interface.
441 @result TRUE if the configuration was stored; FALSE if an error was encountered.
444 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
445 CFDictionaryRef __nullable config
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
448 @function SCNetworkInterfaceSetExtendedConfiguration
449 @discussion Stores the configuration settings for the interface.
450 @param interface The network interface.
451 @param config The configuration settings to associate with this interface.
452 @result TRUE if the configuration was stored; FALSE if an error was encountered.
455 SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface
,
456 CFStringRef extendedType
,
457 CFDictionaryRef __nullable config
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
462 @function SCNetworkInterfaceCopyMediaOptions
463 @discussion For the specified network interface, returns information
464 about the currently requested media options, the active media
465 options, and the media options which are available.
466 @param interface The desired network interface.
467 @param current A pointer to memory that will be filled with a CFDictionaryRef
468 representing the currently requested media options (subtype, options).
469 If NULL, the current options will not be returned.
470 @param active A pointer to memory that will be filled with a CFDictionaryRef
471 representing the active media options (subtype, options).
472 If NULL, the active options will not be returned.
473 @param available A pointer to memory that will be filled with a CFArrayRef
474 representing the possible media options (subtype, options).
475 If NULL, the available options will not be returned.
476 @param filter A boolean indicating whether the available options should be
477 filtered to exclude those options which would not normally be
478 requested by a user/admin (e.g. hw-loopback).
479 @result TRUE if requested information has been returned.
482 SCNetworkInterfaceCopyMediaOptions (SCNetworkInterfaceRef interface
,
483 CFDictionaryRef __nullable
* __nullable current
,
484 CFDictionaryRef __nullable
* __nullable active
,
485 CFArrayRef __nullable
* __nullable available
,
486 Boolean filter
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
489 @function SCNetworkInterfaceCopyMediaSubTypes
490 @discussion For the provided interface configuration options, return a list
491 of available media subtypes.
492 @param available The available options as returned by the
493 SCNetworkInterfaceCopyMediaOptions function.
494 @result An array of available media subtypes CFString's (e.g. 10BaseT/UTP,
495 100baseTX, etc). NULL if no subtypes are available.
497 CFArrayRef __nullable
498 SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
501 @function SCNetworkInterfaceCopyMediaSubTypeOptions
502 @discussion For the provided interface configuration options and specific
503 subtype, return a list of available media options.
504 @param available The available options as returned by the
505 SCNetworkInterfaceCopyMediaOptions function.
506 @param subType The subtype
507 @result An array of available media options. Each of the available options
508 is returned as an array of CFString's (e.g. <half-duplex>,
509 <full-duplex,flow-control>). NULL if no options are available.
511 CFArrayRef __nullable
512 SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available
,
513 CFStringRef subType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
516 @function SCNetworkInterfaceCopyMTU
517 @discussion For the specified network interface, returns information
518 about the currently MTU setting and the range of allowable
520 @param interface The desired network interface.
521 @param mtu_cur A pointer to memory that will be filled with the current
522 MTU setting for the interface.
523 @param mtu_min A pointer to memory that will be filled with the minimum
524 MTU setting for the interface. If negative, the minimum setting
525 could not be determined.
526 @param mtu_max A pointer to memory that will be filled with the maximum
527 MTU setting for the interface. If negative, the maximum setting
528 could not be determined.
529 @result TRUE if requested information has been returned.
532 SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface
,
533 int * __nullable mtu_cur
,
534 int * __nullable mtu_min
,
535 int * __nullable mtu_max
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
538 @function SCNetworkInterfaceSetMediaOptions
539 @discussion For the specified network interface, sets the requested
540 media subtype and options.
541 @param interface The desired network interface.
542 @param subtype The desired media subtype (e.g. "autoselect", "100baseTX", ...).
543 @param options The desired media options (e.g. "half-duplex", "full-duplex", ...).
544 @result TRUE if the configuration was updated; FALSE if an error was encountered.
547 SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface
,
549 CFArrayRef options
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
552 @function SCNetworkInterfaceSetMTU
553 @discussion For the specified network interface, sets the
554 requested MTU setting.
555 @param interface The desired network interface.
556 @param mtu The desired MTU setting for the interface.
557 @result TRUE if the configuration was updated; FALSE if an error was encountered.
560 SCNetworkInterfaceSetMTU (SCNetworkInterfaceRef interface
,
561 int mtu
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
564 @function SCNetworkInterfaceForceConfigurationRefresh
565 @discussion Sends a notification to interested network configuration
566 agents to immediately retry their configuration. For example,
567 calling this function will cause the DHCP client to contact
568 the DHCP server immediately rather than waiting until its
569 timeout has expired. The utility of this function is to
570 allow the caller to give a hint to the system that the
571 network infrastructure or configuration has changed.
573 Note: This function requires root (euid==0) privilege or,
574 alternatively, you may pass an SCNetworkInterface which
575 is derived from a sequence of calls to :
577 SCPreferencesCreateWithAuthorization
579 SCNetworkServiceGetInterface
580 @param interface The desired network interface.
581 @result Returns TRUE if the notification was sent; FALSE otherwise.
584 SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
587 @group Interface configuration (Bond)
591 #pragma mark SCBondInterface configuration (APIs)
594 @function SCBondInterfaceCopyAll
595 @discussion Returns all Ethernet Bond interfaces on the system.
596 @param prefs The "preferences" session.
597 @result The list of Ethernet Bond interfaces on the system.
598 You must release the returned value.
600 CFArrayRef
/* of SCBondInterfaceRef's */
601 SCBondInterfaceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
604 @function SCBondInterfaceCopyAvailableMemberInterfaces
605 @discussion Returns all network capable devices on the system
606 that can be added to an Ethernet Bond interface.
607 @param prefs The "preferences" session.
608 @result The list of interfaces.
609 You must release the returned value.
611 CFArrayRef
/* of SCNetworkInterfaceRef's */
612 SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
615 @function SCBondInterfaceCreate
616 @discussion Create a new SCBondInterface interface.
617 @param prefs The "preferences" session.
618 @result A reference to the new SCBondInterface.
619 You must release the returned value.
621 SCBondInterfaceRef __nullable
622 SCBondInterfaceCreate (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
625 @function SCBondInterfaceRemove
626 @discussion Removes the SCBondInterface from the configuration.
627 @param bond The SCBondInterface interface.
628 @result TRUE if the interface was removed; FALSE if an error was encountered.
631 SCBondInterfaceRemove (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
634 @function SCBondInterfaceGetMemberInterfaces
635 @discussion Returns the member interfaces for the specified Ethernet Bond interface.
636 @param bond The SCBondInterface interface.
637 @result The list of interfaces.
639 CFArrayRef
/* of SCNetworkInterfaceRef's */ __nullable
640 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
643 @function SCBondInterfaceGetOptions
644 @discussion Returns the configuration settings associated with a Ethernet Bond interface.
645 @param bond The SCBondInterface interface.
646 @result The configuration settings associated with the Ethernet Bond interface;
647 NULL if no changes to the default configuration have been saved.
649 CFDictionaryRef __nullable
650 SCBondInterfaceGetOptions (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
653 @function SCBondInterfaceSetMemberInterfaces
654 @discussion Sets the member interfaces for the specified Ethernet Bond interface.
655 @param bond The SCBondInterface interface.
656 @param members The desired member interfaces.
657 @result TRUE if the configuration was stored; FALSE if an error was encountered.
660 SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond
,
661 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
662 __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
665 @function SCBondInterfaceSetLocalizedDisplayName
666 @discussion Sets the localized display name for the specified Ethernet Bond interface.
667 @param bond The SCBondInterface interface.
668 @param newName The new display name.
669 @result TRUE if the configuration was stored; FALSE if an error was encountered.
672 SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond
,
673 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
676 @function SCBondInterfaceSetOptions
677 @discussion Sets the configuration settings for the specified Ethernet Bond interface.
678 @param bond The SCBondInterface interface.
679 @param newOptions The new configuration settings.
680 @result TRUE if the configuration was stored; FALSE if an error was encountered.
683 SCBondInterfaceSetOptions (SCBondInterfaceRef bond
,
684 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
689 @function SCBondInterfaceCopyStatus
690 @discussion Returns the status of the specified Ethernet Bond interface.
691 @param bond The SCBondInterface interface.
692 @result The status associated with the interface.
693 You must release the returned value.
695 SCBondStatusRef __nullable
696 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
699 @function SCBondStatusGetTypeID
700 @discussion Returns the type identifier of all SCBondStatus instances.
703 SCBondStatusGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
706 @function SCBondStatusGetMemberInterfaces
707 @discussion Returns the member interfaces that are represented with the
708 Ethernet Bond interface.
709 @param bondStatus The Ethernet Bond status.
710 @result The list of interfaces.
712 CFArrayRef __nullable
/* of SCNetworkInterfaceRef's */
713 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
716 @function SCBondStatusGetInterfaceStatus
717 @discussion Returns the status of a specific member interface of an
718 Ethernet Bond or the status of the bond as a whole.
719 @param bondStatus The Ethernet Bond status.
720 @param interface The specific member interface; NULL if you want the
721 status of the Ethernet Bond.
722 @result The interface status.
724 Note: at present, no information about the status of the Ethernet
725 Bond is returned. As long as one member interface is active
726 then the bond should be operational.
728 CFDictionaryRef __nullable
729 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus
,
730 SCNetworkInterfaceRef __nullable interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
733 @group Interface configuration (VLAN)
737 #pragma mark SCVLANInterface configuration (APIs)
740 @function SCVLANInterfaceCopyAll
741 @discussion Returns all VLAN interfaces on the system.
742 @result The list of VLAN interfaces on the system.
743 You must release the returned value.
745 CFArrayRef
/* of SCVLANInterfaceRef's */
746 SCVLANInterfaceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
749 @function SCVLANInterfaceCopyAvailablePhysicalInterfaces
750 @discussion Returns the network capable devices on the system
751 that can be associated with a VLAN interface.
752 @result The list of interfaces.
753 You must release the returned value.
755 CFArrayRef
/* of SCNetworkInterfaceRef's */
756 SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
759 @function SCVLANInterfaceCreate
760 @discussion Create a new SCVLANInterface interface.
761 @param prefs The "preferences" session.
762 @param physical The physical interface to associate with the VLAN.
763 @param tag The tag to associate with the VLAN.
764 @result A reference to the new SCVLANInterface.
765 You must release the returned value.
767 Note: the tag must be in the range (1 <= tag <= 4094)
769 SCVLANInterfaceRef __nullable
770 SCVLANInterfaceCreate (SCPreferencesRef prefs
,
771 SCNetworkInterfaceRef physical
,
772 CFNumberRef tag
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
775 @function SCVLANInterfaceRemove
776 @discussion Removes the SCVLANInterface from the configuration.
777 @param vlan The SCVLANInterface interface.
778 @result TRUE if the interface was removed; FALSE if an error was encountered.
781 SCVLANInterfaceRemove (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
784 @function SCVLANInterfaceGetPhysicalInterface
785 @discussion Returns the physical interface for the specified VLAN interface.
786 @param vlan The SCVLANInterface interface.
787 @result The list of interfaces.
789 SCNetworkInterfaceRef __nullable
790 SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
793 @function SCVLANInterfaceGetTag
794 @discussion Returns the tag for the specified VLAN interface.
795 @param vlan The SCVLANInterface interface.
798 CFNumberRef __nullable
799 SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
802 @function SCVLANInterfaceGetOptions
803 @discussion Returns the configuration settings associated with the VLAN interface.
804 @param vlan The SCVLANInterface interface.
805 @result The configuration settings associated with the VLAN interface;
806 NULL if no changes to the default configuration have been saved.
808 CFDictionaryRef __nullable
809 SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
812 @function SCVLANInterfaceSetPhysicalInterfaceAndTag
813 @discussion Updates the specified VLAN interface.
814 @param vlan The SCVLANInterface interface.
815 @param physical The physical interface to associate with the VLAN.
816 @param tag The tag to associate with the VLAN.
817 @result TRUE if the configuration was stored; FALSE if an error was encountered.
819 Note: the tag must be in the range (1 <= tag <= 4094)
822 SCVLANInterfaceSetPhysicalInterfaceAndTag (SCVLANInterfaceRef vlan
,
823 SCNetworkInterfaceRef physical
,
824 CFNumberRef tag
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
827 @function SCVLANInterfaceSetLocalizedDisplayName
828 @discussion Sets the localized display name for the specified VLAN interface.
829 @param vlan The SCVLANInterface interface.
830 @param newName The new display name.
831 @result TRUE if the configuration was stored; FALSE if an error was encountered.
834 SCVLANInterfaceSetLocalizedDisplayName (SCVLANInterfaceRef vlan
,
835 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
838 @function SCVLANInterfaceSetOptions
839 @discussion Sets the configuration settings for the specified VLAN interface.
840 @param vlan The SCVLANInterface interface.
841 @param newOptions The new configuration settings.
842 @result TRUE if the configuration was stored; FALSE if an error was encountered.
845 SCVLANInterfaceSetOptions (SCVLANInterfaceRef vlan
,
846 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
849 /* --------------------------------------------------------------------------------
851 * -------------------------------------------------------------------------------- */
854 @group Protocol configuration
858 #pragma mark SCNetworkProtocol configuration (APIs)
861 @function SCNetworkProtocolGetTypeID
862 @discussion Returns the type identifier of all SCNetworkProtocol instances.
865 SCNetworkProtocolGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
868 @function SCNetworkProtocolGetConfiguration
869 @discussion Returns the configuration settings associated with the protocol.
870 @param protocol The network protocol.
871 @result The configuration settings associated with the protocol;
872 NULL if no configuration settings are associated with the protocol
873 or an error was encountered.
875 CFDictionaryRef __nullable
876 SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
879 @function SCNetworkProtocolGetEnabled
880 @discussion Returns whether this protocol has been enabled.
881 @param protocol The network protocol.
882 @result TRUE if the protocol is enabled.
885 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
888 @function SCNetworkProtocolGetProtocolType
889 @discussion Returns the associated network protocol type.
890 @param protocol The network protocol.
891 @result The protocol type.
893 CFStringRef __nullable
894 SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
897 @function SCNetworkProtocolSetConfiguration
898 @discussion Stores the configuration settings for the protocol.
899 @param protocol The network protocol.
900 @param config The configuration settings to associate with this protocol.
901 @result TRUE if the configuration was stored; FALSE if an error was encountered.
904 SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol
,
905 CFDictionaryRef __nullable config
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
908 @function SCNetworkProtocolSetEnabled
909 @discussion Enables or disables the protocol.
910 @param protocol The network protocol.
911 @param enabled TRUE if the protocol should be enabled.
912 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
915 SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol
,
916 Boolean enabled
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
918 /* --------------------------------------------------------------------------------
920 * -------------------------------------------------------------------------------- */
923 @group Service configuration
927 #pragma mark SCNetworkService configuration (APIs)
930 @function SCNetworkServiceGetTypeID
931 @discussion Returns the type identifier of all SCNetworkService instances.
934 SCNetworkServiceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
937 @function SCNetworkServiceAddProtocolType
938 @discussion Adds a network protocol of the specified type to the
939 service. The protocal configuration is set to default values
940 that are appropriate for the interface associated with the
942 @param service The network service.
943 @param protocolType The type of SCNetworkProtocol to be added to the service.
944 @result TRUE if the protocol was added to the service; FALSE if the
945 protocol was already present or an error was encountered.
948 SCNetworkServiceAddProtocolType (SCNetworkServiceRef service
,
949 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
952 @function SCNetworkServiceCopyAll
953 @discussion Returns all available network services for the specified preferences.
954 @param prefs The "preferences" session.
955 @result The list of SCNetworkService services associated with the preferences.
956 You must release the returned value.
958 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
959 SCNetworkServiceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
962 @function SCNetworkServiceCopyProtocols
963 @discussion Returns all network protocols associated with the service.
964 @param service The network service.
965 @result The list of SCNetworkProtocol protocols associated with the service.
966 You must release the returned value.
968 CFArrayRef
/* of SCNetworkProtocolRef's */ __nullable
969 SCNetworkServiceCopyProtocols (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
972 @function SCNetworkServiceCreate
973 @discussion Create a new network service for the specified interface in the
975 @param prefs The "preferences" session.
976 @result A reference to the new SCNetworkService.
977 You must release the returned value.
979 SCNetworkServiceRef __nullable
980 SCNetworkServiceCreate (SCPreferencesRef prefs
,
981 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
984 @function SCNetworkServiceCopy
985 @discussion Returns the network service with the specified identifier.
986 @param prefs The "preferences" session.
987 @param serviceID The unique identifier for the service.
988 @result A reference to the SCNetworkService from the associated preferences;
989 NULL if the serviceID does not exist in the preferences or if an
990 error was encountered.
991 You must release the returned value.
993 SCNetworkServiceRef __nullable
994 SCNetworkServiceCopy (SCPreferencesRef prefs
,
995 CFStringRef serviceID
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
998 @function SCNetworkServiceEstablishDefaultConfiguration
999 @discussion Establishes the "default" configuration for a network
1000 service. This configuration includes the addition of
1001 network protocols for the service (with "default"
1002 configuration options).
1003 @param service The network service.
1004 @result TRUE if the configuration was updated; FALSE if an error was encountered.
1007 SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
1010 @function SCNetworkServiceGetEnabled
1011 @discussion Returns whether this service has been enabled.
1012 @param service The network service.
1013 @result TRUE if the service is enabled.
1016 SCNetworkServiceGetEnabled (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1019 @function SCNetworkServiceGetInterface
1020 @discussion Returns the network interface associated with the service.
1021 @param service The network service.
1022 @result A reference to the SCNetworkInterface associated with the service;
1023 NULL if an error was encountered.
1025 SCNetworkInterfaceRef __nullable
1026 SCNetworkServiceGetInterface (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1029 @function SCNetworkServiceGetName
1030 @discussion Returns the [user specified] name associated with the service.
1031 @param service The network service.
1032 @result The [user specified] name.
1034 CFStringRef __nullable
1035 SCNetworkServiceGetName (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1038 @function SCNetworkServiceCopyProtocol
1039 @discussion Returns the network protocol of the specified type for
1041 @param service The network service.
1042 @result A reference to the SCNetworkProtocol associated with the service;
1043 NULL if this protocol has not been added or if an error was encountered.
1044 You must release the returned value.
1046 SCNetworkProtocolRef __nullable
1047 SCNetworkServiceCopyProtocol (SCNetworkServiceRef service
,
1048 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1051 @function SCNetworkServiceGetServiceID
1052 @discussion Returns the identifier for the service.
1053 @param service The network service.
1054 @result The service identifier.
1056 CFStringRef __nullable
1057 SCNetworkServiceGetServiceID (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1060 @function SCNetworkServiceRemove
1061 @discussion Removes the network service from the configuration.
1062 @param service The network service.
1063 @result TRUE if the service was removed; FALSE if an error was encountered.
1066 SCNetworkServiceRemove (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1069 @function SCNetworkServiceRemoveProtocolType
1070 @discussion Removes the network protocol of the specified type from the service.
1071 @param service The network service.
1072 @param protocolType The type of SCNetworkProtocol to be removed from the service.
1073 @result TRUE if the protocol was removed to the service; FALSE if the
1074 protocol was not configured or an error was encountered.
1077 SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service
,
1078 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1081 @function SCNetworkServiceSetEnabled
1082 @discussion Enables or disables the service.
1083 @param service The network service.
1084 @param enabled TRUE if the service should be enabled.
1085 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
1088 SCNetworkServiceSetEnabled (SCNetworkServiceRef service
,
1089 Boolean enabled
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1092 @function SCNetworkServiceSetName
1093 @discussion Stores the [user specified] name for the service.
1094 @param service The network service.
1095 @param name The [user defined] name to associate with the service.
1096 @result TRUE if the name was saved; FALSE if an error was encountered.
1098 Note: although not technically required, the [user specified] names
1099 for all services within any given set should be unique. As such, an
1100 error will be returned if you attemp to name two services with the
1104 SCNetworkServiceSetName (SCNetworkServiceRef service
,
1105 CFStringRef __nullable name
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1108 /* --------------------------------------------------------------------------------
1110 * -------------------------------------------------------------------------------- */
1113 @group Set configuration
1117 #pragma mark SCNetworkSet configuration (APIs)
1120 @function SCNetworkSetGetTypeID
1121 @discussion Returns the type identifier of all SCNetworkSet instances.
1124 SCNetworkSetGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1127 @function SCNetworkSetAddService
1128 @discussion Adds the network service to the set.
1129 @param set The network set.
1130 @param service The service to be added.
1131 @result TRUE if the service was added to the set; FALSE if the
1132 service was already present or an error was encountered.
1134 Note: prior to Mac OS X 10.5, the Network Preferences UI
1135 did not support having a single service being a member of
1136 more than one set. An error will be returned if you attempt
1137 to add a service to more than one set on a pre-10.5 system.
1140 SCNetworkSetAddService (SCNetworkSetRef set
,
1141 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1144 @function SCNetworkSetContainsInterface
1145 @discussion Checks if an interface is represented by at least one
1146 network service in the specified set.
1147 @param set The network set.
1148 @param interface The network interface.
1149 @result TRUE if the interface is represented in the set; FALSE if not.
1152 SCNetworkSetContainsInterface (SCNetworkSetRef set
,
1153 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
1156 @function SCNetworkSetCopyAll
1157 @discussion Returns all available sets for the specified preferences.
1158 @param prefs The "preferences" session.
1159 @result The list of SCNetworkSet sets associated with the preferences.
1160 You must release the returned value.
1162 CFArrayRef
/* of SCNetworkSetRef's */ __nullable
1163 SCNetworkSetCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1166 @function SCNetworkSetCopyCurrent
1167 @discussion Returns the "current" set.
1168 @param prefs The "preferences" session.
1169 @result The current set; NULL if no current set has been defined.
1171 SCNetworkSetRef __nullable
1172 SCNetworkSetCopyCurrent (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1175 @function SCNetworkSetCopyServices
1176 @discussion Returns all network services associated with the set.
1177 @param set The network set.
1178 @result The list of SCNetworkService services associated with the set.
1179 You must release the returned value.
1181 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
1182 SCNetworkSetCopyServices (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1185 @function SCNetworkSetCreate
1186 @discussion Create a new set in the configuration.
1187 @param prefs The "preferences" session.
1188 @result A reference to the new SCNetworkSet.
1189 You must release the returned value.
1191 SCNetworkSetRef __nullable
1192 SCNetworkSetCreate (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1195 @function SCNetworkSetCopy
1196 @discussion Returns the set with the specified identifier.
1197 @param prefs The "preferences" session.
1198 @param setID The unique identifier for the set.
1199 @result A reference to the SCNetworkSet from the associated preferences;
1200 NULL if the setID does not exist in the preferences or if an
1201 error was encountered.
1202 You must release the returned value.
1204 SCNetworkSetRef __nullable
1205 SCNetworkSetCopy (SCPreferencesRef prefs
,
1206 CFStringRef setID
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1209 @function SCNetworkSetGetName
1210 @discussion Returns the [user specified] name associated with the set.
1211 @param set The network set.
1212 @result The [user specified] name.
1214 CFStringRef __nullable
1215 SCNetworkSetGetName (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1218 @function SCNetworkSetGetSetID
1219 @discussion Returns the identifier for the set.
1220 @param set The network set.
1221 @result The set identifier.
1223 CFStringRef __nullable
1224 SCNetworkSetGetSetID (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1227 @function SCNetworkSetGetServiceOrder
1228 @discussion Returns the [user specified] ordering of network services
1230 @param set The network set.
1231 @result The ordered list of CFStringRef service identifiers associated
1233 NULL if no service order has been specified or if an error
1236 CFArrayRef
/* of serviceID CFStringRef's */ __nullable
1237 SCNetworkSetGetServiceOrder (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1240 @function SCNetworkSetRemove
1241 @discussion Removes the set from the configuration.
1242 @param set The network set.
1243 @result TRUE if the set was removed; FALSE if an error was encountered.
1246 SCNetworkSetRemove (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1249 @function SCNetworkSetRemoveService
1250 @discussion Removes the network service from the set.
1251 @param set The network set.
1252 @param service The service to be removed.
1253 @result TRUE if the service was removed from the set; FALSE if the
1254 service was not already present or an error was encountered.
1257 SCNetworkSetRemoveService (SCNetworkSetRef set
,
1258 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1261 @function SCNetworkSetSetCurrent
1262 @discussion Specifies the set that should be the "current" set.
1263 @param set The network set.
1264 @result TRUE if the current set was updated;
1265 FALSE if an error was encountered.
1268 SCNetworkSetSetCurrent (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1271 @function SCNetworkSetSetName
1272 @discussion Stores the [user specified] name for the set.
1273 @param set The network set.
1274 @param name The [user defined] name to associate with the set.
1275 @result TRUE if the name was saved; FALSE if an error was encountered.
1277 Note: although not technically required, the [user specified] names
1278 for all set should be unique. As such, an error will be returned if
1279 you attemp to name two sets with the same string.
1282 SCNetworkSetSetName (SCNetworkSetRef set
,
1283 CFStringRef __nullable name
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1286 @function SCNetworkSetSetServiceOrder
1287 @discussion Stores the [user specified] ordering of network services for the set.
1288 @param set The network set.
1289 @param newOrder The ordered list of CFStringRef service identifiers for the set.
1290 @result TRUE if the new service order was saved; FALSE if an error was encountered.
1293 SCNetworkSetSetServiceOrder (SCNetworkSetRef set
,
1294 CFArrayRef newOrder
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/); /* serviceID CFStringRef's */
1299 CF_ASSUME_NONNULL_END
1300 CF_IMPLICIT_BRIDGING_DISABLED
1302 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
1303 #endif /* _SCNETWORKCONFIGURATION_H */