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