]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/genSCPreferences.c
configd-135.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / genSCPreferences.c
1 /*
2 * Copyright (c) 2000-2005 Apple Computer, 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 /*
25 * genSCPreferences.c
26 * - generates System Configuration header/cfile
27 * - invoke with "header" to generate the header
28 * - invoke with "cfile" to generate the cfile
29 */
30
31 /*
32 * Modification History
33 *
34 * 4 March 2004 Allan Nathanson (ajn@apple.com)
35 * - an alternate scheme to help facilitate access to the schema
36 * definitions for cross-compilation to earlier releases AND
37 * access to CFM applications.
38 *
39 * 16 July 2003 Allan Nathanson (ajn@apple.com)
40 * - changes to facilitate cross-compilation to earlier releases
41 *
42 * 5 May 2003 Allan Nathanson (ajn@apple.com)
43 * - switch back to "extern const CFStringRef ..."
44 *
45 * 1 June 2001 Allan Nathanson <ajn@apple.com>
46 * - public API conversion
47 *
48 * 27 Apr 2001 Allan Nathanson (ajn@apple.com)
49 * - switch from "extern const CFStringRef ..." to "#define ..."
50 *
51 * 3 Nov 2000 Dieter Siegmund (dieter@apple)
52 * - created
53 */
54 #include <stdio.h>
55 #include <stdlib.h>
56 #include <string.h>
57 #include <unistd.h>
58 #include <mach/boolean.h>
59
60 char copyright_string[] =
61 "/*\n"
62 " * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.\n"
63 " *\n"
64 " * @APPLE_LICENSE_HEADER_START@\n"
65 " * \n"
66 " * This file contains Original Code and/or Modifications of Original Code\n"
67 " * as defined in and that are subject to the Apple Public Source License\n"
68 " * Version 2.0 (the 'License'). You may not use this file except in\n"
69 " * compliance with the License. Please obtain a copy of the License at\n"
70 " * http://www.opensource.apple.com/apsl/ and read it before using this\n"
71 " * file.\n"
72 " * \n"
73 " * The Original Code and all software distributed under the License are\n"
74 " * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n"
75 " * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n"
76 " * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n"
77 " * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n"
78 " * Please see the License for the specific language governing rights and\n"
79 " * limitations under the License.\n"
80 " * \n"
81 " * @APPLE_LICENSE_HEADER_END@\n"
82 " */\n";
83
84
85 typedef enum {
86 COMMENT,
87 GROUP,
88 SC_10_1,
89 SC_10_1_10_4, // deprecated in 10.4
90 SC_10_2,
91 SC_10_3,
92 SC_10_4,
93 END
94 } controlType;
95
96 #define SC_SCHEMA_DECLARATION "SC_SCHEMA_DECLARATION"
97 #define SC_SCHEMA_KV "SC_SCHEMA_KV"
98
99 #define KEY_PREFIX "kSC"
100
101 #define COMP "Comp"
102 #define DYNAMICSTORE "DynamicStore"
103 #define PREF "Pref"
104 #define PROP "Prop"
105 #define PATH "Path"
106 #define NETENT "EntNet"
107 #define NETPROP "PropNet"
108 #define NETVAL "ValNet"
109 #define SETUPENT "EntSetup"
110 #define SETUPPROP "PropSetup"
111 #define SYSTEMENT "EntSystem"
112 #define SYSTEMPROP "PropSystem"
113 #define RESV "Resv"
114 #define USERSENT "EntUsers"
115 #define USERSPROP "PropUsers"
116 #define VERSION "Version"
117
118 #define CFARRAY_CFNUMBER "CFArray[CFNumber]"
119 #define CFARRAY_CFSTRING "CFArray[CFString]"
120 #define CFBOOLEAN "CFBoolean"
121 #define CFDATA "CFData"
122 #define CFDICTIONARY "CFDictionary"
123 #define CFNUMBER "CFNumber"
124 #define CFNUMBER_BOOL "CFNumber (0 or 1)"
125 #define CFSTRING "CFString"
126
127 #define ACSP "ACSP" // Apple Client Server Protocol
128 #define ACTIVE "Active"
129 #define ADDRESSES "Addresses"
130 #define AFTER "After"
131 #define AIRPORT "AirPort"
132 #define ALERT "Alert"
133 #define ALLOWNETCREATION "AllowNetCreation"
134 #define ALTERNATEREMOTEADDRESS "AlternateRemoteAddress"
135 #define ANYREGEX "AnyRegex"
136 #define APPLETALK "AppleTalk"
137 #define AUTH "Auth"
138 #define AUTOCONFIG "AutoConfig"
139 #define AUTODISCOVERY "AutoDiscovery"
140 #define AUTOMATIC "Automatic"
141 #define BEFORE "Before"
142 #define BINDINGMETHODS "BindingMethods"
143 #define BOOTP "BOOTP"
144 #define BROADCAST "Broadcast"
145 #define CALLWAITINGAUDIBLEALERT "CallWaitingAudibleAlert"
146 #define CAUSE "Cause"
147 #define CCP "CCP"
148 #define CHAP "CHAP"
149 #define COMM "Comm"
150 #define COMPRESSIONACFIELD "CompressionACField"
151 #define COMPRESSIONPFIELD "CompressionPField"
152 #define COMPRESSIONVJ "CompressionVJ"
153 #define COMPUTERNAME "ComputerName"
154 #define CONFIGMETHOD "ConfigMethod"
155 #define CONNECTDELAY "ConnectDelay"
156 #define CONNECTIONSCRIPT "ConnectionScript"
157 #define CONNECTSPEED "ConnectSpeed"
158 #define CONNECTTIME "ConnectTime"
159 #define CONSOLEUSER "ConsoleUser"
160 #define CURRENTSET "CurrentSet"
161 #define DATACOMPRESSION "DataCompression"
162 #define DEFAULT "Default"
163 #define DEFAULTZONE "DefaultZone"
164 #define DEST "Dest"
165 #define DETACHING "Detaching"
166 #define DEVICE "Device"
167 #define DEVICENAME "DeviceName"
168 #define DHCP "DHCP"
169 #define DHCPCLIENTID "DHCPClientID"
170 #define DIALMODE "DialMode"
171 #define DIALONDEMAND "DialOnDemand"
172 #define DISCONNECTONANSWER "DisconnectOnAnswer"
173 #define DISCONNECTONFASTUSERSWITCH "DisconnectOnFastUserSwitch"
174 #define DISCONNECTONIDLE "DisconnectOnIdle"
175 #define DISCONNECTONIDLETIMER "DisconnectOnIdleTimer"
176 #define DISCONNECTONLOGOUT "DisconnectOnLogout"
177 #define DISCONNECTONSLEEP "DisconnectOnSleep"
178 #define DISCONNECTTIME "DisconnectTime"
179 #define DISPLAYTERMINALWINDOW "DisplayTerminalWindow"
180 #define DNS "DNS"
181 #define DOMAIN "Domain"
182 #define DOMAINS "Domains"
183 #define EAP "EAP"
184 #define ECHO "Echo"
185 #define ECHOFAILURE "EchoFailure"
186 #define ECHOINTERVAL "EchoInterval"
187 #define ENABLE "Enable"
188 #define ENABLED "Enabled"
189 #define ENCODING "Encoding"
190 #define ENCRYPTION "Encryption"
191 #define ERRORCORRECTION "ErrorCorrection"
192 #define ETHERNET "Ethernet"
193 #define EXCEPTIONSLIST "ExceptionsList"
194 #define EXCLUDESIMPLEHOSTNAMES "ExcludeSimpleHostnames"
195 #define FILE "File"
196 #define FIREWIRE "FireWire"
197 #define FIRST "First"
198 #define FLAGS "Flags"
199 #define FTP "FTP"
200 #define GID "GID"
201 #define GLOBAL "Global"
202 #define GOPHER "Gopher"
203 #define HARDWARE "Hardware"
204 #define HOLD "Hold"
205 #define HOSTNAMES "HostNames"
206 #define HTTP "HTTP"
207 #define HTTPS "HTTPS"
208 #define IDLEREMINDER "IdleReminder"
209 #define IDLEREMINDERTIMER "IdleReminderTimer"
210 #define IGNOREDIALTONE "IgnoreDialTone"
211 #define INACTIVE "Inactive"
212 #define INFORM "INFORM"
213 #define INTERFACE "Interface"
214 #define INTERFACENAME "InterfaceName"
215 #define INTERFACES "Interfaces"
216 #define IP "IP"
217 #define IPCP "IPCP"
218 #define IPV4 "IPv4"
219 #define IPV6 "IPv6"
220 #define IPSEC "IPSec"
221 #define JOINMODE "JoinMode"
222 #define KEYCHAIN "Keychain"
223 #define L2TP "L2TP"
224 #define LAST "Last"
225 #define LCP "LCP"
226 #define LINK "Link"
227 #define LINKLOCAL "LinkLocal"
228 #define LOCALHOSTNAME "LocalHostName"
229 #define LOGFILE "Logfile"
230 #define MACADDRESS "MACAddress"
231 #define MANUAL "Manual"
232 #define MATCH "Match"
233 #define MEDIA "Media"
234 #define OPTIONS "Options"
235 #define MODEM "Modem"
236 #define MPPE40 "MPPE40"
237 #define MPPE128 "MPPE128"
238 #define MRU "MRU"
239 #define MSCHAP1 "MSCHAP1"
240 #define MSCHAP2 "MSCHAP2"
241 #define MTU "MTU"
242 #define NAME "Name"
243 #define NETINFO "NetInfo"
244 #define NETWORK "Network"
245 #define NETWORKID "NetworkID"
246 #define NETWORKRANGE "NetworkRange"
247 #define NETWORKSERVICES "NetworkServices"
248 #define NODE "Node"
249 #define NODEID "NodeID"
250 #define NOTE "Note"
251 #define ORDER "Order"
252 #define ORDERS "Orders"
253 #define OVERRIDEPRIMARY "OverridePrimary"
254 #define PAP "PAP"
255 #define PASSIVE "Passive"
256 #define PASSWORD "Password"
257 #define PEERDNS "PeerDNS"
258 #define PLUGIN "Plugin"
259 #define PLUGINS "Plugins"
260 #define POWER "Power"
261 #define PORT "Port"
262 #define PPP "PPP"
263 #define PPPOE "PPPoE"
264 #define PPPSERIAL "PPPSerial"
265 #define PPTP "PPTP"
266 #define PREFERRED "Preferred"
267 #define PREFIXLENGTH "PrefixLength"
268 #define PREFS "Prefs"
269 #define PRIMARYINTERFACE "PrimaryInterface"
270 #define PRIMARYSERVICE "PrimaryService"
271 #define PROMPT "Prompt"
272 #define PROTOCOL "Protocol"
273 #define PROXIES "Proxies"
274 #define PROXY "Proxy"
275 #define PULSEDIAL "PulseDial"
276 #define RECEIVEACCM "ReceiveACCM"
277 #define RECENT "Recent"
278 #define REDIALCOUNT "RedialCount"
279 #define REDIAL "Redial"
280 #define REDIALINTERVAL "RedialInterval"
281 #define RELAY "Relay"
282 #define REMINDER "Reminder"
283 #define REMINDERTIME "ReminderTime"
284 #define REMOTEADDRESS "RemoteAddress"
285 #define RETRYCONNECTTIME "RetryConnectTime"
286 #define ROOTSEPARATOR "RootSeparator"
287 #define ROUTER "Router"
288 #define ROUTERADVERTISEMENT "RouterAdvertisement"
289 #define RTSP "RTSP"
290 #define SAVEPASSWORDS "SavePasswords"
291 #define SEARCH "Search"
292 #define SEEDNETWORKRANGE "SeedNetworkRange"
293 #define SEEDROUTER "SeedRouter"
294 #define SEEDZONES "SeedZones"
295 #define SERVER "Server"
296 #define SERVICE "Service"
297 #define SERVICEIDS "ServiceIDs"
298 #define SESSIONTIMER "SessionTimer"
299 #define SETS "Sets"
300 #define SETUP "Setup"
301 #define SHAREDSECRET "SharedSecret"
302 #define SOCKS "SOCKS"
303 #define SORTLIST "SortList"
304 #define SPEAKER "Speaker"
305 #define SPEED "Speed"
306 #define STATE "State"
307 #define STATUS "Status"
308 #define STF "6to4"
309 #define STRONGEST "Strongest"
310 #define SUBNETMASKS "SubnetMasks"
311 #define SUBTYPE "SubType"
312 #define SUPPLEMENTAL "Supplemental"
313 #define SUPPORTSMODEMONHOLD "SupportsModemOnHold"
314 #define SYSTEM "System"
315 #define TAG "Tag"
316 #define TAGS "Tags"
317 #define TERMINALSCRIPT "TerminalScript"
318 #define TIMEOUT "Timeout"
319 #define TRANSMITACCM "TransmitACCM"
320 #define TRANSPORT "Transport"
321 #define TYPE "Type"
322 #define UID "UID"
323 #define UPDATED "Updated"
324 #define URLSTRING "URLString"
325 #define USERDEFINEDNAME "UserDefinedName"
326 #define USE "Use"
327 #define USERS "Users"
328 #define VERBOSELOGGING "VerboseLogging"
329 #define WAITFORDIALTONE "WaitForDialTone"
330
331 struct {
332 int control;
333 const char * prefix;
334 const char * key;
335 const char * value;
336 const char * type;
337 } names[] = {
338
339 { GROUP, NULL, "Reserved Keys", NULL, NULL },
340
341 { SC_10_1, RESV, LINK, "__LINK__", CFSTRING },
342 { SC_10_1, RESV, INACTIVE, "__INACTIVE__", NULL },
343 { COMMENT, "", NULL, NULL, NULL },
344
345 { GROUP, NULL, "Generic Keys", NULL, NULL },
346
347 { SC_10_1, PROP, INTERFACENAME, NULL, CFSTRING },
348 { SC_10_1, PROP, MACADDRESS, NULL, CFSTRING },
349 { SC_10_1, PROP, USERDEFINEDNAME, NULL, CFSTRING },
350 { SC_10_1, PROP, VERSION, NULL, CFSTRING },
351 { COMMENT, "", NULL, NULL, NULL },
352
353 { GROUP, PREF, "Preference Keys", NULL, NULL },
354
355 { SC_10_1, PREF, CURRENTSET, NULL, CFSTRING },
356 { SC_10_1, PREF, NETWORKSERVICES, NULL, CFDICTIONARY },
357 { SC_10_1, PREF, SETS, NULL, CFDICTIONARY },
358 { SC_10_1, PREF, SYSTEM, NULL, CFDICTIONARY },
359 { COMMENT, "", NULL, NULL, NULL },
360
361 { GROUP, COMP, "Component Keys", NULL, NULL },
362
363 { SC_10_1, COMP, NETWORK, NULL, NULL },
364 { SC_10_1, COMP, SERVICE, NULL, NULL },
365 { SC_10_1, COMP, GLOBAL, NULL, NULL },
366 { SC_10_2, COMP, HOSTNAMES, NULL, NULL },
367 { SC_10_1, COMP, INTERFACE, NULL, NULL },
368 { SC_10_1, COMP, SYSTEM, NULL, NULL },
369 { SC_10_1, COMP, USERS, NULL, NULL },
370 { COMMENT, "", NULL, NULL, NULL },
371
372 { COMMENT, "--- Regex pattern which matches any component ---", NULL },
373 { SC_10_1, COMP, ANYREGEX, "[^/]+", NULL },
374 { COMMENT, "", NULL, NULL, NULL },
375
376 { GROUP, NETENT, "Network Entity Keys", NULL, NULL },
377
378 { SC_10_1, NETENT, AIRPORT, NULL, CFDICTIONARY },
379 { SC_10_1, NETENT, APPLETALK, NULL, CFDICTIONARY },
380 { SC_10_1, NETENT, DHCP, NULL, CFDICTIONARY },
381 { SC_10_1, NETENT, DNS, NULL, CFDICTIONARY },
382 { SC_10_1, NETENT, ETHERNET, NULL, CFDICTIONARY },
383 { SC_10_3, NETENT, FIREWIRE, NULL, CFDICTIONARY },
384 { SC_10_1, NETENT, INTERFACE, NULL, CFDICTIONARY },
385 { SC_10_1, NETENT, IPV4, NULL, CFDICTIONARY },
386 { SC_10_1, NETENT, IPV6, NULL, CFDICTIONARY },
387 { SC_10_3, NETENT, L2TP, NULL, CFDICTIONARY },
388 { SC_10_1, NETENT, LINK, NULL, CFDICTIONARY },
389 { SC_10_1, NETENT, MODEM, NULL, CFDICTIONARY },
390 { SC_10_1, NETENT, NETINFO, NULL, CFDICTIONARY },
391 { SC_10_1, NETENT, PPP, NULL, CFDICTIONARY },
392 { SC_10_1, NETENT, PPPOE, NULL, CFDICTIONARY },
393 { SC_10_3, NETENT, PPPSERIAL, NULL, CFDICTIONARY },
394 { SC_10_3, NETENT, PPTP, NULL, CFDICTIONARY },
395 { SC_10_1, NETENT, PROXIES, NULL, CFDICTIONARY },
396 { SC_10_3, NETENT, STF, NULL, CFDICTIONARY },
397 { COMMENT, "", NULL, NULL, NULL },
398
399 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
400
401 { SC_10_2, NETPROP, OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
402 { SC_10_1, NETPROP, SERVICE ORDER, NULL, CFARRAY_CFSTRING },
403 { SC_10_1, NETPROP, PPP OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
404 { COMMENT, "", NULL, NULL, NULL },
405
406 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK INTERFACE " Properties", NULL, NULL },
407
408 { SC_10_2, NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
409 { COMMENT, "", NULL, NULL, NULL },
410
411 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK HOSTNAMES " Properties", NULL, NULL },
412
413 { SC_10_2, NETPROP, LOCALHOSTNAME, NULL, CFSTRING },
414 { COMMENT, "", NULL, NULL, NULL },
415
416 { GROUP, NETPROP AIRPORT, KEY_PREFIX NETENT AIRPORT " (Hardware) Entity Keys", NULL, NULL },
417
418 { SC_10_2, NETPROP AIRPORT, ALLOWNETCREATION, NULL, CFNUMBER_BOOL },
419 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD, NULL, CFDATA },
420 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
421 { SC_10_2, NETPROP AIRPORT, JOINMODE, NULL, CFSTRING },
422 { SC_10_1, NETPROP AIRPORT, POWER ENABLED, NULL, CFNUMBER_BOOL },
423 { SC_10_1, NETPROP AIRPORT, PREFERRED NETWORK, NULL, CFSTRING },
424 { SC_10_2, NETPROP AIRPORT, SAVEPASSWORDS, NULL, CFNUMBER_BOOL },
425 { COMMENT, "", NULL, NULL, NULL },
426 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT JOINMODE " values ---", NULL, NULL, NULL },
427 { SC_10_3, NETVAL AIRPORT JOINMODE, AUTOMATIC, NULL, NULL },
428 { SC_10_2, NETVAL AIRPORT JOINMODE, PREFERRED, NULL, NULL },
429 { SC_10_2, NETVAL AIRPORT JOINMODE, RECENT, NULL, NULL },
430 { SC_10_2, NETVAL AIRPORT JOINMODE, STRONGEST, NULL, NULL },
431 { COMMENT, "", NULL, NULL, NULL },
432 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
433 { SC_10_3, NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
434 { COMMENT, "", NULL, NULL, NULL },
435
436 { GROUP, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },
437
438 { SC_10_1, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
439 { SC_10_1, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
440 { SC_10_1, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
441 { SC_10_1, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
442 { SC_10_1, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
443 { SC_10_2, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
444 { SC_10_1, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
445 { SC_10_1, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
446 { SC_10_1, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
447 { COMMENT, "", NULL, NULL, NULL },
448 { COMMENT, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
449 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
450 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
451 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
452 { COMMENT, "", NULL, NULL, NULL },
453
454 { GROUP, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },
455
456 { SC_10_1, NETPROP DNS, DOMAIN NAME, NULL, CFSTRING },
457 { SC_10_4, NETPROP DNS, OPTIONS, NULL, CFSTRING },
458 { SC_10_1, NETPROP DNS, SEARCH DOMAINS, NULL, CFARRAY_CFSTRING},
459 { SC_10_4, NETPROP DNS, SEARCH ORDER, NULL, CFNUMBER},
460 { SC_10_1, NETPROP DNS, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
461 { SC_10_4, NETPROP DNS, SERVER PORT, NULL, CFNUMBER },
462 { SC_10_4, NETPROP DNS, SERVER TIMEOUT, NULL, CFNUMBER },
463 { SC_10_1, NETPROP DNS, SORTLIST, NULL, CFARRAY_CFSTRING },
464 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH DOMAINS, NULL, CFARRAY_CFSTRING},
465 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH ORDERS, NULL, CFARRAY_CFNUMBER},
466 { COMMENT, "", NULL, NULL, NULL },
467
468 { GROUP, NETPROP ETHERNET, KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys", NULL, NULL },
469
470 { SC_10_2, NETPROP ETHERNET, MEDIA SUBTYPE, NULL, CFSTRING },
471 { SC_10_2, NETPROP ETHERNET, MEDIA OPTIONS, NULL, CFARRAY_CFSTRING },
472 { SC_10_2, NETPROP ETHERNET, MTU, NULL, CFNUMBER },
473 { COMMENT, "", NULL, NULL, NULL },
474
475 { GROUP, NETPROP FIREWIRE, KEY_PREFIX NETENT FIREWIRE " (Hardware) Entity Keys", NULL, NULL },
476
477 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
478 { COMMENT, "", NULL, NULL, NULL },
479
480 { GROUP, NETPROP INTERFACE, KEY_PREFIX NETENT INTERFACE " Entity Keys", NULL, NULL },
481
482 { SC_10_1, NETPROP INTERFACE, DEVICENAME, NULL, CFSTRING },
483 { SC_10_1, NETPROP INTERFACE, HARDWARE, NULL, CFSTRING },
484 { SC_10_1, NETPROP INTERFACE, TYPE, NULL, CFSTRING },
485 { SC_10_1, NETPROP INTERFACE, SUBTYPE, NULL, CFSTRING },
486 { SC_10_2, NETPROP INTERFACE, SUPPORTSMODEMONHOLD, NULL, CFNUMBER_BOOL },
487 { COMMENT, "", NULL, NULL, NULL },
488 { COMMENT, "--- " KEY_PREFIX NETPROP INTERFACE TYPE " values ---", NULL, NULL, NULL },
489 { SC_10_1, NETVAL INTERFACE TYPE, ETHERNET, NULL, NULL },
490 { SC_10_3, NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
491 { SC_10_1, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
492 { SC_10_3, NETVAL INTERFACE TYPE, STF, NULL, NULL },
493 { COMMENT, "", NULL, NULL, NULL },
494 { COMMENT, "--- " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") ---", NULL, NULL, NULL },
495 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
496 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPSERIAL, NULL, NULL },
497 { SC_10_2, NETVAL INTERFACE SUBTYPE, PPTP, NULL, NULL },
498 { SC_10_3, NETVAL INTERFACE SUBTYPE, L2TP, NULL, NULL },
499 { COMMENT, "", NULL, NULL, NULL },
500
501 { GROUP, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
502
503 { SC_10_1, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
504 { SC_10_1, NETPROP IPV4, CONFIGMETHOD, NULL, CFSTRING },
505 { SC_10_1, NETPROP IPV4, DHCPCLIENTID, NULL, CFSTRING },
506 { SC_10_1, NETPROP IPV4, ROUTER, NULL, CFSTRING },
507 { SC_10_1, NETPROP IPV4, SUBNETMASKS, NULL, CFARRAY_CFSTRING },
508 { SC_10_1, NETPROP IPV4, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
509 { SC_10_1, NETPROP IPV4, BROADCAST ADDRESSES, NULL, CFARRAY_CFSTRING },
510 { COMMENT, "", NULL, NULL, NULL },
511 { COMMENT, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
512 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
513 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
514 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
515 { SC_10_2, NETVAL IPV4 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
516 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, MANUAL, NULL, NULL },
517 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, PPP, NULL, NULL },
518 { COMMENT, "", NULL, NULL, NULL },
519
520 { GROUP, NETPROP IPV6, KEY_PREFIX NETENT IPV6 " Entity Keys", NULL, NULL },
521
522 { SC_10_1, NETPROP IPV6, ADDRESSES, NULL, CFARRAY_CFSTRING },
523 { SC_10_1, NETPROP IPV6, CONFIGMETHOD, NULL, CFSTRING },
524 { SC_10_3, NETPROP IPV6, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
525 { SC_10_3, NETPROP IPV6, FLAGS, NULL, CFNUMBER },
526 { SC_10_3, NETPROP IPV6, PREFIXLENGTH, NULL, CFARRAY_CFNUMBER },
527 { SC_10_3, NETPROP IPV6, ROUTER, NULL, CFSTRING },
528 { COMMENT, "", NULL, NULL, NULL },
529 { COMMENT, "--- " KEY_PREFIX NETPROP IPV6 CONFIGMETHOD " values ---", NULL, NULL, NULL },
530 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
531 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, MANUAL, NULL, NULL },
532 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, ROUTERADVERTISEMENT, NULL, NULL },
533 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, STF, NULL, NULL },
534 { COMMENT, "", NULL, NULL, NULL },
535
536 { GROUP, NETPROP STF, KEY_PREFIX NETENT STF " Entity Keys", NULL, NULL },
537
538 { SC_10_3, NETPROP STF, RELAY, NULL, CFSTRING },
539 { COMMENT, "", NULL, NULL, NULL },
540
541 { GROUP, NETPROP LINK, KEY_PREFIX NETENT LINK " Entity Keys", NULL, NULL },
542
543 { SC_10_1, NETPROP LINK, ACTIVE, NULL, CFBOOLEAN },
544 { SC_10_2, NETPROP LINK, DETACHING, NULL, CFBOOLEAN },
545 { COMMENT, "", NULL, NULL, NULL },
546
547 { GROUP, NETPROP MODEM, KEY_PREFIX NETENT MODEM " (Hardware) Entity Keys", NULL, NULL },
548
549 { SC_10_1, NETPROP MODEM, CONNECTIONSCRIPT, NULL, CFSTRING },
550 { SC_10_2, NETPROP MODEM, CONNECTSPEED, NULL, CFNUMBER },
551 { SC_10_1, NETPROP MODEM, DATACOMPRESSION, NULL, CFNUMBER_BOOL },
552 { SC_10_1, NETPROP MODEM, DIALMODE, NULL, CFSTRING },
553 { SC_10_1, NETPROP MODEM, ERRORCORRECTION, NULL, CFNUMBER_BOOL },
554 { SC_10_2, NETPROP MODEM, HOLD CALLWAITINGAUDIBLEALERT, NULL, CFNUMBER_BOOL },
555 { SC_10_2, NETPROP MODEM, HOLD DISCONNECTONANSWER, NULL, CFNUMBER_BOOL },
556 { SC_10_2, NETPROP MODEM, HOLD ENABLED, NULL, CFNUMBER_BOOL },
557 { SC_10_2, NETPROP MODEM, HOLD REMINDER, NULL, CFNUMBER_BOOL },
558 { SC_10_2, NETPROP MODEM, HOLD REMINDERTIME, NULL, CFNUMBER },
559 { SC_10_2, NETPROP MODEM, NOTE, NULL, CFSTRING },
560 { SC_10_1, NETPROP MODEM, PULSEDIAL, NULL, CFNUMBER_BOOL },
561 { SC_10_1, NETPROP MODEM, SPEAKER, NULL, CFNUMBER_BOOL },
562 { SC_10_1, NETPROP MODEM, SPEED, NULL, CFNUMBER },
563 { COMMENT, "", NULL, NULL, NULL },
564 { COMMENT, "--- " KEY_PREFIX NETPROP MODEM DIALMODE " values ---", NULL, NULL, NULL },
565 { SC_10_1, NETVAL MODEM DIALMODE, IGNOREDIALTONE, NULL, NULL },
566 { SC_10_1, NETVAL MODEM DIALMODE, MANUAL, NULL, NULL },
567 { SC_10_1, NETVAL MODEM DIALMODE, WAITFORDIALTONE, NULL, NULL },
568 { COMMENT, "", NULL, NULL, NULL },
569
570 { GROUP, NETPROP NETINFO, KEY_PREFIX NETENT NETINFO " Entity Keys", NULL, NULL },
571
572 { SC_10_1, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
573 { SC_10_1, NETPROP NETINFO, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
574 { SC_10_1, NETPROP NETINFO, SERVER TAGS, NULL, CFARRAY_CFSTRING },
575 { SC_10_1, NETPROP NETINFO, BROADCAST SERVER TAG, NULL, CFSTRING },
576 { COMMENT, "", NULL, NULL, NULL },
577 { COMMENT, "--- " KEY_PREFIX NETPROP NETINFO BINDINGMETHODS " values ---", NULL, NULL, NULL },
578 { SC_10_1, NETVAL NETINFO BINDINGMETHODS, BROADCAST, NULL, NULL },
579 { SC_10_1, NETVAL NETINFO BINDINGMETHODS, DHCP, NULL, NULL },
580 { SC_10_1, NETVAL NETINFO BINDINGMETHODS, MANUAL, NULL, NULL },
581 { COMMENT, "", NULL, NULL, NULL },
582 { COMMENT, "--- " KEY_PREFIX NETPROP NETINFO BROADCAST SERVER TAG " default value ---", NULL, NULL, NULL },
583 { SC_10_1, NETVAL NETINFO, DEFAULT SERVER TAG, "network", NULL },
584 { COMMENT, "", NULL, NULL, NULL },
585
586 { GROUP, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
587
588 { SC_10_3, NETPROP PPP, ACSP ENABLED, NULL, CFNUMBER_BOOL },
589 { SC_10_2, NETPROP PPP, CONNECTTIME, NULL, CFNUMBER },
590 { SC_10_2, NETPROP PPP, DEVICE LAST CAUSE, NULL, CFNUMBER },
591 { SC_10_1, NETPROP PPP, DIALONDEMAND, NULL, CFNUMBER_BOOL },
592 { SC_10_4, NETPROP PPP, DISCONNECTONFASTUSERSWITCH, NULL, CFNUMBER_BOOL },
593 { SC_10_1, NETPROP PPP, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
594 { SC_10_1, NETPROP PPP, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
595 { SC_10_1, NETPROP PPP, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
596 { SC_10_2, NETPROP PPP, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
597 { SC_10_3, NETPROP PPP, DISCONNECTTIME, NULL, CFNUMBER },
598 { SC_10_1, NETPROP PPP, IDLEREMINDERTIMER, NULL, CFNUMBER },
599 { SC_10_1, NETPROP PPP, IDLEREMINDER, NULL, CFNUMBER_BOOL },
600 { SC_10_2, NETPROP PPP, LAST CAUSE, NULL, CFNUMBER },
601 { SC_10_1, NETPROP PPP, LOGFILE, NULL, CFSTRING },
602 { SC_10_2, NETPROP PPP, PLUGINS, NULL, CFARRAY_CFSTRING },
603 { SC_10_3, NETPROP PPP, RETRYCONNECTTIME, NULL, CFNUMBER },
604 { SC_10_1, NETPROP PPP, SESSIONTIMER, NULL, CFNUMBER },
605 { SC_10_2, NETPROP PPP, STATUS, NULL, CFNUMBER },
606 { SC_10_2, NETPROP PPP, USE SESSIONTIMER, NULL, CFNUMBER_BOOL },
607 { SC_10_1, NETPROP PPP, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
608 { COMMENT, "", NULL, NULL, NULL },
609
610 { COMMENT, "--- " AUTH ": ---", NULL, NULL, NULL },
611 { SC_10_3, NETPROP PPP, AUTH EAP PLUGINS, NULL, CFARRAY_CFSTRING },
612 { SC_10_1, NETPROP PPP, AUTH NAME, NULL, CFSTRING },
613 { SC_10_1, NETPROP PPP, AUTH PASSWORD, NULL, CFSTRING },
614 { SC_10_1, NETPROP PPP, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
615 { SC_10_3, NETPROP PPP, AUTH PROMPT, NULL, CFSTRING },
616 { SC_10_1, NETPROP PPP, AUTH PROTOCOL, NULL, CFARRAY_CFSTRING },
617 { COMMENT, "", NULL, NULL, NULL },
618 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
619 { SC_10_3, NETVAL PPP AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
620 { COMMENT, "", NULL, NULL, NULL },
621 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROMPT " values ---", NULL, NULL, NULL },
622 { SC_10_3, NETVAL PPP AUTH PROMPT, BEFORE, NULL, CFSTRING },
623 { SC_10_3, NETVAL PPP AUTH PROMPT, AFTER, NULL, CFSTRING },
624 { COMMENT, "", NULL, NULL, NULL },
625 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROTOCOL " values ---", NULL, NULL, NULL },
626 { SC_10_1, NETVAL PPP AUTH PROTOCOL, CHAP, NULL, CFSTRING },
627 { SC_10_3, NETVAL PPP AUTH PROTOCOL, EAP, NULL, CFSTRING },
628 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP1, NULL, CFSTRING },
629 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP2, NULL, CFSTRING },
630 { SC_10_1, NETVAL PPP AUTH PROTOCOL, PAP, NULL, CFSTRING },
631 { COMMENT, "", NULL, NULL, NULL },
632
633 { COMMENT, "--- " COMM ": ---", NULL, NULL, NULL },
634 { SC_10_1, NETPROP PPP, COMM ALTERNATEREMOTEADDRESS, NULL, CFSTRING },
635 { SC_10_1, NETPROP PPP, COMM CONNECTDELAY, NULL, CFNUMBER },
636 { SC_10_1, NETPROP PPP, COMM DISPLAYTERMINALWINDOW, NULL, CFNUMBER_BOOL },
637 { SC_10_1, NETPROP PPP, COMM REDIALCOUNT, NULL, CFNUMBER },
638 { SC_10_1, NETPROP PPP, COMM REDIAL ENABLED, NULL, CFNUMBER_BOOL },
639 { SC_10_1, NETPROP PPP, COMM REDIALINTERVAL, NULL, CFNUMBER },
640 { SC_10_1, NETPROP PPP, COMM REMOTEADDRESS, NULL, CFSTRING },
641 { SC_10_1, NETPROP PPP, COMM TERMINALSCRIPT, NULL, CFSTRING },
642 { SC_10_2, NETPROP PPP, COMM USE TERMINALSCRIPT, NULL, CFNUMBER_BOOL },
643 { COMMENT, "", NULL, NULL, NULL },
644
645 { COMMENT, "--- " CCP ": ---", NULL, NULL, NULL },
646 { SC_10_2, NETPROP PPP, CCP ENABLED, NULL, CFNUMBER_BOOL },
647 { SC_10_4, NETPROP PPP, CCP MPPE40 ENABLED, NULL, CFNUMBER_BOOL },
648 { SC_10_4, NETPROP PPP, CCP MPPE128 ENABLED, NULL, CFNUMBER_BOOL },
649 { COMMENT, "", NULL, NULL, NULL },
650
651 { COMMENT, "--- " IPCP ": ---", NULL, NULL, NULL },
652 { SC_10_1, NETPROP PPP, IPCP COMPRESSIONVJ, NULL, CFNUMBER_BOOL },
653 { SC_10_4, NETPROP PPP, IPCP USE PEERDNS, NULL, CFNUMBER_BOOL },
654 { COMMENT, "", NULL, NULL, NULL },
655
656 { COMMENT, "--- " LCP ": ---", NULL, NULL, NULL },
657 { SC_10_1, NETPROP PPP, LCP ECHO ENABLED, NULL, CFNUMBER_BOOL },
658 { SC_10_1, NETPROP PPP, LCP ECHOFAILURE, NULL, CFNUMBER },
659 { SC_10_1, NETPROP PPP, LCP ECHOINTERVAL, NULL, CFNUMBER },
660 { SC_10_1, NETPROP PPP, LCP COMPRESSIONACFIELD, NULL, CFNUMBER_BOOL },
661 { SC_10_1, NETPROP PPP, LCP COMPRESSIONPFIELD, NULL, CFNUMBER_BOOL },
662 { SC_10_1, NETPROP PPP, LCP MRU, NULL, CFNUMBER },
663 { SC_10_1, NETPROP PPP, LCP MTU, NULL, CFNUMBER },
664 { SC_10_1, NETPROP PPP, LCP RECEIVEACCM, NULL, CFNUMBER },
665 { SC_10_1, NETPROP PPP, LCP TRANSMITACCM, NULL, CFNUMBER },
666 { COMMENT, "", NULL, NULL, NULL },
667
668 { GROUP, NETPROP PPPOE, KEY_PREFIX NETENT PPPOE " Entity Keys", NULL, NULL },
669
670 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
671 { COMMENT, "", NULL, NULL, NULL },
672
673 { GROUP, NETPROP PPPSERIAL, KEY_PREFIX NETENT PPPSERIAL " Entity Keys", NULL, NULL },
674
675 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
676 { COMMENT, "", NULL, NULL, NULL },
677
678 { GROUP, NETPROP PPTP, KEY_PREFIX NETENT PPTP " Entity Keys", NULL, NULL },
679
680 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
681 { COMMENT, "", NULL, NULL, NULL },
682
683 { GROUP, NETPROP L2TP, KEY_PREFIX NETENT L2TP " Entity Keys", NULL, NULL },
684
685 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET, NULL, CFSTRING },
686 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
687 { SC_10_3, NETPROP L2TP, TRANSPORT, NULL, CFSTRING },
688 { COMMENT, "", NULL, NULL, NULL },
689 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
690 { SC_10_3, NETVAL L2TP IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
691 { COMMENT, "", NULL, NULL, NULL },
692 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP TRANSPORT " values ---", NULL, NULL, NULL },
693 { SC_10_3, NETVAL L2TP TRANSPORT, IP, NULL, NULL },
694 { SC_10_3, NETVAL L2TP TRANSPORT, IPSEC, NULL, NULL },
695 { COMMENT, "", NULL, NULL, NULL },
696
697 { GROUP, NETPROP PROXIES, KEY_PREFIX NETENT PROXIES " Entity Keys", NULL, NULL },
698
699 { SC_10_1, NETPROP PROXIES, EXCEPTIONSLIST, NULL, CFARRAY_CFSTRING },
700 { SC_10_4, NETPROP PROXIES, EXCLUDESIMPLEHOSTNAMES, NULL, CFNUMBER_BOOL },
701 { SC_10_1, NETPROP PROXIES, FTP ENABLE, NULL, CFNUMBER_BOOL },
702 { SC_10_1, NETPROP PROXIES, FTP PASSIVE, NULL, CFNUMBER_BOOL },
703 { SC_10_1, NETPROP PROXIES, FTP PORT, NULL, CFNUMBER },
704 { SC_10_1, NETPROP PROXIES, FTP PROXY, NULL, CFSTRING },
705 { SC_10_1, NETPROP PROXIES, GOPHER ENABLE, NULL, CFNUMBER_BOOL },
706 { SC_10_1, NETPROP PROXIES, GOPHER PORT, NULL, CFNUMBER },
707 { SC_10_1, NETPROP PROXIES, GOPHER PROXY, NULL, CFSTRING },
708 { SC_10_1, NETPROP PROXIES, HTTP ENABLE, NULL, CFNUMBER_BOOL },
709 { SC_10_1, NETPROP PROXIES, HTTP PORT, NULL, CFNUMBER },
710 { SC_10_1, NETPROP PROXIES, HTTP PROXY, NULL, CFSTRING },
711 { SC_10_1, NETPROP PROXIES, HTTPS ENABLE, NULL, CFNUMBER_BOOL },
712 { SC_10_1, NETPROP PROXIES, HTTPS PORT, NULL, CFNUMBER },
713 { SC_10_1, NETPROP PROXIES, HTTPS PROXY, NULL, CFSTRING },
714 { SC_10_1, NETPROP PROXIES, RTSP ENABLE, NULL, CFNUMBER_BOOL },
715 { SC_10_1, NETPROP PROXIES, RTSP PORT, NULL, CFNUMBER },
716 { SC_10_1, NETPROP PROXIES, RTSP PROXY, NULL, CFSTRING },
717 { SC_10_1, NETPROP PROXIES, SOCKS ENABLE, NULL, CFNUMBER_BOOL },
718 { SC_10_1, NETPROP PROXIES, SOCKS PORT, NULL, CFNUMBER },
719 { SC_10_1, NETPROP PROXIES, SOCKS PROXY, NULL, CFSTRING },
720 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG ENABLE, NULL, CFNUMBER_BOOL },
721 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG URLSTRING, NULL, CFSTRING },
722 { SC_10_4, NETPROP PROXIES, PROXY AUTODISCOVERY ENABLE, NULL, CFNUMBER_BOOL },
723 { COMMENT, "", NULL, NULL, NULL },
724
725 { GROUP, USERSENT CONSOLEUSER, KEY_PREFIX COMP USERS " Entity Keys", NULL, NULL },
726
727 { SC_10_1, USERSENT, CONSOLEUSER, NULL, NULL },
728 { COMMENT, "", NULL, NULL, NULL },
729
730 { GROUP, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
731
732 { SC_10_1, SYSTEMPROP, COMPUTERNAME, NULL, CFSTRING },
733 { SC_10_1, SYSTEMPROP, COMPUTERNAME ENCODING, NULL, CFNUMBER },
734 { COMMENT, "", NULL, NULL, NULL },
735
736 { GROUP, DYNAMICSTORE DOMAIN, "SCDynamicStore \"domain\" prefixes", NULL, NULL },
737
738 { SC_10_1, DYNAMICSTORE DOMAIN, FILE, "File:", NULL },
739 { SC_10_1, DYNAMICSTORE DOMAIN, PLUGIN, "Plugin:", NULL },
740 { SC_10_1, DYNAMICSTORE DOMAIN, SETUP, "Setup:", NULL },
741 { SC_10_1, DYNAMICSTORE DOMAIN, STATE, "State:", NULL },
742 { SC_10_1, DYNAMICSTORE DOMAIN, PREFS, "Prefs:", NULL },
743 { COMMENT, "", NULL, NULL, NULL },
744
745 { GROUP, DYNAMICSTORE SETUPPROP, "Preference (\"location\") Keys", NULL, NULL },
746
747 { SC_10_1, DYNAMICSTORE SETUPPROP, CURRENTSET, NULL, CFSTRING },
748 { SC_10_1, DYNAMICSTORE SETUPPROP, LAST UPDATED, NULL, NULL },
749 { COMMENT, "", NULL, NULL, NULL },
750
751 { GROUP, DYNAMICSTORE NETPROP, "Common/shared Keys", NULL, NULL },
752
753 { SC_10_1, DYNAMICSTORE NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
754 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYINTERFACE, NULL, CFSTRING },
755 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYSERVICE, NULL, CFSTRING },
756 { SC_10_1, DYNAMICSTORE NETPROP, SERVICEIDS, NULL, CFARRAY_CFSTRING },
757 // { COMMENT, "", NULL, NULL, NULL },
758
759 //{ GROUP, "DEPRECATED", "Deprecated schema definition keys", NULL, NULL },
760
761 { SC_10_1_10_4, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
762 { SC_10_1_10_4, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
763 { SC_10_1_10_4, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
764 // { COMMENT, "", NULL, NULL, NULL },
765
766 { END, NULL, NULL, NULL, NULL },
767 };
768
769 static inline void
770 setmax(int *max, char **maxstr, char *str)
771 {
772 int l;
773
774 l = strlen(str);
775 if (l > *max) {
776 if (*maxstr) free(*maxstr);
777 *maxstr = strdup(str);
778 *max = l;
779 }
780 return;
781 }
782
783 enum {
784 gen_header_e,
785 gen_comments_e,
786 gen_headerdoc_e,
787 gen_hfile_e,
788 gen_cfile_e,
789 };
790
791 void
792 dump_names(int type)
793 {
794 int i;
795 int maxkbuf = 0;
796 char *maxkstr = NULL;
797 int maxvbuf = 0;
798 char *maxvstr = NULL;
799
800 for (i = 0; TRUE; i++) {
801 switch (names[i].control) {
802 case END: {
803 goto done;
804 break;
805 }
806
807 case COMMENT: {
808 switch (type) {
809 case gen_header_e:
810 break;
811 case gen_comments_e:
812 if (names[i].prefix)
813 printf(" * %s\n", names[i].prefix);
814 break;
815 case gen_hfile_e:
816 // if (names[i].prefix)
817 // printf("%s\n", names[i].prefix);
818 break;
819 default:
820 break;
821 }
822 break;
823 }
824
825 case GROUP: {
826 switch (type) {
827 case gen_header_e:
828 break;
829 case gen_comments_e:
830 if (names[i].key)
831 printf(" * %s\n *\n", names[i].key);
832 break;
833 case gen_headerdoc_e:
834 if (names[i].prefix)
835 printf("\n/*!\n @group %s\n */\n", names[i].key);
836 break;
837 default:
838 break;
839 }
840 break;
841 }
842
843 default: {
844 char kbuf[256];
845 char vbuf[256];
846
847 switch (type) {
848 case gen_header_e:
849 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
850 names[i].prefix, names[i].key);
851
852 if (names[i].value)
853 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
854 names[i].value);
855 else
856 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
857 names[i].key);
858
859 printf("#define %-50s %s\n",
860 kbuf, vbuf);
861 break;
862 case gen_comments_e:
863 switch (names[i].control) {
864 case SC_10_1_10_4:
865 // don't report deprecated keys
866 break;
867 default:
868 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
869 names[i].prefix, names[i].key);
870
871 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
872 names[i].value ? names[i].value : names[i].key);
873
874 if (names[i].type)
875 printf(" * %-50s %-30s %s\n",
876 kbuf, vbuf, names[i].type);
877 else
878 printf(" * %-50s %s\n",
879 kbuf, vbuf);
880 break;
881 }
882 break;
883 case gen_headerdoc_e:
884 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
885 names[i].prefix, names[i].key);
886 setmax(&maxkbuf, &maxkstr, kbuf);
887
888 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
889 names[i].value ? names[i].value : names[i].key);
890 setmax(&maxvbuf, &maxvstr, vbuf);
891
892 printf("\n");
893
894 printf("/*!\n");
895 printf(" @const %s\n", kbuf);
896 switch (names[i].control) {
897 case SC_10_1:
898 printf(" @availability Introduced in Mac OS X 10.1.\n");
899 break;
900 case SC_10_2:
901 printf(" @availability Introduced in Mac OS X 10.2.\n");
902 break;
903 case SC_10_1_10_4:
904 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
905 break;
906 case SC_10_3:
907 printf(" @availability Introduced in Mac OS X 10.3.\n");
908 break;
909 case SC_10_4:
910 printf(" @availability Introduced in Mac OS X 10.4.\n");
911 break;
912 }
913 printf(" */\n");
914 printf("extern const CFStringRef %s;\n", kbuf);
915
916 break;
917 case gen_hfile_e:
918 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
919 names[i].prefix, names[i].key);
920 setmax(&maxkbuf, &maxkstr, kbuf);
921
922 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
923 names[i].value ? names[i].value : names[i].key);
924 setmax(&maxvbuf, &maxvstr, vbuf);
925
926 printf("\n");
927
928 switch (names[i].control) {
929 case SC_10_1:
930 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
931 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)\n", kbuf);
932 printf("#endif\n");
933 break;
934 case SC_10_2:
935 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
936 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)\n", kbuf);
937 printf("#endif\n");
938 break;
939 case SC_10_3:
940 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
941 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)\n", kbuf);
942 printf("#endif\n");
943 break;
944 case SC_10_1_10_4:
945 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
946 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4)\n", kbuf);
947 printf("#endif\n");
948 break;
949 case SC_10_4:
950 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040\n");
951 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)\n", kbuf);
952 printf("#endif\n");
953 break;
954 default:
955 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
956 printf(" " SC_SCHEMA_DECLARATION "(%s,)\n", kbuf);
957 printf("#endif\n");
958 break;
959 }
960
961 switch (names[i].control) {
962 case SC_10_1:
963 case SC_10_1_10_4:
964 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)\n");
965 break;
966 case SC_10_2:
967 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)\n");
968 break;
969 case SC_10_3:
970 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)\n");
971 break;
972 case SC_10_4:
973 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)\n");
974 break;
975 }
976
977 printf(" #define %-48s \\\n",
978 kbuf);
979 printf(" " SC_SCHEMA_KV "(%-48s \\\n",
980 kbuf);
981 printf(" ,%-48s \\\n",
982 vbuf);
983 printf(" ,%-48s )\n",
984 names[i].type ? names[i].type : "");
985
986 switch (names[i].control) {
987 case SC_10_1:
988 case SC_10_1_10_4:
989 case SC_10_2:
990 case SC_10_3:
991 case SC_10_4:
992 printf("#endif\n");
993 break;
994 }
995
996 break;
997 case gen_cfile_e:
998 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
999 names[i].prefix, names[i].key);
1000
1001 if (names[i].value)
1002 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1003 kbuf, names[i].value);
1004 else
1005 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1006 kbuf, names[i].key);
1007 break;
1008 default:
1009 break;
1010 }
1011 break;
1012 }
1013 }
1014 }
1015 done:
1016 switch (type) {
1017 case gen_hfile_e:
1018 fprintf(stderr, "max key: length = %2d, string = %s\n", maxkbuf, maxkstr);
1019 fprintf(stderr, "max val: length = %2d, string = %s\n", maxvbuf, maxvstr);
1020 break;
1021 }
1022 return;
1023 }
1024
1025 int
1026 main(int argc, char * argv[])
1027 {
1028 char * type = "";
1029
1030 if (argc >= 2)
1031 type = argv[1];
1032
1033 if (strcmp(type, "header-x") == 0) {
1034 printf("%s\n", copyright_string);
1035 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1036
1037 printf("/*\n");
1038 printf(" * Note: For Cocoa/Obj-C/Foundation programs accessing these preference\n");
1039 printf(" * keys you may want to consider the following:\n");
1040 printf(" *\n");
1041 printf(" * #define SCSTR(s) (NSString *)CFSTR(s)\n");
1042 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
1043 printf(" */\n\n");
1044
1045 printf("#ifndef _SCSCHEMADEFINITIONS_10_1_H\n#define _SCSCHEMADEFINITIONS_10_1_H\n\n");
1046
1047 printf("#warning USE OF THIS HEADER HAS BEEN DEPRECATED\n");
1048
1049 printf("#ifndef _SCSCHEMADEFINITIONS_H\n");
1050 printf("#warning Please #include <SystemConfiguration/SystemConfiguration.h> instead\n");
1051 printf("#warning of including this file directly.\n");
1052 printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n");
1053 printf("#endif\n\n");
1054
1055 // printf("#ifndef SCSTR\n");
1056 // printf("#include <CoreFoundation/CFString.h>\n");
1057 // printf("#define SCSTR(s) CFSTR(s)\n");
1058 // printf("#endif\n\n");
1059 //
1060 // dump_names(gen_header_e);
1061 // printf("\n");
1062
1063 printf("#endif /* _SCSCHEMADEFINITIONS_10_1_H */\n");
1064 }
1065 else if (strcmp(type, "header") == 0) {
1066 printf("%s\n", copyright_string);
1067 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1068
1069 printf("/*\n");
1070 dump_names(gen_comments_e);
1071 printf(" */\n\n\n");
1072
1073 printf("/*\n");
1074 printf(" * Note: The MACOSX_DEPLOYMENT_TARGET environment variable should be used\n");
1075 printf(" * when building an application targeted for an earlier version of\n");
1076 printf(" * Mac OS X. Please reference Technical Note TN2064 for more details.\n");
1077 printf(" */\n\n");
1078
1079 printf("/*\n");
1080 printf(" * Note: For Cocoa/Obj-C/Foundation applications accessing these preference\n");
1081 printf(" * keys you may want to consider the following :\n");
1082 printf(" *\n");
1083 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k;\n");
1084 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
1085 printf(" */\n\n");
1086
1087 printf("/*\n");
1088 printf(" * Note: For CFM applications using these schema keys you may want to\n");
1089 printf(" * consider the following :\n");
1090 printf(" *\n");
1091 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\n");
1092 printf(" * #define " SC_SCHEMA_KV "(k,v,t)\tlookup_SC_key( CFSTR( #k ) )\n");
1093 printf(" * #include <SystemConfiguration/SystemConfiguration.h>\n");
1094 printf(" *\n");
1095 printf(" * CFStringRef lookup_SC_key(CFStringRef key)\n");
1096 printf(" * {\n");
1097 printf(" * // this function should [dynamically, on-demand] load the\n");
1098 printf(" * // SystemConfiguration.framework, look up the provided key,\n");
1099 printf(" * // and return the associated value.\n");
1100 printf(" * }\n");
1101 printf(" */\n\n");
1102
1103 printf("/*\n");
1104 printf(" * Note: Earlier versions of this header file defined a \"SCSTR\" macro\n");
1105 printf(" * which helped to facilitate Obj-C development. Use of this macro\n");
1106 printf(" * has been deprecated (in Mac OS X 10.4) in favor of the newer\n");
1107 printf(" * \"" SC_SCHEMA_DECLARATION "\" and \"" SC_SCHEMA_KV "\" macros\n");
1108 printf(" */\n\n\n");
1109
1110 printf("#ifndef _SCSCHEMADEFINITIONS_H\n#define _SCSCHEMADEFINITIONS_H\n\n");
1111
1112 printf("/* -------------------- Macro declarations -------------------- */\n\n");
1113
1114 printf("#include <AvailabilityMacros.h>\n\n");
1115
1116 printf("/*\n");
1117 printf(" * let's \"do the right thing\" for those wishing to build for\n");
1118 printf(" * Mac OS X 10.1.0 ... 10.2.x\n");
1119 printf(" */\n");
1120
1121 printf("#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1020\n");
1122 printf(" #ifndef SCSTR\n");
1123 printf(" #include <CoreFoundation/CFString.h>\n");
1124 printf(" #define SCSTR(s) CFSTR(s)\n");
1125 printf(" #endif\n");
1126 printf(" #ifndef " SC_SCHEMA_DECLARATION "\n");
1127 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1128 printf(" #endif\n");
1129 printf(" #ifndef " SC_SCHEMA_KV "\n");
1130 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tSCSTR( v )\n");
1131 printf(" #endif\n");
1132 printf("#endif\n\n");
1133
1134 printf("/*\n");
1135 printf(" * Define a schema key/value/type tuple\n");
1136 printf(" */\n");
1137 printf("#ifndef " SC_SCHEMA_KV "\n");
1138 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tk\n");
1139 printf("#endif\n\n");
1140
1141 printf("/*\n");
1142 printf(" * Provide an \"extern\" for the key/value\n");
1143 printf(" */\n");
1144 printf("#ifndef " SC_SCHEMA_DECLARATION "\n");
1145 printf(" #ifndef SCSTR\n");
1146 printf(" #include <CoreFoundation/CFString.h>\n");
1147 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1148 printf(" #else\n");
1149 printf(" #import <Foundation/NSString.h>\n");
1150 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k q;\n");
1151 printf(" #endif\n");
1152 printf("#endif\n");
1153
1154 // The SCSTR() macro should only be availble for Mac OS X 10.1.0 ... 10.4.x
1155 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)\n");
1156 printf(" #ifndef SCSTR\n");
1157 printf(" #include <CoreFoundation/CFString.h>\n");
1158 printf(" #define SCSTR(s) CFSTR(s)\n");
1159 printf(" #endif\n");
1160 printf("#endif\n\n\n");
1161
1162 printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
1163 printf("#if\t0\n");
1164 printf("/*!\n");
1165 printf(" *\t@header SCSchemaDefinitions\n");
1166 printf(" */\n");
1167 dump_names(gen_headerdoc_e);
1168 printf("\n");
1169 printf("#endif\t/* 0 */\n\n\n");
1170
1171 printf("/* -------------------- Schema declarations -------------------- */\n\n");
1172 dump_names(gen_hfile_e);
1173 printf("\n");
1174
1175 printf("#endif /* _SCSCHEMADEFINITIONS_H */\n");
1176 }
1177 else if (strcmp(type, "cfile") == 0) {
1178 printf("/*\n");
1179 printf(" * This file is automatically generated\n");
1180 printf(" * DO NOT EDIT!\n");
1181 printf(" */\n");
1182 printf("\n");
1183 printf("#include <CoreFoundation/CFString.h>\n");
1184 printf("\n");
1185 dump_names(gen_cfile_e);
1186 }
1187 exit(0);
1188 return (0);
1189 }
1190