]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfiguration.h
0b5dd203b23de577191b56bb2fab1755ff0e1b39
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfiguration.h
1 /*
2 * Copyright (c) 2004-2011, 2015 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 #ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
26 #include <SystemConfiguration/_SCNetworkConfiguration.h>
27 #else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
28 #define _SCNETWORKCONFIGURATION_H
29
30 #include <Availability.h>
31 #include <TargetConditionals.h>
32 #include <sys/cdefs.h>
33 #include <CoreFoundation/CoreFoundation.h>
34 #include <SystemConfiguration/SystemConfiguration.h>
35
36 CF_IMPLICIT_BRIDGING_ENABLED
37 CF_ASSUME_NONNULL_BEGIN
38
39 /*!
40 @header SCNetworkConfiguration
41 @discussion The SCNetworkConfiguration API provides access to the
42 stored network configuration. The functions include
43 providing access to the network capable devices on the
44 system, the network sets, network services, and network
45 protocols.
46
47 Note: When using the SCNetworkConfiguraiton APIs you must
48 keep in mind that in order for any of your changes to be
49 committed to permanent storage a call must be made to the
50 SCPreferencesCommitChanges function.
51 */
52
53
54 /*!
55 @group Interface configuration
56 */
57
58 #pragma mark -
59 #pragma mark SCNetworkInterface configuration (typedefs, consts)
60
61 /*!
62 @typedef SCNetworkInterfaceRef
63 @discussion This is the type of a reference to an object that represents
64 a network interface.
65 */
66 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkInterface * SCNetworkInterfaceRef;
67
68 /*!
69 @const kSCNetworkInterfaceType6to4
70 */
71 extern const CFStringRef kSCNetworkInterfaceType6to4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
72
73 /*!
74 @const kSCNetworkInterfaceTypeBluetooth
75 */
76 extern const CFStringRef kSCNetworkInterfaceTypeBluetooth __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
77
78 /*!
79 @const kSCNetworkInterfaceTypeBond
80 */
81 extern const CFStringRef kSCNetworkInterfaceTypeBond __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0/*SPI*/);
82
83 /*!
84 @const kSCNetworkInterfaceTypeEthernet
85 */
86 extern const CFStringRef kSCNetworkInterfaceTypeEthernet __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
87
88 /*!
89 @const kSCNetworkInterfaceTypeFireWire
90 */
91 extern const CFStringRef kSCNetworkInterfaceTypeFireWire __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
92
93 /*!
94 @const kSCNetworkInterfaceTypeIEEE80211
95 */
96 extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); // IEEE 802.11, AirPort
97
98 /*!
99 @const kSCNetworkInterfaceTypeIPSec
100 */
101 extern const CFStringRef kSCNetworkInterfaceTypeIPSec __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
102
103 /*!
104 @const kSCNetworkInterfaceTypeIrDA
105 */
106 extern const CFStringRef kSCNetworkInterfaceTypeIrDA __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
107
108 /*!
109 @const kSCNetworkInterfaceTypeL2TP
110 */
111 extern const CFStringRef kSCNetworkInterfaceTypeL2TP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
112
113 /*!
114 @const kSCNetworkInterfaceTypeModem
115 */
116 extern const CFStringRef kSCNetworkInterfaceTypeModem __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
117
118 /*!
119 @const kSCNetworkInterfaceTypePPP
120 */
121 extern const CFStringRef kSCNetworkInterfaceTypePPP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
122
123 /*!
124 @const kSCNetworkInterfaceTypePPTP
125 */
126 extern const CFStringRef kSCNetworkInterfaceTypePPTP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
127
128 /*!
129 @const kSCNetworkInterfaceTypeSerial
130 */
131 extern const CFStringRef kSCNetworkInterfaceTypeSerial __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
132
133 /*!
134 @const kSCNetworkInterfaceTypeVLAN
135 */
136 extern const CFStringRef kSCNetworkInterfaceTypeVLAN __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0/*SPI*/);
137
138 /*!
139 @const kSCNetworkInterfaceTypeWWAN
140 */
141 extern const CFStringRef kSCNetworkInterfaceTypeWWAN __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
142
143 /* special network interfaces (and types) */
144
145 /*!
146 @const kSCNetworkInterfaceTypeIPv4
147 */
148 extern const CFStringRef kSCNetworkInterfaceTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
149
150 /*!
151 @const kSCNetworkInterfaceIPv4
152 @discussion A network interface that can used for layering other
153 interfaces (e.g. 6to4, IPSec, PPTP, L2TP) over an existing
154 IPv4 network.
155 */
156 extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
157
158 /*!
159 @group Interface configuration (Bond)
160 */
161
162 #pragma mark -
163
164 /*!
165 @typedef SCBondInterfaceRef
166 @discussion This is the type of a reference to an object that represents
167 an Ethernet Bond interface.
168 */
169 typedef SCNetworkInterfaceRef SCBondInterfaceRef;
170
171 /*!
172 @typedef SCBondStatusRef
173 @discussion This is the type of a reference to an object that represents
174 the status of an Ethernet Bond interface.
175 */
176 typedef const struct CF_BRIDGED_TYPE(id) __SCBondStatus * SCBondStatusRef;
177
178 /*!
179 @enum Ethernet Bond Aggregation Status (kSCBondStatusDeviceAggregationStatus) codes
180 @discussion Returned status codes.
181 @constant kSCBondStatusOK Enabled, active, running, ...
182 @constant kSCBondStatusLinkInvalid The link state was not valid (i.e. down, half-duplex, wrong speed)
183 @constant kSCBondStatusNoPartner The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled
184 @constant kSCBondStatusNotInActiveGroup We're talking to a partner, but the link aggregation group is different from the one that's active
185 @constant kSCBondStatusUnknown Non-specific failure
186 */
187 enum {
188 kSCBondStatusOK = 0, /* enabled, active, running, ... */
189 kSCBondStatusLinkInvalid = 1, /* The link state was not valid (i.e. down, half-duplex, wrong speed) */
190 kSCBondStatusNoPartner = 2, /* The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled */
191 kSCBondStatusNotInActiveGroup = 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
192 kSCBondStatusUnknown = 999 /* Non-specific failure */
193 };
194
195 /*!
196 @const kSCBondStatusDeviceAggregationStatus
197 */
198 extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0/*SPI*/);
199
200 /*!
201 @const kSCBondStatusDeviceCollecting
202 */
203 extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0/*SPI*/);
204
205 /*!
206 @const kSCBondStatusDeviceDistributing
207 */
208 extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0/*SPI*/);
209
210 /*!
211 @group Interface configuration (VLAN)
212 */
213
214 #pragma mark -
215
216 /*!
217 @typedef SCVLANInterfaceRef
218 @discussion This is the type of a reference to an object that represents
219 a Virtual LAN (VLAN) interface.
220 */
221 typedef SCNetworkInterfaceRef SCVLANInterfaceRef;
222
223
224 /*!
225 @group Protocol configuration
226 */
227
228 #pragma mark -
229 #pragma mark SCNetworkProtocol configuration (typedefs, consts)
230
231 /*!
232 @typedef SCNetworkProtocolRef
233 @discussion This is the type of a reference to an object that represents
234 a network protocol.
235 */
236 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkProtocol * SCNetworkProtocolRef;
237
238 /* network "protocol" types */
239
240 /*!
241 @const kSCNetworkProtocolTypeAppleTalk
242 */
243 extern const CFStringRef kSCNetworkProtocolTypeAppleTalk __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
244
245 /*!
246 @const kSCNetworkProtocolTypeDNS
247 */
248 extern const CFStringRef kSCNetworkProtocolTypeDNS __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
249
250 /*!
251 @const kSCNetworkProtocolTypeIPv4
252 */
253 extern const CFStringRef kSCNetworkProtocolTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
254
255 /*!
256 @const kSCNetworkProtocolTypeIPv6
257 */
258 extern const CFStringRef kSCNetworkProtocolTypeIPv6 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
259
260 /*!
261 @const kSCNetworkProtocolTypeProxies
262 */
263 extern const CFStringRef kSCNetworkProtocolTypeProxies __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
264
265 /*!
266 @const kSCNetworkProtocolTypeSMB
267 */
268 extern const CFStringRef kSCNetworkProtocolTypeSMB __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
269
270 /*!
271 @group Service configuration
272 */
273
274 #pragma mark -
275 #pragma mark SCNetworkService configuration (typedefs, consts)
276
277 /*!
278 @typedef SCNetworkServiceRef
279 @discussion This is the type of a reference to an object that represents
280 a network service.
281 */
282 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkService * SCNetworkServiceRef;
283
284
285 /*!
286 @group Set configuration
287 */
288
289 #pragma mark -
290 #pragma mark SCNetworkSet configuration (typedefs, consts)
291
292 /*!
293 @typedef SCNetworkSetRef
294 @discussion This is the type of a reference to an object that represents
295 a network set.
296 */
297 typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkSet * SCNetworkSetRef;
298
299
300 __BEGIN_DECLS
301
302
303 /* --------------------------------------------------------------------------------
304 * INTERFACES
305 * -------------------------------------------------------------------------------- */
306
307 /*!
308 @group Interface configuration
309 */
310
311 #pragma mark -
312 #pragma mark SCNetworkInterface configuration (APIs)
313
314 /*!
315 @function SCNetworkInterfaceGetTypeID
316 @discussion Returns the type identifier of all SCNetworkInterface instances.
317 */
318 CFTypeID
319 SCNetworkInterfaceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
320
321 /*!
322 @function SCNetworkInterfaceCopyAll
323 @discussion Returns all network capable interfaces on the system.
324 @result The list of interfaces on the system.
325 You must release the returned value.
326 */
327 CFArrayRef /* of SCNetworkInterfaceRef's */
328 SCNetworkInterfaceCopyAll (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
329
330 /*!
331 @function SCNetworkInterfaceGetSupportedInterfaceTypes
332 @discussion Identify all of the network interface types (e.g. PPP) that
333 can be layered on top of this interface.
334 @param interface The network interface.
335 @result The list of SCNetworkInterface types supported by the interface;
336 NULL if no interface types are supported.
337 */
338 CFArrayRef /* of kSCNetworkInterfaceTypeXXX CFStringRef's */ __nullable
339 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
340
341 /*!
342 @function SCNetworkInterfaceGetSupportedProtocolTypes
343 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
344 can be layered on top of this interface.
345 @param interface The network interface.
346 @result The list of SCNetworkProtocol types supported by the interface;
347 NULL if no protocol types are supported.
348 */
349 CFArrayRef /* of kSCNetworkProtocolTypeXXX CFStringRef's */ __nullable
350 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
351
352 /*!
353 @function SCNetworkInterfaceCreateWithInterface
354 @discussion Create a new network interface layered on top of another. For
355 example, this function would be used to create a "PPP" interface
356 on top of a "modem".
357 @param interface The network interface.
358 @param interfaceType The type of SCNetworkInterface to be layered on
359 top of the provided interface.
360 @result A reference to the new SCNetworkInterface.
361 You must release the returned value.
362 */
363 SCNetworkInterfaceRef __nullable
364 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface,
365 CFStringRef interfaceType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
366
367 /*!
368 @function SCNetworkInterfaceGetBSDName
369 @discussion Returns the BSD interface (en0) or device name (modem)
370 for the interface.
371 @param interface The network interface.
372 @result The BSD name associated with the interface (e.g. "en0");
373 NULL if no BSD name is available.
374 */
375 CFStringRef __nullable
376 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
377
378 /*!
379 @function SCNetworkInterfaceGetConfiguration
380 @discussion Returns the configuration settings associated with a interface.
381 @param interface The network interface.
382 @result The configuration settings associated with the interface;
383 NULL if no configuration settings are associated with the interface
384 or an error was encountered.
385 */
386 CFDictionaryRef __nullable
387 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
388
389 /*!
390 @function SCNetworkInterfaceGetExtendedConfiguration
391 @discussion Returns the configuration settings associated with a interface.
392 @param interface The network interface.
393 @param extendedType A string representing the type of extended information (e.g. EAPOL).
394 @result The configuration settings associated with the interface;
395 NULL if no configuration settings are associated with the interface
396 or an error was encountered.
397 */
398 CFDictionaryRef __nullable
399 SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface,
400 CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
401
402 /*!
403 @function SCNetworkInterfaceGetHardwareAddressString
404 @discussion Returns a displayable link layer address for the interface.
405 @param interface The network interface.
406 @result A string representing the hardware (MAC) address for the interface.
407 */
408 CFStringRef __nullable
409 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
410
411 /*!
412 @function SCNetworkInterfaceGetInterface
413 @discussion For layered network interfaces, return the underlying interface.
414 @param interface The network interface.
415 @result The underlying network interface;
416 NULL if this is a leaf interface.
417 */
418 SCNetworkInterfaceRef __nullable
419 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
420
421 /*!
422 @function SCNetworkInterfaceGetInterfaceType
423 @discussion Returns the associated network interface type.
424 @param interface The network interface.
425 @result The interface type.
426 */
427 CFStringRef __nullable
428 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
429
430 /*!
431 @function SCNetworkInterfaceGetLocalizedDisplayName
432 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
433 the interface.
434 @param interface The network interface.
435 @result A localized, display name for the interface;
436 NULL if no name is available.
437 */
438 CFStringRef __nullable
439 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
440
441 /*!
442 @function SCNetworkInterfaceSetConfiguration
443 @discussion Stores the configuration settings for the interface.
444 @param interface The network interface.
445 @param config The configuration settings to associate with this interface.
446 @result TRUE if the configuration was stored; FALSE if an error was encountered.
447 */
448 Boolean
449 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
450 CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
451
452 /*!
453 @function SCNetworkInterfaceSetExtendedConfiguration
454 @discussion Stores the configuration settings for the interface.
455 @param interface The network interface.
456 @param config The configuration settings to associate with this interface.
457 @result TRUE if the configuration was stored; FALSE if an error was encountered.
458 */
459 Boolean
460 SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface,
461 CFStringRef extendedType,
462 CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
463
464 #pragma mark -
465
466 /*!
467 @function SCNetworkInterfaceCopyMediaOptions
468 @discussion For the specified network interface, returns information
469 about the currently requested media options, the active media
470 options, and the media options which are available.
471 @param interface The desired network interface.
472 @param current A pointer to memory that will be filled with a CFDictionaryRef
473 representing the currently requested media options (subtype, options).
474 If NULL, the current options will not be returned.
475 @param active A pointer to memory that will be filled with a CFDictionaryRef
476 representing the active media options (subtype, options).
477 If NULL, the active options will not be returned.
478 @param available A pointer to memory that will be filled with a CFArrayRef
479 representing the possible media options (subtype, options).
480 If NULL, the available options will not be returned.
481 @param filter A boolean indicating whether the available options should be
482 filtered to exclude those options which would not normally be
483 requested by a user/admin (e.g. hw-loopback).
484 @result TRUE if requested information has been returned.
485 */
486 Boolean
487 SCNetworkInterfaceCopyMediaOptions (SCNetworkInterfaceRef interface,
488 CFDictionaryRef __nullable * __nullable current,
489 CFDictionaryRef __nullable * __nullable active,
490 CFArrayRef __nullable * __nullable available,
491 Boolean filter) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
492
493 /*!
494 @function SCNetworkInterfaceCopyMediaSubTypes
495 @discussion For the provided interface configuration options, return a list
496 of available media subtypes.
497 @param available The available options as returned by the
498 SCNetworkInterfaceCopyMediaOptions function.
499 @result An array of available media subtypes CFString's (e.g. 10BaseT/UTP,
500 100baseTX, etc). NULL if no subtypes are available.
501 */
502 CFArrayRef __nullable
503 SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
504
505 /*!
506 @function SCNetworkInterfaceCopyMediaSubTypeOptions
507 @discussion For the provided interface configuration options and specific
508 subtype, return a list of available media options.
509 @param available The available options as returned by the
510 SCNetworkInterfaceCopyMediaOptions function.
511 @param subType The subtype
512 @result An array of available media options. Each of the available options
513 is returned as an array of CFString's (e.g. <half-duplex>,
514 <full-duplex,flow-control>). NULL if no options are available.
515 */
516 CFArrayRef __nullable
517 SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available,
518 CFStringRef subType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
519
520 /*!
521 @function SCNetworkInterfaceCopyMTU
522 @discussion For the specified network interface, returns information
523 about the currently MTU setting and the range of allowable
524 values.
525 @param interface The desired network interface.
526 @param mtu_cur A pointer to memory that will be filled with the current
527 MTU setting for the interface.
528 @param mtu_min A pointer to memory that will be filled with the minimum
529 MTU setting for the interface. If negative, the minimum setting
530 could not be determined.
531 @param mtu_max A pointer to memory that will be filled with the maximum
532 MTU setting for the interface. If negative, the maximum setting
533 could not be determined.
534 @result TRUE if requested information has been returned.
535 */
536 Boolean
537 SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface,
538 int * __nullable mtu_cur,
539 int * __nullable mtu_min,
540 int * __nullable mtu_max) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
541
542 /*!
543 @function SCNetworkInterfaceSetMediaOptions
544 @discussion For the specified network interface, sets the requested
545 media subtype and options.
546 @param interface The desired network interface.
547 @param subtype The desired media subtype (e.g. "autoselect", "100baseTX", ...).
548 @param options The desired media options (e.g. "half-duplex", "full-duplex", ...).
549 @result TRUE if the configuration was updated; FALSE if an error was encountered.
550 */
551 Boolean
552 SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface,
553 CFStringRef subtype,
554 CFArrayRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
555
556 /*!
557 @function SCNetworkInterfaceSetMTU
558 @discussion For the specified network interface, sets the
559 requested MTU setting.
560 @param interface The desired network interface.
561 @param mtu The desired MTU setting for the interface.
562 @result TRUE if the configuration was updated; FALSE if an error was encountered.
563 */
564 Boolean
565 SCNetworkInterfaceSetMTU (SCNetworkInterfaceRef interface,
566 int mtu) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
567
568 /*!
569 @function SCNetworkInterfaceForceConfigurationRefresh
570 @discussion Sends a notification to interested network configuration
571 agents to immediately retry their configuration. For example,
572 calling this function will cause the DHCP client to contact
573 the DHCP server immediately rather than waiting until its
574 timeout has expired. The utility of this function is to
575 allow the caller to give a hint to the system that the
576 network infrastructure or configuration has changed.
577
578 Note: This function requires root (euid==0) privilege or,
579 alternatively, you may pass an SCNetworkInterface which
580 is derived from a sequence of calls to :
581
582 SCPreferencesCreateWithAuthorization
583 SCNetworkSetCopy...
584 SCNetworkServiceGetInterface
585 @param interface The desired network interface.
586 @result Returns TRUE if the notification was sent; FALSE otherwise.
587 */
588 Boolean
589 SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
590
591 /*!
592 @group Interface configuration (Bond)
593 */
594
595 #pragma mark -
596 #pragma mark SCBondInterface configuration (APIs)
597
598 /*!
599 @function SCBondInterfaceCopyAll
600 @discussion Returns all Ethernet Bond interfaces on the system.
601 @param prefs The "preferences" session.
602 @result The list of Ethernet Bond interfaces on the system.
603 You must release the returned value.
604 */
605 CFArrayRef /* of SCBondInterfaceRef's */
606 SCBondInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
607
608 /*!
609 @function SCBondInterfaceCopyAvailableMemberInterfaces
610 @discussion Returns all network capable devices on the system
611 that can be added to an Ethernet Bond interface.
612 @param prefs The "preferences" session.
613 @result The list of interfaces.
614 You must release the returned value.
615 */
616 CFArrayRef /* of SCNetworkInterfaceRef's */
617 SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
618
619 /*!
620 @function SCBondInterfaceCreate
621 @discussion Create a new SCBondInterface interface.
622 @param prefs The "preferences" session.
623 @result A reference to the new SCBondInterface.
624 You must release the returned value.
625 */
626 SCBondInterfaceRef __nullable
627 SCBondInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
628
629 /*!
630 @function SCBondInterfaceRemove
631 @discussion Removes the SCBondInterface from the configuration.
632 @param bond The SCBondInterface interface.
633 @result TRUE if the interface was removed; FALSE if an error was encountered.
634 */
635 Boolean
636 SCBondInterfaceRemove (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
637
638 /*!
639 @function SCBondInterfaceGetMemberInterfaces
640 @discussion Returns the member interfaces for the specified Ethernet Bond interface.
641 @param bond The SCBondInterface interface.
642 @result The list of interfaces.
643 */
644 CFArrayRef /* of SCNetworkInterfaceRef's */ __nullable
645 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
646
647 /*!
648 @function SCBondInterfaceGetOptions
649 @discussion Returns the configuration settings associated with a Ethernet Bond interface.
650 @param bond The SCBondInterface interface.
651 @result The configuration settings associated with the Ethernet Bond interface;
652 NULL if no changes to the default configuration have been saved.
653 */
654 CFDictionaryRef __nullable
655 SCBondInterfaceGetOptions (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
656
657 /*!
658 @function SCBondInterfaceSetMemberInterfaces
659 @discussion Sets the member interfaces for the specified Ethernet Bond interface.
660 @param bond The SCBondInterface interface.
661 @param members The desired member interfaces.
662 @result TRUE if the configuration was stored; FALSE if an error was encountered.
663 */
664 Boolean
665 SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond,
666 CFArrayRef members) /* of SCNetworkInterfaceRef's */
667 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
668
669 /*!
670 @function SCBondInterfaceSetLocalizedDisplayName
671 @discussion Sets the localized display name for the specified Ethernet Bond interface.
672 @param bond The SCBondInterface interface.
673 @param newName The new display name.
674 @result TRUE if the configuration was stored; FALSE if an error was encountered.
675 */
676 Boolean
677 SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond,
678 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
679
680 /*!
681 @function SCBondInterfaceSetOptions
682 @discussion Sets the configuration settings for the specified Ethernet Bond interface.
683 @param bond The SCBondInterface interface.
684 @param newOptions The new configuration settings.
685 @result TRUE if the configuration was stored; FALSE if an error was encountered.
686 */
687 Boolean
688 SCBondInterfaceSetOptions (SCBondInterfaceRef bond,
689 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
690
691 #pragma mark -
692
693 /*!
694 @function SCBondInterfaceCopyStatus
695 @discussion Returns the status of the specified Ethernet Bond interface.
696 @param bond The SCBondInterface interface.
697 @result The status associated with the interface.
698 You must release the returned value.
699 */
700 SCBondStatusRef __nullable
701 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
702
703 /*!
704 @function SCBondStatusGetTypeID
705 @discussion Returns the type identifier of all SCBondStatus instances.
706 */
707 CFTypeID
708 SCBondStatusGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
709
710 /*!
711 @function SCBondStatusGetMemberInterfaces
712 @discussion Returns the member interfaces that are represented with the
713 Ethernet Bond interface.
714 @param bondStatus The Ethernet Bond status.
715 @result The list of interfaces.
716 */
717 CFArrayRef __nullable /* of SCNetworkInterfaceRef's */
718 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
719
720 /*!
721 @function SCBondStatusGetInterfaceStatus
722 @discussion Returns the status of a specific member interface of an
723 Ethernet Bond or the status of the bond as a whole.
724 @param bondStatus The Ethernet Bond status.
725 @param interface The specific member interface; NULL if you want the
726 status of the Ethernet Bond.
727 @result The interface status.
728
729 Note: at present, no information about the status of the Ethernet
730 Bond is returned. As long as one member interface is active
731 then the bond should be operational.
732 */
733 CFDictionaryRef __nullable
734 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus,
735 SCNetworkInterfaceRef __nullable interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
736
737 /*!
738 @group Interface configuration (VLAN)
739 */
740
741 #pragma mark -
742 #pragma mark SCVLANInterface configuration (APIs)
743
744 /*!
745 @function SCVLANInterfaceCopyAll
746 @discussion Returns all VLAN interfaces on the system.
747 @result The list of VLAN interfaces on the system.
748 You must release the returned value.
749 */
750 CFArrayRef /* of SCVLANInterfaceRef's */
751 SCVLANInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
752
753 /*!
754 @function SCVLANInterfaceCopyAvailablePhysicalInterfaces
755 @discussion Returns the network capable devices on the system
756 that can be associated with a VLAN interface.
757 @result The list of interfaces.
758 You must release the returned value.
759 */
760 CFArrayRef /* of SCNetworkInterfaceRef's */
761 SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
762
763 /*!
764 @function SCVLANInterfaceCreate
765 @discussion Create a new SCVLANInterface interface.
766 @param prefs The "preferences" session.
767 @param physical The physical interface to associate with the VLAN.
768 @param tag The tag to associate with the VLAN.
769 @result A reference to the new SCVLANInterface.
770 You must release the returned value.
771
772 Note: the tag must be in the range (1 <= tag <= 4094)
773 */
774 SCVLANInterfaceRef __nullable
775 SCVLANInterfaceCreate (SCPreferencesRef prefs,
776 SCNetworkInterfaceRef physical,
777 CFNumberRef tag) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
778
779 /*!
780 @function SCVLANInterfaceRemove
781 @discussion Removes the SCVLANInterface from the configuration.
782 @param vlan The SCVLANInterface interface.
783 @result TRUE if the interface was removed; FALSE if an error was encountered.
784 */
785 Boolean
786 SCVLANInterfaceRemove (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
787
788 /*!
789 @function SCVLANInterfaceGetPhysicalInterface
790 @discussion Returns the physical interface for the specified VLAN interface.
791 @param vlan The SCVLANInterface interface.
792 @result The list of interfaces.
793 */
794 SCNetworkInterfaceRef __nullable
795 SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
796
797 /*!
798 @function SCVLANInterfaceGetTag
799 @discussion Returns the tag for the specified VLAN interface.
800 @param vlan The SCVLANInterface interface.
801 @result The tag.
802 */
803 CFNumberRef __nullable
804 SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
805
806 /*!
807 @function SCVLANInterfaceGetOptions
808 @discussion Returns the configuration settings associated with the VLAN interface.
809 @param vlan The SCVLANInterface interface.
810 @result The configuration settings associated with the VLAN interface;
811 NULL if no changes to the default configuration have been saved.
812 */
813 CFDictionaryRef __nullable
814 SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
815
816 /*!
817 @function SCVLANInterfaceSetPhysicalInterfaceAndTag
818 @discussion Updates the specified VLAN interface.
819 @param vlan The SCVLANInterface interface.
820 @param physical The physical interface to associate with the VLAN.
821 @param tag The tag to associate with the VLAN.
822 @result TRUE if the configuration was stored; FALSE if an error was encountered.
823
824 Note: the tag must be in the range (1 <= tag <= 4094)
825 */
826 Boolean
827 SCVLANInterfaceSetPhysicalInterfaceAndTag (SCVLANInterfaceRef vlan,
828 SCNetworkInterfaceRef physical,
829 CFNumberRef tag) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
830
831 /*!
832 @function SCVLANInterfaceSetLocalizedDisplayName
833 @discussion Sets the localized display name for the specified VLAN interface.
834 @param vlan The SCVLANInterface interface.
835 @param newName The new display name.
836 @result TRUE if the configuration was stored; FALSE if an error was encountered.
837 */
838 Boolean
839 SCVLANInterfaceSetLocalizedDisplayName (SCVLANInterfaceRef vlan,
840 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
841
842 /*!
843 @function SCVLANInterfaceSetOptions
844 @discussion Sets the configuration settings for the specified VLAN interface.
845 @param vlan The SCVLANInterface interface.
846 @param newOptions The new configuration settings.
847 @result TRUE if the configuration was stored; FALSE if an error was encountered.
848 */
849 Boolean
850 SCVLANInterfaceSetOptions (SCVLANInterfaceRef vlan,
851 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
852
853
854 /* --------------------------------------------------------------------------------
855 * PROTOCOLS
856 * -------------------------------------------------------------------------------- */
857
858 /*!
859 @group Protocol configuration
860 */
861
862 #pragma mark -
863 #pragma mark SCNetworkProtocol configuration (APIs)
864
865 /*!
866 @function SCNetworkProtocolGetTypeID
867 @discussion Returns the type identifier of all SCNetworkProtocol instances.
868 */
869 CFTypeID
870 SCNetworkProtocolGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
871
872 /*!
873 @function SCNetworkProtocolGetConfiguration
874 @discussion Returns the configuration settings associated with the protocol.
875 @param protocol The network protocol.
876 @result The configuration settings associated with the protocol;
877 NULL if no configuration settings are associated with the protocol
878 or an error was encountered.
879 */
880 CFDictionaryRef __nullable
881 SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
882
883 /*!
884 @function SCNetworkProtocolGetEnabled
885 @discussion Returns whether this protocol has been enabled.
886 @param protocol The network protocol.
887 @result TRUE if the protocol is enabled.
888 */
889 Boolean
890 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
891
892 /*!
893 @function SCNetworkProtocolGetProtocolType
894 @discussion Returns the associated network protocol type.
895 @param protocol The network protocol.
896 @result The protocol type.
897 */
898 CFStringRef __nullable
899 SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
900
901 /*!
902 @function SCNetworkProtocolSetConfiguration
903 @discussion Stores the configuration settings for the protocol.
904 @param protocol The network protocol.
905 @param config The configuration settings to associate with this protocol.
906 @result TRUE if the configuration was stored; FALSE if an error was encountered.
907 */
908 Boolean
909 SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol,
910 CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
911
912 /*!
913 @function SCNetworkProtocolSetEnabled
914 @discussion Enables or disables the protocol.
915 @param protocol The network protocol.
916 @param enabled TRUE if the protocol should be enabled.
917 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
918 */
919 Boolean
920 SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol,
921 Boolean enabled) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
922
923 /* --------------------------------------------------------------------------------
924 * SERVICES
925 * -------------------------------------------------------------------------------- */
926
927 /*!
928 @group Service configuration
929 */
930
931 #pragma mark -
932 #pragma mark SCNetworkService configuration (APIs)
933
934 /*!
935 @function SCNetworkServiceGetTypeID
936 @discussion Returns the type identifier of all SCNetworkService instances.
937 */
938 CFTypeID
939 SCNetworkServiceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
940
941 /*!
942 @function SCNetworkServiceAddProtocolType
943 @discussion Adds a network protocol of the specified type to the
944 service. The protocal configuration is set to default values
945 that are appropriate for the interface associated with the
946 service.
947 @param service The network service.
948 @param protocolType The type of SCNetworkProtocol to be added to the service.
949 @result TRUE if the protocol was added to the service; FALSE if the
950 protocol was already present or an error was encountered.
951 */
952 Boolean
953 SCNetworkServiceAddProtocolType (SCNetworkServiceRef service,
954 CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
955
956 /*!
957 @function SCNetworkServiceCopyAll
958 @discussion Returns all available network services for the specified preferences.
959 @param prefs The "preferences" session.
960 @result The list of SCNetworkService services associated with the preferences.
961 You must release the returned value.
962 */
963 CFArrayRef /* of SCNetworkServiceRef's */ __nullable
964 SCNetworkServiceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
965
966 /*!
967 @function SCNetworkServiceCopyProtocols
968 @discussion Returns all network protocols associated with the service.
969 @param service The network service.
970 @result The list of SCNetworkProtocol protocols associated with the service.
971 You must release the returned value.
972 */
973 CFArrayRef /* of SCNetworkProtocolRef's */ __nullable
974 SCNetworkServiceCopyProtocols (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
975
976 /*!
977 @function SCNetworkServiceCreate
978 @discussion Create a new network service for the specified interface in the
979 configuration.
980 @param prefs The "preferences" session.
981 @result A reference to the new SCNetworkService.
982 You must release the returned value.
983 */
984 SCNetworkServiceRef __nullable
985 SCNetworkServiceCreate (SCPreferencesRef prefs,
986 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
987
988 /*!
989 @function SCNetworkServiceCopy
990 @discussion Returns the network service with the specified identifier.
991 @param prefs The "preferences" session.
992 @param serviceID The unique identifier for the service.
993 @result A reference to the SCNetworkService from the associated preferences;
994 NULL if the serviceID does not exist in the preferences or if an
995 error was encountered.
996 You must release the returned value.
997 */
998 SCNetworkServiceRef __nullable
999 SCNetworkServiceCopy (SCPreferencesRef prefs,
1000 CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1001
1002 /*!
1003 @function SCNetworkServiceEstablishDefaultConfiguration
1004 @discussion Establishes the "default" configuration for a network
1005 service. This configuration includes the addition of
1006 network protocols for the service (with "default"
1007 configuration options).
1008 @param service The network service.
1009 @result TRUE if the configuration was updated; FALSE if an error was encountered.
1010 */
1011 Boolean
1012 SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
1013
1014 /*!
1015 @function SCNetworkServiceGetEnabled
1016 @discussion Returns whether this service has been enabled.
1017 @param service The network service.
1018 @result TRUE if the service is enabled.
1019 */
1020 Boolean
1021 SCNetworkServiceGetEnabled (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1022
1023 /*!
1024 @function SCNetworkServiceGetInterface
1025 @discussion Returns the network interface associated with the service.
1026 @param service The network service.
1027 @result A reference to the SCNetworkInterface associated with the service;
1028 NULL if an error was encountered.
1029 */
1030 SCNetworkInterfaceRef __nullable
1031 SCNetworkServiceGetInterface (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1032
1033 /*!
1034 @function SCNetworkServiceGetName
1035 @discussion Returns the [user specified] name associated with the service.
1036 @param service The network service.
1037 @result The [user specified] name.
1038 */
1039 CFStringRef __nullable
1040 SCNetworkServiceGetName (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1041
1042 /*!
1043 @function SCNetworkServiceCopyProtocol
1044 @discussion Returns the network protocol of the specified type for
1045 the service.
1046 @param service The network service.
1047 @result A reference to the SCNetworkProtocol associated with the service;
1048 NULL if this protocol has not been added or if an error was encountered.
1049 You must release the returned value.
1050 */
1051 SCNetworkProtocolRef __nullable
1052 SCNetworkServiceCopyProtocol (SCNetworkServiceRef service,
1053 CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1054
1055 /*!
1056 @function SCNetworkServiceGetServiceID
1057 @discussion Returns the identifier for the service.
1058 @param service The network service.
1059 @result The service identifier.
1060 */
1061 CFStringRef __nullable
1062 SCNetworkServiceGetServiceID (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1063
1064 /*!
1065 @function SCNetworkServiceRemove
1066 @discussion Removes the network service from the configuration.
1067 @param service The network service.
1068 @result TRUE if the service was removed; FALSE if an error was encountered.
1069 */
1070 Boolean
1071 SCNetworkServiceRemove (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1072
1073 /*!
1074 @function SCNetworkServiceRemoveProtocolType
1075 @discussion Removes the network protocol of the specified type from the service.
1076 @param service The network service.
1077 @param protocolType The type of SCNetworkProtocol to be removed from the service.
1078 @result TRUE if the protocol was removed to the service; FALSE if the
1079 protocol was not configured or an error was encountered.
1080 */
1081 Boolean
1082 SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service,
1083 CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1084
1085 /*!
1086 @function SCNetworkServiceSetEnabled
1087 @discussion Enables or disables the service.
1088 @param service The network service.
1089 @param enabled TRUE if the service should be enabled.
1090 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
1091 */
1092 Boolean
1093 SCNetworkServiceSetEnabled (SCNetworkServiceRef service,
1094 Boolean enabled) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1095
1096 /*!
1097 @function SCNetworkServiceSetName
1098 @discussion Stores the [user specified] name for the service.
1099 @param service The network service.
1100 @param name The [user defined] name to associate with the service.
1101 @result TRUE if the name was saved; FALSE if an error was encountered.
1102
1103 Note: although not technically required, the [user specified] names
1104 for all services within any given set should be unique. As such, an
1105 error will be returned if you attemp to name two services with the
1106 same string.
1107 */
1108 Boolean
1109 SCNetworkServiceSetName (SCNetworkServiceRef service,
1110 CFStringRef name) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1111
1112
1113 /* --------------------------------------------------------------------------------
1114 * SETS
1115 * -------------------------------------------------------------------------------- */
1116
1117 /*!
1118 @group Set configuration
1119 */
1120
1121 #pragma mark -
1122 #pragma mark SCNetworkSet configuration (APIs)
1123
1124 /*!
1125 @function SCNetworkSetGetTypeID
1126 @discussion Returns the type identifier of all SCNetworkSet instances.
1127 */
1128 CFTypeID
1129 SCNetworkSetGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1130
1131 /*!
1132 @function SCNetworkSetAddService
1133 @discussion Adds the network service to the set.
1134 @param set The network set.
1135 @param service The service to be added.
1136 @result TRUE if the service was added to the set; FALSE if the
1137 service was already present or an error was encountered.
1138
1139 Note: prior to Mac OS X 10.5, the Network Preferences UI
1140 did not support having a single service being a member of
1141 more than one set. An error will be returned if you attempt
1142 to add a service to more than one set on a pre-10.5 system.
1143 */
1144 Boolean
1145 SCNetworkSetAddService (SCNetworkSetRef set,
1146 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1147
1148 /*!
1149 @function SCNetworkSetContainsInterface
1150 @discussion Checks if an interface is represented by at least one
1151 network service in the specified set.
1152 @param set The network set.
1153 @param interface The network interface.
1154 @result TRUE if the interface is represented in the set; FALSE if not.
1155 */
1156 Boolean
1157 SCNetworkSetContainsInterface (SCNetworkSetRef set,
1158 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
1159
1160 /*!
1161 @function SCNetworkSetCopyAll
1162 @discussion Returns all available sets for the specified preferences.
1163 @param prefs The "preferences" session.
1164 @result The list of SCNetworkSet sets associated with the preferences.
1165 You must release the returned value.
1166 */
1167 CFArrayRef /* of SCNetworkSetRef's */ __nullable
1168 SCNetworkSetCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1169
1170 /*!
1171 @function SCNetworkSetCopyCurrent
1172 @discussion Returns the "current" set.
1173 @param prefs The "preferences" session.
1174 @result The current set; NULL if no current set has been defined.
1175 */
1176 SCNetworkSetRef __nullable
1177 SCNetworkSetCopyCurrent (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1178
1179 /*!
1180 @function SCNetworkSetCopyServices
1181 @discussion Returns all network services associated with the set.
1182 @param set The network set.
1183 @result The list of SCNetworkService services associated with the set.
1184 You must release the returned value.
1185 */
1186 CFArrayRef /* of SCNetworkServiceRef's */ __nullable
1187 SCNetworkSetCopyServices (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1188
1189 /*!
1190 @function SCNetworkSetCreate
1191 @discussion Create a new set in the configuration.
1192 @param prefs The "preferences" session.
1193 @result A reference to the new SCNetworkSet.
1194 You must release the returned value.
1195 */
1196 SCNetworkSetRef __nullable
1197 SCNetworkSetCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1198
1199 /*!
1200 @function SCNetworkSetCopy
1201 @discussion Returns the set with the specified identifier.
1202 @param prefs The "preferences" session.
1203 @param setID The unique identifier for the set.
1204 @result A reference to the SCNetworkSet from the associated preferences;
1205 NULL if the setID does not exist in the preferences or if an
1206 error was encountered.
1207 You must release the returned value.
1208 */
1209 SCNetworkSetRef __nullable
1210 SCNetworkSetCopy (SCPreferencesRef prefs,
1211 CFStringRef setID) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1212
1213 /*!
1214 @function SCNetworkSetGetName
1215 @discussion Returns the [user specified] name associated with the set.
1216 @param set The network set.
1217 @result The [user specified] name.
1218 */
1219 CFStringRef __nullable
1220 SCNetworkSetGetName (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1221
1222 /*!
1223 @function SCNetworkSetGetSetID
1224 @discussion Returns the identifier for the set.
1225 @param set The network set.
1226 @result The set identifier.
1227 */
1228 CFStringRef __nullable
1229 SCNetworkSetGetSetID (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1230
1231 /*!
1232 @function SCNetworkSetGetServiceOrder
1233 @discussion Returns the [user specified] ordering of network services
1234 within the set.
1235 @param set The network set.
1236 @result The ordered list of CFStringRef service identifiers associated
1237 with the set;
1238 NULL if no service order has been specified or if an error
1239 was encountered.
1240 */
1241 CFArrayRef /* of serviceID CFStringRef's */ __nullable
1242 SCNetworkSetGetServiceOrder (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1243
1244 /*!
1245 @function SCNetworkSetRemove
1246 @discussion Removes the set from the configuration.
1247 @param set The network set.
1248 @result TRUE if the set was removed; FALSE if an error was encountered.
1249 */
1250 Boolean
1251 SCNetworkSetRemove (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1252
1253 /*!
1254 @function SCNetworkSetRemoveService
1255 @discussion Removes the network service from the set.
1256 @param set The network set.
1257 @param service The service to be removed.
1258 @result TRUE if the service was removed from the set; FALSE if the
1259 service was not already present or an error was encountered.
1260 */
1261 Boolean
1262 SCNetworkSetRemoveService (SCNetworkSetRef set,
1263 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1264
1265 /*!
1266 @function SCNetworkSetSetCurrent
1267 @discussion Specifies the set that should be the "current" set.
1268 @param set The network set.
1269 @result TRUE if the current set was updated;
1270 FALSE if an error was encountered.
1271 */
1272 Boolean
1273 SCNetworkSetSetCurrent (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1274
1275 /*!
1276 @function SCNetworkSetSetName
1277 @discussion Stores the [user specified] name for the set.
1278 @param set The network set.
1279 @param name The [user defined] name to associate with the set.
1280 @result TRUE if the name was saved; FALSE if an error was encountered.
1281
1282 Note: although not technically required, the [user specified] names
1283 for all set should be unique. As such, an error will be returned if
1284 you attemp to name two sets with the same string.
1285 */
1286 Boolean
1287 SCNetworkSetSetName (SCNetworkSetRef set,
1288 CFStringRef name) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
1289
1290 /*!
1291 @function SCNetworkSetSetServiceOrder
1292 @discussion Stores the [user specified] ordering of network services for the set.
1293 @param set The network set.
1294 @param newOrder The ordered list of CFStringRef service identifiers for the set.
1295 @result TRUE if the new service order was saved; FALSE if an error was encountered.
1296 */
1297 Boolean
1298 SCNetworkSetSetServiceOrder (SCNetworkSetRef set,
1299 CFArrayRef newOrder) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); /* serviceID CFStringRef's */
1300
1301
1302 __END_DECLS
1303
1304 CF_ASSUME_NONNULL_END
1305 CF_IMPLICIT_BRIDGING_DISABLED
1306
1307 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
1308 #endif /* _SCNETWORKCONFIGURATION_H */