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 <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
;
137 CFStringRef location
;
140 CFMutableDictionaryRef overrides
;
151 int sort_order
; // sort order for this interface
153 // for BOND interfaces
154 Boolean supportsBond
;
156 CFArrayRef interfaces
;
157 CFDictionaryRef options
;
161 // for Bridge interfaces
162 Boolean supportsBridge
;
164 CFArrayRef interfaces
;
165 CFDictionaryRef options
;
168 // for VLAN interfaces
169 Boolean supportsVLAN
;
171 SCNetworkInterfaceRef interface
;
172 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
173 CFDictionaryRef options
;
176 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
183 #pragma mark SCNetworkInterface configuration (internal)
187 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
189 SCNetworkInterfacePrivateRef
190 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
191 SCNetworkInterfaceRef interface
,
192 SCPreferencesRef prefs
,
193 CFStringRef serviceID
);
195 SCNetworkInterfacePrivateRef
196 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
197 SCNetworkInterfaceRef interface
,
198 SCPreferencesRef prefs
,
199 CFStringRef serviceID
);
201 SCNetworkInterfacePrivateRef
202 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
203 CFStringRef bond_if
);
205 SCNetworkInterfacePrivateRef
206 _SCBridgeInterfaceCreatePrivate (CFAllocatorRef allocator
,
207 CFStringRef bridge_if
);
209 SCNetworkInterfacePrivateRef
210 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
211 CFStringRef vlan_if
);
214 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
217 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set
,
218 SCNetworkInterfaceRef interface
);
220 #if !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
222 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface
);
225 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface
);
226 #endif // !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
229 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface
,
231 CFDictionaryRef capability_options
);
234 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface
,
235 CFDictionaryRef media_options
);
238 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
241 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
244 __SCNetworkInterfaceIsMember (SCPreferencesRef prefs
,
245 SCNetworkInterfaceRef interface
);
248 __SCNetworkInterfaceIsValidExtendedConfigurationType
249 (SCNetworkInterfaceRef interface
,
250 CFStringRef extendedType
,
251 Boolean requirePerInterface
);
254 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
255 CFStringRef overrideType
);
258 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
261 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
262 CFStringRef extendedType
,
263 CFDictionaryRef config
,
267 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set
,
268 SCNetworkInterfaceRef interface
,
272 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
275 __SCBondInterfaceListCollectMembers (CFArrayRef interfaces
,
276 CFMutableSetRef set
);
279 __SCBridgeInterfaceListCollectMembers (CFArrayRef interfaces
,
280 CFMutableSetRef set
);
283 #pragma mark SCNetworkProtocol configuration (internal)
286 SCNetworkProtocolPrivateRef
287 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
288 CFStringRef entityID
,
289 SCNetworkServiceRef service
);
292 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
296 #pragma mark SCNetworkService configuration (internal)
299 CFArrayRef
/* of SCNetworkServiceRef's */
300 __SCNetworkServiceCopyAllEnabled (SCPreferencesRef prefs
);
302 SCNetworkServicePrivateRef
303 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
304 SCPreferencesRef prefs
,
305 CFStringRef serviceID
,
306 SCNetworkInterfaceRef interface
);
309 __SCNetworkServiceExistsForInterface (CFArrayRef services
,
310 SCNetworkInterfaceRef interface
);
313 __SCNetworkServiceNextName (SCNetworkServiceRef service
);
317 #pragma mark SCNetworkSet configuration (internal)
321 #pragma mark Miscellaneous (internal)
325 __copyInterfaceTemplate (CFStringRef interfaceType
,
326 CFStringRef childInterfaceType
);
329 __copyProtocolTemplate (CFStringRef interfaceType
,
330 CFStringRef childInterfaceType
,
331 CFStringRef protocolType
);
334 __getPrefsConfiguration (SCPreferencesRef prefs
,
338 __setPrefsConfiguration (SCPreferencesRef prefs
,
340 CFDictionaryRef config
,
341 Boolean keepInactive
);
344 __getPrefsEnabled (SCPreferencesRef prefs
,
348 __setPrefsEnabled (SCPreferencesRef prefs
,
353 __createInterface (int s
,
354 CFStringRef interface
);
357 __destroyInterface (int s
,
358 CFStringRef interface
);
361 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
362 (SCPreferencesRef prefs
,
366 __extract_password (SCPreferencesRef prefs
,
367 CFDictionaryRef config
,
368 CFStringRef passwordKey
,
369 CFStringRef encryptionKey
,
370 CFStringRef encryptionKeyChainValue
,
371 CFStringRef unique_id
,
372 CFDataRef
*password
);
375 __remove_password (SCPreferencesRef prefs
,
376 CFDictionaryRef config
,
377 CFStringRef passwordKey
,
378 CFStringRef encryptionKey
,
379 CFStringRef encryptionKeyChainValue
,
380 CFStringRef unique_id
,
381 CFDictionaryRef
*newConfig
);
385 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */