]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfiguration.h
configd-963.200.27.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfiguration.h
1 /*
2 * Copyright (c) 2004-2011, 2015, 2016, 2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _SCNETWORKCONFIGURATION_H
25 #define _SCNETWORKCONFIGURATION_H
26
27 #include <os/availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32
33 CF_IMPLICIT_BRIDGING_ENABLED
34 CF_ASSUME_NONNULL_BEGIN
35
36 /*!
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
42 protocols.
43
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.
48 */
49
50
51 /*!
52 @group Interface configuration
53 */
54
55 #pragma mark -
56 #pragma mark SCNetworkInterface configuration (typedefs, consts)
57
58 /*!
59 @typedef SCNetworkInterfaceRef
60 @discussion This is the type of a reference to an object that represents
61 a network interface.
62 */
63 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkInterface * SCNetworkInterfaceRef;
64
65 /*!
66 @const kSCNetworkInterfaceType6to4
67 */
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));
70
71 /*!
72 @const kSCNetworkInterfaceTypeBluetooth
73 */
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));
76
77 /*!
78 @const kSCNetworkInterfaceTypeBond
79 */
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));
82
83 /*!
84 @const kSCNetworkInterfaceTypeEthernet
85 */
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));
88
89 /*!
90 @const kSCNetworkInterfaceTypeFireWire
91 */
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));
94
95 /*!
96 @const kSCNetworkInterfaceTypeIEEE80211
97 */
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
100
101 /*!
102 @const kSCNetworkInterfaceTypeIPSec
103 */
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));
106
107 /*!
108 @const kSCNetworkInterfaceTypeIrDA
109 */
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));
112
113 /*!
114 @const kSCNetworkInterfaceTypeL2TP
115 */
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));
118
119 /*!
120 @const kSCNetworkInterfaceTypeModem
121 */
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));
124
125 /*!
126 @const kSCNetworkInterfaceTypePPP
127 */
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));
130
131 /*!
132 @const kSCNetworkInterfaceTypePPTP
133 */
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));
136
137
138 /*!
139 @const kSCNetworkInterfaceTypeSerial
140 */
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));
143
144 /*!
145 @const kSCNetworkInterfaceTypeVLAN
146 */
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));
149
150 /*!
151 @const kSCNetworkInterfaceTypeWWAN
152 */
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));
155
156 /* special network interfaces (and types) */
157
158 /*!
159 @const kSCNetworkInterfaceTypeIPv4
160 */
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));
163
164 /*!
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
168 IPv4 network.
169 */
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));
172
173 /*!
174 @group Interface configuration (Bond)
175 */
176
177 #pragma mark -
178
179 /*!
180 @typedef SCBondInterfaceRef
181 @discussion This is the type of a reference to an object that represents
182 an Ethernet Bond interface.
183 */
184 typedef SCNetworkInterfaceRef SCBondInterfaceRef;
185
186 /*!
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.
190 */
191 typedef const struct CF_BRIDGED_TYPE(id) __SCBondStatus * SCBondStatusRef;
192
193 /*!
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
201 */
202 enum {
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 */
208 };
209
210 /*!
211 @const kSCBondStatusDeviceAggregationStatus
212 */
213 extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
214
215 /*!
216 @const kSCBondStatusDeviceCollecting
217 */
218 extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
219
220 /*!
221 @const kSCBondStatusDeviceDistributing
222 */
223 extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
224
225 /*!
226 @group Interface configuration (VLAN)
227 */
228
229 #pragma mark -
230
231 /*!
232 @typedef SCVLANInterfaceRef
233 @discussion This is the type of a reference to an object that represents
234 a Virtual LAN (VLAN) interface.
235 */
236 typedef SCNetworkInterfaceRef SCVLANInterfaceRef;
237
238
239 /*!
240 @group Protocol configuration
241 */
242
243 #pragma mark -
244 #pragma mark SCNetworkProtocol configuration (typedefs, consts)
245
246 /*!
247 @typedef SCNetworkProtocolRef
248 @discussion This is the type of a reference to an object that represents
249 a network protocol.
250 */
251 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkProtocol * SCNetworkProtocolRef;
252
253 /* network "protocol" types */
254
255 /*!
256 @const kSCNetworkProtocolTypeDNS
257 */
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));
260
261 /*!
262 @const kSCNetworkProtocolTypeIPv4
263 */
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));
266
267 /*!
268 @const kSCNetworkProtocolTypeIPv6
269 */
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));
272
273 /*!
274 @const kSCNetworkProtocolTypeProxies
275 */
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));
278
279 /*!
280 @const kSCNetworkProtocolTypeSMB
281 */
282 extern const CFStringRef kSCNetworkProtocolTypeSMB API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
283
284 /*!
285 @group Service configuration
286 */
287
288 #pragma mark -
289 #pragma mark SCNetworkService configuration (typedefs, consts)
290
291 /*!
292 @typedef SCNetworkServiceRef
293 @discussion This is the type of a reference to an object that represents
294 a network service.
295 */
296 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkService * SCNetworkServiceRef;
297
298
299 /*!
300 @group Set configuration
301 */
302
303 #pragma mark -
304 #pragma mark SCNetworkSet configuration (typedefs, consts)
305
306 /*!
307 @typedef SCNetworkSetRef
308 @discussion This is the type of a reference to an object that represents
309 a network set.
310 */
311 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkSet * SCNetworkSetRef;
312
313
314 __BEGIN_DECLS
315
316
317 /* --------------------------------------------------------------------------------
318 * INTERFACES
319 * -------------------------------------------------------------------------------- */
320
321 /*!
322 @group Interface configuration
323 */
324
325 #pragma mark -
326 #pragma mark SCNetworkInterface configuration (APIs)
327
328 /*!
329 @function SCNetworkInterfaceGetTypeID
330 @discussion Returns the type identifier of all SCNetworkInterface instances.
331 */
332 CFTypeID
333 SCNetworkInterfaceGetTypeID (void) API_AVAILABLE(macos(10.4))
334 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
335
336 /*!
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.
341 */
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));
345
346 /*!
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.
353 */
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));
357
358 /*!
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.
365 */
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));
369
370 /*!
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
374 on top of a "modem".
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.
380 */
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));
385
386 /*!
387 @function SCNetworkInterfaceGetBSDName
388 @discussion Returns the BSD interface (en0) or device name (modem)
389 for the interface.
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.
393 */
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));
397
398 /*!
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.
405 */
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));
409
410 /*!
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.
418 */
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));
423
424 /*!
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.
429 */
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));
433
434 /*!
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.
440 */
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));
444
445 /*!
446 @function SCNetworkInterfaceGetInterfaceType
447 @discussion Returns the associated network interface type.
448 @param interface The network interface.
449 @result The interface type.
450 */
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));
454
455 /*!
456 @function SCNetworkInterfaceGetLocalizedDisplayName
457 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
458 the interface.
459 @param interface The network interface.
460 @result A localized, display name for the interface;
461 NULL if no name is available.
462 */
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));
466
467 /*!
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.
473 */
474 Boolean
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));
478
479 /*!
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.
485 */
486 Boolean
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));
491
492 #pragma mark -
493
494 /*!
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.
513 */
514 Boolean
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));
521
522 /*!
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.
530 */
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));
534
535 /*!
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.
545 */
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));
550
551 /*!
552 @function SCNetworkInterfaceCopyMTU
553 @discussion For the specified network interface, returns information
554 about the currently MTU setting and the range of allowable
555 values.
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.
566 */
567 Boolean
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));
573
574 /*!
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.
582 */
583 Boolean
584 SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface,
585 CFStringRef subtype,
586 CFArrayRef options) API_AVAILABLE(macos(10.5))
587 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
588
589 /*!
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.
596 */
597 Boolean
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));
601
602 /*!
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.
611
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 :
615
616 SCPreferencesCreateWithAuthorization
617 SCNetworkSetCopy...
618 SCNetworkServiceGetInterface
619 @param interface The desired network interface.
620 @result Returns TRUE if the notification was sent; FALSE otherwise.
621 */
622 Boolean
623 SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface) API_AVAILABLE(macos(10.5))
624 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
625
626 /*!
627 @group Interface configuration (Bond)
628 */
629
630 #pragma mark -
631 #pragma mark SCBondInterface configuration (APIs)
632
633 /*!
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.
639 */
640 CFArrayRef /* of SCBondInterfaceRef's */
641 SCBondInterfaceCopyAll (SCPreferencesRef prefs) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
642
643 /*!
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.
650 */
651 CFArrayRef /* of SCNetworkInterfaceRef's */
652 SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
653
654 /*!
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.
660 */
661 SCBondInterfaceRef __nullable
662 SCBondInterfaceCreate (SCPreferencesRef prefs) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
663
664 /*!
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.
669 */
670 Boolean
671 SCBondInterfaceRemove (SCBondInterfaceRef bond) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
672
673 /*!
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.
678 */
679 CFArrayRef /* of SCNetworkInterfaceRef's */ __nullable
680 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
681
682 /*!
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.
688 */
689 CFDictionaryRef __nullable
690 SCBondInterfaceGetOptions (SCBondInterfaceRef bond) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
691
692 /*!
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.
698 */
699 Boolean
700 SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond,
701 CFArrayRef members) /* of SCNetworkInterfaceRef's */
702 API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
703
704 /*!
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.
710 */
711 Boolean
712 SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond,
713 CFStringRef newName) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
714
715 /*!
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.
721 */
722 Boolean
723 SCBondInterfaceSetOptions (SCBondInterfaceRef bond,
724 CFDictionaryRef newOptions) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
725
726 #pragma mark -
727
728 /*!
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.
734 */
735 SCBondStatusRef __nullable
736 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
737
738 /*!
739 @function SCBondStatusGetTypeID
740 @discussion Returns the type identifier of all SCBondStatus instances.
741 */
742 CFTypeID
743 SCBondStatusGetTypeID (void) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
744
745 /*!
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.
751 */
752 CFArrayRef __nullable /* of SCNetworkInterfaceRef's */
753 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
754
755 /*!
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.
763
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.
767 */
768 CFDictionaryRef __nullable
769 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus,
770 SCNetworkInterfaceRef __nullable interface) API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, bridgeos);
771
772 /*!
773 @group Interface configuration (VLAN)
774 */
775
776 #pragma mark -
777 #pragma mark SCVLANInterface configuration (APIs)
778
779 /*!
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.
784 */
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));
788
789 /*!
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.
795 */
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));
799
800 /*!
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.
808
809 Note: the tag must be in the range (1 <= tag <= 4094)
810 */
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));
816
817 /*!
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.
822 */
823 Boolean
824 SCVLANInterfaceRemove (SCVLANInterfaceRef vlan) API_AVAILABLE(macos(10.5))
825 SPI_AVAILABLE(ios(4.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
826
827 /*!
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.
832 */
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));
836
837 /*!
838 @function SCVLANInterfaceGetTag
839 @discussion Returns the tag for the specified VLAN interface.
840 @param vlan The SCVLANInterface interface.
841 @result The tag.
842 */
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));
846
847 /*!
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.
853 */
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));
857
858 /*!
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.
865
866 Note: the tag must be in the range (1 <= tag <= 4094)
867 */
868 Boolean
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));
873
874 /*!
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.
880 */
881 Boolean
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));
885
886 /*!
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.
892 */
893 Boolean
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));
897
898
899 /* --------------------------------------------------------------------------------
900 * PROTOCOLS
901 * -------------------------------------------------------------------------------- */
902
903 /*!
904 @group Protocol configuration
905 */
906
907 #pragma mark -
908 #pragma mark SCNetworkProtocol configuration (APIs)
909
910 /*!
911 @function SCNetworkProtocolGetTypeID
912 @discussion Returns the type identifier of all SCNetworkProtocol instances.
913 */
914 CFTypeID
915 SCNetworkProtocolGetTypeID (void) API_AVAILABLE(macos(10.4))
916 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
917
918 /*!
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.
925 */
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));
929
930 /*!
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.
935 */
936 Boolean
937 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol) API_AVAILABLE(macos(10.4))
938 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
939
940 /*!
941 @function SCNetworkProtocolGetProtocolType
942 @discussion Returns the associated network protocol type.
943 @param protocol The network protocol.
944 @result The protocol type.
945 */
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));
949
950 /*!
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.
956 */
957 Boolean
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));
961
962 /*!
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.
968 */
969 Boolean
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));
973
974 /* --------------------------------------------------------------------------------
975 * SERVICES
976 * -------------------------------------------------------------------------------- */
977
978 /*!
979 @group Service configuration
980 */
981
982 #pragma mark -
983 #pragma mark SCNetworkService configuration (APIs)
984
985 /*!
986 @function SCNetworkServiceGetTypeID
987 @discussion Returns the type identifier of all SCNetworkService instances.
988 */
989 CFTypeID
990 SCNetworkServiceGetTypeID (void) API_AVAILABLE(macos(10.4))
991 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
992
993 /*!
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
998 service.
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.
1003 */
1004 Boolean
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));
1008
1009 /*!
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.
1015 */
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));
1019
1020 /*!
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.
1026 */
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));
1030
1031 /*!
1032 @function SCNetworkServiceCreate
1033 @discussion Create a new network service for the specified interface in the
1034 configuration.
1035 @param prefs The "preferences" session.
1036 @result A reference to the new SCNetworkService.
1037 You must release the returned value.
1038 */
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));
1043
1044 /*!
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.
1053 */
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));
1058
1059 /*!
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.
1067 */
1068 Boolean
1069 SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service) API_AVAILABLE(macos(10.5))
1070 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1071
1072 /*!
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.
1077 */
1078 Boolean
1079 SCNetworkServiceGetEnabled (SCNetworkServiceRef service) API_AVAILABLE(macos(10.4))
1080 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1081
1082 /*!
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.
1088 */
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));
1092
1093 /*!
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.
1098 */
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));
1102
1103 /*!
1104 @function SCNetworkServiceCopyProtocol
1105 @discussion Returns the network protocol of the specified type for
1106 the service.
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.
1111 */
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));
1116
1117 /*!
1118 @function SCNetworkServiceGetServiceID
1119 @discussion Returns the identifier for the service.
1120 @param service The network service.
1121 @result The service identifier.
1122 */
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));
1126
1127 /*!
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.
1132 */
1133 Boolean
1134 SCNetworkServiceRemove (SCNetworkServiceRef service) API_AVAILABLE(macos(10.4))
1135 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1136
1137 /*!
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.
1144 */
1145 Boolean
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));
1149
1150 /*!
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.
1156 */
1157 Boolean
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));
1161
1162 /*!
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.
1168
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
1172 same string.
1173 */
1174 Boolean
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));
1178
1179
1180 /* --------------------------------------------------------------------------------
1181 * SETS
1182 * -------------------------------------------------------------------------------- */
1183
1184 /*!
1185 @group Set configuration
1186 */
1187
1188 #pragma mark -
1189 #pragma mark SCNetworkSet configuration (APIs)
1190
1191 /*!
1192 @function SCNetworkSetGetTypeID
1193 @discussion Returns the type identifier of all SCNetworkSet instances.
1194 */
1195 CFTypeID
1196 SCNetworkSetGetTypeID (void) API_AVAILABLE(macos(10.4))
1197 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1198
1199 /*!
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.
1206
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.
1211 */
1212 Boolean
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));
1216
1217 /*!
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.
1224 */
1225 Boolean
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));
1229
1230 /*!
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.
1236 */
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));
1240
1241 /*!
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.
1246 */
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));
1250
1251 /*!
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.
1257 */
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));
1261
1262 /*!
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.
1268 */
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));
1272
1273 /*!
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.
1282 */
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));
1287
1288 /*!
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.
1293 */
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));
1297
1298 /*!
1299 @function SCNetworkSetGetSetID
1300 @discussion Returns the identifier for the set.
1301 @param set The network set.
1302 @result The set identifier.
1303 */
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));
1307
1308 /*!
1309 @function SCNetworkSetGetServiceOrder
1310 @discussion Returns the [user specified] ordering of network services
1311 within the set.
1312 @param set The network set.
1313 @result The ordered list of CFStringRef service identifiers associated
1314 with the set;
1315 NULL if no service order has been specified or if an error
1316 was encountered.
1317 */
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));
1321
1322 /*!
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.
1327 */
1328 Boolean
1329 SCNetworkSetRemove (SCNetworkSetRef set) API_AVAILABLE(macos(10.4))
1330 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1331
1332 /*!
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.
1339 */
1340 Boolean
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));
1344
1345 /*!
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.
1351 */
1352 Boolean
1353 SCNetworkSetSetCurrent (SCNetworkSetRef set) API_AVAILABLE(macos(10.4))
1354 SPI_AVAILABLE(ios(2.0), tvos(9.0), watchos(1.0), bridgeos(1.0));
1355
1356 /*!
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.
1362
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.
1366 */
1367 Boolean
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));
1371
1372 /*!
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.
1378 */
1379 Boolean
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 */
1383
1384
1385 __END_DECLS
1386
1387 CF_ASSUME_NONNULL_END
1388 CF_IMPLICIT_BRIDGING_DISABLED
1389
1390 #endif /* _SCNETWORKCONFIGURATION_H */