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