2 * Copyright (c) 2004-2011, 2015, 2016, 2018 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCNETWORKCONFIGURATION_H
25 #define _SCNETWORKCONFIGURATION_H
27 #include <os/availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
33 CF_IMPLICIT_BRIDGING_ENABLED
34 CF_ASSUME_NONNULL_BEGIN
37 @header SCNetworkConfiguration
38 @discussion The SCNetworkConfiguration API provides access to the
39 stored network configuration. The functions include
40 providing access to the network capable devices on the
41 system, the network sets, network services, and network
44 Note: When using the SCNetworkConfiguraiton APIs you must
45 keep in mind that in order for any of your changes to be
46 committed to permanent storage a call must be made to the
47 SCPreferencesCommitChanges function.
52 @group Interface configuration
56 #pragma mark SCNetworkInterface configuration (typedefs, consts)
59 @typedef SCNetworkInterfaceRef
60 @discussion This is the type of a reference to an object that represents
63 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkInterface
* SCNetworkInterfaceRef
;
66 @const kSCNetworkInterfaceType6to4
68 extern const CFStringRef kSCNetworkInterfaceType6to4
API_AVAILABLE(macos(10.4))
69 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
72 @const kSCNetworkInterfaceTypeBluetooth
74 extern const CFStringRef kSCNetworkInterfaceTypeBluetooth
API_AVAILABLE(macos(10.4))
75 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
78 @const kSCNetworkInterfaceTypeBond
80 extern const CFStringRef kSCNetworkInterfaceTypeBond
API_AVAILABLE(macos(10.4))
81 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
84 @const kSCNetworkInterfaceTypeEthernet
86 extern const CFStringRef kSCNetworkInterfaceTypeEthernet
API_AVAILABLE(macos(10.4))
87 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
90 @const kSCNetworkInterfaceTypeFireWire
92 extern const CFStringRef kSCNetworkInterfaceTypeFireWire
API_AVAILABLE(macos(10.4))
93 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
96 @const kSCNetworkInterfaceTypeIEEE80211
98 extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211
API_AVAILABLE(macos(10.4))
99 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0)); // IEEE 802.11, AirPort
102 @const kSCNetworkInterfaceTypeIPSec
104 extern const CFStringRef kSCNetworkInterfaceTypeIPSec
API_AVAILABLE(macos(10.5))
105 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
108 @const kSCNetworkInterfaceTypeIrDA
110 extern const CFStringRef kSCNetworkInterfaceTypeIrDA
API_AVAILABLE(macos(10.4))
111 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
114 @const kSCNetworkInterfaceTypeL2TP
116 extern const CFStringRef kSCNetworkInterfaceTypeL2TP
API_AVAILABLE(macos(10.4))
117 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
120 @const kSCNetworkInterfaceTypeModem
122 extern const CFStringRef kSCNetworkInterfaceTypeModem
API_AVAILABLE(macos(10.4))
123 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
126 @const kSCNetworkInterfaceTypePPP
128 extern const CFStringRef kSCNetworkInterfaceTypePPP
API_AVAILABLE(macos(10.4))
129 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
132 @const kSCNetworkInterfaceTypePPTP
134 extern const CFStringRef kSCNetworkInterfaceTypePPTP
API_DEPRECATED("No longer supported", macos(10.4,10.12))
135 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
139 @const kSCNetworkInterfaceTypeSerial
141 extern const CFStringRef kSCNetworkInterfaceTypeSerial
API_AVAILABLE(macos(10.4))
142 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
145 @const kSCNetworkInterfaceTypeVLAN
147 extern const CFStringRef kSCNetworkInterfaceTypeVLAN
API_AVAILABLE(macos(10.4))
148 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
151 @const kSCNetworkInterfaceTypeWWAN
153 extern const CFStringRef kSCNetworkInterfaceTypeWWAN
API_AVAILABLE(macos(10.5))
154 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
156 /* special network interfaces (and types) */
159 @const kSCNetworkInterfaceTypeIPv4
161 extern const CFStringRef kSCNetworkInterfaceTypeIPv4
API_AVAILABLE(macos(10.4))
162 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
165 @const kSCNetworkInterfaceIPv4
166 @discussion A network interface that can used for layering other
167 interfaces (e.g. 6to4, IPSec, PPTP, L2TP) over an existing
170 extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4
API_AVAILABLE(macos(10.4))
171 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
174 @group Interface configuration (Bond)
180 @typedef SCBondInterfaceRef
181 @discussion This is the type of a reference to an object that represents
182 an Ethernet Bond interface.
184 typedef SCNetworkInterfaceRef SCBondInterfaceRef
;
187 @typedef SCBondStatusRef
188 @discussion This is the type of a reference to an object that represents
189 the status of an Ethernet Bond interface.
191 typedef const struct CF_BRIDGED_TYPE(id
) __SCBondStatus
* SCBondStatusRef
;
194 @enum Ethernet Bond Aggregation Status (kSCBondStatusDeviceAggregationStatus) codes
195 @discussion Returned status codes.
196 @constant kSCBondStatusOK Enabled, active, running, ...
197 @constant kSCBondStatusLinkInvalid The link state was not valid (i.e. down, half-duplex, wrong speed)
198 @constant kSCBondStatusNoPartner The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled
199 @constant kSCBondStatusNotInActiveGroup We're talking to a partner, but the link aggregation group is different from the one that's active
200 @constant kSCBondStatusUnknown Non-specific failure
203 kSCBondStatusOK
= 0, /* enabled, active, running, ... */
204 kSCBondStatusLinkInvalid
= 1, /* The link state was not valid (i.e. down, half-duplex, wrong speed) */
205 kSCBondStatusNoPartner
= 2, /* The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled */
206 kSCBondStatusNotInActiveGroup
= 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
207 kSCBondStatusUnknown
= 999 /* Non-specific failure */
211 @const kSCBondStatusDeviceAggregationStatus
213 extern const CFStringRef kSCBondStatusDeviceAggregationStatus
/* CFNumber */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
216 @const kSCBondStatusDeviceCollecting
218 extern const CFStringRef kSCBondStatusDeviceCollecting
/* CFNumber (0 or 1) */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
221 @const kSCBondStatusDeviceDistributing
223 extern const CFStringRef kSCBondStatusDeviceDistributing
/* CFNumber (0 or 1) */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
226 @group Interface configuration (VLAN)
232 @typedef SCVLANInterfaceRef
233 @discussion This is the type of a reference to an object that represents
234 a Virtual LAN (VLAN) interface.
236 typedef SCNetworkInterfaceRef SCVLANInterfaceRef
;
240 @group Protocol configuration
244 #pragma mark SCNetworkProtocol configuration (typedefs, consts)
247 @typedef SCNetworkProtocolRef
248 @discussion This is the type of a reference to an object that represents
251 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkProtocol
* SCNetworkProtocolRef
;
253 /* network "protocol" types */
256 @const kSCNetworkProtocolTypeDNS
258 extern const CFStringRef kSCNetworkProtocolTypeDNS
API_AVAILABLE(macos(10.4))
259 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
262 @const kSCNetworkProtocolTypeIPv4
264 extern const CFStringRef kSCNetworkProtocolTypeIPv4
API_AVAILABLE(macos(10.4))
265 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
268 @const kSCNetworkProtocolTypeIPv6
270 extern const CFStringRef kSCNetworkProtocolTypeIPv6
API_AVAILABLE(macos(10.4))
271 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
274 @const kSCNetworkProtocolTypeProxies
276 extern const CFStringRef kSCNetworkProtocolTypeProxies
API_AVAILABLE(macos(10.4))
277 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
280 @const kSCNetworkProtocolTypeSMB
282 extern const CFStringRef kSCNetworkProtocolTypeSMB
API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
285 @group Service configuration
289 #pragma mark SCNetworkService configuration (typedefs, consts)
292 @typedef SCNetworkServiceRef
293 @discussion This is the type of a reference to an object that represents
296 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkService
* SCNetworkServiceRef
;
300 @group Set configuration
304 #pragma mark SCNetworkSet configuration (typedefs, consts)
307 @typedef SCNetworkSetRef
308 @discussion This is the type of a reference to an object that represents
311 typedef const struct CF_BRIDGED_TYPE(id
) __SCNetworkSet
* SCNetworkSetRef
;
317 /* --------------------------------------------------------------------------------
319 * -------------------------------------------------------------------------------- */
322 @group Interface configuration
326 #pragma mark SCNetworkInterface configuration (APIs)
329 @function SCNetworkInterfaceGetTypeID
330 @discussion Returns the type identifier of all SCNetworkInterface instances.
333 SCNetworkInterfaceGetTypeID (void) API_AVAILABLE(macos(10.4))
334 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
337 @function SCNetworkInterfaceCopyAll
338 @discussion Returns all network capable interfaces on the system.
339 @result The list of interfaces on the system.
340 You must release the returned value.
342 CFArrayRef
/* of SCNetworkInterfaceRef's */
343 SCNetworkInterfaceCopyAll (void) API_AVAILABLE(macos(10.4))
344 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
347 @function SCNetworkInterfaceGetSupportedInterfaceTypes
348 @discussion Identify all of the network interface types (e.g. PPP) that
349 can be layered on top of this interface.
350 @param interface The network interface.
351 @result The list of SCNetworkInterface types supported by the interface;
352 NULL if no interface types are supported.
354 CFArrayRef
/* of kSCNetworkInterfaceTypeXXX CFStringRef's */ __nullable
355 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
356 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
359 @function SCNetworkInterfaceGetSupportedProtocolTypes
360 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
361 can be layered on top of this interface.
362 @param interface The network interface.
363 @result The list of SCNetworkProtocol types supported by the interface;
364 NULL if no protocol types are supported.
366 CFArrayRef
/* of kSCNetworkProtocolTypeXXX CFStringRef's */ __nullable
367 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
368 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
371 @function SCNetworkInterfaceCreateWithInterface
372 @discussion Create a new network interface layered on top of another. For
373 example, this function would be used to create a "PPP" interface
375 @param interface The network interface.
376 @param interfaceType The type of SCNetworkInterface to be layered on
377 top of the provided interface.
378 @result A reference to the new SCNetworkInterface.
379 You must release the returned value.
381 SCNetworkInterfaceRef __nullable
382 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface
,
383 CFStringRef interfaceType
) API_AVAILABLE(macos(10.4))
384 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
387 @function SCNetworkInterfaceGetBSDName
388 @discussion Returns the BSD interface (en0) or device name (modem)
390 @param interface The network interface.
391 @result The BSD name associated with the interface (e.g. "en0");
392 NULL if no BSD name is available.
394 CFStringRef __nullable
395 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
396 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
399 @function SCNetworkInterfaceGetConfiguration
400 @discussion Returns the configuration settings associated with a interface.
401 @param interface The network interface.
402 @result The configuration settings associated with the interface;
403 NULL if no configuration settings are associated with the interface
404 or an error was encountered.
406 CFDictionaryRef __nullable
407 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
408 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
411 @function SCNetworkInterfaceGetExtendedConfiguration
412 @discussion Returns the configuration settings associated with a interface.
413 @param interface The network interface.
414 @param extendedType A string representing the type of extended information (e.g. EAPOL).
415 @result The configuration settings associated with the interface;
416 NULL if no configuration settings are associated with the interface
417 or an error was encountered.
419 CFDictionaryRef __nullable
420 SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface
,
421 CFStringRef extendedType
) API_AVAILABLE(macos(10.5))
422 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
425 @function SCNetworkInterfaceGetHardwareAddressString
426 @discussion Returns a displayable link layer address for the interface.
427 @param interface The network interface.
428 @result A string representing the hardware (MAC) address for the interface.
430 CFStringRef __nullable
431 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
432 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
435 @function SCNetworkInterfaceGetInterface
436 @discussion For layered network interfaces, return the underlying interface.
437 @param interface The network interface.
438 @result The underlying network interface;
439 NULL if this is a leaf interface.
441 SCNetworkInterfaceRef __nullable
442 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
443 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
446 @function SCNetworkInterfaceGetInterfaceType
447 @discussion Returns the associated network interface type.
448 @param interface The network interface.
449 @result The interface type.
451 CFStringRef __nullable
452 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
453 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
456 @function SCNetworkInterfaceGetLocalizedDisplayName
457 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
459 @param interface The network interface.
460 @result A localized, display name for the interface;
461 NULL if no name is available.
463 CFStringRef __nullable
464 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
465 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
468 @function SCNetworkInterfaceSetConfiguration
469 @discussion Stores the configuration settings for the interface.
470 @param interface The network interface.
471 @param config The configuration settings to associate with this interface.
472 @result TRUE if the configuration was stored; FALSE if an error was encountered.
475 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
476 CFDictionaryRef __nullable config
) API_AVAILABLE(macos(10.4))
477 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
480 @function SCNetworkInterfaceSetExtendedConfiguration
481 @discussion Stores the configuration settings for the interface.
482 @param interface The network interface.
483 @param config The configuration settings to associate with this interface.
484 @result TRUE if the configuration was stored; FALSE if an error was encountered.
487 SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface
,
488 CFStringRef extendedType
,
489 CFDictionaryRef __nullable config
) API_AVAILABLE(macos(10.5))
490 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
495 @function SCNetworkInterfaceCopyMediaOptions
496 @discussion For the specified network interface, returns information
497 about the currently requested media options, the active media
498 options, and the media options which are available.
499 @param interface The desired network interface.
500 @param current A pointer to memory that will be filled with a CFDictionaryRef
501 representing the currently requested media options (subtype, options).
502 If NULL, the current options will not be returned.
503 @param active A pointer to memory that will be filled with a CFDictionaryRef
504 representing the active media options (subtype, options).
505 If NULL, the active options will not be returned.
506 @param available A pointer to memory that will be filled with a CFArrayRef
507 representing the possible media options (subtype, options).
508 If NULL, the available options will not be returned.
509 @param filter A boolean indicating whether the available options should be
510 filtered to exclude those options which would not normally be
511 requested by a user/admin (e.g. hw-loopback).
512 @result TRUE if requested information has been returned.
515 SCNetworkInterfaceCopyMediaOptions (SCNetworkInterfaceRef interface
,
516 CFDictionaryRef __nullable
* __nullable current
,
517 CFDictionaryRef __nullable
* __nullable active
,
518 CFArrayRef __nullable
* __nullable available
,
519 Boolean filter
) API_AVAILABLE(macos(10.5))
520 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
523 @function SCNetworkInterfaceCopyMediaSubTypes
524 @discussion For the provided interface configuration options, return a list
525 of available media subtypes.
526 @param available The available options as returned by the
527 SCNetworkInterfaceCopyMediaOptions function.
528 @result An array of available media subtypes CFString's (e.g. 10BaseT/UTP,
529 100baseTX, etc). NULL if no subtypes are available.
531 CFArrayRef __nullable
532 SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available
) API_AVAILABLE(macos(10.5))
533 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
536 @function SCNetworkInterfaceCopyMediaSubTypeOptions
537 @discussion For the provided interface configuration options and specific
538 subtype, return a list of available media options.
539 @param available The available options as returned by the
540 SCNetworkInterfaceCopyMediaOptions function.
541 @param subType The subtype
542 @result An array of available media options. Each of the available options
543 is returned as an array of CFString's (e.g. <half-duplex>,
544 <full-duplex,flow-control>). NULL if no options are available.
546 CFArrayRef __nullable
547 SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available
,
548 CFStringRef subType
) API_AVAILABLE(macos(10.5))
549 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
552 @function SCNetworkInterfaceCopyMTU
553 @discussion For the specified network interface, returns information
554 about the currently MTU setting and the range of allowable
556 @param interface The desired network interface.
557 @param mtu_cur A pointer to memory that will be filled with the current
558 MTU setting for the interface.
559 @param mtu_min A pointer to memory that will be filled with the minimum
560 MTU setting for the interface. If negative, the minimum setting
561 could not be determined.
562 @param mtu_max A pointer to memory that will be filled with the maximum
563 MTU setting for the interface. If negative, the maximum setting
564 could not be determined.
565 @result TRUE if requested information has been returned.
568 SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface
,
569 int * __nullable mtu_cur
,
570 int * __nullable mtu_min
,
571 int * __nullable mtu_max
) API_AVAILABLE(macos(10.5))
572 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
575 @function SCNetworkInterfaceSetMediaOptions
576 @discussion For the specified network interface, sets the requested
577 media subtype and options.
578 @param interface The desired network interface.
579 @param subtype The desired media subtype (e.g. "autoselect", "100baseTX", ...).
580 @param options The desired media options (e.g. "half-duplex", "full-duplex", ...).
581 @result TRUE if the configuration was updated; FALSE if an error was encountered.
584 SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface
,
586 CFArrayRef options
) API_AVAILABLE(macos(10.5))
587 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
590 @function SCNetworkInterfaceSetMTU
591 @discussion For the specified network interface, sets the
592 requested MTU setting.
593 @param interface The desired network interface.
594 @param mtu The desired MTU setting for the interface.
595 @result TRUE if the configuration was updated; FALSE if an error was encountered.
598 SCNetworkInterfaceSetMTU (SCNetworkInterfaceRef interface
,
599 int mtu
) API_AVAILABLE(macos(10.5))
600 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
603 @function SCNetworkInterfaceForceConfigurationRefresh
604 @discussion Sends a notification to interested network configuration
605 agents to immediately retry their configuration. For example,
606 calling this function will cause the DHCP client to contact
607 the DHCP server immediately rather than waiting until its
608 timeout has expired. The utility of this function is to
609 allow the caller to give a hint to the system that the
610 network infrastructure or configuration has changed.
612 Note: This function requires root (euid==0) privilege or,
613 alternatively, you may pass an SCNetworkInterface which
614 is derived from a sequence of calls to :
616 SCPreferencesCreateWithAuthorization
618 SCNetworkServiceGetInterface
619 @param interface The desired network interface.
620 @result Returns TRUE if the notification was sent; FALSE otherwise.
623 SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5))
624 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
627 @group Interface configuration (Bond)
631 #pragma mark SCBondInterface configuration (APIs)
634 @function SCBondInterfaceCopyAll
635 @discussion Returns all Ethernet Bond interfaces on the system.
636 @param prefs The "preferences" session.
637 @result The list of Ethernet Bond interfaces on the system.
638 You must release the returned value.
640 CFArrayRef
/* of SCBondInterfaceRef's */
641 SCBondInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
644 @function SCBondInterfaceCopyAvailableMemberInterfaces
645 @discussion Returns all network capable devices on the system
646 that can be added to an Ethernet Bond interface.
647 @param prefs The "preferences" session.
648 @result The list of interfaces.
649 You must release the returned value.
651 CFArrayRef
/* of SCNetworkInterfaceRef's */
652 SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
655 @function SCBondInterfaceCreate
656 @discussion Create a new SCBondInterface interface.
657 @param prefs The "preferences" session.
658 @result A reference to the new SCBondInterface.
659 You must release the returned value.
661 SCBondInterfaceRef __nullable
662 SCBondInterfaceCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
665 @function SCBondInterfaceRemove
666 @discussion Removes the SCBondInterface from the configuration.
667 @param bond The SCBondInterface interface.
668 @result TRUE if the interface was removed; FALSE if an error was encountered.
671 SCBondInterfaceRemove (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
674 @function SCBondInterfaceGetMemberInterfaces
675 @discussion Returns the member interfaces for the specified Ethernet Bond interface.
676 @param bond The SCBondInterface interface.
677 @result The list of interfaces.
679 CFArrayRef
/* of SCNetworkInterfaceRef's */ __nullable
680 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
683 @function SCBondInterfaceGetOptions
684 @discussion Returns the configuration settings associated with a Ethernet Bond interface.
685 @param bond The SCBondInterface interface.
686 @result The configuration settings associated with the Ethernet Bond interface;
687 NULL if no changes to the default configuration have been saved.
689 CFDictionaryRef __nullable
690 SCBondInterfaceGetOptions (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
693 @function SCBondInterfaceSetMemberInterfaces
694 @discussion Sets the member interfaces for the specified Ethernet Bond interface.
695 @param bond The SCBondInterface interface.
696 @param members The desired member interfaces.
697 @result TRUE if the configuration was stored; FALSE if an error was encountered.
700 SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond
,
701 CFArrayRef members
) /* of SCNetworkInterfaceRef's */
702 API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
705 @function SCBondInterfaceSetLocalizedDisplayName
706 @discussion Sets the localized display name for the specified Ethernet Bond interface.
707 @param bond The SCBondInterface interface.
708 @param newName The new display name.
709 @result TRUE if the configuration was stored; FALSE if an error was encountered.
712 SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond
,
713 CFStringRef newName
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
716 @function SCBondInterfaceSetOptions
717 @discussion Sets the configuration settings for the specified Ethernet Bond interface.
718 @param bond The SCBondInterface interface.
719 @param newOptions The new configuration settings.
720 @result TRUE if the configuration was stored; FALSE if an error was encountered.
723 SCBondInterfaceSetOptions (SCBondInterfaceRef bond
,
724 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
729 @function SCBondInterfaceCopyStatus
730 @discussion Returns the status of the specified Ethernet Bond interface.
731 @param bond The SCBondInterface interface.
732 @result The status associated with the interface.
733 You must release the returned value.
735 SCBondStatusRef __nullable
736 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
739 @function SCBondStatusGetTypeID
740 @discussion Returns the type identifier of all SCBondStatus instances.
743 SCBondStatusGetTypeID (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
746 @function SCBondStatusGetMemberInterfaces
747 @discussion Returns the member interfaces that are represented with the
748 Ethernet Bond interface.
749 @param bondStatus The Ethernet Bond status.
750 @result The list of interfaces.
752 CFArrayRef __nullable
/* of SCNetworkInterfaceRef's */
753 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
756 @function SCBondStatusGetInterfaceStatus
757 @discussion Returns the status of a specific member interface of an
758 Ethernet Bond or the status of the bond as a whole.
759 @param bondStatus The Ethernet Bond status.
760 @param interface The specific member interface; NULL if you want the
761 status of the Ethernet Bond.
762 @result The interface status.
764 Note: at present, no information about the status of the Ethernet
765 Bond is returned. As long as one member interface is active
766 then the bond should be operational.
768 CFDictionaryRef __nullable
769 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus
,
770 SCNetworkInterfaceRef __nullable interface
) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios
, tvos
, watchos
, bridgeos
);
773 @group Interface configuration (VLAN)
777 #pragma mark SCVLANInterface configuration (APIs)
780 @function SCVLANInterfaceCopyAll
781 @discussion Returns all VLAN interfaces on the system.
782 @result The list of VLAN interfaces on the system.
783 You must release the returned value.
785 CFArrayRef
/* of SCVLANInterfaceRef's */
786 SCVLANInterfaceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.5))
787 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
790 @function SCVLANInterfaceCopyAvailablePhysicalInterfaces
791 @discussion Returns the network capable devices on the system
792 that can be associated with a VLAN interface.
793 @result The list of interfaces.
794 You must release the returned value.
796 CFArrayRef
/* of SCNetworkInterfaceRef's */
797 SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) API_AVAILABLE(macos(10.5))
798 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
801 @function SCVLANInterfaceCreate
802 @discussion Create a new SCVLANInterface interface.
803 @param prefs The "preferences" session.
804 @param physical The physical interface to associate with the VLAN.
805 @param tag The tag to associate with the VLAN.
806 @result A reference to the new SCVLANInterface.
807 You must release the returned value.
809 Note: the tag must be in the range (1 <= tag <= 4094)
811 SCVLANInterfaceRef __nullable
812 SCVLANInterfaceCreate (SCPreferencesRef prefs
,
813 SCNetworkInterfaceRef physical
,
814 CFNumberRef tag
) API_AVAILABLE(macos(10.5))
815 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
818 @function SCVLANInterfaceRemove
819 @discussion Removes the SCVLANInterface from the configuration.
820 @param vlan The SCVLANInterface interface.
821 @result TRUE if the interface was removed; FALSE if an error was encountered.
824 SCVLANInterfaceRemove (SCVLANInterfaceRef vlan
) API_AVAILABLE(macos(10.5))
825 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
828 @function SCVLANInterfaceGetPhysicalInterface
829 @discussion Returns the physical interface for the specified VLAN interface.
830 @param vlan The SCVLANInterface interface.
831 @result The list of interfaces.
833 SCNetworkInterfaceRef __nullable
834 SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan
) API_AVAILABLE(macos(10.5))
835 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
838 @function SCVLANInterfaceGetTag
839 @discussion Returns the tag for the specified VLAN interface.
840 @param vlan The SCVLANInterface interface.
843 CFNumberRef __nullable
844 SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan
) API_AVAILABLE(macos(10.5))
845 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
848 @function SCVLANInterfaceGetOptions
849 @discussion Returns the configuration settings associated with the VLAN interface.
850 @param vlan The SCVLANInterface interface.
851 @result The configuration settings associated with the VLAN interface;
852 NULL if no changes to the default configuration have been saved.
854 CFDictionaryRef __nullable
855 SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan
) API_AVAILABLE(macos(10.5))
856 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
859 @function SCVLANInterfaceSetPhysicalInterfaceAndTag
860 @discussion Updates the specified VLAN interface.
861 @param vlan The SCVLANInterface interface.
862 @param physical The physical interface to associate with the VLAN.
863 @param tag The tag to associate with the VLAN.
864 @result TRUE if the configuration was stored; FALSE if an error was encountered.
866 Note: the tag must be in the range (1 <= tag <= 4094)
869 SCVLANInterfaceSetPhysicalInterfaceAndTag (SCVLANInterfaceRef vlan
,
870 SCNetworkInterfaceRef physical
,
871 CFNumberRef tag
) API_AVAILABLE(macos(10.5))
872 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
875 @function SCVLANInterfaceSetLocalizedDisplayName
876 @discussion Sets the localized display name for the specified VLAN interface.
877 @param vlan The SCVLANInterface interface.
878 @param newName The new display name.
879 @result TRUE if the configuration was stored; FALSE if an error was encountered.
882 SCVLANInterfaceSetLocalizedDisplayName (SCVLANInterfaceRef vlan
,
883 CFStringRef newName
) API_AVAILABLE(macos(10.5))
884 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
887 @function SCVLANInterfaceSetOptions
888 @discussion Sets the configuration settings for the specified VLAN interface.
889 @param vlan The SCVLANInterface interface.
890 @param newOptions The new configuration settings.
891 @result TRUE if the configuration was stored; FALSE if an error was encountered.
894 SCVLANInterfaceSetOptions (SCVLANInterfaceRef vlan
,
895 CFDictionaryRef newOptions
) API_AVAILABLE(macos(10.5))
896 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
899 /* --------------------------------------------------------------------------------
901 * -------------------------------------------------------------------------------- */
904 @group Protocol configuration
908 #pragma mark SCNetworkProtocol configuration (APIs)
911 @function SCNetworkProtocolGetTypeID
912 @discussion Returns the type identifier of all SCNetworkProtocol instances.
915 SCNetworkProtocolGetTypeID (void) API_AVAILABLE(macos(10.4))
916 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
919 @function SCNetworkProtocolGetConfiguration
920 @discussion Returns the configuration settings associated with the protocol.
921 @param protocol The network protocol.
922 @result The configuration settings associated with the protocol;
923 NULL if no configuration settings are associated with the protocol
924 or an error was encountered.
926 CFDictionaryRef __nullable
927 SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol
) API_AVAILABLE(macos(10.4))
928 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
931 @function SCNetworkProtocolGetEnabled
932 @discussion Returns whether this protocol has been enabled.
933 @param protocol The network protocol.
934 @result TRUE if the protocol is enabled.
937 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol
) API_AVAILABLE(macos(10.4))
938 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
941 @function SCNetworkProtocolGetProtocolType
942 @discussion Returns the associated network protocol type.
943 @param protocol The network protocol.
944 @result The protocol type.
946 CFStringRef __nullable
947 SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol
) API_AVAILABLE(macos(10.4))
948 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
951 @function SCNetworkProtocolSetConfiguration
952 @discussion Stores the configuration settings for the protocol.
953 @param protocol The network protocol.
954 @param config The configuration settings to associate with this protocol.
955 @result TRUE if the configuration was stored; FALSE if an error was encountered.
958 SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol
,
959 CFDictionaryRef __nullable config
) API_AVAILABLE(macos(10.4))
960 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
963 @function SCNetworkProtocolSetEnabled
964 @discussion Enables or disables the protocol.
965 @param protocol The network protocol.
966 @param enabled TRUE if the protocol should be enabled.
967 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
970 SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol
,
971 Boolean enabled
) API_AVAILABLE(macos(10.4))
972 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
974 /* --------------------------------------------------------------------------------
976 * -------------------------------------------------------------------------------- */
979 @group Service configuration
983 #pragma mark SCNetworkService configuration (APIs)
986 @function SCNetworkServiceGetTypeID
987 @discussion Returns the type identifier of all SCNetworkService instances.
990 SCNetworkServiceGetTypeID (void) API_AVAILABLE(macos(10.4))
991 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
994 @function SCNetworkServiceAddProtocolType
995 @discussion Adds a network protocol of the specified type to the
996 service. The protocal configuration is set to default values
997 that are appropriate for the interface associated with the
999 @param service The network service.
1000 @param protocolType The type of SCNetworkProtocol to be added to the service.
1001 @result TRUE if the protocol was added to the service; FALSE if the
1002 protocol was already present or an error was encountered.
1005 SCNetworkServiceAddProtocolType (SCNetworkServiceRef service
,
1006 CFStringRef protocolType
) API_AVAILABLE(macos(10.4))
1007 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1010 @function SCNetworkServiceCopyAll
1011 @discussion Returns all available network services for the specified preferences.
1012 @param prefs The "preferences" session.
1013 @result The list of SCNetworkService services associated with the preferences.
1014 You must release the returned value.
1016 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
1017 SCNetworkServiceCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.4))
1018 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1021 @function SCNetworkServiceCopyProtocols
1022 @discussion Returns all network protocols associated with the service.
1023 @param service The network service.
1024 @result The list of SCNetworkProtocol protocols associated with the service.
1025 You must release the returned value.
1027 CFArrayRef
/* of SCNetworkProtocolRef's */ __nullable
1028 SCNetworkServiceCopyProtocols (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1029 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1032 @function SCNetworkServiceCreate
1033 @discussion Create a new network service for the specified interface in the
1035 @param prefs The "preferences" session.
1036 @result A reference to the new SCNetworkService.
1037 You must release the returned value.
1039 SCNetworkServiceRef __nullable
1040 SCNetworkServiceCreate (SCPreferencesRef prefs
,
1041 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.4))
1042 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1045 @function SCNetworkServiceCopy
1046 @discussion Returns the network service with the specified identifier.
1047 @param prefs The "preferences" session.
1048 @param serviceID The unique identifier for the service.
1049 @result A reference to the SCNetworkService from the associated preferences;
1050 NULL if the serviceID does not exist in the preferences or if an
1051 error was encountered.
1052 You must release the returned value.
1054 SCNetworkServiceRef __nullable
1055 SCNetworkServiceCopy (SCPreferencesRef prefs
,
1056 CFStringRef serviceID
) API_AVAILABLE(macos(10.4))
1057 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1060 @function SCNetworkServiceEstablishDefaultConfiguration
1061 @discussion Establishes the "default" configuration for a network
1062 service. This configuration includes the addition of
1063 network protocols for the service (with "default"
1064 configuration options).
1065 @param service The network service.
1066 @result TRUE if the configuration was updated; FALSE if an error was encountered.
1069 SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.5))
1070 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1073 @function SCNetworkServiceGetEnabled
1074 @discussion Returns whether this service has been enabled.
1075 @param service The network service.
1076 @result TRUE if the service is enabled.
1079 SCNetworkServiceGetEnabled (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1080 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1083 @function SCNetworkServiceGetInterface
1084 @discussion Returns the network interface associated with the service.
1085 @param service The network service.
1086 @result A reference to the SCNetworkInterface associated with the service;
1087 NULL if an error was encountered.
1089 SCNetworkInterfaceRef __nullable
1090 SCNetworkServiceGetInterface (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1091 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1094 @function SCNetworkServiceGetName
1095 @discussion Returns the [user specified] name associated with the service.
1096 @param service The network service.
1097 @result The [user specified] name.
1099 CFStringRef __nullable
1100 SCNetworkServiceGetName (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1101 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1104 @function SCNetworkServiceCopyProtocol
1105 @discussion Returns the network protocol of the specified type for
1107 @param service The network service.
1108 @result A reference to the SCNetworkProtocol associated with the service;
1109 NULL if this protocol has not been added or if an error was encountered.
1110 You must release the returned value.
1112 SCNetworkProtocolRef __nullable
1113 SCNetworkServiceCopyProtocol (SCNetworkServiceRef service
,
1114 CFStringRef protocolType
) API_AVAILABLE(macos(10.4))
1115 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1118 @function SCNetworkServiceGetServiceID
1119 @discussion Returns the identifier for the service.
1120 @param service The network service.
1121 @result The service identifier.
1123 CFStringRef __nullable
1124 SCNetworkServiceGetServiceID (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1125 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1128 @function SCNetworkServiceRemove
1129 @discussion Removes the network service from the configuration.
1130 @param service The network service.
1131 @result TRUE if the service was removed; FALSE if an error was encountered.
1134 SCNetworkServiceRemove (SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1135 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1138 @function SCNetworkServiceRemoveProtocolType
1139 @discussion Removes the network protocol of the specified type from the service.
1140 @param service The network service.
1141 @param protocolType The type of SCNetworkProtocol to be removed from the service.
1142 @result TRUE if the protocol was removed to the service; FALSE if the
1143 protocol was not configured or an error was encountered.
1146 SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service
,
1147 CFStringRef protocolType
) API_AVAILABLE(macos(10.4))
1148 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1151 @function SCNetworkServiceSetEnabled
1152 @discussion Enables or disables the service.
1153 @param service The network service.
1154 @param enabled TRUE if the service should be enabled.
1155 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
1158 SCNetworkServiceSetEnabled (SCNetworkServiceRef service
,
1159 Boolean enabled
) API_AVAILABLE(macos(10.4))
1160 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1163 @function SCNetworkServiceSetName
1164 @discussion Stores the [user specified] name for the service.
1165 @param service The network service.
1166 @param name The [user defined] name to associate with the service.
1167 @result TRUE if the name was saved; FALSE if an error was encountered.
1169 Note: although not technically required, the [user specified] names
1170 for all services within any given set should be unique. As such, an
1171 error will be returned if you attemp to name two services with the
1175 SCNetworkServiceSetName (SCNetworkServiceRef service
,
1176 CFStringRef __nullable name
) API_AVAILABLE(macos(10.4))
1177 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1180 /* --------------------------------------------------------------------------------
1182 * -------------------------------------------------------------------------------- */
1185 @group Set configuration
1189 #pragma mark SCNetworkSet configuration (APIs)
1192 @function SCNetworkSetGetTypeID
1193 @discussion Returns the type identifier of all SCNetworkSet instances.
1196 SCNetworkSetGetTypeID (void) API_AVAILABLE(macos(10.4))
1197 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1200 @function SCNetworkSetAddService
1201 @discussion Adds the network service to the set.
1202 @param set The network set.
1203 @param service The service to be added.
1204 @result TRUE if the service was added to the set; FALSE if the
1205 service was already present or an error was encountered.
1207 Note: prior to Mac OS X 10.5, the Network Preferences UI
1208 did not support having a single service being a member of
1209 more than one set. An error will be returned if you attempt
1210 to add a service to more than one set on a pre-10.5 system.
1213 SCNetworkSetAddService (SCNetworkSetRef set
,
1214 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1215 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1218 @function SCNetworkSetContainsInterface
1219 @discussion Checks if an interface is represented by at least one
1220 network service in the specified set.
1221 @param set The network set.
1222 @param interface The network interface.
1223 @result TRUE if the interface is represented in the set; FALSE if not.
1226 SCNetworkSetContainsInterface (SCNetworkSetRef set
,
1227 SCNetworkInterfaceRef interface
) API_AVAILABLE(macos(10.5))
1228 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1231 @function SCNetworkSetCopyAll
1232 @discussion Returns all available sets for the specified preferences.
1233 @param prefs The "preferences" session.
1234 @result The list of SCNetworkSet sets associated with the preferences.
1235 You must release the returned value.
1237 CFArrayRef
/* of SCNetworkSetRef's */ __nullable
1238 SCNetworkSetCopyAll (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.4))
1239 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1242 @function SCNetworkSetCopyCurrent
1243 @discussion Returns the "current" set.
1244 @param prefs The "preferences" session.
1245 @result The current set; NULL if no current set has been defined.
1247 SCNetworkSetRef __nullable
1248 SCNetworkSetCopyCurrent (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.4))
1249 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1252 @function SCNetworkSetCopyServices
1253 @discussion Returns all network services associated with the set.
1254 @param set The network set.
1255 @result The list of SCNetworkService services associated with the set.
1256 You must release the returned value.
1258 CFArrayRef
/* of SCNetworkServiceRef's */ __nullable
1259 SCNetworkSetCopyServices (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1260 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1263 @function SCNetworkSetCreate
1264 @discussion Create a new set in the configuration.
1265 @param prefs The "preferences" session.
1266 @result A reference to the new SCNetworkSet.
1267 You must release the returned value.
1269 SCNetworkSetRef __nullable
1270 SCNetworkSetCreate (SCPreferencesRef prefs
) API_AVAILABLE(macos(10.4))
1271 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1274 @function SCNetworkSetCopy
1275 @discussion Returns the set with the specified identifier.
1276 @param prefs The "preferences" session.
1277 @param setID The unique identifier for the set.
1278 @result A reference to the SCNetworkSet from the associated preferences;
1279 NULL if the setID does not exist in the preferences or if an
1280 error was encountered.
1281 You must release the returned value.
1283 SCNetworkSetRef __nullable
1284 SCNetworkSetCopy (SCPreferencesRef prefs
,
1285 CFStringRef setID
) API_AVAILABLE(macos(10.4))
1286 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1289 @function SCNetworkSetGetName
1290 @discussion Returns the [user specified] name associated with the set.
1291 @param set The network set.
1292 @result The [user specified] name.
1294 CFStringRef __nullable
1295 SCNetworkSetGetName (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1296 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1299 @function SCNetworkSetGetSetID
1300 @discussion Returns the identifier for the set.
1301 @param set The network set.
1302 @result The set identifier.
1304 CFStringRef __nullable
1305 SCNetworkSetGetSetID (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1306 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1309 @function SCNetworkSetGetServiceOrder
1310 @discussion Returns the [user specified] ordering of network services
1312 @param set The network set.
1313 @result The ordered list of CFStringRef service identifiers associated
1315 NULL if no service order has been specified or if an error
1318 CFArrayRef
/* of serviceID CFStringRef's */ __nullable
1319 SCNetworkSetGetServiceOrder (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1320 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1323 @function SCNetworkSetRemove
1324 @discussion Removes the set from the configuration.
1325 @param set The network set.
1326 @result TRUE if the set was removed; FALSE if an error was encountered.
1329 SCNetworkSetRemove (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1330 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1333 @function SCNetworkSetRemoveService
1334 @discussion Removes the network service from the set.
1335 @param set The network set.
1336 @param service The service to be removed.
1337 @result TRUE if the service was removed from the set; FALSE if the
1338 service was not already present or an error was encountered.
1341 SCNetworkSetRemoveService (SCNetworkSetRef set
,
1342 SCNetworkServiceRef service
) API_AVAILABLE(macos(10.4))
1343 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1346 @function SCNetworkSetSetCurrent
1347 @discussion Specifies the set that should be the "current" set.
1348 @param set The network set.
1349 @result TRUE if the current set was updated;
1350 FALSE if an error was encountered.
1353 SCNetworkSetSetCurrent (SCNetworkSetRef set
) API_AVAILABLE(macos(10.4))
1354 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1357 @function SCNetworkSetSetName
1358 @discussion Stores the [user specified] name for the set.
1359 @param set The network set.
1360 @param name The [user defined] name to associate with the set.
1361 @result TRUE if the name was saved; FALSE if an error was encountered.
1363 Note: although not technically required, the [user specified] names
1364 for all set should be unique. As such, an error will be returned if
1365 you attemp to name two sets with the same string.
1368 SCNetworkSetSetName (SCNetworkSetRef set
,
1369 CFStringRef __nullable name
) API_AVAILABLE(macos(10.4))
1370 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1373 @function SCNetworkSetSetServiceOrder
1374 @discussion Stores the [user specified] ordering of network services for the set.
1375 @param set The network set.
1376 @param newOrder The ordered list of CFStringRef service identifiers for the set.
1377 @result TRUE if the new service order was saved; FALSE if an error was encountered.
1380 SCNetworkSetSetServiceOrder (SCNetworkSetRef set
,
1381 CFArrayRef newOrder
) API_AVAILABLE(macos(10.4))
1382 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0)); /* serviceID CFStringRef's */
1387 CF_ASSUME_NONNULL_END
1388 CF_IMPLICIT_BRIDGING_DISABLED
1390 #endif /* _SCNETWORKCONFIGURATION_H */