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
;
144 int sort_order
; // sort order for this interface
146 #if !TARGET_OS_IPHONE
147 // for BOND interfaces
148 Boolean supportsBond
;
150 CFArrayRef interfaces
;
151 CFDictionaryRef options
;
155 // for VLAN interfaces
156 Boolean supportsVLAN
;
158 SCNetworkInterfaceRef interface
;
159 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
160 CFDictionaryRef options
;
162 #endif // !TARGET_OS_IPHONE
164 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
171 #pragma mark SCNetworkInterface configuration (internal)
175 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
177 SCNetworkInterfacePrivateRef
178 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
179 SCNetworkInterfaceRef interface
,
180 SCPreferencesRef prefs
,
181 CFStringRef serviceID
);
183 SCNetworkInterfacePrivateRef
184 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
185 SCNetworkInterfaceRef interface
,
186 SCPreferencesRef prefs
,
187 CFStringRef serviceID
,
190 #if !TARGET_OS_IPHONE
191 SCNetworkInterfacePrivateRef
192 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
193 CFStringRef bond_if
);
195 SCNetworkInterfacePrivateRef
196 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
197 CFStringRef vlan_if
);
198 #endif // !TARGET_OS_IPHONE
201 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
204 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set
,
205 SCNetworkInterfaceRef interface
);
208 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface
);
211 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface
);
214 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
217 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
220 __SCNetworkInterfaceIsValidExtendedConfigurationType
221 (SCNetworkInterfaceRef interface
,
222 CFStringRef extendedType
,
223 Boolean requirePerInterface
);
226 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
227 CFStringRef interfaceType
);
230 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
233 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
234 CFStringRef extendedType
,
235 CFDictionaryRef config
,
239 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set
,
240 SCNetworkInterfaceRef interface
,
243 #if !TARGET_OS_IPHONE
245 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
248 __SCBondInterfaceListCopyMembers (CFArrayRef interfaces
,
249 CFMutableSetRef set
);
250 #endif // !TARGET_OS_IPHONE
253 #pragma mark SCNetworkProtocol configuration (internal)
256 SCNetworkProtocolPrivateRef
257 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
258 CFStringRef entityID
,
259 SCNetworkServiceRef service
);
262 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
266 #pragma mark SCNetworkService configuration (internal)
269 SCNetworkServicePrivateRef
270 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
271 SCPreferencesRef prefs
,
272 CFStringRef serviceID
,
273 SCNetworkInterfaceRef interface
);
277 #pragma mark SCNetworkSet configuration (internal)
281 #pragma mark Miscellaneous (internal)
285 __copyInterfaceTemplate (CFStringRef interfaceType
,
286 CFStringRef childInterfaceType
);
289 __copyProtocolTemplate (CFStringRef interfaceType
,
290 CFStringRef childInterfaceType
,
291 CFStringRef protocolType
);
294 __getPrefsConfiguration (SCPreferencesRef prefs
,
298 __setPrefsConfiguration (SCPreferencesRef prefs
,
300 CFDictionaryRef config
,
301 Boolean keepInactive
);
304 __getPrefsEnabled (SCPreferencesRef prefs
,
308 __setPrefsEnabled (SCPreferencesRef prefs
,
313 __createInterface (int s
,
314 CFStringRef interface
);
317 __destroyInterface (int s
,
318 CFStringRef interface
);
321 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
322 (SCPreferencesRef prefs
,
326 __extract_password (SCPreferencesRef prefs
,
327 CFDictionaryRef config
,
328 CFStringRef passwordKey
,
329 CFStringRef encryptionKey
,
330 CFStringRef encryptionKeyChainValue
,
331 CFStringRef unique_id
,
332 CFDataRef
*password
);
335 __remove_password (SCPreferencesRef prefs
,
336 CFDictionaryRef config
,
337 CFStringRef passwordKey
,
338 CFStringRef encryptionKey
,
339 CFStringRef encryptionKeyChainValue
,
340 CFStringRef unique_id
,
341 CFDictionaryRef
*newConfig
);
345 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */