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