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