2 * Copyright (c) 2004-2009 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 <IOKit/IOKitLib.h>
37 // base CFType information
44 SCPreferencesRef prefs
;
52 } SCNetworkSetPrivate
, *SCNetworkSetPrivateRef
;
57 // base CFType information
61 CFStringRef serviceID
;
64 SCNetworkInterfaceRef interface
;
67 SCPreferencesRef prefs
;
69 // store (for live SCNetworkService)
70 SCDynamicStoreRef store
;
75 } SCNetworkServicePrivate
, *SCNetworkServicePrivateRef
;
80 // base CFType information
87 SCNetworkServiceRef service
;
89 } SCNetworkProtocolPrivate
, *SCNetworkProtocolPrivateRef
;
94 // base CFType information
97 // interface information
98 CFStringRef interface_type
; // interface type
100 // [non-localized] name
101 CFStringRef name
; // non-localized [display] name
104 CFStringRef localized_name
; // localized [display] name
105 CFStringRef localized_key
;
106 CFStringRef localized_arg1
;
107 CFStringRef localized_arg2
;
109 // [layered] interface
110 SCNetworkInterfaceRef interface
;
112 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
113 SCPreferencesRef prefs
;
115 // serviceID (NULL if not associated with a service)
116 CFStringRef serviceID
;
118 // unsaved configuration (when prefs not [yet] available)
119 CFMutableDictionaryRef unsaved
;
121 // [SCPreferences] interface entity information
122 CFStringRef entity_device
; // interface device
123 CFStringRef entity_device_unique
; // ... UniqueIdentifier
124 CFStringRef entity_type
; // interface type
125 CFStringRef entity_subtype
; // interface subtype
127 // configuration information
128 CFMutableArrayRef supported_interface_types
;
129 CFMutableArrayRef supported_protocol_types
;
131 // IORegistry (service plane) information
133 CFStringRef addressString
;
135 CFStringRef configurationAction
;
136 CFStringRef location
;
138 CFMutableDictionaryRef overrides
;
149 int sort_order
; // sort order for this interface
151 #if !TARGET_OS_IPHONE
152 // for BOND interfaces
153 Boolean supportsBond
;
155 CFArrayRef interfaces
;
156 CFDictionaryRef options
;
160 // for VLAN interfaces
161 Boolean supportsVLAN
;
163 SCNetworkInterfaceRef interface
;
164 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
165 CFDictionaryRef options
;
167 #endif // !TARGET_OS_IPHONE
169 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
176 #pragma mark SCNetworkInterface configuration (internal)
180 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
182 SCNetworkInterfacePrivateRef
183 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
184 SCNetworkInterfaceRef interface
,
185 SCPreferencesRef prefs
,
186 CFStringRef serviceID
);
188 SCNetworkInterfacePrivateRef
189 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
190 SCNetworkInterfaceRef interface
,
191 SCPreferencesRef prefs
,
192 CFStringRef serviceID
,
195 #if !TARGET_OS_IPHONE
196 SCNetworkInterfacePrivateRef
197 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
198 CFStringRef bond_if
);
200 SCNetworkInterfacePrivateRef
201 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
202 CFStringRef vlan_if
);
203 #endif // !TARGET_OS_IPHONE
206 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
209 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set
,
210 SCNetworkInterfaceRef interface
);
213 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface
);
216 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface
);
219 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
222 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
225 __SCNetworkInterfaceIsValidExtendedConfigurationType
226 (SCNetworkInterfaceRef interface
,
227 CFStringRef extendedType
,
228 Boolean requirePerInterface
);
231 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
232 CFStringRef interfaceType
);
235 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
238 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
239 CFStringRef extendedType
,
240 CFDictionaryRef config
,
244 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set
,
245 SCNetworkInterfaceRef interface
,
248 #if !TARGET_OS_IPHONE
250 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
253 __SCBondInterfaceListCopyMembers (CFArrayRef interfaces
,
254 CFMutableSetRef set
);
255 #endif // !TARGET_OS_IPHONE
258 #pragma mark SCNetworkProtocol configuration (internal)
261 SCNetworkProtocolPrivateRef
262 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
263 CFStringRef entityID
,
264 SCNetworkServiceRef service
);
267 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
271 #pragma mark SCNetworkService configuration (internal)
274 SCNetworkServicePrivateRef
275 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
276 SCPreferencesRef prefs
,
277 CFStringRef serviceID
,
278 SCNetworkInterfaceRef interface
);
282 #pragma mark SCNetworkSet configuration (internal)
286 #pragma mark Miscellaneous (internal)
290 __copyInterfaceTemplate (CFStringRef interfaceType
,
291 CFStringRef childInterfaceType
);
294 __copyProtocolTemplate (CFStringRef interfaceType
,
295 CFStringRef childInterfaceType
,
296 CFStringRef protocolType
);
299 __getPrefsConfiguration (SCPreferencesRef prefs
,
303 __setPrefsConfiguration (SCPreferencesRef prefs
,
305 CFDictionaryRef config
,
306 Boolean keepInactive
);
309 __getPrefsEnabled (SCPreferencesRef prefs
,
313 __setPrefsEnabled (SCPreferencesRef prefs
,
318 __createInterface (int s
,
319 CFStringRef interface
);
322 __destroyInterface (int s
,
323 CFStringRef interface
);
326 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
327 (SCPreferencesRef prefs
,
331 __extract_password (SCPreferencesRef prefs
,
332 CFDictionaryRef config
,
333 CFStringRef passwordKey
,
334 CFStringRef encryptionKey
,
335 CFStringRef encryptionKeyChainValue
,
336 CFStringRef unique_id
,
337 CFDataRef
*password
);
340 __remove_password (SCPreferencesRef prefs
,
341 CFDictionaryRef config
,
342 CFStringRef passwordKey
,
343 CFStringRef encryptionKey
,
344 CFStringRef encryptionKeyChainValue
,
345 CFStringRef unique_id
,
346 CFDictionaryRef
*newConfig
);
350 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */