]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationPrivate.h
3998ac96cb3833c2a6c917510be466e84d5ec5d7
[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 _SCNetworkInterfaceIsBluetoothPAN
304 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
305 @param interface The network interface.
306 @result TRUE if the interface is a Bluetooth PAN device.
307 */
308 Boolean
309 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
310
311 /*!
312 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
313 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
314 @param interface The network interface.
315 @result TRUE if the interface is a Bluetooth PAN-NAP device.
316 */
317 Boolean
318 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
319
320 /*!
321 @function _SCNetworkInterfaceIsBluetoothP2P
322 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
323 @param interface The network interface.
324 @result TRUE if the interface is a Bluetooth P2P device.
325 */
326 Boolean
327 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
328
329 /*!
330 @function _SCNetworkInterfaceIsBuiltin
331 @discussion Identifies if a network interface is "built-in".
332 @param interface The network interface.
333 @result TRUE if the interface is "built-in".
334 */
335 Boolean
336 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
337
338 /*!
339 @function _SCNetworkInterfaceIsHiddenConfiguration
340 @discussion Identifies if the configuration of a network interface should be
341 hidden from any user interface (e.g. the "Network" pref pane).
342 @param interface The network interface.
343 @result TRUE if the interface configuration should be hidden.
344 */
345 Boolean
346 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
347
348 /*!
349 @function _SCNetworkInterfaceIsModemV92
350 @discussion Identifies if a modem network interface supports
351 v.92 (hold).
352 @param interface The network interface.
353 @result TRUE if the interface is "v.92" modem.
354 */
355 Boolean
356 _SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
357
358 /*!
359 @function _SCNetworkInterfaceIsTethered
360 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
361 @param interface The network interface.
362 @result TRUE if the interface is a tethered device.
363 */
364 Boolean
365 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
366
367 /*!
368 @function _SCNetworkInterfaceIsPhysicalEthernet
369 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
370 @param interface The network interface.
371 @result TRUE if the interface is a real ethernet interface.
372 */
373 Boolean
374 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
375
376 /*!
377 @function _SCNetworkInterfaceForceConfigurationRefresh
378 @discussion Forces a configuration refresh of the
379 specified interface.
380 @param ifName Network interface name.
381 @result TRUE if the refresh was successfully posted.
382 */
383 Boolean
384 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
385
386 /*!
387 @function SCNetworkInterfaceCopyCapability
388 @discussion For the specified network interface, returns information
389 about the currently requested capabilities, the active capabilities,
390 and the capabilities which are available.
391 @param interface The desired network interface.
392 @param capability The desired capability.
393 @result a CFTypeRef representing the current value of requested
394 capability;
395 NULL if the capability is not available for this
396 interface or if an error was encountered.
397 You must release the returned value.
398 */
399 CFTypeRef
400 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface,
401 CFStringRef capability) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
402
403 /*!
404 @function SCNetworkInterfaceSetCapability
405 @discussion For the specified network interface, sets the requested
406 capabilities.
407 @param interface The desired network interface.
408 @param capability The desired capability.
409 @param newValue The new requested setting for the capability;
410 NULL to restore the default setting.
411 @result TRUE if the configuration was updated; FALSE if an error was encountered.
412 */
413 Boolean
414 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface,
415 CFStringRef capability,
416 CFTypeRef newValue) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
417
418 #pragma mark -
419 #pragma mark SCBondInterface configuration (SPIs)
420
421 /*!
422 @function _SCBondInterfaceCopyActive
423 @discussion Returns all Ethernet Bond interfaces on the system.
424 @result The list of SCBondInterface interfaces on the system.
425 You must release the returned value.
426 */
427 CFArrayRef
428 _SCBondInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
429
430 /*!
431 @function _SCBondInterfaceUpdateConfiguration
432 @discussion Updates the bond interface configuration.
433 @param prefs The "preferences" session.
434 @result TRUE if the bond interface configuration was updated.; FALSE if the
435 an error was encountered.
436 */
437 Boolean
438 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
439
440 /*!
441 @function SCBondInterfaceGetMode
442 @discussion Return the mode for the given bond interface.
443 @param bond The bond interface to get the mode from.
444 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
445 */
446 CFNumberRef
447 SCBondInterfaceGetMode (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
448
449 /*!
450 @function SCBondInterfaceSetMode
451 @discussion Set the mode on the bond interface.
452 @param bond The bond interface on which to adjust the mode.
453 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
454 @result TRUE if operation succeeded.
455 */
456 Boolean
457 SCBondInterfaceSetMode (SCBondInterfaceRef bond,
458 CFNumberRef mode) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
459
460 #pragma mark -
461 #pragma mark SCBridgeInterface configuration (SPIs)
462
463 /*!
464 @function SCBridgeInterfaceCopyAll
465 @discussion Returns all bridge interfaces on the system.
466 @param prefs The "preferences" session.
467 @result The list of bridge interfaces on the system.
468 You must release the returned value.
469 */
470 CFArrayRef /* of SCBridgeInterfaceRef's */
471 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
472
473 /*!
474 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
475 @discussion Returns all network capable devices on the system
476 that can be added to an bridge interface.
477 @param prefs The "preferences" session.
478 @result The list of interfaces.
479 You must release the returned value.
480 */
481 CFArrayRef /* of SCNetworkInterfaceRef's */
482 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
483
484 /*!
485 @function SCBridgeInterfaceCreate
486 @discussion Create a new SCBridgeInterface interface.
487 @param prefs The "preferences" session.
488 @result A reference to the new SCBridgeInterface.
489 You must release the returned value.
490 */
491 SCBridgeInterfaceRef
492 SCBridgeInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
493
494 /*!
495 @function SCBridgeInterfaceRemove
496 @discussion Removes the SCBridgeInterface from the configuration.
497 @param bridge The SCBridgeInterface interface.
498 @result TRUE if the interface was removed; FALSE if an error was encountered.
499 */
500 Boolean
501 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
502
503 /*!
504 @function SCBridgeInterfaceGetMemberInterfaces
505 @discussion Returns the member interfaces for the specified bridge interface.
506 @param bridge The SCBridgeInterface interface.
507 @result The list of interfaces.
508 */
509 CFArrayRef /* of SCNetworkInterfaceRef's */
510 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
511
512 /*!
513 @function SCBridgeInterfaceGetOptions
514 @discussion Returns the configuration settings associated with a bridge interface.
515 @param bridge The SCBridgeInterface interface.
516 @result The configuration settings associated with the bridge interface;
517 NULL if no changes to the default configuration have been saved.
518 */
519 CFDictionaryRef
520 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
521
522 /*!
523 @function SCBridgeInterfaceSetMemberInterfaces
524 @discussion Sets the member interfaces for the specified bridge interface.
525 @param bridge The SCBridgeInterface interface.
526 @param members The desired member interfaces.
527 @result TRUE if the configuration was stored; FALSE if an error was encountered.
528 */
529 Boolean
530 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge,
531 CFArrayRef members) /* of SCNetworkInterfaceRef's */
532 __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
533
534 /*!
535 @function SCBridgeInterfaceSetLocalizedDisplayName
536 @discussion Sets the localized display name for the specified bridge interface.
537 @param bridge The SCBridgeInterface interface.
538 @param newName The new display name.
539 @result TRUE if the configuration was stored; FALSE if an error was encountered.
540 */
541 Boolean
542 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge,
543 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
544
545 /*!
546 @function SCBridgeInterfaceSetOptions
547 @discussion Sets the configuration settings for the specified bridge interface.
548 @param bridge The SCBridgeInterface interface.
549 @param newOptions The new configuration settings.
550 @result TRUE if the configuration was stored; FALSE if an error was encountered.
551 */
552 Boolean
553 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge,
554 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
555
556 #pragma mark -
557
558 /*!
559 @function _SCBridgeInterfaceCopyActive
560 @discussion Returns all bridge interfaces on the system.
561 @result The list of SCBridgeInterface interfaces on the system.
562 You must release the returned value.
563 */
564 CFArrayRef
565 _SCBridgeInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
566
567 /*!
568 @function _SCBridgeInterfaceUpdateConfiguration
569 @discussion Updates the bridge interface configuration.
570 @param prefs The "preferences" session.
571 @result TRUE if the bridge interface configuration was updated.; FALSE if the
572 an error was encountered.
573 */
574 Boolean
575 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
576
577
578 #pragma mark -
579 #pragma mark SCVLANInterface configuration (SPIs)
580
581 /*!
582 @function _SCVLANInterfaceCopyActive
583 @discussion Returns all VLAN interfaces on the system.
584 @result The list of SCVLANInterface interfaces on the system.
585 You must release the returned value.
586 */
587 CFArrayRef
588 _SCVLANInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
589
590 /*!
591 @function _SCVLANInterfaceUpdateConfiguration
592 @discussion Updates the VLAN interface configuration.
593 @param prefs The "preferences" session.
594 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
595 an error was encountered.
596 */
597 Boolean
598 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
599
600
601 #pragma mark -
602 #pragma mark SCNetworkInterface Password SPIs
603
604
605 enum {
606 kSCNetworkInterfacePasswordTypePPP = 1,
607 kSCNetworkInterfacePasswordTypeIPSecSharedSecret,
608 kSCNetworkInterfacePasswordTypeEAPOL,
609 kSCNetworkInterfacePasswordTypeIPSecXAuth,
610 kSCNetworkInterfacePasswordTypeVPN,
611 };
612 typedef uint32_t SCNetworkInterfacePasswordType;
613
614 Boolean
615 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface,
616 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
617
618 CFDataRef
619 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface,
620 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
621
622 Boolean
623 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface,
624 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
625
626 Boolean
627 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface,
628 SCNetworkInterfacePasswordType passwordType,
629 CFDataRef password,
630 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
631
632
633 #pragma mark -
634 #pragma mark SCNetworkProtocol configuration (SPI)
635
636
637 /*!
638 @group Protocol configuration
639 */
640
641
642 static __inline__ CFTypeRef
643 isA_SCNetworkProtocol(CFTypeRef obj)
644 {
645 return (isA_CFType(obj, SCNetworkProtocolGetTypeID()));
646 }
647
648
649 #pragma mark -
650 #pragma mark SCNetworkService configuration (SPI)
651
652
653 /*!
654 @group Service configuration
655 */
656
657
658 static __inline__ CFTypeRef
659 isA_SCNetworkService(CFTypeRef obj)
660 {
661 return (isA_CFType(obj, SCNetworkServiceGetTypeID()));
662 }
663
664 enum {
665 kSCNetworkServicePrimaryRankDefault = 0,
666 kSCNetworkServicePrimaryRankFirst = 1,
667 kSCNetworkServicePrimaryRankLast = 2,
668 kSCNetworkServicePrimaryRankNever = 3
669 };
670 typedef uint32_t SCNetworkServicePrimaryRank;
671
672 /*!
673 @function _SCNetworkServiceCompare
674 @discussion Compares two SCNetworkService objects.
675 @param val1 The SCNetworkService object.
676 @param val2 The SCNetworkService object.
677 @param context The service order (from SCNetworkSetGetServiceOrder).
678 @result A comparison result.
679 */
680 CFComparisonResult
681 _SCNetworkServiceCompare (const void *val1,
682 const void *val2,
683 void *context) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
684
685 /*!
686 @function _SCNetworkServiceCopyActive
687 @discussion Returns the network service with the specified identifier.
688
689 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
690 API in that queries and operations interact with the "active" service
691 represented in the SCDynamicStore. Only a limited subset of the
692 SCNetworkService APIs are supported.
693 @param prefs The dynamic store session.
694 @param serviceID The unique identifier for the service.
695 @result A reference to the SCNetworkService represented in the SCDynamicStore;
696 NULL if the serviceID does not exist in the SCDynamicStore or if an
697 error was encountered.
698 You must release the returned value.
699 */
700 SCNetworkServiceRef
701 _SCNetworkServiceCopyActive (SCDynamicStoreRef store,
702 CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_1);
703
704 /*!
705 @function SCNetworkServiceGetPrimaryRank
706 @discussion Returns the primary service rank associated with a service.
707 @param service The network service.
708 @result The primary service rank associated with the specified application;
709 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
710 application or an error was encountered.
711 */
712 SCNetworkServicePrimaryRank
713 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
714
715 /*!
716 @function SCNetworkServiceSetPrimaryRank
717 @discussion Updates the the primary service rank associated with a service.
718 @param service The network service.
719 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
720 if the default service rank should be used.
721 @result TRUE if the rank was stored; FALSE if an error was encountered.
722
723 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
724 values can only valid as a transient setting.
725 */
726 Boolean
727 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service,
728 SCNetworkServicePrimaryRank newRank) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
729
730 /*!
731 @function _SCNetworkServiceIsVPN
732 @discussion Identifies a VPN service.
733 @param service The network service.
734 @result TRUE if the service is a VPN.
735 */
736 Boolean
737 _SCNetworkServiceIsVPN (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
738
739 #pragma mark -
740 #pragma mark SCNetworkSet configuration (SPI)
741
742
743 /*!
744 @group Set configuration
745 */
746
747
748 static __inline__ CFTypeRef
749 isA_SCNetworkSet(CFTypeRef obj)
750 {
751 return (isA_CFType(obj, SCNetworkSetGetTypeID()));
752 }
753
754
755 /*!
756 @function SCNetworkSetEstablishDefaultConfiguration
757 @discussion Updates a network set by adding services for
758 any network interface that is not currently
759 represented.
760 If the provided set contains one (or more) services, new
761 services will only be added for those interfaces that are
762 not represented in *any* set.
763 Otherwise, new services will be added for those interfaces
764 that are not represented in the provided set.
765 The new services are established with "default" configuration
766 options.
767 @param set The network set.
768 @result TRUE if the configuration was updated; FALSE if no
769 changes were required or if an error was encountered.
770 */
771 Boolean
772 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
773
774 /*!
775 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
776 @discussion Updates a network set by adding services for
777 the specified network interface if is not currently
778 represented.
779 If the provided set contains one (or more) services, new
780 services will only be added for interfaces that are not
781 represented in *any* set.
782 Otherwise, new services will be added for interfaces that
783 are not represented in the provided set.
784 The new services are established with "default" configuration
785 options.
786 @param set The network set.
787 @param interface The network interface.
788 @result TRUE if the configuration was updated; FALSE if no
789 changes were required or if an error was encountered.
790 */
791 Boolean
792 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set,
793 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
794
795 /*!
796 @function SCNetworkSetCopySelectedVPNService
797 @discussion On the iPhone we only allow a single VPN network service
798 to be selected at any given time. This API will identify
799 the selected VPN service.
800 @param set The network set.
801 @result The selected VPN service; NULL if no service has been
802 selected.
803 You must release the returned value.
804 */
805 SCNetworkServiceRef
806 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
807
808 /*!
809 @function SCNetworkSetSetSelectedVPNService
810 @discussion On the iPhone we only allow a single VPN network service
811 to be selected at any given time. This API should be used to
812 select a VPN service.
813 @param set The network set.
814 @param service The VPN service to be selected.
815 @result TRUE if the name was saved; FALSE if an error was encountered.
816 */
817 Boolean
818 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set,
819 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
820
821 __END_DECLS
822
823 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */