]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfiguration.h
configd-293.4.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfiguration.h
1 /*
2 * Copyright (c) 2004-2008 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 /*!
37 @header SCNetworkConfiguration
38 @discussion The SCNetworkConfiguration API provides access to the
39 stored network configuration. The functions include
40 providing access to the network capable devices on the
41 system, the network sets, network services, and network
42 protocols.
43
44 Note: When using the SCNetworkConfiguraiton APIs you must
45 keep in mind that in order for any of your changes to be
46 committed to permanent storage a call must be made to the
47 SCPreferencesCommitChanges function.
48 */
49
50
51 /*!
52 @group Interface configuration
53 */
54
55 #pragma mark -
56 #pragma mark SCNetworkInterface configuration (typedefs, consts)
57
58 /*!
59 @typedef SCNetworkInterfaceRef
60 @discussion This is the type of a reference to an object that represents
61 a network interface.
62 */
63 typedef const struct __SCNetworkInterface * SCNetworkInterfaceRef;
64
65 /*!
66 @const kSCNetworkInterfaceType6to4
67 */
68 extern const CFStringRef kSCNetworkInterfaceType6to4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
69
70 /*!
71 @const kSCNetworkInterfaceTypeBluetooth
72 */
73 extern const CFStringRef kSCNetworkInterfaceTypeBluetooth __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
74
75 /*!
76 @const kSCNetworkInterfaceTypeBond
77 */
78 extern const CFStringRef kSCNetworkInterfaceTypeBond __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
79
80 /*!
81 @const kSCNetworkInterfaceTypeEthernet
82 */
83 extern const CFStringRef kSCNetworkInterfaceTypeEthernet __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
84
85 /*!
86 @const kSCNetworkInterfaceTypeFireWire
87 */
88 extern const CFStringRef kSCNetworkInterfaceTypeFireWire __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
89
90 /*!
91 @const kSCNetworkInterfaceTypeIEEE80211
92 */
93 extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); // IEEE 802.11, AirPort
94
95 /*!
96 @const kSCNetworkInterfaceTypeIPSec
97 */
98 extern const CFStringRef kSCNetworkInterfaceTypeIPSec __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
99
100 /*!
101 @const kSCNetworkInterfaceTypeIrDA
102 */
103 extern const CFStringRef kSCNetworkInterfaceTypeIrDA __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
104
105 /*!
106 @const kSCNetworkInterfaceTypeL2TP
107 */
108 extern const CFStringRef kSCNetworkInterfaceTypeL2TP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
109
110 /*!
111 @const kSCNetworkInterfaceTypeModem
112 */
113 extern const CFStringRef kSCNetworkInterfaceTypeModem __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
114
115 /*!
116 @const kSCNetworkInterfaceTypePPP
117 */
118 extern const CFStringRef kSCNetworkInterfaceTypePPP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
119
120 /*!
121 @const kSCNetworkInterfaceTypePPTP
122 */
123 extern const CFStringRef kSCNetworkInterfaceTypePPTP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
124
125 /*!
126 @const kSCNetworkInterfaceTypeSerial
127 */
128 extern const CFStringRef kSCNetworkInterfaceTypeSerial __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
129
130 /*!
131 @const kSCNetworkInterfaceTypeVLAN
132 */
133 extern const CFStringRef kSCNetworkInterfaceTypeVLAN __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
134
135 /*!
136 @const kSCNetworkInterfaceTypeWWAN
137 */
138 extern const CFStringRef kSCNetworkInterfaceTypeWWAN __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
139
140 /* special network interfaces (and types) */
141
142 /*!
143 @const kSCNetworkInterfaceTypeIPv4
144 */
145 extern const CFStringRef kSCNetworkInterfaceTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
146
147 /*!
148 @const kSCNetworkInterfaceIPv4
149 @discussion A network interface that can used for layering other
150 interfaces (e.g. 6to4, IPSec, PPTP, L2TP) over an existing
151 IPv4 network.
152 */
153 extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
154
155 /*!
156 @group Interface configuration (Bond)
157 */
158
159 #pragma mark -
160
161 /*!
162 @typedef SCBondInterfaceRef
163 @discussion This is the type of a reference to an object that represents
164 an Ethernet Bond interface.
165 */
166 typedef SCNetworkInterfaceRef SCBondInterfaceRef;
167
168 /*!
169 @typedef SCBondStatusRef
170 @discussion This is the type of a reference to an object that represents
171 the status of an Ethernet Bond interface.
172 */
173 typedef const struct __SCBondStatus * SCBondStatusRef;
174
175 #if !TARGET_OS_IPHONE
176 /*!
177 @enum Ethernet Bond Aggregation Status (kSCBondStatusDeviceAggregationStatus) codes
178 @discussion Returned status codes.
179 @constant kSCBondStatusOK Enabled, active, running, ...
180 @constant kSCBondStatusLinkInvalid The link state was not valid (i.e. down, half-duplex, wrong speed)
181 @constant kSCBondStatusNoPartner The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled
182 @constant kSCBondStatusNotInActiveGroup We're talking to a partner, but the link aggregation group is different from the one that's active
183 @constant kSCBondStatusUnknown Non-specific failure
184 */
185 enum {
186 kSCBondStatusOK = 0, /* enabled, active, running, ... */
187 kSCBondStatusLinkInvalid = 1, /* The link state was not valid (i.e. down, half-duplex, wrong speed) */
188 kSCBondStatusNoPartner = 2, /* The port on the switch that the device is connected doesn't seem to have 802.3ad Link Aggregation enabled */
189 kSCBondStatusNotInActiveGroup = 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
190 kSCBondStatusUnknown = 999 /* Non-specific failure */
191 };
192 #endif // !TARGET_OS_IPHONE
193
194 /*!
195 @const kSCBondStatusDeviceAggregationStatus
196 */
197 extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
198
199 /*!
200 @const kSCBondStatusDeviceCollecting
201 */
202 extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
203
204 /*!
205 @const kSCBondStatusDeviceDistributing
206 */
207 extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
208
209 /*!
210 @group Interface configuration (VLAN)
211 */
212
213 #pragma mark -
214
215 /*!
216 @typedef SCVLANInterfaceRef
217 @discussion This is the type of a reference to an object that represents
218 a Virtual LAN (VLAN) interface.
219 */
220 typedef SCNetworkInterfaceRef SCVLANInterfaceRef;
221
222
223 /*!
224 @group Protocol configuration
225 */
226
227 #pragma mark -
228 #pragma mark SCNetworkProtocol configuration (typedefs, consts)
229
230 /*!
231 @typedef SCNetworkProtocolRef
232 @discussion This is the type of a reference to an object that represents
233 a network protocol.
234 */
235 typedef const struct __SCNetworkProtocol * SCNetworkProtocolRef;
236
237 /* network "protocol" types */
238
239 /*!
240 @const kSCNetworkProtocolTypeAppleTalk
241 */
242 extern const CFStringRef kSCNetworkProtocolTypeAppleTalk __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
243
244 /*!
245 @const kSCNetworkProtocolTypeDNS
246 */
247 extern const CFStringRef kSCNetworkProtocolTypeDNS __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
248
249 /*!
250 @const kSCNetworkProtocolTypeIPv4
251 */
252 extern const CFStringRef kSCNetworkProtocolTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
253
254 /*!
255 @const kSCNetworkProtocolTypeIPv6
256 */
257 extern const CFStringRef kSCNetworkProtocolTypeIPv6 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
258
259 /*!
260 @const kSCNetworkProtocolTypeProxies
261 */
262 extern const CFStringRef kSCNetworkProtocolTypeProxies __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
263
264 /*!
265 @const kSCNetworkProtocolTypeSMB
266 */
267 extern const CFStringRef kSCNetworkProtocolTypeSMB __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
268
269 /*!
270 @group Service configuration
271 */
272
273 #pragma mark -
274 #pragma mark SCNetworkService configuration (typedefs, consts)
275
276 /*!
277 @typedef SCNetworkServiceRef
278 @discussion This is the type of a reference to an object that represents
279 a network service.
280 */
281 typedef const struct __SCNetworkService * SCNetworkServiceRef;
282
283
284 /*!
285 @group Set configuration
286 */
287
288 #pragma mark -
289 #pragma mark SCNetworkSet configuration (typedefs, consts)
290
291 /*!
292 @typedef SCNetworkSetRef
293 @discussion This is the type of a reference to an object that represents
294 a network set.
295 */
296 typedef const struct __SCNetworkSet * SCNetworkSetRef;
297
298
299 __BEGIN_DECLS
300
301
302 /* --------------------------------------------------------------------------------
303 * INTERFACES
304 * -------------------------------------------------------------------------------- */
305
306 /*!
307 @group Interface configuration
308 */
309
310 #pragma mark -
311 #pragma mark SCNetworkInterface configuration (APIs)
312
313 /*!
314 @function SCNetworkInterfaceGetTypeID
315 @discussion Returns the type identifier of all SCNetworkInterface instances.
316 */
317 CFTypeID
318 SCNetworkInterfaceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
319
320 /*!
321 @function SCNetworkInterfaceCopyAll
322 @discussion Returns all network capable interfaces on the system.
323 @result The list of interfaces on the system.
324 You must release the returned value.
325 */
326 CFArrayRef /* of SCNetworkInterfaceRef's */
327 SCNetworkInterfaceCopyAll (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
328
329 /*!
330 @function SCNetworkInterfaceGetSupportedInterfaceTypes
331 @discussion Identify all of the network interface types (e.g. PPP) that
332 can be layered on top of this interface.
333 @param interface The network interface.
334 @result The list of SCNetworkInterface types supported by the interface;
335 NULL if no interface types are supported.
336 */
337 CFArrayRef /* of kSCNetworkInterfaceTypeXXX CFStringRef's */
338 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
339
340 /*!
341 @function SCNetworkInterfaceGetSupportedProtocolTypes
342 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
343 can be layered on top of this interface.
344 @param interface The network interface.
345 @result The list of SCNetworkProtocol types supported by the interface;
346 NULL if no protocol types are supported.
347 */
348 CFArrayRef /* of kSCNetworkProtocolTypeXXX CFStringRef's */
349 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
350
351 /*!
352 @function SCNetworkInterfaceCreateWithInterface
353 @discussion Create a new network interface layered on top of another. For
354 example, this function would be used to create a "PPP" interface
355 on top of a "modem".
356 @param interface The network interface.
357 @param interfaceType The type of SCNetworkInterface to be layered on
358 top of the provided interface.
359 @result A reference to the new SCNetworkInterface.
360 You must release the returned value.
361 */
362 SCNetworkInterfaceRef
363 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface,
364 CFStringRef interfaceType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
365
366 /*!
367 @function SCNetworkInterfaceGetBSDName
368 @discussion Returns the BSD interface (en0) or device name (modem)
369 for the interface.
370 @param interface The network interface.
371 @result The BSD name associated with the interface (e.g. "en0");
372 NULL if no BSD name is available.
373 */
374 CFStringRef
375 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
376
377 /*!
378 @function SCNetworkInterfaceGetConfiguration
379 @discussion Returns the configuration settings associated with a interface.
380 @param interface The network interface.
381 @result The configuration settings associated with the interface;
382 NULL if no configuration settings are associated with the interface
383 or an error was encountered.
384 */
385 CFDictionaryRef
386 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
387
388 /*!
389 @function SCNetworkInterfaceGetExtendedConfiguration
390 @discussion Returns the configuration settings associated with a interface.
391 @param interface The network interface.
392 @param extendedType A string representing the type of extended information (e.g. EAPOL).
393 @result The configuration settings associated with the interface;
394 NULL if no configuration settings are associated with the interface
395 or an error was encountered.
396 */
397 CFDictionaryRef
398 SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface,
399 CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
400
401 /*!
402 @function SCNetworkInterfaceGetHardwareAddressString
403 @discussion Returns a displayable link layer address for the interface.
404 @param interface The network interface.
405 @result A string representing the hardware (MAC) address for the interface.
406 */
407 CFStringRef
408 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
409
410 /*!
411 @function SCNetworkInterfaceGetInterface
412 @discussion For layered network interfaces, return the underlying interface.
413 @param interface The network interface.
414 @result The underlying network interface;
415 NULL if this is a leaf interface.
416 */
417 SCNetworkInterfaceRef
418 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
419
420 /*!
421 @function SCNetworkInterfaceGetInterfaceType
422 @discussion Returns the associated network interface type.
423 @param interface The network interface.
424 @result The interface type.
425 */
426 CFStringRef
427 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
428
429 /*!
430 @function SCNetworkInterfaceGetLocalizedDisplayName
431 @discussion Returns the localized name (e.g. "Ethernet", "FireWire") for
432 the interface.
433 @param interface The network interface.
434 @result A localized, display name for the interface;
435 NULL if no name is available.
436 */
437 CFStringRef
438 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
439
440 /*!
441 @function SCNetworkInterfaceSetConfiguration
442 @discussion Stores the configuration settings for the interface.
443 @param interface The network interface.
444 @param config The configuration settings to associate with this interface.
445 @result TRUE if the configuration was stored; FALSE if an error was encountered.
446 */
447 Boolean
448 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
449 CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
450
451 /*!
452 @function SCNetworkInterfaceSetExtendedConfiguration
453 @discussion Stores the configuration settings for the interface.
454 @param interface The network interface.
455 @param config The configuration settings to associate with this interface.
456 @result TRUE if the configuration was stored; FALSE if an error was encountered.
457 */
458 Boolean
459 SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface,
460 CFStringRef extendedType,
461 CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
462
463 #pragma mark -
464
465 /*!
466 @function SCNetworkInterfaceCopyMediaOptions
467 @discussion For the specified network interface, returns information
468 about the currently requested media options, the active media
469 options, and the media options which are available.
470 @param interface The desired network interface.
471 @param current A pointer to memory that will be filled with a CFDictionaryRef
472 representing the currently requested media options (subtype, options).
473 If NULL, the current options will not be returned.
474 @param active A pointer to memory that will be filled with a CFDictionaryRef
475 representing the active media options (subtype, options).
476 If NULL, the active options will not be returned.
477 @param available A pointer to memory that will be filled with a CFArrayRef
478 representing the possible media options (subtype, options).
479 If NULL, the available options will not be returned.
480 @param filter A boolean indicating whether the available options should be
481 filtered to exclude those options which would not normally be
482 requested by a user/admin (e.g. hw-loopback).
483 @result TRUE if requested information has been returned.
484 */
485 Boolean
486 SCNetworkInterfaceCopyMediaOptions (SCNetworkInterfaceRef interface,
487 CFDictionaryRef *current,
488 CFDictionaryRef *active,
489 CFArrayRef *available,
490 Boolean filter) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
491
492 /*!
493 @function SCNetworkInterfaceCopyMediaSubTypes
494 @discussion For the provided interface configuration options, return a list
495 of available media subtypes.
496 @param available The available options as returned by the
497 SCNetworkInterfaceCopyMediaOptions function.
498 @result An array of available media subtypes CFString's (e.g. 10BaseT/UTP,
499 100baseTX, etc). NULL if no subtypes are available.
500 */
501 CFArrayRef
502 SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
503
504 /*!
505 @function SCNetworkInterfaceCopyMediaSubTypeOptions
506 @discussion For the provided interface configuration options and specific
507 subtype, return a list of available media options.
508 @param available The available options as returned by the
509 NetworkInterfaceCopyMediaOptions function.
510 @param subType The subtype
511 @result An array of available media options. Each of the available options
512 is returned as an array of CFString's (e.g. <half-duplex>,
513 <full-duplex,flow-control>). NULL if no options are available.
514 */
515 CFArrayRef
516 SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available,
517 CFStringRef subType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
518
519 /*!
520 @function SCNetworkInterfaceCopyMTU
521 @discussion For the specified network interface, returns information
522 about the currently MTU setting and the range of allowable
523 values.
524 @param interface The desired network interface.
525 @param mtu_cur A pointer to memory that will be filled with the current
526 MTU setting for the interface.
527 @param mtu_min A pointer to memory that will be filled with the minimum
528 MTU setting for the interface. If negative, the minimum setting
529 could not be determined.
530 @param mtu_max A pointer to memory that will be filled with the maximum
531 MTU setting for the interface. If negative, the maximum setting
532 could not be determined.
533 @result TRUE if requested information has been returned.
534 */
535 Boolean
536 SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface,
537 int *mtu_cur,
538 int *mtu_min,
539 int *mtu_max) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
540
541 /*!
542 @function SCNetworkInterfaceSetMediaOptions
543 @discussion For the specified network interface, sets the requested
544 media subtype and options.
545 @param interface The desired network interface.
546 @param subtype The desired media subtype (e.g. "autoselect", "100baseTX", ...).
547 @param options The desired media options (e.g. "half-duplex", "full-duplex", ...).
548 If NULL, the active options will not be returned.
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_NA);
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_NA);
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
627 SCBondInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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 */
645 SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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
655 SCBondInterfaceGetOptions (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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_NA);
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_NA);
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
701 SCBondInterfaceCopyStatus (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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 /* of SCNetworkInterfaceRef's */
718 SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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
734 SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus,
735 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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_NA);
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
775 SCVLANInterfaceCreate (SCPreferencesRef prefs,
776 SCNetworkInterfaceRef physical,
777 CFNumberRef tag) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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
795 SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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
804 SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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
814 SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
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_NA);
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_NA);
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_NA);
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
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
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 */
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 */
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
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
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
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
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
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
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 */
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
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 */
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
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
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
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
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 */
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 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
1305 #endif /* _SCNETWORKCONFIGURATION_H */