2 * Copyright (c) 2004-2011 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 } SCNetworkServicePrivate
, *SCNetworkServicePrivateRef
;
81 // base CFType information
88 SCNetworkServiceRef service
;
90 } SCNetworkProtocolPrivate
, *SCNetworkProtocolPrivateRef
;
95 // base CFType information
98 // interface information
99 CFStringRef interface_type
; // interface type
101 // [non-localized] name
102 CFStringRef name
; // non-localized [display] name
105 CFStringRef localized_name
; // localized [display] name
106 CFStringRef localized_key
;
107 CFStringRef localized_arg1
;
108 CFStringRef localized_arg2
;
110 // [layered] interface
111 SCNetworkInterfaceRef interface
;
113 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
114 SCPreferencesRef prefs
;
117 SCDynamicStoreRef store
;
119 // serviceID (NULL if not associated with a service)
120 CFStringRef serviceID
;
122 // unsaved configuration (when prefs not [yet] available)
123 CFMutableDictionaryRef unsaved
;
125 // [SCPreferences] interface entity information
126 CFStringRef entity_device
; // interface device
127 CFStringRef entity_device_unique
; // ... UniqueIdentifier
128 CFStringRef entity_type
; // interface type
129 CFStringRef entity_subtype
; // interface subtype
131 // configuration information
132 CFMutableArrayRef supported_interface_types
;
133 CFMutableArrayRef supported_protocol_types
;
135 // IORegistry (service plane) information
137 CFStringRef addressString
;
139 CFStringRef configurationAction
;
141 CFStringRef location
;
144 CFMutableDictionaryRef overrides
;
155 int sort_order
; // sort order for this interface
157 // for BOND interfaces
158 Boolean supportsBond
;
160 CFArrayRef interfaces
;
161 CFDictionaryRef options
;
165 // for Bridge interfaces
166 Boolean supportsBridge
;
168 CFArrayRef interfaces
;
169 CFDictionaryRef options
;
172 // for VLAN interfaces
173 Boolean supportsVLAN
;
175 SCNetworkInterfaceRef interface
;
176 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
177 CFDictionaryRef options
;
180 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
187 #pragma mark SCNetworkInterface configuration (internal)
191 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
193 SCNetworkInterfacePrivateRef
194 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
195 SCNetworkInterfaceRef interface
,
196 SCPreferencesRef prefs
,
197 CFStringRef serviceID
);
199 SCNetworkInterfacePrivateRef
200 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
201 SCNetworkInterfaceRef interface
,
202 SCPreferencesRef prefs
,
203 CFStringRef serviceID
);
205 SCNetworkInterfacePrivateRef
206 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
207 CFStringRef bond_if
);
209 SCNetworkInterfacePrivateRef
210 _SCBridgeInterfaceCreatePrivate (CFAllocatorRef allocator
,
211 CFStringRef bridge_if
);
213 SCNetworkInterfacePrivateRef
214 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
215 CFStringRef vlan_if
);
218 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
221 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set
,
222 SCNetworkInterfaceRef interface
);
224 #if !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
226 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface
);
229 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface
);
230 #endif // !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
233 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
235 CFDictionaryRef capability_options
);
238 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
239 CFDictionaryRef media_options
);
242 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
245 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
248 __SCNetworkInterfaceIsMember (SCPreferencesRef prefs
,
249 SCNetworkInterfaceRef interface
);
252 __SCNetworkInterfaceIsValidExtendedConfigurationType
253 (SCNetworkInterfaceRef interface
,
254 CFStringRef extendedType
,
255 Boolean requirePerInterface
);
258 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
259 CFStringRef overrideType
);
262 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
265 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
266 CFStringRef extendedType
,
267 CFDictionaryRef config
,
271 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set
,
272 SCNetworkInterfaceRef interface
,
276 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
279 __SCBondInterfaceListCollectMembers (CFArrayRef interfaces
,
280 CFMutableSetRef set
);
283 __SCBridgeInterfaceListCollectMembers (CFArrayRef interfaces
,
284 CFMutableSetRef set
);
287 #pragma mark SCNetworkProtocol configuration (internal)
290 SCNetworkProtocolPrivateRef
291 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
292 CFStringRef entityID
,
293 SCNetworkServiceRef service
);
296 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
300 #pragma mark SCNetworkService configuration (internal)
303 CFArrayRef
/* of SCNetworkServiceRef's */
304 __SCNetworkServiceCopyAllEnabled (SCPreferencesRef prefs
);
306 SCNetworkServicePrivateRef
307 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
308 SCPreferencesRef prefs
,
309 CFStringRef serviceID
,
310 SCNetworkInterfaceRef interface
);
313 __SCNetworkServiceExistsForInterface (CFArrayRef services
,
314 SCNetworkInterfaceRef interface
);
318 __SCNetworkServiceNextName (SCNetworkServiceRef service
);
322 #pragma mark SCNetworkSet configuration (internal)
326 #pragma mark Miscellaneous (internal)
330 __copyInterfaceTemplate (CFStringRef interfaceType
,
331 CFStringRef childInterfaceType
);
334 __copyProtocolTemplate (CFStringRef interfaceType
,
335 CFStringRef childInterfaceType
,
336 CFStringRef protocolType
);
339 __getPrefsConfiguration (SCPreferencesRef prefs
,
343 __setPrefsConfiguration (SCPreferencesRef prefs
,
345 CFDictionaryRef config
,
346 Boolean keepInactive
);
349 __getPrefsEnabled (SCPreferencesRef prefs
,
353 __setPrefsEnabled (SCPreferencesRef prefs
,
358 __createInterface (int s
,
359 CFStringRef interface
);
362 __destroyInterface (int s
,
363 CFStringRef interface
);
366 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
367 (SCPreferencesRef prefs
,
371 __extract_password (SCPreferencesRef prefs
,
372 CFDictionaryRef config
,
373 CFStringRef passwordKey
,
374 CFStringRef encryptionKey
,
375 CFStringRef encryptionKeyChainValue
,
376 CFStringRef unique_id
,
377 CFDataRef
*password
);
380 __remove_password (SCPreferencesRef prefs
,
381 CFDictionaryRef config
,
382 CFStringRef passwordKey
,
383 CFStringRef encryptionKey
,
384 CFStringRef encryptionKeyChainValue
,
385 CFStringRef unique_id
,
386 CFDictionaryRef
*newConfig
);
389 __rank_to_str (SCNetworkServicePrimaryRank rank
,
390 CFStringRef
*rankStr
);
393 __str_to_rank (CFStringRef rankStr
,
394 SCNetworkServicePrimaryRank
*rank
);
398 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */