]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationInternal.h
configd-395.6.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCNetworkConfigurationInternal.h
1 /*
2 * Copyright (c) 2004-2011 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 Boolean hidden;
137 CFStringRef location;
138 CFStringRef path;
139 CFMutableDictionaryRef overrides;
140 Boolean modemIsV92;
141 CFNumberRef type;
142 CFNumberRef unit;
143 struct {
144 CFStringRef name;
145 CFNumberRef vid;
146 CFNumberRef pid;
147 } usb;
148
149 // misc
150 int sort_order; // sort order for this interface
151
152 // for BOND interfaces
153 Boolean supportsBond;
154 struct {
155 CFArrayRef interfaces;
156 CFDictionaryRef options;
157 CFNumberRef mode;
158 } bond;
159
160 // for Bridge interfaces
161 Boolean supportsBridge;
162 struct {
163 CFArrayRef interfaces;
164 CFDictionaryRef options;
165 } bridge;
166
167 // for VLAN interfaces
168 Boolean supportsVLAN;
169 struct {
170 SCNetworkInterfaceRef interface;
171 CFNumberRef tag; // e.g. 1 <= tag <= 4094
172 CFDictionaryRef options;
173 } vlan;
174
175 } SCNetworkInterfacePrivate, *SCNetworkInterfacePrivateRef;
176
177
178 __BEGIN_DECLS
179
180
181 #pragma mark -
182 #pragma mark SCNetworkInterface configuration (internal)
183
184
185 CFArrayRef
186 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
187
188 SCNetworkInterfacePrivateRef
189 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator,
190 SCNetworkInterfaceRef interface,
191 SCPreferencesRef prefs,
192 CFStringRef serviceID);
193
194 SCNetworkInterfacePrivateRef
195 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator,
196 SCNetworkInterfaceRef interface,
197 SCPreferencesRef prefs,
198 CFStringRef serviceID,
199 io_string_t path);
200
201 SCNetworkInterfacePrivateRef
202 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator,
203 CFStringRef bond_if);
204
205 SCNetworkInterfacePrivateRef
206 _SCBridgeInterfaceCreatePrivate (CFAllocatorRef allocator,
207 CFStringRef bridge_if);
208
209 SCNetworkInterfacePrivateRef
210 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator,
211 CFStringRef vlan_if);
212
213 CFDictionaryRef
214 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface);
215
216 CFArrayRef
217 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set,
218 SCNetworkInterfaceRef interface);
219
220 #if !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
221 CFStringRef
222 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface);
223
224 CFStringRef
225 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface);
226 #endif // !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
227
228 int
229 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface,
230 int capability_base,
231 CFDictionaryRef capability_options);
232
233 int
234 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface,
235 CFDictionaryRef media_options);
236
237 CFStringRef
238 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface);
239
240 CFStringRef
241 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface);
242
243 Boolean
244 __SCNetworkInterfaceIsMember (SCPreferencesRef prefs,
245 SCNetworkInterfaceRef interface);
246
247 Boolean
248 __SCNetworkInterfaceIsValidExtendedConfigurationType
249 (SCNetworkInterfaceRef interface,
250 CFStringRef extendedType,
251 Boolean requirePerInterface);
252
253 CFDictionaryRef
254 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface,
255 CFStringRef overrideType);
256
257 int
258 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface);
259
260 Boolean
261 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
262 CFStringRef extendedType,
263 CFDictionaryRef config,
264 Boolean okToHold);
265
266 void
267 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set,
268 SCNetworkInterfaceRef interface,
269 CFArrayRef configs);
270
271 Boolean
272 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if);
273
274 void
275 __SCBondInterfaceListCollectMembers (CFArrayRef interfaces,
276 CFMutableSetRef set);
277
278 void
279 __SCBridgeInterfaceListCollectMembers (CFArrayRef interfaces,
280 CFMutableSetRef set);
281
282 #pragma mark -
283 #pragma mark SCNetworkProtocol configuration (internal)
284
285
286 SCNetworkProtocolPrivateRef
287 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator,
288 CFStringRef entityID,
289 SCNetworkServiceRef service);
290
291 Boolean
292 __SCNetworkProtocolIsValidType (CFStringRef protocolType);
293
294
295 #pragma mark -
296 #pragma mark SCNetworkService configuration (internal)
297
298
299 CFArrayRef /* of SCNetworkServiceRef's */
300 __SCNetworkServiceCopyAllEnabled (SCPreferencesRef prefs);
301
302 SCNetworkServicePrivateRef
303 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator,
304 SCPreferencesRef prefs,
305 CFStringRef serviceID,
306 SCNetworkInterfaceRef interface);
307
308 Boolean
309 __SCNetworkServiceExistsForInterface (CFArrayRef services,
310 SCNetworkInterfaceRef interface);
311
312 CFStringRef
313 __SCNetworkServiceNextName (SCNetworkServiceRef service);
314
315
316 #pragma mark -
317 #pragma mark SCNetworkSet configuration (internal)
318
319
320 #pragma mark -
321 #pragma mark Miscellaneous (internal)
322
323
324 CFDictionaryRef
325 __copyInterfaceTemplate (CFStringRef interfaceType,
326 CFStringRef childInterfaceType);
327
328 CFDictionaryRef
329 __copyProtocolTemplate (CFStringRef interfaceType,
330 CFStringRef childInterfaceType,
331 CFStringRef protocolType);
332
333 CFDictionaryRef
334 __getPrefsConfiguration (SCPreferencesRef prefs,
335 CFStringRef path);
336
337 Boolean
338 __setPrefsConfiguration (SCPreferencesRef prefs,
339 CFStringRef path,
340 CFDictionaryRef config,
341 Boolean keepInactive);
342
343 Boolean
344 __getPrefsEnabled (SCPreferencesRef prefs,
345 CFStringRef path);
346
347 Boolean
348 __setPrefsEnabled (SCPreferencesRef prefs,
349 CFStringRef path,
350 Boolean enabled);
351
352 Boolean
353 __createInterface (int s,
354 CFStringRef interface);
355
356 Boolean
357 __destroyInterface (int s,
358 CFStringRef interface);
359
360 CFStringRef
361 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
362 (SCPreferencesRef prefs,
363 CFStringRef prefix);
364
365 Boolean
366 __extract_password (SCPreferencesRef prefs,
367 CFDictionaryRef config,
368 CFStringRef passwordKey,
369 CFStringRef encryptionKey,
370 CFStringRef encryptionKeyChainValue,
371 CFStringRef unique_id,
372 CFDataRef *password);
373
374 Boolean
375 __remove_password (SCPreferencesRef prefs,
376 CFDictionaryRef config,
377 CFStringRef passwordKey,
378 CFStringRef encryptionKey,
379 CFStringRef encryptionKeyChainValue,
380 CFStringRef unique_id,
381 CFDictionaryRef *newConfig);
382
383 __END_DECLS
384
385 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */