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