]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfiguration.h
configd-130.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfiguration.h
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _SCNETWORKCONFIGURATION_H
25 #define _SCNETWORKCONFIGURATION_H
26
27
28 #include <sys/cdefs.h>
29 #include <AvailabilityMacros.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32
33
34 /*!
35 @header SCNetworkConfiguration
36 @discussion The SCNetworkConfiguration API provides access to the
37 stored network configuration. The functions include
38 providing access to the network capable devices on the
39 system, the network sets, network services, and network
40 protocols.
41
42 Note: When using the SCNetworkConfiguraiton APIs you must
43 keep in mind that in order for any of your changes to be
44 committed to permanent storage a call must be made to the
45 SCPreferencesCommitChanges function.
46 */
47
48 /*!
49 @group Interface configuration
50 */
51
52 /*!
53 @typedef SCNetworkInterfaceRef
54 @discussion This is the type of a reference to an object that represents
55 a network interface.
56 */
57 typedef const struct __SCNetworkInterface * SCNetworkInterfaceRef;
58
59 /*!
60 @const kSCNetworkInterfaceType6to4
61 */
62 extern const CFStringRef kSCNetworkInterfaceType6to4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
63
64 /*!
65 @const kSCNetworkInterfaceTypeBluetooth
66 */
67 extern const CFStringRef kSCNetworkInterfaceTypeBluetooth AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
68
69 /*!
70 @const kSCNetworkInterfaceTypeBond
71 */
72 extern const CFStringRef kSCNetworkInterfaceTypeBond AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
73
74 /*!
75 @const kSCNetworkInterfaceTypeEthernet
76 */
77 extern const CFStringRef kSCNetworkInterfaceTypeEthernet AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
78
79 /*!
80 @const kSCNetworkInterfaceTypeFireWire
81 */
82 extern const CFStringRef kSCNetworkInterfaceTypeFireWire AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
83
84 /*!
85 @const kSCNetworkInterfaceTypeIEEE80211
86 */
87 extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // IEEE 802.11, AirPort
88
89 /*!
90 @const kSCNetworkInterfaceTypeIrDA
91 */
92 extern const CFStringRef kSCNetworkInterfaceTypeIrDA AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
93
94 /*!
95 @const kSCNetworkInterfaceTypeL2TP
96 */
97 extern const CFStringRef kSCNetworkInterfaceTypeL2TP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
98
99 /*!
100 @const kSCNetworkInterfaceTypeModem
101 */
102 extern const CFStringRef kSCNetworkInterfaceTypeModem AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
103
104 /*!
105 @const kSCNetworkInterfaceTypePPP
106 */
107 extern const CFStringRef kSCNetworkInterfaceTypePPP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
108
109 /*!
110 @const kSCNetworkInterfaceTypePPTP
111 */
112 extern const CFStringRef kSCNetworkInterfaceTypePPTP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
113
114 /*!
115 @const kSCNetworkInterfaceTypeSerial
116 */
117 extern const CFStringRef kSCNetworkInterfaceTypeSerial AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
118
119 /*!
120 @const kSCNetworkInterfaceTypeVLAN
121 */
122 extern const CFStringRef kSCNetworkInterfaceTypeVLAN AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
123
124 /* special network interfaces (and types) */
125
126 /*!
127 @const kSCNetworkInterfaceTypeIPv4
128 */
129 extern const CFStringRef kSCNetworkInterfaceTypeIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
130
131 /*!
132 @const kSCNetworkInterfaceIPv4
133 @discussion A network interface that can used for layering other
134 interfaces (e.g. 6to4, PPP, PPTP, L2TP) over an existing
135 IPv4 network.
136 */
137 extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
138
139
140 /*!
141 @group Protocol configuration
142 */
143
144 /*!
145 @typedef SCNetworkProtocolRef
146 @discussion This is the type of a reference to an object that represents
147 a network protocol.
148 */
149 typedef const struct __SCNetworkProtocol * SCNetworkProtocolRef;
150
151 /* network "protocol" types */
152
153 /*!
154 @const kSCNetworkProtocolTypeAppleTalk
155 */
156 extern const CFStringRef kSCNetworkProtocolTypeAppleTalk AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
157
158 /*!
159 @const kSCNetworkProtocolTypeDNS
160 */
161 extern const CFStringRef kSCNetworkProtocolTypeDNS AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
162
163 /*!
164 @const kSCNetworkProtocolTypeIPv4
165 */
166 extern const CFStringRef kSCNetworkProtocolTypeIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
167
168 /*!
169 @const kSCNetworkProtocolTypeIPv6
170 */
171 extern const CFStringRef kSCNetworkProtocolTypeIPv6 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
172
173 /*!
174 @const kSCNetworkProtocolTypeProxies
175 */
176 extern const CFStringRef kSCNetworkProtocolTypeProxies AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
177
178
179 /*!
180 @group Service configuration
181 */
182
183 /*!
184 @typedef SCNetworkServiceRef
185 @discussion This is the type of a reference to an object that represents
186 a network service.
187 */
188 typedef const struct __SCNetworkService * SCNetworkServiceRef;
189
190
191 /*!
192 @group Set configuration
193 */
194
195 /*!
196 @typedef SCNetworkSetRef
197 @discussion This is the type of a reference to an object that represents
198 a network set.
199 */
200 typedef const struct __SCNetworkSet * SCNetworkSetRef;
201
202
203 __BEGIN_DECLS
204
205
206 /* --------------------------------------------------------------------------------
207 * INTERFACES
208 * -------------------------------------------------------------------------------- */
209
210 /*!
211 @group Interface configuration
212 */
213
214 /*!
215 @function SCNetworkInterfaceGetTypeID
216 @discussion Returns the type identifier of all SCNetworkInterface instances.
217 */
218 CFTypeID
219 SCNetworkInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
220
221 /*!
222 @function SCNetworkInterfaceCopyAll
223 @discussion Returns all network capable devices on the system.
224 @result The list of SCNetworkInterface devices on the system.
225 You must release the returned value.
226 */
227 CFArrayRef /* of SCNetworkInterfaceRef's */
228 SCNetworkInterfaceCopyAll (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
229
230 /*!
231 @function SCNetworkInterfaceGetSupportedInterfaceTypes
232 @discussion Identify all of the network interface types (e.g. PPP) that
233 can be layered on top of this interface.
234 @param interface The network interface.
235 @result The list of SCNetworkInterface types supported by the interface;
236 NULL if no interface types are supported.
237 */
238 CFArrayRef /* of kSCNetworkInterfaceTypeXXX CFStringRef's */
239 SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
240
241 /*!
242 @function SCNetworkInterfaceGetSupportedProtocolTypes
243 @discussion Identify all of the network protocol types (e.g. IPv4, IPv6) that
244 can be layered on top of this interface.
245 @param interface The network interface.
246 @result The list of SCNetworkProtocol types supported by the interface;
247 NULL if no protocol types are supported.
248 */
249 CFArrayRef /* of kSCNetworkProtocolTypeXXX CFStringRef's */
250 SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
251
252 /*!
253 @function SCNetworkInterfaceCreateWithInterface
254 @discussion Create a new network interface layered on top of another. For
255 example, this function would be used to create a "PPP" interface
256 on top of a "modem".
257 @param interface The network interface.
258 @param interfaceType The type of SCNetworkInterface to be layered on
259 top of the provided interface.
260 @result A reference to the new SCNetworkInterface.
261 You must release the returned value.
262 */
263 SCNetworkInterfaceRef
264 SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface,
265 CFStringRef interfaceType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
266
267 /*!
268 @function SCNetworkInterfaceGetBSDName
269 @discussion Returns the BSD interface (en0) or device name (modem)
270 for the interface.
271 @param interface The network interface.
272 @result The BSD name associated with the interface (e.g. "en0");
273 NULL if no BSD name is available.
274 */
275 CFStringRef
276 SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
277
278 /*!
279 @function SCNetworkInterfaceGetConfiguration
280 @discussion Returns the configuration settings associated with a interface.
281 @param interface The network interface.
282 @result The configuration settings associated with the interface;
283 NULL if no changes to the default configuration have been saved.
284 */
285 CFDictionaryRef
286 SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
287
288 /*!
289 @function SCNetworkInterfaceGetHardwareAddressString
290 @discussion Returns a displayable link layer address for the interface.
291 @param interface The network interface.
292 @result A string representing the hardware (MAC) address for the interface.
293 */
294 CFStringRef
295 SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
296
297 /*!
298 @function SCNetworkInterfaceGetInterface
299 @discussion For layered network interfaces, return the underlying interface.
300 @param interface The network interface.
301 @result The underlying network interface;
302 NULL if this is a leaf interface.
303 */
304 SCNetworkInterfaceRef
305 SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
306
307 /*!
308 @function SCNetworkInterfaceGetInterfaceType
309 @discussion Returns the associated network interface type.
310 @param interface The network interface.
311 @result The interface type.
312 */
313 CFStringRef
314 SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
315
316 /*!
317 @function SCNetworkInterfaceGetLocalizedDisplayName
318 @discussion Returns the localized name (e.g. "Built-in Ethernet") for
319 the interface.
320 @param interface The network interface.
321 @result A localized, display name for the interface;
322 NULL if no name is available.
323 */
324 CFStringRef
325 SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
326
327 /*!
328 @function SCNetworkInterfaceSetConfiguration
329 @discussion Stores the configuration settings for the interface.
330 @param interface The network interface.
331 @param config The configuration settings to associate with this interface.
332 @result TRUE if the configuration was stored; FALSE if an error was encountered.
333 */
334 Boolean
335 SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
336 CFDictionaryRef config) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
337
338 /* --------------------------------------------------------------------------------
339 * PROTOCOLS
340 * -------------------------------------------------------------------------------- */
341
342 /*!
343 @group Protocol configuration
344 */
345
346 /*!
347 @function SCNetworkProtocolGetTypeID
348 @discussion Returns the type identifier of all SCNetworkProtocol instances.
349 */
350 CFTypeID
351 SCNetworkProtocolGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
352
353 /*!
354 @function SCNetworkProtocolGetConfiguration
355 @discussion Returns the configuration settings associated with the protocol.
356 @param protocol The network protocol.
357 @result The configuration settings associated with the protocol;
358 NULL if no changes to the default configuration have been saved.
359 */
360 CFDictionaryRef
361 SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
362
363 /*!
364 @function SCNetworkProtocolGetEnabled
365 @discussion Returns whether this protocol has been enabled.
366 @param protocol The network protocol.
367 @result TRUE if the protocol is enabled.
368 */
369 Boolean
370 SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
371
372 /*!
373 @function SCNetworkProtocolGetProtocolType
374 @discussion Returns the associated network protocol type.
375 @param protocol The network protocol.
376 @result The protocol type.
377 */
378 CFStringRef
379 SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
380
381 /*!
382 @function SCNetworkProtocolSetConfiguration
383 @discussion Stores the configuration settings for the protocol.
384 @param protocol The network protocol.
385 @param config The configuration settings to associate with this protocol.
386 @result TRUE if the configuration was stored; FALSE if an error was encountered.
387 */
388 Boolean
389 SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol,
390 CFDictionaryRef config) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
391
392 /*!
393 @function SCNetworkProtocolSetEnabled
394 @discussion Enables or disables the protocol.
395 @param protocol The network protocol.
396 @param enabled TRUE if the protocol should be enabled.
397 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
398 */
399 Boolean
400 SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol,
401 Boolean enabled) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
402
403 /* --------------------------------------------------------------------------------
404 * SERVICES
405 * -------------------------------------------------------------------------------- */
406
407 /*!
408 @group Service configuration
409 */
410
411 /*!
412 @function SCNetworkServiceGetTypeID
413 @discussion Returns the type identifier of all SCNetworkService instances.
414 */
415 CFTypeID
416 SCNetworkServiceGetTypeID (void);
417
418 /*!
419 @function SCNetworkServiceAddProtocolType
420 @discussion Adds a network protocol of the specified type to the
421 service. The protocal configuration is set to default values
422 that are appropriate for the interface associated with the
423 service.
424 @param service The network service.
425 @param protocolType The type of SCNetworkProtocol to be added to the service.
426 @result TRUE if the protocol was added to the service; FALSE if the
427 protocol was already present or an error was encountered.
428 */
429 Boolean
430 SCNetworkServiceAddProtocolType (SCNetworkServiceRef service,
431 CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
432
433 /*!
434 @function SCNetworkServiceCopyAll
435 @discussion Returns all available network services for the specified preferences.
436 @param prefs The "preferences" session.
437 @result The list of SCNetworkService services associated with the preferences.
438 You must release the returned value.
439 */
440 CFArrayRef /* of SCNetworkServiceRef's */
441 SCNetworkServiceCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
442
443 /*!
444 @function SCNetworkServiceCopyProtocols
445 @discussion Returns all network protocols associated with the service.
446 @param service The network service.
447 @result The list of SCNetworkProtocol protocols associated with the service.
448 You must release the returned value.
449 */
450 CFArrayRef /* of SCNetworkProtocolRef's */
451 SCNetworkServiceCopyProtocols (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
452
453 /*!
454 @function SCNetworkServiceCreate
455 @discussion Create a new network service for the specified interface in the
456 configuration.
457 @param prefs The "preferences" session.
458 @result A reference to the new SCNetworkService.
459 You must release the returned value.
460 */
461 SCNetworkServiceRef
462 SCNetworkServiceCreate (SCPreferencesRef prefs,
463 SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
464
465 /*!
466 @function SCNetworkServiceCopy
467 @discussion Returns the network service with the specified identifier.
468 @param prefs The "preferences" session.
469 @param serviceID The unique identifier for the service.
470 @result A reference to the SCNetworkService from the associated preferences;
471 NULL if the serviceID does not exist in the preferences or if an
472 error was encountered.
473 You must release the returned value.
474 */
475 SCNetworkServiceRef
476 SCNetworkServiceCopy (SCPreferencesRef prefs,
477 CFStringRef serviceID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
478
479 /*!
480 @function SCNetworkServiceGetEnabled
481 @discussion Returns whether this service has been enabled.
482 @param service The network service.
483 @result TRUE if the service is enabled.
484 */
485 Boolean
486 SCNetworkServiceGetEnabled (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
487
488 /*!
489 @function SCNetworkServiceGetInterface
490 @discussion Returns the network interface associated with the service.
491 @param service The network service.
492 @result A reference to the SCNetworkInterface associated with the service;
493 NULL if an error was encountered.
494 */
495 SCNetworkInterfaceRef
496 SCNetworkServiceGetInterface (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
497
498 /*!
499 @function SCNetworkServiceGetName
500 @discussion Returns the [user specified] name associated with the service.
501 @param service The network service.
502 @result The [user specified] name.
503 */
504 CFStringRef
505 SCNetworkServiceGetName (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
506
507 /*!
508 @function SCNetworkServiceCopyProtocol
509 @discussion Returns the network protocol of the specified type for
510 the service.
511 @param service The network service.
512 @result A reference to the SCNetworkProtocol associated with the service;
513 NULL if this protocol has not been added or if an error was encountered.
514 You must release the returned value.
515 */
516 SCNetworkProtocolRef
517 SCNetworkServiceCopyProtocol (SCNetworkServiceRef service,
518 CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
519
520 /*!
521 @function SCNetworkServiceGetServiceID
522 @discussion Returns the identifier for the service.
523 @param service The network service.
524 @result The service identifier.
525 */
526 CFStringRef
527 SCNetworkServiceGetServiceID (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
528
529 /*!
530 @function SCNetworkServiceRemove
531 @discussion Removes the network service from the configuration.
532 @param service The network service.
533 @result TRUE if the service was removed; FALSE if an error was encountered.
534 */
535 Boolean
536 SCNetworkServiceRemove (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
537
538 /*!
539 @function SCNetworkServiceRemoveProtocolType
540 @discussion Removes the network protocol of the specified type from the service.
541 @param service The network service.
542 @param protocolType The type of SCNetworkProtocol to be removed from the service.
543 @result TRUE if the protocol was removed to the service; FALSE if the
544 protocol was not configured or an error was encountered.
545 */
546 Boolean
547 SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service,
548 CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
549
550 /*!
551 @function SCNetworkServiceSetEnabled
552 @discussion Enables or disables the service.
553 @param service The network service.
554 @param enabled TRUE if the service should be enabled.
555 @result TRUE if the enabled status was saved; FALSE if an error was encountered.
556 */
557 Boolean
558 SCNetworkServiceSetEnabled (SCNetworkServiceRef service,
559 Boolean enabled) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
560
561 /*!
562 @function SCNetworkServiceSetName
563 @discussion Stores the [user specified] name for the service.
564 @param service The network service.
565 @param name The [user defined] name to associate with the service.
566 @result TRUE if the name was saved; FALSE if an error was encountered.
567
568 Note: although not technically required, the [user specified] names
569 for all services within any given set should be unique. As such, an
570 error will be returned if you attemp to name two services with the
571 same string.
572 */
573 Boolean
574 SCNetworkServiceSetName (SCNetworkServiceRef service,
575 CFStringRef name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
576
577 /* --------------------------------------------------------------------------------
578 * SETS
579 * -------------------------------------------------------------------------------- */
580
581 /*!
582 @group Set configuration
583 */
584
585 /*!
586 @function SCNetworkSetGetTypeID
587 @discussion Returns the type identifier of all SCNetworkSet instances.
588 */
589 CFTypeID
590 SCNetworkSetGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
591
592 /*!
593 @function SCNetworkSetAddService
594 @discussion Adds the network service to the set.
595 @param set The network set.
596 @param service The service to be added.
597 @result TRUE if the service was added to the set; FALSE if the
598 service was already present or an error was encountered.
599
600 Note: at the present time, the Network Prefs UI does not
601 support having a single service be a member of more than
602 one set. As such, an error will be returned if you attempt
603 to add a service to more than one set.
604 */
605 Boolean
606 SCNetworkSetAddService (SCNetworkSetRef set,
607 SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
608
609 /*!
610 @function SCNetworkSetCopyAll
611 @discussion Returns all available sets for the specified preferences.
612 @param prefs The "preferences" session.
613 @result The list of SCNetworkSet sets associated with the preferences.
614 You must release the returned value.
615 */
616 CFArrayRef /* of SCNetworkSetRef's */
617 SCNetworkSetCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
618
619 /*!
620 @function SCNetworkSetCopyCurrent
621 @discussion Returns the "current" set.
622 @param prefs The "preferences" session.
623 @result The current set; NULL if no current set has been defined.
624 */
625 SCNetworkSetRef
626 SCNetworkSetCopyCurrent (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
627
628 /*!
629 @function SCNetworkSetCopyServices
630 @discussion Returns all network services associated with the set.
631 @param set The network set.
632 @result The list of SCNetworkService services associated with the set.
633 You must release the returned value.
634 */
635 CFArrayRef /* of SCNetworkServiceRef's */
636 SCNetworkSetCopyServices (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
637
638 /*!
639 @function SCNetworkSetCreate
640 @discussion Create a new set in the configuration.
641 @param prefs The "preferences" session.
642 @result A reference to the new SCNetworkSet.
643 You must release the returned value.
644 */
645 SCNetworkSetRef
646 SCNetworkSetCreate (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
647
648 /*!
649 @function SCNetworkSetCopy
650 @discussion Returns the set with the specified identifier.
651 @param prefs The "preferences" session.
652 @param setID The unique identifier for the set.
653 @result A reference to the SCNetworkSet from the associated preferences;
654 NULL if the setID does not exist in the preferences or if an
655 error was encountered.
656 You must release the returned value.
657 */
658 SCNetworkSetRef
659 SCNetworkSetCopy (SCPreferencesRef prefs,
660 CFStringRef setID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
661
662 /*!
663 @function SCNetworkSetGetName
664 @discussion Returns the [user specified] name associated with the set.
665 @param set The network set.
666 @result The [user specified] name.
667 */
668 CFStringRef
669 SCNetworkSetGetName (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
670
671 /*!
672 @function SCNetworkSetGetSetID
673 @discussion Returns the identifier for the set.
674 @param set The network set.
675 @result The set identifier.
676 */
677 CFStringRef
678 SCNetworkSetGetSetID (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
679
680 /*!
681 @function SCNetworkSetGetServiceOrder
682 @discussion Returns the [user specified] ordering of network services
683 within the set.
684 @param set The network set.
685 @result The ordered list of CFStringRef service identifiers associated
686 with the set;
687 NULL if no service order has been specified or if an error
688 was encountered.
689 */
690 CFArrayRef /* of serviceID CFStringRef's */
691 SCNetworkSetGetServiceOrder (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
692
693 /*!
694 @function SCNetworkSetRemove
695 @discussion Removes the set from the configuration.
696 @param set The network set.
697 @result TRUE if the set was removed; FALSE if an error was encountered.
698 */
699 Boolean
700 SCNetworkSetRemove (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
701
702 /*!
703 @function SCNetworkSetRemoveService
704 @discussion Removes the network service from the set.
705 @param set The network set.
706 @param service The service to be removed.
707 @result TRUE if the service was removed from the set; FALSE if the
708 service was not already present or an error was encountered.
709 */
710 Boolean
711 SCNetworkSetRemoveService (SCNetworkSetRef set,
712 SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
713
714 /*!
715 @function SCNetworkSetSetCurrent
716 @discussion Specifies the set that should be the "current" set.
717 @param set The network set.
718 @result TRUE if the current set was updated;
719 FALSE if an error was encountered.
720 */
721 Boolean
722 SCNetworkSetSetCurrent (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
723
724 /*!
725 @function SCNetworkSetSetName
726 @discussion Stores the [user specified] name for the set.
727 @param set The network set.
728 @param name The [user defined] name to associate with the set.
729 @result TRUE if the name was saved; FALSE if an error was encountered.
730
731 Note: although not technically required, the [user specified] names
732 for all set should be unique. As such, an error will be returned if
733 you attemp to name two sets with the same string.
734 */
735 Boolean
736 SCNetworkSetSetName (SCNetworkSetRef set,
737 CFStringRef name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
738
739 /*!
740 @function SCNetworkSetGetServiceOrder
741 @discussion Stores the [user specified] ordering of network services for the set.
742 @param set The network set.
743 @param newOrder The ordered list of CFStringRef service identifiers for the set.
744 @result TRUE if the new service order was saved; FALSE if an error was encountered.
745 */
746 Boolean
747 SCNetworkSetSetServiceOrder (SCNetworkSetRef set,
748 CFArrayRef newOrder) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /* serviceID CFStringRef's */
749
750
751 __END_DECLS
752
753 #endif /* _SCNETWORKCONFIGURATION_H */