]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationPrivate.h
537bab5b432bf6efecc7b9c8200d2ab79f9fa060
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfigurationPrivate.h
1 /*
2 * Copyright (c) 2005-2016 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 /*!
56 @const kSCNetworkInterfaceTypeLoopback
57 */
58 extern const CFStringRef kSCNetworkInterfaceTypeLoopback __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
59
60 /*!
61 @const kSCNetworkInterfaceLoopback
62 @discussion A network interface representing the loopback
63 interface (lo0).
64 */
65 extern const SCNetworkInterfaceRef kSCNetworkInterfaceLoopback __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
66
67 /*!
68 @const kSCNetworkInterfaceTypeVPN
69 */
70 extern const CFStringRef kSCNetworkInterfaceTypeVPN __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
71
72 /*!
73 @group Interface configuration (Bridge)
74 */
75
76 /*!
77 @typedef SCBridgeInterfaceRef
78 @discussion This is the type of a reference to an object that represents
79 a bridge interface.
80 */
81 typedef SCNetworkInterfaceRef SCBridgeInterfaceRef;
82
83 typedef CF_ENUM(uint32_t, SCNetworkServicePrimaryRank) {
84 kSCNetworkServicePrimaryRankDefault = 0,
85 kSCNetworkServicePrimaryRankFirst = 1,
86 kSCNetworkServicePrimaryRankLast = 2,
87 kSCNetworkServicePrimaryRankNever = 3,
88 kSCNetworkServicePrimaryRankScoped = 4
89 };
90
91 #pragma mark -
92 #pragma mark SCNetworkInterface configuration (SPI)
93
94 /*!
95 @group Interface configuration
96 */
97
98 static __inline__ CFTypeRef
99 isA_SCNetworkInterface(CFTypeRef obj)
100 {
101 return (isA_CFType(obj, SCNetworkInterfaceGetTypeID()));
102 }
103
104 static __inline__ CFTypeRef
105 isA_SCBondInterface(CFTypeRef obj)
106 {
107 CFStringRef interfaceType;
108
109 if (!isA_SCNetworkInterface(obj)) {
110 // if not an SCNetworkInterface
111 return NULL;
112 }
113
114 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
115 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
116 // if not a Bond
117 return NULL;
118 }
119
120 return obj;
121 }
122
123 static __inline__ CFTypeRef
124 isA_SCBridgeInterface(CFTypeRef obj)
125 {
126 CFStringRef interfaceType;
127
128 if (!isA_SCNetworkInterface(obj)) {
129 // if not an SCNetworkInterface
130 return NULL;
131 }
132
133 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
134 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeBridge)) {
135 // if not a bridge
136 return NULL;
137 }
138
139 return obj;
140 }
141
142 static __inline__ CFTypeRef
143 isA_SCVLANInterface(CFTypeRef obj)
144 {
145 CFStringRef interfaceType;
146
147 if (!isA_SCNetworkInterface(obj)) {
148 // if not an SCNetworkInterface
149 return NULL;
150 }
151
152 interfaceType = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)obj);
153 if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeVLAN)) {
154 // if not a VLAN
155 return NULL;
156 }
157
158 return obj;
159 }
160
161 /*!
162 @function _SCNetworkInterfaceCompare
163 @discussion Compares two SCNetworkInterface objects.
164 @param val1 The SCNetworkInterface object.
165 @param val2 The SCNetworkInterface object.
166 @param context Not used.
167 @result A comparison result.
168 */
169 CFComparisonResult
170 _SCNetworkInterfaceCompare (const void *val1,
171 const void *val2,
172 void *context) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
173
174 /*!
175 @function _SCNetworkInterfaceCopyActive
176 @discussion Creates an SCNetworkInterface and associated with interface name
177 and SCDynamicStoreRef
178 @param the interface name
179 @param the SCDynamicStoreRef
180 @result the SCNetworkInterface
181 */
182 SCNetworkInterfaceRef
183 _SCNetworkInterfaceCopyActive (SCDynamicStoreRef store,
184 CFStringRef bsdName) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_0);
185
186 /*!
187 @function _SCNetworkInterfaceCopyAllWithPreferences
188 Returns all network capable interfaces on the system.
189 @param prefs The "preferences" session.
190 @result The list of interfaces on the system.
191 You must release the returned value.
192 */
193 CFArrayRef /* of SCNetworkInterfaceRef's */
194 _SCNetworkInterfaceCopyAllWithPreferences (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
195
196 /*!
197 @function _SCNetworkInterfaceCopyBTPANInterface
198 @discussion Returns the SCNetworkInterface associated with the BT-PAN interface
199 @result The BT-PAN interface; NULL if the interface is not (yet) known.
200 */
201 SCNetworkInterfaceRef
202 _SCNetworkInterfaceCopyBTPANInterface (void) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_NA);
203
204 /*!
205 @function _SCNetworkInterfaceCopySlashDevPath
206 @discussion Returns the /dev pathname for the interface.
207 @param interface The network interface.
208 @result The /dev pathname associated with the interface (e.g. "/dev/modem");
209 NULL if no path is available.
210 */
211 CFStringRef
212 _SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
213
214 #define kIncludeNoVirtualInterfaces 0x0
215 #define kIncludeVLANInterfaces 0x1
216 #define kIncludeBondInterfaces 0x2
217 #define kIncludeBridgeInterfaces 0x4
218 #define kIncludeAllVirtualInterfaces 0xffffffff
219
220 /*!
221 @function _SCNetworkInterfaceCreateWithBSDName
222 @discussion Create a new network interface associated with the provided
223 BSD interface name. This API supports Ethernet, FireWire, and
224 IEEE 802.11 interfaces.
225 @param bsdName The BSD interface name.
226 @param flags Indicates whether virtual (Bond, Bridge, VLAN)
227 network interfaces should be included.
228 @result A reference to the new SCNetworkInterface.
229 You must release the returned value.
230 */
231 SCNetworkInterfaceRef
232 _SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator,
233 CFStringRef bsdName,
234 UInt32 flags) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
235
236 /*!
237 @function _SCNetworkInterfaceCreateWithEntity
238 @discussion Create a new network interface associated with the provided
239 SCDynamicStore service entity dictionary.
240 @param interface_entity The entity dictionary.
241 @param service The network service.
242 @result A reference to the new SCNetworkInterface.
243 You must release the returned value.
244 */
245 SCNetworkInterfaceRef
246 _SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator,
247 CFDictionaryRef interface_entity,
248 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
249
250 /*!
251 @function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
252 @discussion Create a new network interface associated with the provided
253 IORegistry "IONetworkInterface" object.
254 @param if_obj The IONetworkInterface object.
255 @result A reference to the new SCNetworkInterface.
256 You must release the returned value.
257 */
258 SCNetworkInterfaceRef
259 _SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
260
261 /*!
262 @function SCNetworkInterfaceGetPrimaryRank
263 @discussion We allow caller to retrieve the rank on an interface.
264 @param the interface to get the rank
265 @result SCNetworkServicePrimaryRank
266 */
267 SCNetworkServicePrimaryRank
268 SCNetworkInterfaceGetPrimaryRank (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_0);
269
270 /*!
271 @function SCNetworkInterfaceSetPrimaryRank
272 @discussion We allow caller to set an assertion on an interface.
273 The rank assertion lives as long as the SCNetworkInterfaceRef
274 remains valid.
275 @param the interface to set the rank assertion
276 @param the new rank to be set
277 @result TRUE if operation is successful; FALSE if an error was encountered.
278 */
279 Boolean
280 SCNetworkInterfaceSetPrimaryRank (SCNetworkInterfaceRef interface,
281 SCNetworkServicePrimaryRank newRank) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_0);
282
283 #define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
284 #define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
285 #define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
286 #define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
287
288 #define kSCNetworkInterfaceNetworkConfigurationOverridesKey CFSTR("NetworkConfigurationOverrides")
289 #define kSCNetworkInterfaceHiddenConfigurationKey CFSTR("HiddenConfiguration")
290 #define kSCNetworkInterfaceHiddenPortKey CFSTR("HiddenPort") /* for serial ports */
291 #define kSCNetworkInterfaceHiddenInterfaceKey CFSTR("HiddenInterface") /* for network interfaces */
292
293 // IORegistry property to indicate that a [WWAN] interface is not yet ready
294 #define kSCNetworkInterfaceInitializingKey CFSTR("Initializing")
295
296 /*!
297 @function _SCNetworkInterfaceCopyInterfaceInfo
298 @discussion Returns interface details
299 @param interface The network interface.
300 @result A dictionary with details about the network interface.
301 */
302 CFDictionaryRef
303 _SCNetworkInterfaceCopyInterfaceInfo (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
304
305 /*!
306 @function _SCNetworkInterfaceGetConfigurationAction
307 @discussion Returns a user-notification / auto-configuration action for the interface.
308 @param interface The network interface.
309 @result The user-notification / auto-configuration action;
310 NULL if the default action should be used.
311 */
312 CFStringRef
313 _SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
314
315 /*!
316 @function _SCNetworkInterfaceGetFamilyType
317 @discussion Returns the family type for the interface.
318 @param interface The network interface.
319 @result The family type (ift_family) associated with the interface;
320 NULL if no family type is available.
321 */
322 CFNumberRef
323 _SCNetworkInterfaceGetFamilyType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0);
324
325 /*!
326 @function _SCNetworkInterfaceGetFamilySubType
327 @discussion Returns the family subtype for the interface.
328 @param interface The network interface.
329 @result The family subtype (ift_subfamily) associated with the interface;
330 NULL if no family subtype is available.
331 */
332 CFNumberRef
333 _SCNetworkInterfaceGetFamilySubType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0);
334
335 /*!
336 @function _SCNetworkInterfaceGetHardwareAddress
337 @discussion Returns a link layer address for the interface.
338 @param interface The network interface.
339 @result The hardware (MAC) address for the interface.
340 NULL if no hardware address is available.
341 */
342 CFDataRef
343 _SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
344
345 /*!
346 @function _SCNetworkInterfaceGetIOInterfaceNamePrefix
347 @discussion Returns the IOInterfaceNamePrefix for the interface.
348 @param interface The network interface.
349 @result The IOInterfaceNamePrefix associated with the interface;
350 NULL if no IOInterfaceNamePrefix is available.
351 */
352 CFStringRef
353 _SCNetworkInterfaceGetIOInterfaceNamePrefix (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_6_0);
354
355 /*!
356 @function _SCNetworkInterfaceGetIOInterfaceType
357 @discussion Returns the IOInterfaceType for the interface.
358 @param interface The network interface.
359 @result The IOInterfaceType associated with the interface
360 */
361 CFNumberRef
362 _SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
363
364 /*!
365 @function _SCNetworkInterfaceGetIOInterfaceUnit
366 @discussion Returns the IOInterfaceUnit for the interface.
367 @param interface The network interface.
368 @result The IOInterfaceUnit associated with the interface;
369 NULL if no IOInterfaceUnit is available.
370 */
371 CFNumberRef
372 _SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
373
374 /*!
375 @function _SCNetworkInterfaceGetIOPath
376 @discussion Returns the IOPath for the interface.
377 @param interface The network interface.
378 @result The IOPath associated with the interface;
379 NULL if no IOPath is available.
380 */
381 CFStringRef
382 _SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
383
384 /*!
385 @function _SCNetworkInterfaceGetIORegistryEntryID
386 @discussion Returns the IORegistry entry ID for the interface.
387 @param interface The network interface.
388 @result The IORegistry entry ID associated with the interface;
389 Zero if no entry ID is available.
390 */
391 uint64_t
392 _SCNetworkInterfaceGetIORegistryEntryID (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_0);
393
394 /*!
395 @function _SCNetworkInterfaceIsBluetoothPAN
396 @discussion Identifies if a network interface is a Bluetooth PAN (GN) device.
397 @param interface The network interface.
398 @result TRUE if the interface is a Bluetooth PAN device.
399 */
400 Boolean
401 _SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
402
403 /*!
404 @function _SCNetworkInterfaceIsBluetoothPAN_NAP
405 @discussion Identifies if a network interface is a Bluetooth PAN-NAP device.
406 @param interface The network interface.
407 @result TRUE if the interface is a Bluetooth PAN-NAP device.
408 */
409 Boolean
410 _SCNetworkInterfaceIsBluetoothPAN_NAP (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
411
412 /*!
413 @function _SCNetworkInterfaceIsBluetoothP2P
414 @discussion Identifies if a network interface is a Bluetooth P2P (PAN-U) device.
415 @param interface The network interface.
416 @result TRUE if the interface is a Bluetooth P2P device.
417 */
418 Boolean
419 _SCNetworkInterfaceIsBluetoothP2P (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
420
421 /*!
422 @function _SCNetworkInterfaceIsBuiltin
423 @discussion Identifies if a network interface is "built-in".
424 @param interface The network interface.
425 @result TRUE if the interface is "built-in".
426 */
427 Boolean
428 _SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
429
430 /*!
431 @function _SCNetworkInterfaceIsHiddenConfiguration
432 @discussion Identifies if the configuration of a network interface should be
433 hidden from any user interface (e.g. the "Network" pref pane).
434 @param interface The network interface.
435 @result TRUE if the interface configuration should be hidden.
436 */
437 Boolean
438 _SCNetworkInterfaceIsHiddenConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
439
440 /*!
441 @function _SCNetworkInterfaceIsModemV92
442 @discussion Identifies if a modem network interface supports
443 v.92 (hold).
444 @param interface The network interface.
445 @result TRUE if the interface is "v.92" modem.
446 */
447 Boolean
448 _SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
449
450 /*!
451 @function _SCNetworkInterfaceIsTethered
452 @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
453 @param interface The network interface.
454 @result TRUE if the interface is a tethered device.
455 */
456 Boolean
457 _SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
458
459 /*!
460 @function _SCNetworkInterfaceIsThunderbolt
461 @discussion Identifies if a network interface is a Thunderbolt device
462 @param interface The network interface.
463 @result TRUE if the interface is a Thunderbolt device.
464 */
465 Boolean
466 _SCNetworkInterfaceIsThunderbolt (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0);
467
468 /*!
469 @function _SCNetworkInterfaceIsPhysicalEthernet
470 @discussion Indicates whether a network interface is a real ethernet interface i.e. one with an ethernet PHY.
471 @param interface The network interface.
472 @result TRUE if the interface is a real ethernet interface.
473 */
474 Boolean
475 _SCNetworkInterfaceIsPhysicalEthernet (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
476
477 /*!
478 @function _SCNetworkInterfaceForceConfigurationRefresh
479 @discussion Forces a configuration refresh of the
480 specified interface.
481 @param ifName Network interface name.
482 @result TRUE if the refresh was successfully posted.
483 */
484 Boolean
485 _SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
486
487 /*!
488 @function SCNetworkInterfaceCopyCapability
489 @discussion For the specified network interface, returns information
490 about the currently requested capabilities, the active capabilities,
491 and the capabilities which are available.
492 @param interface The desired network interface.
493 @param capability The desired capability;
494 NULL to return a CFDictionary of all capabilities.
495 @result a CFTypeRef representing the current value of requested
496 capability;
497 NULL if the capability is not available for this
498 interface or if an error was encountered.
499 You must release the returned value.
500 */
501 CFTypeRef
502 SCNetworkInterfaceCopyCapability (SCNetworkInterfaceRef interface,
503 CFStringRef capability) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
504
505 /*!
506 @function SCNetworkInterfaceSetCapability
507 @discussion For the specified network interface, sets the requested
508 capabilities.
509 @param interface The desired network interface.
510 @param capability The desired capability.
511 @param newValue The new requested setting for the capability;
512 NULL to restore the default setting.
513 @result TRUE if the configuration was updated; FALSE if an error was encountered.
514 */
515 Boolean
516 SCNetworkInterfaceSetCapability (SCNetworkInterfaceRef interface,
517 CFStringRef capability,
518 CFTypeRef newValue) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/);
519
520 #pragma mark -
521 #pragma mark SCBondInterface configuration (SPIs)
522
523 /*!
524 @function _SCBondInterfaceCopyActive
525 @discussion Returns all Ethernet Bond interfaces on the system.
526 @result The list of SCBondInterface interfaces on the system.
527 You must release the returned value.
528 */
529 CFArrayRef
530 _SCBondInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
531
532 /*!
533 @function _SCBondInterfaceUpdateConfiguration
534 @discussion Updates the bond interface configuration.
535 @param prefs The "preferences" session.
536 @result TRUE if the bond interface configuration was updated.; FALSE if the
537 an error was encountered.
538 */
539 Boolean
540 _SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
541
542 /*!
543 @function SCBondInterfaceGetMode
544 @discussion Return the mode for the given bond interface.
545 @param bond The bond interface to get the mode from.
546 @result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
547 */
548 CFNumberRef
549 SCBondInterfaceGetMode (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
550
551 /*!
552 @function SCBondInterfaceSetMode
553 @discussion Set the mode on the bond interface.
554 @param bond The bond interface on which to adjust the mode.
555 @param mode The mode value (0=IF_BOND_MODE_LACP,1=IF_BOND_MODE_STATIC)
556 @result TRUE if operation succeeded.
557 */
558 Boolean
559 SCBondInterfaceSetMode (SCBondInterfaceRef bond,
560 CFNumberRef mode) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
561
562 #pragma mark -
563 #pragma mark SCBridgeInterface configuration (SPIs)
564
565 /*!
566 @function SCBridgeInterfaceCopyAll
567 @discussion Returns all bridge interfaces on the system.
568 @param prefs The "preferences" session.
569 @result The list of bridge interfaces on the system.
570 You must release the returned value.
571 */
572 CFArrayRef /* of SCBridgeInterfaceRef's */
573 SCBridgeInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
574
575 /*!
576 @function SCBridgeInterfaceCopyAvailableMemberInterfaces
577 @discussion Returns all network capable devices on the system
578 that can be added to an bridge interface.
579 @param prefs The "preferences" session.
580 @result The list of interfaces.
581 You must release the returned value.
582 */
583 CFArrayRef /* of SCNetworkInterfaceRef's */
584 SCBridgeInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
585
586 /*!
587 @function SCBridgeInterfaceCreate
588 @discussion Create a new SCBridgeInterface interface.
589 @param prefs The "preferences" session.
590 @result A reference to the new SCBridgeInterface.
591 You must release the returned value.
592 */
593 SCBridgeInterfaceRef
594 SCBridgeInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
595
596 /*!
597 @function SCBridgeInterfaceRemove
598 @discussion Removes the SCBridgeInterface from the configuration.
599 @param bridge The SCBridgeInterface interface.
600 @result TRUE if the interface was removed; FALSE if an error was encountered.
601 */
602 Boolean
603 SCBridgeInterfaceRemove (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
604
605 /*!
606 @function SCBridgeInterfaceGetMemberInterfaces
607 @discussion Returns the member interfaces for the specified bridge interface.
608 @param bridge The SCBridgeInterface interface.
609 @result The list of interfaces.
610 */
611 CFArrayRef /* of SCNetworkInterfaceRef's */
612 SCBridgeInterfaceGetMemberInterfaces (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
613
614 /*!
615 @function SCBridgeInterfaceGetOptions
616 @discussion Returns the configuration settings associated with a bridge interface.
617 @param bridge The SCBridgeInterface interface.
618 @result The configuration settings associated with the bridge interface;
619 NULL if no changes to the default configuration have been saved.
620 */
621 CFDictionaryRef
622 SCBridgeInterfaceGetOptions (SCBridgeInterfaceRef bridge) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
623
624 /*!
625 @function SCBridgeInterfaceSetMemberInterfaces
626 @discussion Sets the member interfaces for the specified bridge interface.
627 @param bridge The SCBridgeInterface interface.
628 @param members The desired member interfaces.
629 @result TRUE if the configuration was stored; FALSE if an error was encountered.
630 */
631 Boolean
632 SCBridgeInterfaceSetMemberInterfaces (SCBridgeInterfaceRef bridge,
633 CFArrayRef members) /* of SCNetworkInterfaceRef's */
634 __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
635
636 /*!
637 @function SCBridgeInterfaceSetLocalizedDisplayName
638 @discussion Sets the localized display name for the specified bridge interface.
639 @param bridge The SCBridgeInterface interface.
640 @param newName The new display name.
641 @result TRUE if the configuration was stored; FALSE if an error was encountered.
642 */
643 Boolean
644 SCBridgeInterfaceSetLocalizedDisplayName (SCBridgeInterfaceRef bridge,
645 CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
646
647 /*!
648 @function SCBridgeInterfaceSetOptions
649 @discussion Sets the configuration settings for the specified bridge interface.
650 @param bridge The SCBridgeInterface interface.
651 @param newOptions The new configuration settings.
652 @result TRUE if the configuration was stored; FALSE if an error was encountered.
653 */
654 Boolean
655 SCBridgeInterfaceSetOptions (SCBridgeInterfaceRef bridge,
656 CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
657
658 #pragma mark -
659
660 /*!
661 @function _SCBridgeInterfaceCopyActive
662 @discussion Returns all bridge interfaces on the system.
663 @result The list of SCBridgeInterface interfaces on the system.
664 You must release the returned value.
665 */
666 CFArrayRef
667 _SCBridgeInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
668
669 /*!
670 @function _SCBridgeInterfaceUpdateConfiguration
671 @discussion Updates the bridge interface configuration.
672 @param prefs The "preferences" session.
673 @result TRUE if the bridge interface configuration was updated.; FALSE if the
674 an error was encountered.
675 */
676 Boolean
677 _SCBridgeInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/);
678
679
680 #pragma mark -
681 #pragma mark SCVLANInterface configuration (SPIs)
682
683 /*!
684 @function _SCVLANInterfaceCopyActive
685 @discussion Returns all VLAN interfaces on the system.
686 @result The list of SCVLANInterface interfaces on the system.
687 You must release the returned value.
688 */
689 CFArrayRef
690 _SCVLANInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
691
692 /*!
693 @function _SCVLANInterfaceUpdateConfiguration
694 @discussion Updates the VLAN interface configuration.
695 @param prefs The "preferences" session.
696 @result TRUE if the VLAN interface configuration was updated.; FALSE if the
697 an error was encountered.
698 */
699 Boolean
700 _SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0/*SPI*/);
701
702
703 #pragma mark -
704 #pragma mark SCNetworkInterface Password SPIs
705
706
707 enum {
708 kSCNetworkInterfacePasswordTypePPP = 1,
709 kSCNetworkInterfacePasswordTypeIPSecSharedSecret,
710 kSCNetworkInterfacePasswordTypeEAPOL,
711 kSCNetworkInterfacePasswordTypeIPSecXAuth,
712 kSCNetworkInterfacePasswordTypeVPN,
713 };
714 typedef uint32_t SCNetworkInterfacePasswordType;
715
716 Boolean
717 SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface,
718 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
719
720 CFDataRef
721 SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface,
722 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
723
724 Boolean
725 SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface,
726 SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
727
728 Boolean
729 SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface,
730 SCNetworkInterfacePasswordType passwordType,
731 CFDataRef password,
732 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
733
734
735 Boolean
736 SCNetworkInterfaceGetDisableUntilNeeded (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0);
737
738 Boolean
739 SCNetworkInterfaceSetDisableUntilNeeded (SCNetworkInterfaceRef interface,
740 Boolean disable) __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0);
741
742
743 CFDictionaryRef
744 SCNetworkInterfaceGetQoSMarkingPolicy (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0);
745
746 Boolean
747 SCNetworkInterfaceSetQoSMarkingPolicy (SCNetworkInterfaceRef interface,
748 CFDictionaryRef policy) __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0);
749
750
751 #pragma mark -
752 #pragma mark SCNetworkProtocol configuration (SPI)
753
754
755 /*!
756 @group Protocol configuration
757 */
758
759
760 static __inline__ CFTypeRef
761 isA_SCNetworkProtocol(CFTypeRef obj)
762 {
763 return (isA_CFType(obj, SCNetworkProtocolGetTypeID()));
764 }
765
766
767 #pragma mark -
768 #pragma mark SCNetworkService configuration (SPI)
769
770
771 /*!
772 @group Service configuration
773 */
774
775
776 static __inline__ CFTypeRef
777 isA_SCNetworkService(CFTypeRef obj)
778 {
779 return (isA_CFType(obj, SCNetworkServiceGetTypeID()));
780 }
781
782 /*!
783 @function _SCNetworkServiceCompare
784 @discussion Compares two SCNetworkService objects.
785 @param val1 The SCNetworkService object.
786 @param val2 The SCNetworkService object.
787 @param context The service order (from SCNetworkSetGetServiceOrder).
788 @result A comparison result.
789 */
790 CFComparisonResult
791 _SCNetworkServiceCompare (const void *val1,
792 const void *val2,
793 void *context) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
794
795 /*!
796 @function _SCNetworkServiceCopyActive
797 @discussion Returns the network service with the specified identifier.
798
799 Note: The service returned by this SPI differs from the SCNetworkServiceCopy
800 API in that queries and operations interact with the "active" service
801 represented in the SCDynamicStore. Only a limited subset of the
802 SCNetworkService APIs are supported.
803 @param prefs The dynamic store session.
804 @param serviceID The unique identifier for the service.
805 @result A reference to the SCNetworkService represented in the SCDynamicStore;
806 NULL if the serviceID does not exist in the SCDynamicStore or if an
807 error was encountered.
808 You must release the returned value.
809 */
810 SCNetworkServiceRef
811 _SCNetworkServiceCopyActive (SCDynamicStoreRef store,
812 CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_1);
813
814 /*!
815 @function SCNetworkServiceGetPrimaryRank
816 @discussion Returns the primary service rank associated with a service.
817 @param service The network service.
818 @result The primary service rank associated with the specified application;
819 kSCNetworkServicePrimaryRankDefault if no rank is associated with the
820 application or an error was encountered.
821 */
822 SCNetworkServicePrimaryRank
823 SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
824
825 /*!
826 @function SCNetworkServiceSetPrimaryRank
827 @discussion Updates the the primary service rank associated with a service.
828 @param service The network service.
829 @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
830 if the default service rank should be used.
831 @result TRUE if the rank was stored; FALSE if an error was encountered.
832
833 Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
834 values can only valid as a transient setting.
835 */
836 Boolean
837 SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service,
838 SCNetworkServicePrimaryRank newRank) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
839
840 /*!
841 @function _SCNetworkServiceIsVPN
842 @discussion Identifies a VPN service.
843 @param service The network service.
844 @result TRUE if the service is a VPN.
845 */
846 Boolean
847 _SCNetworkServiceIsVPN (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
848
849 /*!
850 @function SCNetworkServiceSetExternalID
851 @discussion Set the external identifier for a network service.
852 @param service A reference to the network service.
853 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to set.
854 @param identifier The new external identifier to assign to the network service.
855 @result Returns TRUE if the external identifier was set successfully, FALSE if an error occurred.
856 */
857 Boolean
858 SCNetworkServiceSetExternalID (SCNetworkServiceRef service,
859 CFStringRef identifierDomain,
860 CFStringRef identifier);
861
862 /*!
863 @function SCNetworkServiceCopyExternalID
864 @discussion Copy the external identifier for a network service.
865 @param service The network service.
866 @param identifierDomain A service can have multiple external identifiers. This string specifies which external identifier to copy.
867 @result Returns the service's external identifier, or NULL if the service does not have an external identifier in the given domain.
868 */
869 CFStringRef
870 SCNetworkServiceCopyExternalID (SCNetworkServiceRef service,
871 CFStringRef identifierDomain);
872
873 /*!
874 @function _SCNetworkServiceSetServiceID
875 @discussion Sets serviceID of the service to a different value provided.
876 @param service The network service
877 @param newServiceID The new service ID
878 @result TRUE if new service ID is set successfully.
879 */
880 Boolean
881 _SCNetworkServiceSetServiceID (SCNetworkServiceRef service,
882 CFStringRef newServiceID) __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
883
884 #pragma mark -
885 #pragma mark SCNetworkSet configuration (SPI)
886
887
888 /*!
889 @group Set configuration
890 */
891
892
893 static __inline__ CFTypeRef
894 isA_SCNetworkSet(CFTypeRef obj)
895 {
896 return (isA_CFType(obj, SCNetworkSetGetTypeID()));
897 }
898
899
900 /*!
901 @function SCNetworkSetCopyAvailableInterfaces
902 @discussion Returns all available interfaces for the set.
903 The interfaces excludes those of bond and bridge members.
904 @param set The network set.
905 @result The list of SCNetworkInterfaces.
906 You must release the returned value.
907 */
908 CFArrayRef
909 SCNetworkSetCopyAvailableInterfaces (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
910
911 /*!
912 @function _SCNetworkSetCreateDefault
913 @discussion Create a new [default] set in the configuration.
914 @param prefs The "preferences" session.
915 @result A reference to the new SCNetworkSet.
916 You must release the returned value.
917 */
918 SCNetworkSetRef
919 _SCNetworkSetCreateDefault (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0/*SPI*/);
920
921 /*!
922 @function SCNetworkSetEstablishDefaultConfiguration
923 @discussion Updates a network set by adding services for
924 any network interface that is not currently
925 represented.
926 If the provided set contains one (or more) services, new
927 services will only be added for those interfaces that are
928 not represented in *any* set.
929 Otherwise, new services will be added for those interfaces
930 that are not represented in the provided set.
931 The new services are established with "default" configuration
932 options.
933 @param set The network set.
934 @result TRUE if the configuration was updated; FALSE if no
935 changes were required or if an error was encountered.
936 */
937 Boolean
938 SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
939
940 /*!
941 @function SCNetworkSetEstablishDefaultInterfaceConfiguration
942 @discussion Updates a network set by adding services for
943 the specified network interface if is not currently
944 represented.
945 If the provided set contains one (or more) services, new
946 services will only be added for interfaces that are not
947 represented in *any* set.
948 Otherwise, new services will be added for interfaces that
949 are not represented in the provided set.
950 The new services are established with "default" configuration
951 options.
952 @param set The network set.
953 @param interface The network interface.
954 @result TRUE if the configuration was updated; FALSE if no
955 changes were required or if an error was encountered.
956 */
957 Boolean
958 SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set,
959 SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
960
961 /*!
962 @function SCNetworkSetCopySelectedVPNService
963 @discussion On the iPhone we only allow a single VPN network service
964 to be selected at any given time. This API will identify
965 the selected VPN service.
966 @param set The network set.
967 @result The selected VPN service; NULL if no service has been
968 selected.
969 You must release the returned value.
970 */
971 SCNetworkServiceRef
972 SCNetworkSetCopySelectedVPNService (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
973
974 /*!
975 @function SCNetworkSetSetSelectedVPNService
976 @discussion On the iPhone we only allow a single VPN network service
977 to be selected at any given time. This API should be used to
978 select a VPN service.
979 @param set The network set.
980 @param service The VPN service to be selected.
981 @result TRUE if the name was saved; FALSE if an error was encountered.
982 */
983 Boolean
984 SCNetworkSetSetSelectedVPNService (SCNetworkSetRef set,
985 SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
986
987 Boolean
988 _SCNetworkSetSetSetID (SCNetworkSetRef set,
989 CFStringRef setID) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
990
991 /*!
992 @group VPN Service configuration
993 */
994
995 #pragma mark -
996 #pragma mark VPN Service configuration
997
998 typedef SCNetworkServiceRef VPNServiceRef;
999
1000 /*!
1001 @function VPNServiceCopyAllMatchingExternalID
1002 @discussion Copy the VPN services with the given external identifier.
1003 @param prefs A reference to the prefs where the VPN services are stored.
1004 @param identifierDomain A service can have multiple external identifiers. This string specifies which one to match with the given identifier.
1005 @param identifier The external identifier of the desired services.
1006 @result A array of references to the VPN services with the given identifier, or NULL if no such service exists
1007 */
1008 CFArrayRef
1009 VPNServiceCopyAllMatchingExternalID (SCPreferencesRef prefs,
1010 CFStringRef identifierDomain,
1011 CFStringRef identifier) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1012
1013 /*!
1014 @function VPNServiceCopyAll
1015 @discussion Copy all VPN services.
1016 @param prefs A reference to the prefs where the VPN services are stored.
1017 @result An array containing VPNServiceRefs for all the VPN services.
1018 */
1019 CFArrayRef
1020 VPNServiceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1021
1022 /*!
1023 @function VPNServiceCopyAppRuleIDs
1024 @discussion Copy all the app rule identifiers for a VPN service.
1025 @param service A reference to the VPN service.
1026 @result An array of CFStringRefs, each string containing the identifier of a app rule in the given service.
1027 */
1028 CFArrayRef
1029 VPNServiceCopyAppRuleIDs (VPNServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1030
1031 /*!
1032 @function VPNServiceSetAppRule
1033 @discussion Add or modify an app rule in a VPN service. The ruleSettings dictionary must contain one of the following keys:
1034 <pre>kSCValNetVPNAppRuleExecutableMatch</pre>
1035 <pre>kSCValNetVPNAppRuleAccountIdentifierMatch</pre>
1036 The ruleSettings dictionary may also contain the following keys:
1037 <pre>kSCValNetVPNAppRuleDNSDomainMatch</pre>
1038 See SCSchemaDefinitionsPrivate.h for more details.
1039 @param service A reference to the VPN service.
1040 @param ruleIdentifier The identifier of the new app rule.
1041 @param ruleSettings The settings for the new app rule. See the dictionary keys defined above.
1042 @result TRUE if the app rule was set successfully, FALSE if an error occurred.
1043 */
1044 Boolean
1045 VPNServiceSetAppRule (VPNServiceRef service,
1046 CFStringRef ruleIdentifier,
1047 CFDictionaryRef ruleSettings) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1048
1049 /*!
1050 @function VPNServiceCopyAppRule
1051 @discussion Copy the settings for a app rule in a VPN service.
1052 @param service The app tunnel service.
1053 @param ruleIdentifier The ID of the app rule.
1054 @result The rule settings, or NULL if the app rule could not be found.
1055 */
1056 CFDictionaryRef
1057 VPNServiceCopyAppRule (VPNServiceRef service,
1058 CFStringRef ruleIdentifier) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1059
1060 /*!
1061 @function VPNServiceRemoveAppRule
1062 @discussion Remove an app rule from a VPN service.
1063 @param service The VPN service.
1064 @param ruleIdentifier The ID of the app rule to remove.
1065 @result Returns TRUE if the app rule was removed successfully; FALSE otherwise.
1066 */
1067 Boolean
1068 VPNServiceRemoveAppRule (VPNServiceRef service,
1069 CFStringRef ruleIdentifier) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1070
1071 /*!
1072 @function VPNServiceIsManagedAppVPN
1073 @discussion Check to see if a VPN service is a managed App VPN service
1074 @param service The VPN servie.
1075 @result Returns TRUE if the service is a managed App VPN service; FALSE otherwise.
1076 */
1077 Boolean
1078 VPNServiceIsManagedAppVPN (VPNServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/);
1079
1080 /*!
1081 @group Migration SPI
1082 */
1083 #pragma mark -
1084 #pragma mark Migration SPI
1085
1086 extern const CFStringRef kSCNetworkConfigurationRepair /* CFBoolean */ __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
1087
1088 extern const CFStringRef kSCNetworkConfigurationMigrationActionKey /* CFNumber */ __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
1089
1090 typedef CF_ENUM(uint32_t, SCNetworkConfigurationMigrationAction) {
1091 kSCNetworkConfigurationMigrationAction_CleanInstall = 0,
1092 kSCNetworkConfigurationMigrationAction_Upgrade = 1,
1093 kSCNetworkConfigurationMigrationAction_Restore = 2,
1094 };
1095
1096 /*!
1097 @function _SCNetworkConfigurationCopyMigrationPaths
1098 @result Returns an array of paths that we would need from the source
1099 */
1100 CFArrayRef
1101 _SCNetworkConfigurationCopyMigrationPaths(CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
1102
1103 /*!
1104 @function _SCNetworkConfigurationPerformMigration
1105 @discussion Updates the network configuration of the target system with
1106 configurations from previous system. Both sourceDir and targetDir
1107 cannot be NULL, since NULL indicates API to look at the local system
1108 @param sourceDir A reference which points to the root of a directory populated
1109 with the list of requested directories/path from the "source" volume. Passing NULL
1110 will indicate that sourceDir should point to local system
1111 @param currentDir A reference which points to the root of a directory populated
1112 with the list of requested directories/path from the "destination" volume. Passing
1113 NULL will indicate that currentDir should point to local system.
1114 @param targetDir A reference which points to the root of a directory that we
1115 will populate (update) with new configuration. Passing NULL will mean that we want to
1116 migrate to the currentDir. If not NULL, then this path should exist.
1117 @param options Argument which will tell us what action we are supposed to take
1118 (clean-install, upgrade, migrate/restore settings from another system, ...)
1119 @result Returns array which would consist of those paths that should be moved
1120 from the "targetDir" directory to destination volume. You must release the returned value.
1121 */
1122
1123 CF_RETURNS_RETAINED
1124 CFArrayRef
1125 _SCNetworkConfigurationPerformMigration(CFURLRef sourceDir,
1126 CFURLRef currentDir,
1127 CFURLRef targetDir,
1128 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
1129
1130
1131 /*!
1132 @function _SCNetworkConfigurationCheckValidity
1133 @discussion Verifies whether the configuration files present in the specified
1134 directory have valid mappings or not
1135 @param configDir A reference which points to the directory where the configuration
1136 files are present
1137 @result TRUE if valid configurations are found
1138
1139 */
1140
1141 Boolean
1142 _SCNetworkConfigurationCheckValidity(CFURLRef configDir,
1143 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
1144
1145
1146 /*!
1147 @function _SCNetworkConfigurationCheckValidityWithPreferences
1148 @discussion Validates the specified preferences.plist against NetworkInterfaces.plist
1149 @param prefs the preferences ref pointing to the said preferences.plist
1150 @param ni_prefs the preferences ref pointing to the said NetworkInterfaces.plist
1151 @result TRUE if the configurations are valid against each other
1152
1153 */
1154
1155 Boolean
1156 _SCNetworkConfigurationCheckValidityWithPreferences (SCPreferencesRef prefs,
1157 SCPreferencesRef ni_prefs,
1158 CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
1159
1160
1161 /*!
1162 @function _SCNetworkMigrationAreConfigurationsIdentical
1163 @discussion Compares the migration output between network configurations
1164 with the expected output.
1165 @param configPref Preferences pointing toward preferences.plist file to
1166 be compared with expected file.
1167 @param configNetworkInterfacePref Preferences pointing toward NetworkInterfaces.plist
1168 file to be compared with expected file.
1169 @param expectedConfigPref Preferences pointing toward preferences.plist file
1170 which is the expected result.
1171 @param expectedNetworkInterfacePref Preferences pointing toward NetworkInterfaces.plist
1172 file which is the expected file.
1173 @result TRUE if configurations match with the expected configurations
1174
1175 */
1176
1177 Boolean
1178 _SCNetworkMigrationAreConfigurationsIdentical (CFURLRef configurationURL,
1179 CFURLRef expectedConfigurationURL)
1180 __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
1181
1182 /*!
1183 @function _SCNetworkConfigurationCopyMigrationRemovePaths
1184 @discussion List of paths to files which we want to be removed from the target filesystem after migration
1185 @param targetPaths the CFArray returned by _SCNetworkConfigurationPerformMigration
1186 @param targetDir the CFURL passed to _SCNetworkConfigurationPerformMigration
1187 @result An array of CFURL's; NULL if no paths need to be removed from the target filesystem
1188
1189 */
1190
1191 CFArrayRef // of CFURLRef's
1192 _SCNetworkConfigurationCopyMigrationRemovePaths (CFArrayRef targetPaths,
1193 CFURLRef targetDir) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
1194
1195 __END_DECLS
1196 #endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */