]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationPrivate.h
e04c5ccdbe92bde947da7270c32156f31bf0cbe9
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfigurationPrivate.h
1 /*
2 * Copyright (c) 2005-2011 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 _SCNETWORKCONFIGURATIONPRIVATE_H
25 #define _SCNETWORKCONFIGURATIONPRIVATE_H
26
27 #include <Availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32 #include <SystemConfiguration/SCValidation.h>
33 #include <IOKit/IOKitLib.h>
34
35 /*!
36 @header SCNetworkConfigurationPrivate
37 */
38
39 __BEGIN_DECLS
40
41
42 /*!
43 @group Interface configuration
44 */
45
46 #pragma mark -
47 #pragma mark SCNetworkInterface configuration (typedefs, consts)
48
49 /*!
50 @const kSCNetworkInterfaceTypeBridge
51 */
52 extern const CFStringRef kSCNetworkInterfaceTypeBridge __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
53
54 /*!
55 @const kSCNetworkInterfaceTypeLoopback
56 */
57 extern const CFStringRef kSCNetworkInterfaceTypeLoopback __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
58
59 /*!
60 @const kSCNetworkInterfaceLoopback
61 @discussion A network interface representing the loopback
62 interface (lo0).
63 */
64 extern const SCNetworkInterfaceRef kSCNetworkInterfaceLoopback __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
65
66 /*!
67 @const kSCNetworkInterfaceTypeVPN
68 */
69 extern const CFStringRef kSCNetworkInterfaceTypeVPN __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
70
71 /*!
72 @group Interface configuration (Bridge)
73 */
74
75 /*!
76 @typedef SCBridgeInterfaceRef
77 @discussion This is the type of a reference to an object that represents
78 a bridge interface.
79 */
80 typedef SCNetworkInterfaceRef SCBridgeInterfaceRef;
81
82 #pragma mark -
83 #pragma mark SCNetworkInterface configuration (SPI)
84
85 /*!
86 @group Interface configuration
87 */
88
89 static __inline__ CFTypeRef
90 isA_SCNetworkInterface(CFTypeRef obj)
91 {
92 return (isA_CFType(obj, SCNetworkInterfaceGetTypeID()));
93 }
94
95 static __inline__ CFTypeRef
96 isA_SCBondInterface(CFTypeRef obj)
97 {
98 CFStringRef interfaceType;
99
100 if (!isA_SCNetworkInterface(obj)) {
101 // if not an SCNetworkInterface
102 return NULL;
103 }
104
105 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
106 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
107 // if not a Bond
108 return NULL;
109 }
110
111 return obj;
112 }
113
114 static __inline__ CFTypeRef
115 isA_SCBridgeInterface(CFTypeRef obj)
116 {
117 CFStringRef interfaceType;
118
119 if (!isA_SCNetworkInterface(obj)) {
120 // if not an SCNetworkInterface
121 return NULL;
122 }
123
124 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
125 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeBridge)) {
126 // if not a bridge
127 return NULL;
128 }
129
130 return obj;
131 }
132
133 static __inline__ CFTypeRef
134 isA_SCVLANInterface(CFTypeRef obj)
135 {
136 CFStringRef interfaceType;
137
138 if (!isA_SCNetworkInterface(obj)) {
139 // if not an SCNetworkInterface
140 return NULL;
141 }
142
143 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
144 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeVLAN)) {
145 // if not a VLAN
146 return NULL;
147 }
148
149 return obj;
150 }
151
152 /*!
153 @function _SCNetworkInterfaceCompare
154 @discussion Compares two SCNetworkInterface objects.
155 @param val1 The SCNetworkInterface object.
156 @param val2 The SCNetworkInterface object.
157 @param context Not used.
158 @result A comparison result.
159 */
160 CFComparisonResult
161 _SCNetworkInterfaceCompare (const void *val1,
162 const void *val2,
163 void *context) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
164
165 /*!
166 @function _SCNetworkInterfaceCopyAllWithPreferences
167 Returns all network capable interfaces on the system.
168 @param prefs The "preferences" session.
169 @result The list of interfaces on the system.
170 You must release the returned value.
171 */
172 CFArrayRef /* of SCNetworkInterfaceRef's */
173 _SCNetworkInterfaceCopyAllWithPreferences (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
174
175 /*!
176 @function _SCNetworkInterfaceCopySlashDevPath
177 @discussion Returns the /dev pathname for the interface.
178 @param interface The network interface.
179 @result The /dev pathname associated with the interface (e.g. "/dev/modem");
180 NULL if no path is available.
181 */
182 CFStringRef
183 _SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
184
185 #define kIncludeNoVirtualInterfaces 0x0
186 #define kIncludeVLANInterfaces 0x1
187 #define kIncludeBondInterfaces 0x2
188 #define kIncludeBridgeInterfaces 0x4
189 #define kIncludeAllVirtualInterfaces 0xffffffff
190
191 /*!
192 @function _SCNetworkInterfaceCreateWithBSDName
193 @discussion Create a new network interface associated with the provided
194 BSD interface name. This API supports Ethernet, FireWire, and
195 IEEE 802.11 interfaces.
196 @param bsdName The BSD interface name.
197 @param flags Indicates whether virtual (Bond, Bridge, VLAN)
198 network interfaces should be included.
199 @result A reference to the new SCNetworkInterface.
200 You must release the returned value.
201 */
202 SCNetworkInterfaceRef
203 _SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator,
204 CFStringRef bsdName,
205 UInt32 flags) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
206
207 /*!
208 @function _SCNetworkInterfaceCreateWithEntity
209 @discussion Create a new network interface associated with the provided
210 SCDynamicStore service entity dictionary.
211 @param interface_entity The entity dictionary.
212 @param service The network service.
213 @result A reference to the new SCNetworkInterface.
214 You must release the returned value.
215 */
216 SCNetworkInterfaceRef
217 _SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator,
218 CFDictionaryRef interface_entity,
219 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
220
221 /*!
222 @function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
223 @discussion Create a new network interface associated with the provided
224 IORegistry "IONetworkInterface" object.
225 @param if_obj The IONetworkInterface object.
226 @result A reference to the new SCNetworkInterface.
227 You must release the returned value.
228 */
229 SCNetworkInterfaceRef
230 _SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
231
232 #define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
233 #define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
234 #define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
235 #define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
236
237 #define kSCNetworkInterfaceNetworkConfigurationOverridesKey CFSTR("NetworkConfigurationOverrides")
238 #define kSCNetworkInterfaceHiddenConfigurationKey CFSTR("HiddenConfiguration")
239 #define kSCNetworkInterfaceHiddenPortKey CFSTR("HiddenPort")
240
241 // IORegistry property to indicate that a [WWAN] interface is not yet ready
242 #define kSCNetworkInterfaceInitializingKey CFSTR("Initializing")
243
244 /*!
245 @function _SCNetworkInterfaceCopyInterfaceInfo
246 @discussion Returns interface details
247 @param interface The network interface.
248 @result A dictionary with details about the network interface.
249 */
250 CFDictionaryRef
251 _SCNetworkInterfaceCopyInterfaceInfo (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
252
253 /*!
254 @function _SCNetworkInterfaceGetConfigurationAction
255 @discussion Returns a user-notification / auto-configuration action for the interface.
256 @param interface The network interface.
257 @result The user-notification / auto-configuration action;
258 NULL if the default action should be used.
259 */
260 CFStringRef
261 _SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
262
263 /*!
264 @function _SCNetworkInterfaceGetHardwareAddress
265 @discussion Returns a link layer address for the interface.
266 @param interface The network interface.
267 @result The hardware (MAC) address for the interface.
268 NULL if no hardware address is available.
269 */
270 CFDataRef
271 _SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
272
273 /*!
274 @function _SCNetworkInterfaceGetIOInterfaceType
275 @discussion Returns the IOInterfaceType for the interface.
276 @param interface The network interface.
277 @result The IOInterfaceType associated with the interface
278 */
279 CFNumberRef
280 _SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
281
282 /*!
283 @function _SCNetworkInterfaceGetIOInterfaceUnit
284 @discussion Returns the IOInterfaceUnit for the interface.
285 @param interface The network interface.
286 @result The IOInterfaceUnit associated with the interface;
287 NULL if no IOLocation is available.
288 */
289 CFNumberRef
290 _SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
291
292 /*!
293 @function _SCNetworkInterfaceGetIOPath
294 @discussion Returns the IOPath for the interface.
295 @param interface The network interface.
296 @result The IOPath associated with the interface;
297 NULL if no IOPath is available.
298 */
299 CFStringRef
300 _SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
301
302 /*!
303 @function _SCNetworkInterfaceGetIORegistryEntryID
304 @discussion Returns the IORegistry entry ID for the interface.
305 @param interface The network interface.
306 @result The IORegistry entry ID associated with the interface;
307 Zero if no entry ID is available.
308 */
309 uint64_t
310 _SCNetworkInterfaceGetIORegistryEntryID (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7/*FIXME*/,__IPHONE_5_0);
311
312 /*!
313 @function _SCNetworkInterfaceIsBluetoothPAN
314 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
315 @param interface The network interface.
316 @result TRUE if the interface is a Bluetooth PAN device.
317 */
318 Boolean
319 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
320
321 /*!
322 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
323 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
324 @param interface The network interface.
325 @result TRUE if the interface is a Bluetooth PAN-NAP device.
326 */
327 Boolean
328 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
329
330 /*!
331 @function _SCNetworkInterfaceIsBluetoothP2P
332 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
333 @param interface The network interface.
334 @result TRUE if the interface is a Bluetooth P2P device.
335 */
336 Boolean
337 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
338
339 /*!
340 @function _SCNetworkInterfaceIsBuiltin
341 @discussion Identifies if a network interface is "built-in".
342 @param interface The network interface.
343 @result TRUE if the interface is "built-in".
344 */
345 Boolean
346 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
347
348 /*!
349 @function _SCNetworkInterfaceIsHiddenConfiguration
350 @discussion Identifies if the configuration of a network interface should be
351 hidden from any user interface (e.g. the "Network" pref pane).
352 @param interface The network interface.
353 @result TRUE if the interface configuration should be hidden.
354 */
355 Boolean
356 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
357
358 /*!
359 @function _SCNetworkInterfaceIsModemV92
360 @discussion Identifies if a modem network interface supports
361 v.92 (hold).
362 @param interface The network interface.
363 @result TRUE if the interface is "v.92" modem.
364 */
365 Boolean
366 _SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
367
368 /*!
369 @function _SCNetworkInterfaceIsTethered
370 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
371 @param interface The network interface.
372 @result TRUE if the interface is a tethered device.
373 */
374 Boolean
375 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
376
377 /*!
378 @function _SCNetworkInterfaceIsPhysicalEthernet
379 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
380 @param interface The network interface.
381 @result TRUE if the interface is a real ethernet interface.
382 */
383 Boolean
384 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
385
386 /*!
387 @function _SCNetworkInterfaceForceConfigurationRefresh
388 @discussion Forces a configuration refresh of the
389 specified interface.
390 @param ifName Network interface name.
391 @result TRUE if the refresh was successfully posted.
392 */
393 Boolean
394 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
395
396 /*!
397 @function SCNetworkInterfaceCopyCapability
398 @discussion For the specified network interface, returns information
399 about the currently requested capabilities, the active capabilities,
400 and the capabilities which are available.
401 @param interface The desired network interface.
402 @param capability The desired capability.
403 @result a CFTypeRef representing the current value of requested
404 capability;
405 NULL if the capability is not available for this
406 interface or if an error was encountered.
407 You must release the returned value.
408 */
409 CFTypeRef
410 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface,
411 CFStringRef capability) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
412
413 /*!
414 @function SCNetworkInterfaceSetCapability
415 @discussion For the specified network interface, sets the requested
416 capabilities.
417 @param interface The desired network interface.
418 @param capability The desired capability.
419 @param newValue The new requested setting for the capability;
420 NULL to restore the default setting.
421 @result TRUE if the configuration was updated; FALSE if an error was encountered.
422 */
423 Boolean
424 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface,
425 CFStringRef capability,
426 CFTypeRef newValue) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
427
428 #pragma mark -
429 #pragma mark SCBondInterface configuration (SPIs)
430
431 /*!
432 @function _SCBondInterfaceCopyActive
433 @discussion Returns all Ethernet Bond interfaces on the system.
434 @result The list of SCBondInterface interfaces on the system.
435 You must release the returned value.
436 */
437 CFArrayRef
438 _SCBondInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
439
440 /*!
441 @function _SCBondInterfaceUpdateConfiguration
442 @discussion Updates the bond interface configuration.
443 @param prefs The "preferences" session.
444 @result TRUE if the bond interface configuration was updated.; FALSE if the
445 an error was encountered.
446 */
447 Boolean
448 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
449
450 /*!
451 @function SCBondInterfaceGetMode
452 @discussion Return the mode for the given bond interface.
453 @param bond The bond interface to get the mode from.
454 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
455 */
456 CFNumberRef
457 SCBondInterfaceGetMode (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
458
459 /*!
460 @function SCBondInterfaceSetMode
461 @discussion Set the mode on the bond interface.
462 @param bond The bond interface on which to adjust the mode.
463 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
464 @result TRUE if operation succeeded.
465 */
466 Boolean
467 SCBondInterfaceSetMode (SCBondInterfaceRef bond,
468 CFNumberRef mode) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
469
470 #pragma mark -
471 #pragma mark SCBridgeInterface configuration (SPIs)
472
473 /*!
474 @function SCBridgeInterfaceCopyAll
475 @discussion Returns all bridge interfaces on the system.
476 @param prefs The "preferences" session.
477 @result The list of bridge interfaces on the system.
478 You must release the returned value.
479 */
480 CFArrayRef /* of SCBridgeInterfaceRef's */
481 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
482
483 /*!
484 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
485 @discussion Returns all network capable devices on the system
486 that can be added to an bridge interface.
487 @param prefs The "preferences" session.
488 @result The list of interfaces.
489 You must release the returned value.
490 */
491 CFArrayRef /* of SCNetworkInterfaceRef's */
492 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
493
494 /*!
495 @function SCBridgeInterfaceCreate
496 @discussion Create a new SCBridgeInterface interface.
497 @param prefs The "preferences" session.
498 @result A reference to the new SCBridgeInterface.
499 You must release the returned value.
500 */
501 SCBridgeInterfaceRef
502 SCBridgeInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
503
504 /*!
505 @function SCBridgeInterfaceRemove
506 @discussion Removes the SCBridgeInterface from the configuration.
507 @param bridge The SCBridgeInterface interface.
508 @result TRUE if the interface was removed; FALSE if an error was encountered.
509 */
510 Boolean
511 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
512
513 /*!
514 @function SCBridgeInterfaceGetMemberInterfaces
515 @discussion Returns the member interfaces for the specified bridge interface.
516 @param bridge The SCBridgeInterface interface.
517 @result The list of interfaces.
518 */
519 CFArrayRef /* of SCNetworkInterfaceRef's */
520 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
521
522 /*!
523 @function SCBridgeInterfaceGetOptions
524 @discussion Returns the configuration settings associated with a bridge interface.
525 @param bridge The SCBridgeInterface interface.
526 @result The configuration settings associated with the bridge interface;
527 NULL if no changes to the default configuration have been saved.
528 */
529 CFDictionaryRef
530 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
531
532 /*!
533 @function SCBridgeInterfaceSetMemberInterfaces
534 @discussion Sets the member interfaces for the specified bridge interface.
535 @param bridge The SCBridgeInterface interface.
536 @param members The desired member interfaces.
537 @result TRUE if the configuration was stored; FALSE if an error was encountered.
538 */
539 Boolean
540 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge,
541 CFArrayRef members) /* of SCNetworkInterfaceRef's */
542 __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
543
544 /*!
545 @function SCBridgeInterfaceSetLocalizedDisplayName
546 @discussion Sets the localized display name for the specified bridge interface.
547 @param bridge The SCBridgeInterface interface.
548 @param newName The new display name.
549 @result TRUE if the configuration was stored; FALSE if an error was encountered.
550 */
551 Boolean
552 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge,
553 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
554
555 /*!
556 @function SCBridgeInterfaceSetOptions
557 @discussion Sets the configuration settings for the specified bridge interface.
558 @param bridge The SCBridgeInterface interface.
559 @param newOptions The new configuration settings.
560 @result TRUE if the configuration was stored; FALSE if an error was encountered.
561 */
562 Boolean
563 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge,
564 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
565
566 #pragma mark -
567
568 /*!
569 @function _SCBridgeInterfaceCopyActive
570 @discussion Returns all bridge interfaces on the system.
571 @result The list of SCBridgeInterface interfaces on the system.
572 You must release the returned value.
573 */
574 CFArrayRef
575 _SCBridgeInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
576
577 /*!
578 @function _SCBridgeInterfaceUpdateConfiguration
579 @discussion Updates the bridge interface configuration.
580 @param prefs The "preferences" session.
581 @result TRUE if the bridge interface configuration was updated.; FALSE if the
582 an error was encountered.
583 */
584 Boolean
585 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
586
587
588 #pragma mark -
589 #pragma mark SCVLANInterface configuration (SPIs)
590
591 /*!
592 @function _SCVLANInterfaceCopyActive
593 @discussion Returns all VLAN interfaces on the system.
594 @result The list of SCVLANInterface interfaces on the system.
595 You must release the returned value.
596 */
597 CFArrayRef
598 _SCVLANInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
599
600 /*!
601 @function _SCVLANInterfaceUpdateConfiguration
602 @discussion Updates the VLAN interface configuration.
603 @param prefs The "preferences" session.
604 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
605 an error was encountered.
606 */
607 Boolean
608 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
609
610
611 #pragma mark -
612 #pragma mark SCNetworkInterface Password SPIs
613
614
615 enum {
616 kSCNetworkInterfacePasswordTypePPP = 1,
617 kSCNetworkInterfacePasswordTypeIPSecSharedSecret,
618 kSCNetworkInterfacePasswordTypeEAPOL,
619 kSCNetworkInterfacePasswordTypeIPSecXAuth,
620 kSCNetworkInterfacePasswordTypeVPN,
621 };
622 typedef uint32_t SCNetworkInterfacePasswordType;
623
624 Boolean
625 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface,
626 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
627
628 CFDataRef
629 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface,
630 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
631
632 Boolean
633 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface,
634 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
635
636 Boolean
637 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface,
638 SCNetworkInterfacePasswordType passwordType,
639 CFDataRef password,
640 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
641
642
643 #pragma mark -
644 #pragma mark SCNetworkProtocol configuration (SPI)
645
646
647 /*!
648 @group Protocol configuration
649 */
650
651
652 static __inline__ CFTypeRef
653 isA_SCNetworkProtocol(CFTypeRef obj)
654 {
655 return (isA_CFType(obj, SCNetworkProtocolGetTypeID()));
656 }
657
658
659 #pragma mark -
660 #pragma mark SCNetworkService configuration (SPI)
661
662
663 /*!
664 @group Service configuration
665 */
666
667
668 static __inline__ CFTypeRef
669 isA_SCNetworkService(CFTypeRef obj)
670 {
671 return (isA_CFType(obj, SCNetworkServiceGetTypeID()));
672 }
673
674 enum {
675 kSCNetworkServicePrimaryRankDefault = 0,
676 kSCNetworkServicePrimaryRankFirst = 1,
677 kSCNetworkServicePrimaryRankLast = 2,
678 kSCNetworkServicePrimaryRankNever = 3
679 };
680 typedef uint32_t SCNetworkServicePrimaryRank;
681
682 /*!
683 @function _SCNetworkServiceCompare
684 @discussion Compares two SCNetworkService objects.
685 @param val1 The SCNetworkService object.
686 @param val2 The SCNetworkService object.
687 @param context The service order (from SCNetworkSetGetServiceOrder).
688 @result A comparison result.
689 */
690 CFComparisonResult
691 _SCNetworkServiceCompare (const void *val1,
692 const void *val2,
693 void *context) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
694
695 /*!
696 @function _SCNetworkServiceCopyActive
697 @discussion Returns the network service with the specified identifier.
698
699 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
700 API in that queries and operations interact with the "active" service
701 represented in the SCDynamicStore. Only a limited subset of the
702 SCNetworkService APIs are supported.
703 @param prefs The dynamic store session.
704 @param serviceID The unique identifier for the service.
705 @result A reference to the SCNetworkService represented in the SCDynamicStore;
706 NULL if the serviceID does not exist in the SCDynamicStore or if an
707 error was encountered.
708 You must release the returned value.
709 */
710 SCNetworkServiceRef
711 _SCNetworkServiceCopyActive (SCDynamicStoreRef store,
712 CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_1);
713
714 /*!
715 @function SCNetworkServiceGetPrimaryRank
716 @discussion Returns the primary service rank associated with a service.
717 @param service The network service.
718 @result The primary service rank associated with the specified application;
719 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
720 application or an error was encountered.
721 */
722 SCNetworkServicePrimaryRank
723 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
724
725 /*!
726 @function SCNetworkServiceSetPrimaryRank
727 @discussion Updates the the primary service rank associated with a service.
728 @param service The network service.
729 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
730 if the default service rank should be used.
731 @result TRUE if the rank was stored; FALSE if an error was encountered.
732
733 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
734 values can only valid as a transient setting.
735 */
736 Boolean
737 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service,
738 SCNetworkServicePrimaryRank newRank) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
739
740 /*!
741 @function _SCNetworkServiceIsVPN
742 @discussion Identifies a VPN service.
743 @param service The network service.
744 @result TRUE if the service is a VPN.
745 */
746 Boolean
747 _SCNetworkServiceIsVPN (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
748
749 #pragma mark -
750 #pragma mark SCNetworkSet configuration (SPI)
751
752
753 /*!
754 @group Set configuration
755 */
756
757
758 static __inline__ CFTypeRef
759 isA_SCNetworkSet(CFTypeRef obj)
760 {
761 return (isA_CFType(obj, SCNetworkSetGetTypeID()));
762 }
763
764
765 /*!
766 @function SCNetworkSetEstablishDefaultConfiguration
767 @discussion Updates a network set by adding services for
768 any network interface that is not currently
769 represented.
770 If the provided set contains one (or more) services, new
771 services will only be added for those interfaces that are
772 not represented in *any* set.
773 Otherwise, new services will be added for those interfaces
774 that are not represented in the provided set.
775 The new services are established with "default" configuration
776 options.
777 @param set The network set.
778 @result TRUE if the configuration was updated; FALSE if no
779 changes were required or if an error was encountered.
780 */
781 Boolean
782 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
783
784 /*!
785 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
786 @discussion Updates a network set by adding services for
787 the specified network interface if is not currently
788 represented.
789 If the provided set contains one (or more) services, new
790 services will only be added for interfaces that are not
791 represented in *any* set.
792 Otherwise, new services will be added for interfaces that
793 are not represented in the provided set.
794 The new services are established with "default" configuration
795 options.
796 @param set The network set.
797 @param interface The network interface.
798 @result TRUE if the configuration was updated; FALSE if no
799 changes were required or if an error was encountered.
800 */
801 Boolean
802 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set,
803 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
804
805 /*!
806 @function SCNetworkSetCopySelectedVPNService
807 @discussion On the iPhone we only allow a single VPN network service
808 to be selected at any given time. This API will identify
809 the selected VPN service.
810 @param set The network set.
811 @result The selected VPN service; NULL if no service has been
812 selected.
813 You must release the returned value.
814 */
815 SCNetworkServiceRef
816 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
817
818 /*!
819 @function SCNetworkSetSetSelectedVPNService
820 @discussion On the iPhone we only allow a single VPN network service
821 to be selected at any given time. This API should be used to
822 select a VPN service.
823 @param set The network set.
824 @param service The VPN service to be selected.
825 @result TRUE if the name was saved; FALSE if an error was encountered.
826 */
827 Boolean
828 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set,
829 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
830
831 __END_DECLS
832
833 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */