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
;
70 } SCNetworkServicePrivate
, *SCNetworkServicePrivateRef
;
75 // base CFType information
82 SCNetworkServiceRef service
;
84 } SCNetworkProtocolPrivate
, *SCNetworkProtocolPrivateRef
;
89 // base CFType information
92 // interface information
93 CFStringRef interface_type
; // interface type
95 // [non-localized] name
96 CFStringRef name
; // non-localized [display] name
99 CFStringRef localized_name
; // localized [display] name
100 CFStringRef localized_key
;
101 CFStringRef localized_arg1
;
102 CFStringRef localized_arg2
;
104 // [layered] interface
105 SCNetworkInterfaceRef interface
;
107 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
108 SCPreferencesRef prefs
;
110 // serviceID (NULL if not associated with a service)
111 CFStringRef serviceID
;
113 // unsaved configuration (when prefs not [yet] available)
114 CFMutableDictionaryRef unsaved
;
116 // [SCPreferences] interface entity information
117 CFStringRef entity_device
; // interface device
118 CFStringRef entity_type
; // interface type
119 CFStringRef entity_subtype
; // interface subtype
121 // configuration information
122 CFMutableArrayRef supported_interface_types
;
123 CFMutableArrayRef supported_protocol_types
;
125 // IORegistry (service plane) information
127 CFStringRef addressString
;
129 CFStringRef location
;
131 CFMutableDictionaryRef overrides
;
133 Boolean supportsBond
;
134 Boolean supportsVLAN
;
139 int sort_order
; // sort order for this interface
141 // for BOND interfaces
143 CFArrayRef interfaces
;
144 CFDictionaryRef options
;
148 // for VLAN interfaces
150 SCNetworkInterfaceRef interface
;
151 CFNumberRef tag
; // e.g. 1 <= tag <= 4094
152 CFDictionaryRef options
;
155 } SCNetworkInterfacePrivate
, *SCNetworkInterfacePrivateRef
;
162 #pragma mark SCNetworkInterface configuration (internal)
166 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
168 SCNetworkInterfacePrivateRef
169 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator
,
170 SCNetworkInterfaceRef interface
,
171 SCPreferencesRef prefs
,
172 CFStringRef serviceID
);
174 SCNetworkInterfacePrivateRef
175 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator
,
176 SCNetworkInterfaceRef interface
,
177 SCPreferencesRef prefs
,
178 CFStringRef serviceID
,
181 SCNetworkInterfacePrivateRef
182 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator
,
183 CFStringRef bond_if
);
185 SCNetworkInterfacePrivateRef
186 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator
,
187 CFStringRef vlan_if
);
190 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface
);
193 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkInterfaceRef interface
);
196 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface
);
199 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface
);
202 __SCNetworkInterfaceIsValidExtendedConfigurationType
203 (SCNetworkInterfaceRef interface
,
204 CFStringRef extendedType
,
205 Boolean requirePerInterface
);
208 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface
,
209 CFStringRef interfaceType
);
212 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface
);
215 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface
,
216 CFStringRef extendedType
,
217 CFDictionaryRef config
,
221 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkInterfaceRef interface
,
225 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if
);
228 __SCBondInterfaceListCopyMembers (CFArrayRef interfaces
,
229 CFMutableSetRef set
);
232 #pragma mark SCNetworkProtocol configuration (internal)
235 SCNetworkProtocolPrivateRef
236 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator
,
237 CFStringRef entityID
,
238 SCNetworkServiceRef service
);
241 __SCNetworkProtocolIsValidType (CFStringRef protocolType
);
245 #pragma mark SCNetworkService configuration (internal)
248 SCNetworkServicePrivateRef
249 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator
,
250 SCPreferencesRef prefs
,
251 CFStringRef serviceID
,
252 SCNetworkInterfaceRef interface
);
256 #pragma mark SCNetworkSet configuration (internal)
260 #pragma mark Miscellaneous (internal)
264 __copyInterfaceTemplate (CFStringRef interfaceType
,
265 CFStringRef childInterfaceType
);
268 __copyProtocolTemplate (CFStringRef interfaceType
,
269 CFStringRef childInterfaceType
,
270 CFStringRef protocolType
);
273 __getPrefsConfiguration (SCPreferencesRef prefs
,
277 __setPrefsConfiguration (SCPreferencesRef prefs
,
279 CFDictionaryRef config
,
280 Boolean keepInactive
);
283 __getPrefsEnabled (SCPreferencesRef prefs
,
287 __setPrefsEnabled (SCPreferencesRef prefs
,
292 __createInterface (int s
,
293 CFStringRef interface
);
296 __destroyInterface (int s
,
297 CFStringRef interface
);
300 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
301 (SCPreferencesRef prefs
,
305 __extract_password (SCPreferencesRef prefs
,
306 CFDictionaryRef config
,
307 CFStringRef passwordKey
,
308 CFStringRef encryptionKey
,
309 CFStringRef encryptionKeyChainValue
,
310 CFStringRef unique_id
,
311 CFDataRef
*password
);
315 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */