]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationInternal.h
configd-289.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfigurationInternal.h
1 /*
2 * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef _SCNETWORKCONFIGURATIONINTERNAL_H
25 #define _SCNETWORKCONFIGURATIONINTERNAL_H
26
27
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>
33
34
35 typedef struct {
36
37 // base CFType information
38 CFRuntimeBase cfBase;
39
40 // set id
41 CFStringRef setID;
42
43 // prefs
44 SCPreferencesRef prefs;
45
46 // name
47 CFStringRef name;
48
49 // misc
50 Boolean established;
51
52 } SCNetworkSetPrivate, *SCNetworkSetPrivateRef;
53
54
55 typedef struct {
56
57 // base CFType information
58 CFRuntimeBase cfBase;
59
60 // service id
61 CFStringRef serviceID;
62
63 // interface
64 SCNetworkInterfaceRef interface;
65
66 // prefs
67 SCPreferencesRef prefs;
68
69 // store (for live SCNetworkService)
70 SCDynamicStoreRef store;
71
72 // name
73 CFStringRef name;
74
75 } SCNetworkServicePrivate, *SCNetworkServicePrivateRef;
76
77
78 typedef struct {
79
80 // base CFType information
81 CFRuntimeBase cfBase;
82
83 // entity id
84 CFStringRef entityID;
85
86 // service
87 SCNetworkServiceRef service;
88
89 } SCNetworkProtocolPrivate, *SCNetworkProtocolPrivateRef;
90
91
92 typedef struct {
93
94 // base CFType information
95 CFRuntimeBase cfBase;
96
97 // interface information
98 CFStringRef interface_type; // interface type
99
100 // [non-localized] name
101 CFStringRef name; // non-localized [display] name
102
103 // localized name
104 CFStringRef localized_name; // localized [display] name
105 CFStringRef localized_key;
106 CFStringRef localized_arg1;
107 CFStringRef localized_arg2;
108
109 // [layered] interface
110 SCNetworkInterfaceRef interface;
111
112 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
113 SCPreferencesRef prefs;
114
115 // serviceID (NULL if not associated with a service)
116 CFStringRef serviceID;
117
118 // unsaved configuration (when prefs not [yet] available)
119 CFMutableDictionaryRef unsaved;
120
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
126
127 // configuration information
128 CFMutableArrayRef supported_interface_types;
129 CFMutableArrayRef supported_protocol_types;
130
131 // IORegistry (service plane) information
132 CFDataRef address;
133 CFStringRef addressString;
134 Boolean builtin;
135 CFStringRef configurationAction;
136 CFStringRef location;
137 CFStringRef path;
138 CFMutableDictionaryRef overrides;
139 Boolean modemIsV92;
140 CFNumberRef type;
141 CFNumberRef unit;
142
143 // misc
144 int sort_order; // sort order for this interface
145
146 #if !TARGET_OS_IPHONE
147 // for BOND interfaces
148 Boolean supportsBond;
149 struct {
150 CFArrayRef interfaces;
151 CFDictionaryRef options;
152 CFNumberRef mode;
153 } bond;
154
155 // for VLAN interfaces
156 Boolean supportsVLAN;
157 struct {
158 SCNetworkInterfaceRef interface;
159 CFNumberRef tag; // e.g. 1 <= tag <= 4094
160 CFDictionaryRef options;
161 } vlan;
162 #endif // !TARGET_OS_IPHONE
163
164 } SCNetworkInterfacePrivate, *SCNetworkInterfacePrivateRef;
165
166
167 __BEGIN_DECLS
168
169
170 #pragma mark -
171 #pragma mark SCNetworkInterface configuration (internal)
172
173
174 CFArrayRef
175 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
176
177 SCNetworkInterfacePrivateRef
178 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator,
179 SCNetworkInterfaceRef interface,
180 SCPreferencesRef prefs,
181 CFStringRef serviceID);
182
183 SCNetworkInterfacePrivateRef
184 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator,
185 SCNetworkInterfaceRef interface,
186 SCPreferencesRef prefs,
187 CFStringRef serviceID,
188 io_string_t path);
189
190 #if !TARGET_OS_IPHONE
191 SCNetworkInterfacePrivateRef
192 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator,
193 CFStringRef bond_if);
194
195 SCNetworkInterfacePrivateRef
196 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator,
197 CFStringRef vlan_if);
198 #endif // !TARGET_OS_IPHONE
199
200 CFDictionaryRef
201 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface);
202
203 CFArrayRef
204 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set,
205 SCNetworkInterfaceRef interface);
206
207 CFStringRef
208 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface);
209
210 CFStringRef
211 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface);
212
213 CFStringRef
214 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface);
215
216 CFStringRef
217 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface);
218
219 Boolean
220 __SCNetworkInterfaceIsValidExtendedConfigurationType
221 (SCNetworkInterfaceRef interface,
222 CFStringRef extendedType,
223 Boolean requirePerInterface);
224
225 CFDictionaryRef
226 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface,
227 CFStringRef interfaceType);
228
229 int
230 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface);
231
232 Boolean
233 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
234 CFStringRef extendedType,
235 CFDictionaryRef config,
236 Boolean okToHold);
237
238 void
239 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set,
240 SCNetworkInterfaceRef interface,
241 CFArrayRef configs);
242
243 #if !TARGET_OS_IPHONE
244 Boolean
245 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if);
246
247 void
248 __SCBondInterfaceListCopyMembers (CFArrayRef interfaces,
249 CFMutableSetRef set);
250 #endif // !TARGET_OS_IPHONE
251
252 #pragma mark -
253 #pragma mark SCNetworkProtocol configuration (internal)
254
255
256 SCNetworkProtocolPrivateRef
257 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator,
258 CFStringRef entityID,
259 SCNetworkServiceRef service);
260
261 Boolean
262 __SCNetworkProtocolIsValidType (CFStringRef protocolType);
263
264
265 #pragma mark -
266 #pragma mark SCNetworkService configuration (internal)
267
268
269 SCNetworkServicePrivateRef
270 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator,
271 SCPreferencesRef prefs,
272 CFStringRef serviceID,
273 SCNetworkInterfaceRef interface);
274
275
276 #pragma mark -
277 #pragma mark SCNetworkSet configuration (internal)
278
279
280 #pragma mark -
281 #pragma mark Miscellaneous (internal)
282
283
284 CFDictionaryRef
285 __copyInterfaceTemplate (CFStringRef interfaceType,
286 CFStringRef childInterfaceType);
287
288 CFDictionaryRef
289 __copyProtocolTemplate (CFStringRef interfaceType,
290 CFStringRef childInterfaceType,
291 CFStringRef protocolType);
292
293 CFDictionaryRef
294 __getPrefsConfiguration (SCPreferencesRef prefs,
295 CFStringRef path);
296
297 Boolean
298 __setPrefsConfiguration (SCPreferencesRef prefs,
299 CFStringRef path,
300 CFDictionaryRef config,
301 Boolean keepInactive);
302
303 Boolean
304 __getPrefsEnabled (SCPreferencesRef prefs,
305 CFStringRef path);
306
307 Boolean
308 __setPrefsEnabled (SCPreferencesRef prefs,
309 CFStringRef path,
310 Boolean enabled);
311
312 Boolean
313 __createInterface (int s,
314 CFStringRef interface);
315
316 Boolean
317 __destroyInterface (int s,
318 CFStringRef interface);
319
320 CFStringRef
321 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
322 (SCPreferencesRef prefs,
323 CFStringRef prefix);
324
325 Boolean
326 __extract_password (SCPreferencesRef prefs,
327 CFDictionaryRef config,
328 CFStringRef passwordKey,
329 CFStringRef encryptionKey,
330 CFStringRef encryptionKeyChainValue,
331 CFStringRef unique_id,
332 CFDataRef *password);
333
334 Boolean
335 __remove_password (SCPreferencesRef prefs,
336 CFDictionaryRef config,
337 CFStringRef passwordKey,
338 CFStringRef encryptionKey,
339 CFStringRef encryptionKeyChainValue,
340 CFStringRef unique_id,
341 CFDictionaryRef *newConfig);
342
343 __END_DECLS
344
345 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */