2 * Copyright (c) 2004-2013 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCNETWORKCONFIGURATIONINTERNAL_H
25 #define _SCNETWORKCONFIGURATIONINTERNAL_H
28 #include <CoreFoundation/CoreFoundation.h>
29 #include <CoreFoundation/CFRuntime.h>
30 #include <SystemConfiguration/SystemConfiguration.h>
31 #include <SystemConfiguration/SCPreferencesPathKey.h>
32 #include <SystemConfiguration/SCNetworkConfigurationPrivate.h>
33 #include <IOKit/IOKitLib.h>
38 // base CFType information
45 SCPreferencesRef prefs
;
53 } SCNetworkSetPrivate
, *SCNetworkSetPrivateRef
;
58 // base CFType information
62 CFStringRef serviceID
;
65 SCNetworkInterfaceRef interface
;
68 SCPreferencesRef prefs
;
70 // store (for live SCNetworkService)
71 SCDynamicStoreRef store
;
76 // external identifiers
77 CFMutableDictionaryRef externalIDs
;
79 } SCNetworkServicePrivate
, *SCNetworkServicePrivateRef
;
84 // base CFType information
91 SCNetworkServiceRef service
;
93 } SCNetworkProtocolPrivate
, *SCNetworkProtocolPrivateRef
;
98 // base CFType information
101 // interface information
102 CFStringRef interface_type
; // interface type
104 // [non-localized] name
105 CFStringRef name
; // non-localized [display] name
108 CFStringRef localized_name
; // localized [display] name
109 CFStringRef localized_key
;
110 CFStringRef localized_arg1
;
111 CFStringRef localized_arg2
;
113 // [layered] interface
114 SCNetworkInterfaceRef interface
;
116 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
117 SCPreferencesRef prefs
;
120 SCDynamicStoreRef store
;
122 // serviceID (NULL if not associated with a service)
123 CFStringRef serviceID
;
125 // unsaved configuration (when prefs not [yet] available)
126 CFMutableDictionaryRef unsaved
;
128 // [SCPreferences] interface entity information
129 CFStringRef entity_device
; // interface device
130 CFStringRef entity_device_unique
; // ... UniqueIdentifier
131 CFStringRef entity_type
; // interface type
132 CFStringRef entity_subtype
; // interface subtype
134 // configuration information
135 CFMutableArrayRef supported_interface_types
;
136 CFMutableArrayRef supported_protocol_types
;
138 // IORegistry (service plane) information
140 CFStringRef addressString
;
142 CFStringRef configurationAction
;
144 CFStringRef location
;
147 CFMutableDictionaryRef overrides
;
159 int sort_order
; // sort order for this interface
161 // for BOND interfaces
162 Boolean supportsBond
;
164 CFArrayRef interfaces
;
166 CFDictionaryRef options
;
169 // for Bridge interfaces
170 Boolean supportsBridge
;
172 CFArrayRef interfaces
;
173 CFDictionaryRef options
;
176 // for VLAN interfaces
177 Boolean supportsVLAN
;
179 SCNetworkInterfaceRef interface
;
180 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
181 CFDictionaryRef options
;
184 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
191 #pragma mark SCNetworkInterface configuration (internal)
195 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
197 SCNetworkInterfacePrivateRef
198 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
199 SCNetworkInterfaceRef interface
,
200 SCPreferencesRef prefs
,
201 CFStringRef serviceID
);
203 SCNetworkInterfacePrivateRef
204 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
205 SCNetworkInterfaceRef interface
,
206 SCPreferencesRef prefs
,
207 CFStringRef serviceID
);
209 SCNetworkInterfacePrivateRef
210 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
211 CFStringRef bond_if
);
213 SCNetworkInterfacePrivateRef
214 _SCBridgeInterfaceCreatePrivate (CFAllocatorRef allocator
,
215 CFStringRef bridge_if
);
217 SCNetworkInterfacePrivateRef
218 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
219 CFStringRef vlan_if
);
222 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
225 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set
,
226 SCNetworkInterfaceRef interface
);
228 #if !TARGET_OS_IPHONE
230 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface
);
233 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface
);
234 #endif // !TARGET_OS_IPHONE
237 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
239 CFDictionaryRef capability_options
);
242 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
243 CFDictionaryRef media_options
);
246 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
249 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
252 __SCNetworkInterfaceIsMember (SCPreferencesRef prefs
,
253 SCNetworkInterfaceRef interface
);
256 __SCNetworkInterfaceIsValidExtendedConfigurationType
257 (SCNetworkInterfaceRef interface
,
258 CFStringRef extendedType
,
259 Boolean requirePerInterface
);
262 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
263 CFStringRef overrideType
);
266 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
269 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
270 CFStringRef extendedType
,
271 CFDictionaryRef config
,
275 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set
,
276 SCNetworkInterfaceRef interface
,
280 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
283 __SCBondInterfaceListCollectMembers (CFArrayRef interfaces
,
284 CFMutableSetRef set
);
287 __SCBridgeInterfaceListCollectMembers (CFArrayRef interfaces
,
288 CFMutableSetRef set
);
291 #pragma mark SCNetworkProtocol configuration (internal)
294 SCNetworkProtocolPrivateRef
295 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
296 CFStringRef entityID
,
297 SCNetworkServiceRef service
);
300 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
304 #pragma mark SCNetworkService configuration (internal)
307 CFArrayRef
/* of SCNetworkServiceRef's */
308 __SCNetworkServiceCopyAllEnabled (SCPreferencesRef prefs
);
310 SCNetworkServicePrivateRef
311 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
312 SCPreferencesRef prefs
,
313 CFStringRef serviceID
,
314 SCNetworkInterfaceRef interface
);
317 __SCNetworkServiceExistsForInterface (CFArrayRef services
,
318 SCNetworkInterfaceRef interface
);
322 __SCNetworkServiceNextName (SCNetworkServiceRef service
);
326 #pragma mark SCNetworkSet configuration (internal)
330 #pragma mark Miscellaneous (internal)
334 __copyInterfaceTemplate (CFStringRef interfaceType
,
335 CFStringRef childInterfaceType
);
338 __copyProtocolTemplate (CFStringRef interfaceType
,
339 CFStringRef childInterfaceType
,
340 CFStringRef protocolType
);
343 __getPrefsConfiguration (SCPreferencesRef prefs
,
347 __setPrefsConfiguration (SCPreferencesRef prefs
,
349 CFDictionaryRef config
,
350 Boolean keepInactive
);
353 __getPrefsEnabled (SCPreferencesRef prefs
,
357 __setPrefsEnabled (SCPreferencesRef prefs
,
362 __createInterface (int s
,
363 CFStringRef interface
);
366 __destroyInterface (int s
,
367 CFStringRef interface
);
370 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
371 (SCPreferencesRef prefs
,
375 __extract_password (SCPreferencesRef prefs
,
376 CFDictionaryRef config
,
377 CFStringRef passwordKey
,
378 CFStringRef encryptionKey
,
379 CFStringRef encryptionKeyChainValue
,
380 CFStringRef unique_id
,
381 CFDataRef
*password
);
384 __remove_password (SCPreferencesRef prefs
,
385 CFDictionaryRef config
,
386 CFStringRef passwordKey
,
387 CFStringRef encryptionKey
,
388 CFStringRef encryptionKeyChainValue
,
389 CFStringRef unique_id
,
390 CFDictionaryRef
*newConfig
);
393 __rank_to_str (SCNetworkServicePrimaryRank rank
,
394 CFStringRef
*rankStr
);
397 __str_to_rank (CFStringRef rankStr
,
398 SCNetworkServicePrimaryRank
*rank
);
402 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */