]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCNetworkConfigurationInternal.h
configd-453.16.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 <SystemConfiguration/SCNetworkConfigurationPrivate.h>
33 #include <IOKit/IOKitLib.h>
34
35
36 typedef struct {
37
38 // base CFType information
39 CFRuntimeBase cfBase;
40
41 // set id
42 CFStringRef setID;
43
44 // prefs
45 SCPreferencesRef prefs;
46
47 // name
48 CFStringRef name;
49
50 // misc
51 Boolean established;
52
53 } SCNetworkSetPrivate, *SCNetworkSetPrivateRef;
54
55
56 typedef struct {
57
58 // base CFType information
59 CFRuntimeBase cfBase;
60
61 // service id
62 CFStringRef serviceID;
63
64 // interface
65 SCNetworkInterfaceRef interface;
66
67 // prefs
68 SCPreferencesRef prefs;
69
70 // store (for live SCNetworkService)
71 SCDynamicStoreRef store;
72
73 // name
74 CFStringRef name;
75
76 } SCNetworkServicePrivate, *SCNetworkServicePrivateRef;
77
78
79 typedef struct {
80
81 // base CFType information
82 CFRuntimeBase cfBase;
83
84 // entity id
85 CFStringRef entityID;
86
87 // service
88 SCNetworkServiceRef service;
89
90 } SCNetworkProtocolPrivate, *SCNetworkProtocolPrivateRef;
91
92
93 typedef struct {
94
95 // base CFType information
96 CFRuntimeBase cfBase;
97
98 // interface information
99 CFStringRef interface_type; // interface type
100
101 // [non-localized] name
102 CFStringRef name; // non-localized [display] name
103
104 // localized name
105 CFStringRef localized_name; // localized [display] name
106 CFStringRef localized_key;
107 CFStringRef localized_arg1;
108 CFStringRef localized_arg2;
109
110 // [layered] interface
111 SCNetworkInterfaceRef interface;
112
113 // prefs (for associated service, BOND interfaces, and VLAN interfaces)
114 SCPreferencesRef prefs;
115
116 // SCDynamicStore
117 SCDynamicStoreRef store;
118
119 // serviceID (NULL if not associated with a service)
120 CFStringRef serviceID;
121
122 // unsaved configuration (when prefs not [yet] available)
123 CFMutableDictionaryRef unsaved;
124
125 // [SCPreferences] interface entity information
126 CFStringRef entity_device; // interface device
127 CFStringRef entity_device_unique; // ... UniqueIdentifier
128 CFStringRef entity_type; // interface type
129 CFStringRef entity_subtype; // interface subtype
130
131 // configuration information
132 CFMutableArrayRef supported_interface_types;
133 CFMutableArrayRef supported_protocol_types;
134
135 // IORegistry (service plane) information
136 CFDataRef address;
137 CFStringRef addressString;
138 Boolean builtin;
139 CFStringRef configurationAction;
140 Boolean hidden;
141 CFStringRef location;
142 CFStringRef path;
143 uint64_t entryID;
144 CFMutableDictionaryRef overrides;
145 Boolean modemIsV92;
146 CFNumberRef type;
147 CFNumberRef unit;
148 struct {
149 CFStringRef name;
150 CFNumberRef vid;
151 CFNumberRef pid;
152 } usb;
153
154 // misc
155 int sort_order; // sort order for this interface
156
157 // for BOND interfaces
158 Boolean supportsBond;
159 struct {
160 CFArrayRef interfaces;
161 CFDictionaryRef options;
162 CFNumberRef mode;
163 } bond;
164
165 // for Bridge interfaces
166 Boolean supportsBridge;
167 struct {
168 CFArrayRef interfaces;
169 CFDictionaryRef options;
170 } bridge;
171
172 // for VLAN interfaces
173 Boolean supportsVLAN;
174 struct {
175 SCNetworkInterfaceRef interface;
176 CFNumberRef tag; // e.g. 1 <= tag <= 4094
177 CFDictionaryRef options;
178 } vlan;
179
180 } SCNetworkInterfacePrivate, *SCNetworkInterfacePrivateRef;
181
182
183 __BEGIN_DECLS
184
185
186 #pragma mark -
187 #pragma mark SCNetworkInterface configuration (internal)
188
189
190 CFArrayRef
191 __SCNetworkInterfaceCopyAll_IONetworkInterface (void);
192
193 SCNetworkInterfacePrivateRef
194 __SCNetworkInterfaceCreateCopy (CFAllocatorRef allocator,
195 SCNetworkInterfaceRef interface,
196 SCPreferencesRef prefs,
197 CFStringRef serviceID);
198
199 SCNetworkInterfacePrivateRef
200 __SCNetworkInterfaceCreatePrivate (CFAllocatorRef allocator,
201 SCNetworkInterfaceRef interface,
202 SCPreferencesRef prefs,
203 CFStringRef serviceID);
204
205 SCNetworkInterfacePrivateRef
206 _SCBondInterfaceCreatePrivate (CFAllocatorRef allocator,
207 CFStringRef bond_if);
208
209 SCNetworkInterfacePrivateRef
210 _SCBridgeInterfaceCreatePrivate (CFAllocatorRef allocator,
211 CFStringRef bridge_if);
212
213 SCNetworkInterfacePrivateRef
214 _SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator,
215 CFStringRef vlan_if);
216
217 CFDictionaryRef
218 __SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface);
219
220 CFArrayRef
221 __SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set,
222 SCNetworkInterfaceRef interface);
223
224 #if !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
225 CFStringRef
226 __SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface);
227
228 CFStringRef
229 __SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface);
230 #endif // !TARGET_OS_EMBEDDED && !TARGET_IPHONE_SIMULATOR
231
232 int
233 __SCNetworkInterfaceCreateCapabilities (SCNetworkInterfaceRef interface,
234 int capability_base,
235 CFDictionaryRef capability_options);
236
237 int
238 __SCNetworkInterfaceCreateMediaOptions (SCNetworkInterfaceRef interface,
239 CFDictionaryRef media_options);
240
241 CFStringRef
242 __SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface);
243
244 CFStringRef
245 __SCNetworkInterfaceGetNonLocalizedDisplayName (SCNetworkInterfaceRef interface);
246
247 Boolean
248 __SCNetworkInterfaceIsMember (SCPreferencesRef prefs,
249 SCNetworkInterfaceRef interface);
250
251 Boolean
252 __SCNetworkInterfaceIsValidExtendedConfigurationType
253 (SCNetworkInterfaceRef interface,
254 CFStringRef extendedType,
255 Boolean requirePerInterface);
256
257 CFDictionaryRef
258 __SCNetworkInterfaceGetTemplateOverrides (SCNetworkInterfaceRef interface,
259 CFStringRef overrideType);
260
261 int
262 __SCNetworkInterfaceOrder (SCNetworkInterfaceRef interface);
263
264 Boolean
265 __SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
266 CFStringRef extendedType,
267 CFDictionaryRef config,
268 Boolean okToHold);
269
270 void
271 __SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set,
272 SCNetworkInterfaceRef interface,
273 CFArrayRef configs);
274
275 Boolean
276 __SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if);
277
278 void
279 __SCBondInterfaceListCollectMembers (CFArrayRef interfaces,
280 CFMutableSetRef set);
281
282 void
283 __SCBridgeInterfaceListCollectMembers (CFArrayRef interfaces,
284 CFMutableSetRef set);
285
286 #pragma mark -
287 #pragma mark SCNetworkProtocol configuration (internal)
288
289
290 SCNetworkProtocolPrivateRef
291 __SCNetworkProtocolCreatePrivate (CFAllocatorRef allocator,
292 CFStringRef entityID,
293 SCNetworkServiceRef service);
294
295 Boolean
296 __SCNetworkProtocolIsValidType (CFStringRef protocolType);
297
298
299 #pragma mark -
300 #pragma mark SCNetworkService configuration (internal)
301
302
303 CFArrayRef /* of SCNetworkServiceRef's */
304 __SCNetworkServiceCopyAllEnabled (SCPreferencesRef prefs);
305
306 SCNetworkServicePrivateRef
307 __SCNetworkServiceCreatePrivate (CFAllocatorRef allocator,
308 SCPreferencesRef prefs,
309 CFStringRef serviceID,
310 SCNetworkInterfaceRef interface);
311
312 Boolean
313 __SCNetworkServiceExistsForInterface (CFArrayRef services,
314 SCNetworkInterfaceRef interface);
315
316 CF_RETURNS_RETAINED
317 CFStringRef
318 __SCNetworkServiceNextName (SCNetworkServiceRef service);
319
320
321 #pragma mark -
322 #pragma mark SCNetworkSet configuration (internal)
323
324
325 #pragma mark -
326 #pragma mark Miscellaneous (internal)
327
328
329 CFDictionaryRef
330 __copyInterfaceTemplate (CFStringRef interfaceType,
331 CFStringRef childInterfaceType);
332
333 CFDictionaryRef
334 __copyProtocolTemplate (CFStringRef interfaceType,
335 CFStringRef childInterfaceType,
336 CFStringRef protocolType);
337
338 CFDictionaryRef
339 __getPrefsConfiguration (SCPreferencesRef prefs,
340 CFStringRef path);
341
342 Boolean
343 __setPrefsConfiguration (SCPreferencesRef prefs,
344 CFStringRef path,
345 CFDictionaryRef config,
346 Boolean keepInactive);
347
348 Boolean
349 __getPrefsEnabled (SCPreferencesRef prefs,
350 CFStringRef path);
351
352 Boolean
353 __setPrefsEnabled (SCPreferencesRef prefs,
354 CFStringRef path,
355 Boolean enabled);
356
357 Boolean
358 __createInterface (int s,
359 CFStringRef interface);
360
361 Boolean
362 __destroyInterface (int s,
363 CFStringRef interface);
364
365 CFStringRef
366 __SCPreferencesPathCreateUniqueChild_WithMoreSCFCompatibility
367 (SCPreferencesRef prefs,
368 CFStringRef prefix);
369
370 Boolean
371 __extract_password (SCPreferencesRef prefs,
372 CFDictionaryRef config,
373 CFStringRef passwordKey,
374 CFStringRef encryptionKey,
375 CFStringRef encryptionKeyChainValue,
376 CFStringRef unique_id,
377 CFDataRef *password);
378
379 Boolean
380 __remove_password (SCPreferencesRef prefs,
381 CFDictionaryRef config,
382 CFStringRef passwordKey,
383 CFStringRef encryptionKey,
384 CFStringRef encryptionKeyChainValue,
385 CFStringRef unique_id,
386 CFDictionaryRef *newConfig);
387
388 Boolean
389 __rank_to_str (SCNetworkServicePrimaryRank rank,
390 CFStringRef *rankStr);
391
392 Boolean
393 __str_to_rank (CFStringRef rankStr,
394 SCNetworkServicePrimaryRank *rank);
395
396 __END_DECLS
397
398 #endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */