2 * Copyright (c) 2004-2007 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 <sys/cdefs.h>
29 #include <CoreFoundation/CoreFoundation.h>
30 #include <CoreFoundation/CFRuntime.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32 #include <SystemConfiguration/SCPreferencesPathKey.h>
33 #include <IOKit/IOKitLib.h>
38 // base CFType information
45 SCPreferencesRef prefs
;
50 } SCNetworkSetPrivate
, *SCNetworkSetPrivateRef
;
55 // base CFType information
59 CFStringRef serviceID
;
62 SCNetworkInterfaceRef interface
;
65 SCPreferencesRef prefs
;
67 } SCNetworkServicePrivate
, *SCNetworkServicePrivateRef
;
72 // base CFType information
79 SCNetworkServiceRef service
;
81 } SCNetworkProtocolPrivate
, *SCNetworkProtocolPrivateRef
;
86 // base CFType information
89 // interface information
90 CFStringRef interface_type
; // interface type
92 // [non-localized] name
93 CFStringRef name
; // non-localized [display] name
96 CFStringRef localized_name
; // localized [display] name
97 CFStringRef localized_key
;
98 CFStringRef localized_arg1
;
99 CFStringRef localized_arg2
;
101 // [layered] interface
102 SCNetworkInterfaceRef interface
;
104 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
105 SCPreferencesRef prefs
;
107 // serviceID (NULL if not associated with a service)
108 CFStringRef serviceID
;
110 // unsaved configuration (when prefs not [yet] available)
111 CFMutableDictionaryRef unsaved
;
113 // [SCPreferences] interface entity information
114 CFStringRef entity_device
; // interface device
115 CFStringRef entity_type
; // interface type
116 CFStringRef entity_subtype
; // interface subtype
118 // configuration information
119 CFMutableArrayRef supported_interface_types
;
120 CFMutableArrayRef supported_protocol_types
;
122 // IORegistry (service plane) information
124 CFStringRef addressString
;
126 CFStringRef location
;
128 CFMutableDictionaryRef overrides
;
130 Boolean supportsBond
;
131 Boolean supportsVLAN
;
136 int sort_order
; // sort order for this interface
138 // for BOND interfaces
140 CFArrayRef interfaces
;
141 CFDictionaryRef options
;
145 // for VLAN interfaces
147 SCNetworkInterfaceRef interface
;
148 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
149 CFDictionaryRef options
;
152 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
159 #pragma mark SCNetworkInterface configuration (internal)
163 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
165 SCNetworkInterfacePrivateRef
166 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
167 SCNetworkInterfaceRef interface
,
168 SCPreferencesRef prefs
,
169 CFStringRef serviceID
);
171 SCNetworkInterfacePrivateRef
172 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
173 SCNetworkInterfaceRef interface
,
174 SCPreferencesRef prefs
,
175 CFStringRef serviceID
,
178 SCNetworkInterfacePrivateRef
179 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
180 CFStringRef bond_if
);
182 SCNetworkInterfacePrivateRef
183 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
184 CFStringRef vlan_if
);
187 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
190 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkInterfaceRef interface
);
193 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
196 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
199 __SCNetworkInterfaceIsValidExtendedConfigurationType
200 (SCNetworkInterfaceRef interface
,
201 CFStringRef extendedType
,
202 Boolean requirePerInterface
);
205 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
206 CFStringRef interfaceType
);
209 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
212 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
213 CFStringRef extendedType
,
214 CFDictionaryRef config
,
218 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkInterfaceRef interface
,
222 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
225 __SCBondInterfaceListCopyMembers (CFArrayRef interfaces
,
226 CFMutableSetRef set
);
229 #pragma mark SCNetworkProtocol configuration (internal)
232 SCNetworkProtocolPrivateRef
233 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
234 CFStringRef entityID
,
235 SCNetworkServiceRef service
);
238 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
242 #pragma mark SCNetworkService configuration (internal)
245 SCNetworkServicePrivateRef
246 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
247 SCPreferencesRef prefs
,
248 CFStringRef serviceID
,
249 SCNetworkInterfaceRef interface
);
253 #pragma mark SCNetworkSet configuration (internal)
257 #pragma mark Miscellaneous (internal)
261 __copyInterfaceTemplate (CFStringRef interfaceType
,
262 CFStringRef childInterfaceType
);
265 __copyProtocolTemplate (CFStringRef interfaceType
,
266 CFStringRef childInterfaceType
,
267 CFStringRef protocolType
);
270 __getPrefsConfiguration (SCPreferencesRef prefs
,
274 __setPrefsConfiguration (SCPreferencesRef prefs
,
276 CFDictionaryRef config
,
277 Boolean keepInactive
);
280 __getPrefsEnabled (SCPreferencesRef prefs
,
284 __setPrefsEnabled (SCPreferencesRef prefs
,
289 __createInterface (int s
,
290 CFStringRef interface
);
293 __destroyInterface (int s
,
294 CFStringRef interface
);
297 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
298 (SCPreferencesRef prefs
,
302 __extract_password (SCPreferencesRef prefs
,
303 CFDictionaryRef config
,
304 CFStringRef passwordKey
,
305 CFStringRef encryptionKey
,
306 CFStringRef encryptionKeyChainValue
,
307 CFStringRef unique_id
,
308 CFDataRef
*password
);
312 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */