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