2 * Copyright (c) 2004-2011, 2015 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_STARTING(__MAC_10_4
,__IPHONE_2_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 kSCNetworkProtocolTypeAppleTalk
243 extern const CFStringRef kSCNetworkProtocolTypeAppleTalk
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4
,__MAC_10_6
,__IPHONE_NA
,__IPHONE_NA
);
246 @const kSCNetworkProtocolTypeDNS
248 extern const CFStringRef kSCNetworkProtocolTypeDNS
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
251 @const kSCNetworkProtocolTypeIPv4
253 extern const CFStringRef kSCNetworkProtocolTypeIPv4
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
256 @const kSCNetworkProtocolTypeIPv6
258 extern const CFStringRef kSCNetworkProtocolTypeIPv6
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
261 @const kSCNetworkProtocolTypeProxies
263 extern const CFStringRef kSCNetworkProtocolTypeProxies
__OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
266 @const kSCNetworkProtocolTypeSMB
268 extern const CFStringRef kSCNetworkProtocolTypeSMB
__OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_NA
);
271 @group Service configuration
275 #pragma mark SCNetworkService configuration (typedefs, consts)
278 @typedef SCNetworkServiceRef
279 @discussion This is the type of a reference to an object that represents
282 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkService
* SCNetworkServiceRef
;
286 @group Set configuration
290 #pragma mark SCNetworkSet configuration (typedefs, consts)
293 @typedef SCNetworkSetRef
294 @discussion This is the type of a reference to an object that represents
297 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkSet
* SCNetworkSetRef
;
303 /* --------------------------------------------------------------------------------
305 * -------------------------------------------------------------------------------- */
308 @group Interface configuration
312 #pragma mark SCNetworkInterface configuration (APIs)
315 @function SCNetworkInterfaceGetTypeID
316 @discussion Returns the type identifier of all SCNetworkInterface instances.
319 SCNetworkInterfaceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
322 @function SCNetworkInterfaceCopyAll
323 @discussion Returns all network capable interfaces on the system.
324 @result The list of interfaces on the system.
325 You must release the returned value.
327 CFArrayRef
/* of SCNetworkInterfaceRef's */
328 SCNetworkInterfaceCopyAll (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
331 @function SCNetworkInterfaceGetSupportedInterfaceTypes
332 @discussion Identify all of the network interface types (e.g. PPP) that
333 can be layered on top of this interface.
334 @param interface The network interface.
335 @result The list of SCNetworkInterface types supported by the interface;
336 NULL if no interface types are supported.
338 CFArrayRef
/* of kSCNetworkInterfaceTypeXXX CFStringRef's */ __nullable
339 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
342 @function SCNetworkInterfaceGetSupportedProtocolTypes
343 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
344 can be layered on top of this interface.
345 @param interface The network interface.
346 @result The list of SCNetworkProtocol types supported by the interface;
347 NULL if no protocol types are supported.
349 CFArrayRef
/* of kSCNetworkProtocolTypeXXX CFStringRef's */ __nullable
350 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
353 @function SCNetworkInterfaceCreateWithInterface
354 @discussion Create a new network interface layered on top of another. For
355 example, this function would be used to create a "PPP" interface
357 @param interface The network interface.
358 @param interfaceType The type of SCNetworkInterface to be layered on
359 top of the provided interface.
360 @result A reference to the new SCNetworkInterface.
361 You must release the returned value.
363 SCNetworkInterfaceRef __nullable
364 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface
,
365 CFStringRef interfaceType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
368 @function SCNetworkInterfaceGetBSDName
369 @discussion Returns the BSD interface (en0) or device name (modem)
371 @param interface The network interface.
372 @result The BSD name associated with the interface (e.g. "en0");
373 NULL if no BSD name is available.
375 CFStringRef __nullable
376 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
379 @function SCNetworkInterfaceGetConfiguration
380 @discussion Returns the configuration settings associated with a interface.
381 @param interface The network interface.
382 @result The configuration settings associated with the interface;
383 NULL if no configuration settings are associated with the interface
384 or an error was encountered.
386 CFDictionaryRef __nullable
387 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
390 @function SCNetworkInterfaceGetExtendedConfiguration
391 @discussion Returns the configuration settings associated with a interface.
392 @param interface The network interface.
393 @param extendedType A string representing the type of extended information (e.g. EAPOL).
394 @result The configuration settings associated with the interface;
395 NULL if no configuration settings are associated with the interface
396 or an error was encountered.
398 CFDictionaryRef __nullable
399 SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface
,
400 CFStringRef extendedType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
403 @function SCNetworkInterfaceGetHardwareAddressString
404 @discussion Returns a displayable link layer address for the interface.
405 @param interface The network interface.
406 @result A string representing the hardware (MAC) address for the interface.
408 CFStringRef __nullable
409 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
412 @function SCNetworkInterfaceGetInterface
413 @discussion For layered network interfaces, return the underlying interface.
414 @param interface The network interface.
415 @result The underlying network interface;
416 NULL if this is a leaf interface.
418 SCNetworkInterfaceRef __nullable
419 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
422 @function SCNetworkInterfaceGetInterfaceType
423 @discussion Returns the associated network interface type.
424 @param interface The network interface.
425 @result The interface type.
427 CFStringRef __nullable
428 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
431 @function SCNetworkInterfaceGetLocalizedDisplayName
432 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
434 @param interface The network interface.
435 @result A localized, display name for the interface;
436 NULL if no name is available.
438 CFStringRef __nullable
439 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
442 @function SCNetworkInterfaceSetConfiguration
443 @discussion Stores the configuration settings for the interface.
444 @param interface The network interface.
445 @param config The configuration settings to associate with this interface.
446 @result TRUE if the configuration was stored; FALSE if an error was encountered.
449 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
450 CFDictionaryRef config
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
453 @function SCNetworkInterfaceSetExtendedConfiguration
454 @discussion Stores the configuration settings for the interface.
455 @param interface The network interface.
456 @param config The configuration settings to associate with this interface.
457 @result TRUE if the configuration was stored; FALSE if an error was encountered.
460 SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface
,
461 CFStringRef extendedType
,
462 CFDictionaryRef config
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
467 @function SCNetworkInterfaceCopyMediaOptions
468 @discussion For the specified network interface, returns information
469 about the currently requested media options, the active media
470 options, and the media options which are available.
471 @param interface The desired network interface.
472 @param current A pointer to memory that will be filled with a CFDictionaryRef
473 representing the currently requested media options (subtype, options).
474 If NULL, the current options will not be returned.
475 @param active A pointer to memory that will be filled with a CFDictionaryRef
476 representing the active media options (subtype, options).
477 If NULL, the active options will not be returned.
478 @param available A pointer to memory that will be filled with a CFArrayRef
479 representing the possible media options (subtype, options).
480 If NULL, the available options will not be returned.
481 @param filter A boolean indicating whether the available options should be
482 filtered to exclude those options which would not normally be
483 requested by a user/admin (e.g. hw-loopback).
484 @result TRUE if requested information has been returned.
487 SCNetworkInterfaceCopyMediaOptions (SCNetworkInterfaceRef interface
,
488 CFDictionaryRef __nullable
* __nullable current
,
489 CFDictionaryRef __nullable
* __nullable active
,
490 CFArrayRef __nullable
* __nullable available
,
491 Boolean filter
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
494 @function SCNetworkInterfaceCopyMediaSubTypes
495 @discussion For the provided interface configuration options, return a list
496 of available media subtypes.
497 @param available The available options as returned by the
498 SCNetworkInterfaceCopyMediaOptions function.
499 @result An array of available media subtypes CFString's (e.g. 10BaseT/UTP,
500 100baseTX, etc). NULL if no subtypes are available.
502 CFArrayRef __nullable
503 SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
506 @function SCNetworkInterfaceCopyMediaSubTypeOptions
507 @discussion For the provided interface configuration options and specific
508 subtype, return a list of available media options.
509 @param available The available options as returned by the
510 SCNetworkInterfaceCopyMediaOptions function.
511 @param subType The subtype
512 @result An array of available media options. Each of the available options
513 is returned as an array of CFString's (e.g. <half-duplex>,
514 <full-duplex,flow-control>). NULL if no options are available.
516 CFArrayRef __nullable
517 SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available
,
518 CFStringRef subType
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
521 @function SCNetworkInterfaceCopyMTU
522 @discussion For the specified network interface, returns information
523 about the currently MTU setting and the range of allowable
525 @param interface The desired network interface.
526 @param mtu_cur A pointer to memory that will be filled with the current
527 MTU setting for the interface.
528 @param mtu_min A pointer to memory that will be filled with the minimum
529 MTU setting for the interface. If negative, the minimum setting
530 could not be determined.
531 @param mtu_max A pointer to memory that will be filled with the maximum
532 MTU setting for the interface. If negative, the maximum setting
533 could not be determined.
534 @result TRUE if requested information has been returned.
537 SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface
,
538 int * __nullable mtu_cur
,
539 int * __nullable mtu_min
,
540 int * __nullable mtu_max
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
543 @function SCNetworkInterfaceSetMediaOptions
544 @discussion For the specified network interface, sets the requested
545 media subtype and options.
546 @param interface The desired network interface.
547 @param subtype The desired media subtype (e.g. "autoselect", "100baseTX", ...).
548 @param options The desired media options (e.g. "half-duplex", "full-duplex", ...).
549 @result TRUE if the configuration was updated; FALSE if an error was encountered.
552 SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface
,
554 CFArrayRef options
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
557 @function SCNetworkInterfaceSetMTU
558 @discussion For the specified network interface, sets the
559 requested MTU setting.
560 @param interface The desired network interface.
561 @param mtu The desired MTU setting for the interface.
562 @result TRUE if the configuration was updated; FALSE if an error was encountered.
565 SCNetworkInterfaceSetMTU (SCNetworkInterfaceRef interface
,
566 int mtu
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
569 @function SCNetworkInterfaceForceConfigurationRefresh
570 @discussion Sends a notification to interested network configuration
571 agents to immediately retry their configuration. For example,
572 calling this function will cause the DHCP client to contact
573 the DHCP server immediately rather than waiting until its
574 timeout has expired. The utility of this function is to
575 allow the caller to give a hint to the system that the
576 network infrastructure or configuration has changed.
578 Note: This function requires root (euid==0) privilege or,
579 alternatively, you may pass an SCNetworkInterface which
580 is derived from a sequence of calls to :
582 SCPreferencesCreateWithAuthorization
584 SCNetworkServiceGetInterface
585 @param interface The desired network interface.
586 @result Returns TRUE if the notification was sent; FALSE otherwise.
589 SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
592 @group Interface configuration (Bond)
596 #pragma mark SCBondInterface configuration (APIs)
599 @function SCBondInterfaceCopyAll
600 @discussion Returns all Ethernet Bond interfaces on the system.
601 @param prefs The "preferences" session.
602 @result The list of Ethernet Bond interfaces on the system.
603 You must release the returned value.
605 CFArrayRef
/* of SCBondInterfaceRef's */
606 SCBondInterfaceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
609 @function SCBondInterfaceCopyAvailableMemberInterfaces
610 @discussion Returns all network capable devices on the system
611 that can be added to an Ethernet Bond interface.
612 @param prefs The "preferences" session.
613 @result The list of interfaces.
614 You must release the returned value.
616 CFArrayRef
/* of SCNetworkInterfaceRef's */
617 SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
620 @function SCBondInterfaceCreate
621 @discussion Create a new SCBondInterface interface.
622 @param prefs The "preferences" session.
623 @result A reference to the new SCBondInterface.
624 You must release the returned value.
626 SCBondInterfaceRef __nullable
627 SCBondInterfaceCreate (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
630 @function SCBondInterfaceRemove
631 @discussion Removes the SCBondInterface from the configuration.
632 @param bond The SCBondInterface interface.
633 @result TRUE if the interface was removed; FALSE if an error was encountered.
636 SCBondInterfaceRemove (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
639 @function SCBondInterfaceGetMemberInterfaces
640 @discussion Returns the member interfaces for the specified Ethernet Bond interface.
641 @param bond The SCBondInterface interface.
642 @result The list of interfaces.
644 CFArrayRef
/* of SCNetworkInterfaceRef's */ __nullable
645 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
648 @function SCBondInterfaceGetOptions
649 @discussion Returns the configuration settings associated with a Ethernet Bond interface.
650 @param bond The SCBondInterface interface.
651 @result The configuration settings associated with the Ethernet Bond interface;
652 NULL if no changes to the default configuration have been saved.
654 CFDictionaryRef __nullable
655 SCBondInterfaceGetOptions (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
658 @function SCBondInterfaceSetMemberInterfaces
659 @discussion Sets the member interfaces for the specified Ethernet Bond interface.
660 @param bond The SCBondInterface interface.
661 @param members The desired member interfaces.
662 @result TRUE if the configuration was stored; FALSE if an error was encountered.
665 SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond
,
666 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
667 __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
670 @function SCBondInterfaceSetLocalizedDisplayName
671 @discussion Sets the localized display name for the specified Ethernet Bond interface.
672 @param bond The SCBondInterface interface.
673 @param newName The new display name.
674 @result TRUE if the configuration was stored; FALSE if an error was encountered.
677 SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond
,
678 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
681 @function SCBondInterfaceSetOptions
682 @discussion Sets the configuration settings for the specified Ethernet Bond interface.
683 @param bond The SCBondInterface interface.
684 @param newOptions The new configuration settings.
685 @result TRUE if the configuration was stored; FALSE if an error was encountered.
688 SCBondInterfaceSetOptions (SCBondInterfaceRef bond
,
689 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
694 @function SCBondInterfaceCopyStatus
695 @discussion Returns the status of the specified Ethernet Bond interface.
696 @param bond The SCBondInterface interface.
697 @result The status associated with the interface.
698 You must release the returned value.
700 SCBondStatusRef __nullable
701 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
704 @function SCBondStatusGetTypeID
705 @discussion Returns the type identifier of all SCBondStatus instances.
708 SCBondStatusGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
711 @function SCBondStatusGetMemberInterfaces
712 @discussion Returns the member interfaces that are represented with the
713 Ethernet Bond interface.
714 @param bondStatus The Ethernet Bond status.
715 @result The list of interfaces.
717 CFArrayRef __nullable
/* of SCNetworkInterfaceRef's */
718 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
721 @function SCBondStatusGetInterfaceStatus
722 @discussion Returns the status of a specific member interface of an
723 Ethernet Bond or the status of the bond as a whole.
724 @param bondStatus The Ethernet Bond status.
725 @param interface The specific member interface; NULL if you want the
726 status of the Ethernet Bond.
727 @result The interface status.
729 Note: at present, no information about the status of the Ethernet
730 Bond is returned. As long as one member interface is active
731 then the bond should be operational.
733 CFDictionaryRef __nullable
734 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus
,
735 SCNetworkInterfaceRef __nullable interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
738 @group Interface configuration (VLAN)
742 #pragma mark SCVLANInterface configuration (APIs)
745 @function SCVLANInterfaceCopyAll
746 @discussion Returns all VLAN interfaces on the system.
747 @result The list of VLAN interfaces on the system.
748 You must release the returned value.
750 CFArrayRef
/* of SCVLANInterfaceRef's */
751 SCVLANInterfaceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
754 @function SCVLANInterfaceCopyAvailablePhysicalInterfaces
755 @discussion Returns the network capable devices on the system
756 that can be associated with a VLAN interface.
757 @result The list of interfaces.
758 You must release the returned value.
760 CFArrayRef
/* of SCNetworkInterfaceRef's */
761 SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
764 @function SCVLANInterfaceCreate
765 @discussion Create a new SCVLANInterface interface.
766 @param prefs The "preferences" session.
767 @param physical The physical interface to associate with the VLAN.
768 @param tag The tag to associate with the VLAN.
769 @result A reference to the new SCVLANInterface.
770 You must release the returned value.
772 Note: the tag must be in the range (1 <= tag <= 4094)
774 SCVLANInterfaceRef __nullable
775 SCVLANInterfaceCreate (SCPreferencesRef prefs
,
776 SCNetworkInterfaceRef physical
,
777 CFNumberRef tag
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
780 @function SCVLANInterfaceRemove
781 @discussion Removes the SCVLANInterface from the configuration.
782 @param vlan The SCVLANInterface interface.
783 @result TRUE if the interface was removed; FALSE if an error was encountered.
786 SCVLANInterfaceRemove (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
789 @function SCVLANInterfaceGetPhysicalInterface
790 @discussion Returns the physical interface for the specified VLAN interface.
791 @param vlan The SCVLANInterface interface.
792 @result The list of interfaces.
794 SCNetworkInterfaceRef __nullable
795 SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
798 @function SCVLANInterfaceGetTag
799 @discussion Returns the tag for the specified VLAN interface.
800 @param vlan The SCVLANInterface interface.
803 CFNumberRef __nullable
804 SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
807 @function SCVLANInterfaceGetOptions
808 @discussion Returns the configuration settings associated with the VLAN interface.
809 @param vlan The SCVLANInterface interface.
810 @result The configuration settings associated with the VLAN interface;
811 NULL if no changes to the default configuration have been saved.
813 CFDictionaryRef __nullable
814 SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
817 @function SCVLANInterfaceSetPhysicalInterfaceAndTag
818 @discussion Updates the specified VLAN interface.
819 @param vlan The SCVLANInterface interface.
820 @param physical The physical interface to associate with the VLAN.
821 @param tag The tag to associate with the VLAN.
822 @result TRUE if the configuration was stored; FALSE if an error was encountered.
824 Note: the tag must be in the range (1 <= tag <= 4094)
827 SCVLANInterfaceSetPhysicalInterfaceAndTag (SCVLANInterfaceRef vlan
,
828 SCNetworkInterfaceRef physical
,
829 CFNumberRef tag
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
832 @function SCVLANInterfaceSetLocalizedDisplayName
833 @discussion Sets the localized display name for the specified VLAN interface.
834 @param vlan The SCVLANInterface interface.
835 @param newName The new display name.
836 @result TRUE if the configuration was stored; FALSE if an error was encountered.
839 SCVLANInterfaceSetLocalizedDisplayName (SCVLANInterfaceRef vlan
,
840 CFStringRef newName
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
843 @function SCVLANInterfaceSetOptions
844 @discussion Sets the configuration settings for the specified VLAN interface.
845 @param vlan The SCVLANInterface interface.
846 @param newOptions The new configuration settings.
847 @result TRUE if the configuration was stored; FALSE if an error was encountered.
850 SCVLANInterfaceSetOptions (SCVLANInterfaceRef vlan
,
851 CFDictionaryRef newOptions
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_4_0
/*SPI*/);
854 /* --------------------------------------------------------------------------------
856 * -------------------------------------------------------------------------------- */
859 @group Protocol configuration
863 #pragma mark SCNetworkProtocol configuration (APIs)
866 @function SCNetworkProtocolGetTypeID
867 @discussion Returns the type identifier of all SCNetworkProtocol instances.
870 SCNetworkProtocolGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
873 @function SCNetworkProtocolGetConfiguration
874 @discussion Returns the configuration settings associated with the protocol.
875 @param protocol The network protocol.
876 @result The configuration settings associated with the protocol;
877 NULL if no configuration settings are associated with the protocol
878 or an error was encountered.
880 CFDictionaryRef __nullable
881 SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
884 @function SCNetworkProtocolGetEnabled
885 @discussion Returns whether this protocol has been enabled.
886 @param protocol The network protocol.
887 @result TRUE if the protocol is enabled.
890 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
893 @function SCNetworkProtocolGetProtocolType
894 @discussion Returns the associated network protocol type.
895 @param protocol The network protocol.
896 @result The protocol type.
898 CFStringRef __nullable
899 SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
902 @function SCNetworkProtocolSetConfiguration
903 @discussion Stores the configuration settings for the protocol.
904 @param protocol The network protocol.
905 @param config The configuration settings to associate with this protocol.
906 @result TRUE if the configuration was stored; FALSE if an error was encountered.
909 SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol
,
910 CFDictionaryRef config
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
913 @function SCNetworkProtocolSetEnabled
914 @discussion Enables or disables the protocol.
915 @param protocol The network protocol.
916 @param enabled TRUE if the protocol should be enabled.
917 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
920 SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol
,
921 Boolean enabled
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
923 /* --------------------------------------------------------------------------------
925 * -------------------------------------------------------------------------------- */
928 @group Service configuration
932 #pragma mark SCNetworkService configuration (APIs)
935 @function SCNetworkServiceGetTypeID
936 @discussion Returns the type identifier of all SCNetworkService instances.
939 SCNetworkServiceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
942 @function SCNetworkServiceAddProtocolType
943 @discussion Adds a network protocol of the specified type to the
944 service. The protocal configuration is set to default values
945 that are appropriate for the interface associated with the
947 @param service The network service.
948 @param protocolType The type of SCNetworkProtocol to be added to the service.
949 @result TRUE if the protocol was added to the service; FALSE if the
950 protocol was already present or an error was encountered.
953 SCNetworkServiceAddProtocolType (SCNetworkServiceRef service
,
954 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
957 @function SCNetworkServiceCopyAll
958 @discussion Returns all available network services for the specified preferences.
959 @param prefs The "preferences" session.
960 @result The list of SCNetworkService services associated with the preferences.
961 You must release the returned value.
963 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
964 SCNetworkServiceCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
967 @function SCNetworkServiceCopyProtocols
968 @discussion Returns all network protocols associated with the service.
969 @param service The network service.
970 @result The list of SCNetworkProtocol protocols associated with the service.
971 You must release the returned value.
973 CFArrayRef
/* of SCNetworkProtocolRef's */ __nullable
974 SCNetworkServiceCopyProtocols (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
977 @function SCNetworkServiceCreate
978 @discussion Create a new network service for the specified interface in the
980 @param prefs The "preferences" session.
981 @result A reference to the new SCNetworkService.
982 You must release the returned value.
984 SCNetworkServiceRef __nullable
985 SCNetworkServiceCreate (SCPreferencesRef prefs
,
986 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
989 @function SCNetworkServiceCopy
990 @discussion Returns the network service with the specified identifier.
991 @param prefs The "preferences" session.
992 @param serviceID The unique identifier for the service.
993 @result A reference to the SCNetworkService from the associated preferences;
994 NULL if the serviceID does not exist in the preferences or if an
995 error was encountered.
996 You must release the returned value.
998 SCNetworkServiceRef __nullable
999 SCNetworkServiceCopy (SCPreferencesRef prefs
,
1000 CFStringRef serviceID
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1003 @function SCNetworkServiceEstablishDefaultConfiguration
1004 @discussion Establishes the "default" configuration for a network
1005 service. This configuration includes the addition of
1006 network protocols for the service (with "default"
1007 configuration options).
1008 @param service The network service.
1009 @result TRUE if the configuration was updated; FALSE if an error was encountered.
1012 SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
1015 @function SCNetworkServiceGetEnabled
1016 @discussion Returns whether this service has been enabled.
1017 @param service The network service.
1018 @result TRUE if the service is enabled.
1021 SCNetworkServiceGetEnabled (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1024 @function SCNetworkServiceGetInterface
1025 @discussion Returns the network interface associated with the service.
1026 @param service The network service.
1027 @result A reference to the SCNetworkInterface associated with the service;
1028 NULL if an error was encountered.
1030 SCNetworkInterfaceRef __nullable
1031 SCNetworkServiceGetInterface (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1034 @function SCNetworkServiceGetName
1035 @discussion Returns the [user specified] name associated with the service.
1036 @param service The network service.
1037 @result The [user specified] name.
1039 CFStringRef __nullable
1040 SCNetworkServiceGetName (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1043 @function SCNetworkServiceCopyProtocol
1044 @discussion Returns the network protocol of the specified type for
1046 @param service The network service.
1047 @result A reference to the SCNetworkProtocol associated with the service;
1048 NULL if this protocol has not been added or if an error was encountered.
1049 You must release the returned value.
1051 SCNetworkProtocolRef __nullable
1052 SCNetworkServiceCopyProtocol (SCNetworkServiceRef service
,
1053 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1056 @function SCNetworkServiceGetServiceID
1057 @discussion Returns the identifier for the service.
1058 @param service The network service.
1059 @result The service identifier.
1061 CFStringRef __nullable
1062 SCNetworkServiceGetServiceID (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1065 @function SCNetworkServiceRemove
1066 @discussion Removes the network service from the configuration.
1067 @param service The network service.
1068 @result TRUE if the service was removed; FALSE if an error was encountered.
1071 SCNetworkServiceRemove (SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1074 @function SCNetworkServiceRemoveProtocolType
1075 @discussion Removes the network protocol of the specified type from the service.
1076 @param service The network service.
1077 @param protocolType The type of SCNetworkProtocol to be removed from the service.
1078 @result TRUE if the protocol was removed to the service; FALSE if the
1079 protocol was not configured or an error was encountered.
1082 SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service
,
1083 CFStringRef protocolType
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1086 @function SCNetworkServiceSetEnabled
1087 @discussion Enables or disables the service.
1088 @param service The network service.
1089 @param enabled TRUE if the service should be enabled.
1090 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
1093 SCNetworkServiceSetEnabled (SCNetworkServiceRef service
,
1094 Boolean enabled
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1097 @function SCNetworkServiceSetName
1098 @discussion Stores the [user specified] name for the service.
1099 @param service The network service.
1100 @param name The [user defined] name to associate with the service.
1101 @result TRUE if the name was saved; FALSE if an error was encountered.
1103 Note: although not technically required, the [user specified] names
1104 for all services within any given set should be unique. As such, an
1105 error will be returned if you attemp to name two services with the
1109 SCNetworkServiceSetName (SCNetworkServiceRef service
,
1110 CFStringRef name
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1113 /* --------------------------------------------------------------------------------
1115 * -------------------------------------------------------------------------------- */
1118 @group Set configuration
1122 #pragma mark SCNetworkSet configuration (APIs)
1125 @function SCNetworkSetGetTypeID
1126 @discussion Returns the type identifier of all SCNetworkSet instances.
1129 SCNetworkSetGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1132 @function SCNetworkSetAddService
1133 @discussion Adds the network service to the set.
1134 @param set The network set.
1135 @param service The service to be added.
1136 @result TRUE if the service was added to the set; FALSE if the
1137 service was already present or an error was encountered.
1139 Note: prior to Mac OS X 10.5, the Network Preferences UI
1140 did not support having a single service being a member of
1141 more than one set. An error will be returned if you attempt
1142 to add a service to more than one set on a pre-10.5 system.
1145 SCNetworkSetAddService (SCNetworkSetRef set
,
1146 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1149 @function SCNetworkSetContainsInterface
1150 @discussion Checks if an interface is represented by at least one
1151 network service in the specified set.
1152 @param set The network set.
1153 @param interface The network interface.
1154 @result TRUE if the interface is represented in the set; FALSE if not.
1157 SCNetworkSetContainsInterface (SCNetworkSetRef set
,
1158 SCNetworkInterfaceRef interface
) __OSX_AVAILABLE_STARTING(__MAC_10_5
,__IPHONE_2_0
/*SPI*/);
1161 @function SCNetworkSetCopyAll
1162 @discussion Returns all available sets for the specified preferences.
1163 @param prefs The "preferences" session.
1164 @result The list of SCNetworkSet sets associated with the preferences.
1165 You must release the returned value.
1167 CFArrayRef
/* of SCNetworkSetRef's */ __nullable
1168 SCNetworkSetCopyAll (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1171 @function SCNetworkSetCopyCurrent
1172 @discussion Returns the "current" set.
1173 @param prefs The "preferences" session.
1174 @result The current set; NULL if no current set has been defined.
1176 SCNetworkSetRef __nullable
1177 SCNetworkSetCopyCurrent (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1180 @function SCNetworkSetCopyServices
1181 @discussion Returns all network services associated with the set.
1182 @param set The network set.
1183 @result The list of SCNetworkService services associated with the set.
1184 You must release the returned value.
1186 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
1187 SCNetworkSetCopyServices (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1190 @function SCNetworkSetCreate
1191 @discussion Create a new set in the configuration.
1192 @param prefs The "preferences" session.
1193 @result A reference to the new SCNetworkSet.
1194 You must release the returned value.
1196 SCNetworkSetRef __nullable
1197 SCNetworkSetCreate (SCPreferencesRef prefs
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1200 @function SCNetworkSetCopy
1201 @discussion Returns the set with the specified identifier.
1202 @param prefs The "preferences" session.
1203 @param setID The unique identifier for the set.
1204 @result A reference to the SCNetworkSet from the associated preferences;
1205 NULL if the setID does not exist in the preferences or if an
1206 error was encountered.
1207 You must release the returned value.
1209 SCNetworkSetRef __nullable
1210 SCNetworkSetCopy (SCPreferencesRef prefs
,
1211 CFStringRef setID
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1214 @function SCNetworkSetGetName
1215 @discussion Returns the [user specified] name associated with the set.
1216 @param set The network set.
1217 @result The [user specified] name.
1219 CFStringRef __nullable
1220 SCNetworkSetGetName (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1223 @function SCNetworkSetGetSetID
1224 @discussion Returns the identifier for the set.
1225 @param set The network set.
1226 @result The set identifier.
1228 CFStringRef __nullable
1229 SCNetworkSetGetSetID (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1232 @function SCNetworkSetGetServiceOrder
1233 @discussion Returns the [user specified] ordering of network services
1235 @param set The network set.
1236 @result The ordered list of CFStringRef service identifiers associated
1238 NULL if no service order has been specified or if an error
1241 CFArrayRef
/* of serviceID CFStringRef's */ __nullable
1242 SCNetworkSetGetServiceOrder (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1245 @function SCNetworkSetRemove
1246 @discussion Removes the set from the configuration.
1247 @param set The network set.
1248 @result TRUE if the set was removed; FALSE if an error was encountered.
1251 SCNetworkSetRemove (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1254 @function SCNetworkSetRemoveService
1255 @discussion Removes the network service from the set.
1256 @param set The network set.
1257 @param service The service to be removed.
1258 @result TRUE if the service was removed from the set; FALSE if the
1259 service was not already present or an error was encountered.
1262 SCNetworkSetRemoveService (SCNetworkSetRef set
,
1263 SCNetworkServiceRef service
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1266 @function SCNetworkSetSetCurrent
1267 @discussion Specifies the set that should be the "current" set.
1268 @param set The network set.
1269 @result TRUE if the current set was updated;
1270 FALSE if an error was encountered.
1273 SCNetworkSetSetCurrent (SCNetworkSetRef set
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1276 @function SCNetworkSetSetName
1277 @discussion Stores the [user specified] name for the set.
1278 @param set The network set.
1279 @param name The [user defined] name to associate with the set.
1280 @result TRUE if the name was saved; FALSE if an error was encountered.
1282 Note: although not technically required, the [user specified] names
1283 for all set should be unique. As such, an error will be returned if
1284 you attemp to name two sets with the same string.
1287 SCNetworkSetSetName (SCNetworkSetRef set
,
1288 CFStringRef name
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/);
1291 @function SCNetworkSetSetServiceOrder
1292 @discussion Stores the [user specified] ordering of network services for the set.
1293 @param set The network set.
1294 @param newOrder The ordered list of CFStringRef service identifiers for the set.
1295 @result TRUE if the new service order was saved; FALSE if an error was encountered.
1298 SCNetworkSetSetServiceOrder (SCNetworkSetRef set
,
1299 CFArrayRef newOrder
) __OSX_AVAILABLE_STARTING(__MAC_10_4
,__IPHONE_2_0
/*SPI*/); /* serviceID CFStringRef's */
1304 CF_ASSUME_NONNULL_END
1305 CF_IMPLICIT_BRIDGING_DISABLED
1307 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
1308 #endif /* _SCNETWORKCONFIGURATION_H */