]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/genSCPreferences.c
configd-84.6.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / genSCPreferences.c
1 /*
2 * Copyright (c) 2000-2003 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 * 16 July 2003 Allan Nathanson (ajn@apple.com)
35 * - changes to facilitate cross-compilation to earlier releases
36 *
37 * 5 May 2003 Allan Nathanson (ajn@apple.com)
38 * - switch back to "extern const CFStringRef ..."
39 *
40 * 1 June 2001 Allan Nathanson <ajn@apple.com>
41 * - public API conversion
42 *
43 * 27 Apr 2001 Allan Nathanson (ajn@apple.com)
44 * - switch from "extern const CFStringRef ..." to "#define ..."
45 *
46 * 3 Nov 2000 Dieter Siegmund (dieter@apple)
47 * - created
48 */
49 #include <stdio.h>
50 #include <stdlib.h>
51 #include <string.h>
52 #include <unistd.h>
53 #include <mach/boolean.h>
54
55 char copyright_string[] =
56 "/*\n"
57 " * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.\n"
58 " *\n"
59 " * @APPLE_LICENSE_HEADER_START@\n"
60 " * \n"
61 " * This file contains Original Code and/or Modifications of Original Code\n"
62 " * as defined in and that are subject to the Apple Public Source License\n"
63 " * Version 2.0 (the 'License'). You may not use this file except in\n"
64 " * compliance with the License. Please obtain a copy of the License at\n"
65 " * http://www.opensource.apple.com/apsl/ and read it before using this\n"
66 " * file.\n"
67 " * \n"
68 " * The Original Code and all software distributed under the License are\n"
69 " * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n"
70 " * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n"
71 " * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n"
72 " * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n"
73 " * Please see the License for the specific language governing rights and\n"
74 " * limitations under the License.\n"
75 " * \n"
76 " * @APPLE_LICENSE_HEADER_END@\n"
77 " */\n";
78
79
80 typedef enum {
81 COMMENT,
82 OBSOLETE,
83 REGULAR,
84 DEFINE,
85 FUTURE,
86 END
87 } controlType;
88
89 #define SC_SCHEMA_DECLARATION "SC_SCHEMA_DECLARATION"
90
91 #define KEY_PREFIX "kSC"
92
93 #define COMP "Comp"
94 #define DYNAMICSTORE "DynamicStore"
95 #define PREF "Pref"
96 #define PROP "Prop"
97 #define PATH "Path"
98 #define NETENT "EntNet"
99 #define NETPROP "PropNet"
100 #define NETVAL "ValNet"
101 #define SETUPENT "EntSetup"
102 #define SETUPPROP "PropSetup"
103 #define SYSTEMENT "EntSystem"
104 #define SYSTEMPROP "PropSystem"
105 #define RESV "Resv"
106 #define USERSENT "EntUsers"
107 #define USERSPROP "PropUsers"
108 #define VERSION "Version"
109
110 #define CFARRAY_CFNUMBER "CFArray[CFNumber]"
111 #define CFARRAY_CFSTRING "CFArray[CFString]"
112 #define CFBOOLEAN "CFBoolean"
113 #define CFDATA "CFData"
114 #define CFDICTIONARY "CFDictionary"
115 #define CFNUMBER "CFNumber"
116 #define CFNUMBER_BOOL "CFNumber (0 or 1)"
117 #define CFSTRING "CFString"
118
119 #define ACSPENABLED "ACSPEnabled" // Apple Client Server Protocol
120 #define ACTIVE "Active"
121 #define ADDRESSES "Addresses"
122 #define AFTER "After"
123 #define AIRPORT "AirPort"
124 #define ALERT "Alert"
125 #define ALLOWNETCREATION "AllowNetCreation"
126 #define ALTERNATEREMOTEADDRESS "AlternateRemoteAddress"
127 #define ANYREGEX "AnyRegex"
128 #define APPLETALK "AppleTalk"
129 #define AUTH "Auth"
130 #define AUTOMATIC "Automatic"
131 #define BEFORE "Before"
132 #define BINDINGMETHODS "BindingMethods"
133 #define BOOTP "BOOTP"
134 #define BROADCAST "Broadcast"
135 #define BROADCASTADDRESSES "BroadcastAddresses"
136 #define BROADCASTSERVERTAG "BroadcastServerTag"
137 #define CALLWAITINGAUDIBLEALERT "CallWaitingAudibleAlert"
138 #define CCP "CCP"
139 #define CHAP "CHAP"
140 #define COMM "Comm"
141 #define COMPRESSIONACFIELD "CompressionACField"
142 #define COMPRESSIONPFIELD "CompressionPField"
143 #define COMPRESSIONVJ "CompressionVJ"
144 #define COMPUTERNAME "ComputerName"
145 #define CONFIGMETHOD "ConfigMethod"
146 #define CONNECTDELAY "ConnectDelay"
147 #define CONNECTIONSCRIPT "ConnectionScript"
148 #define CONNECTSPEED "ConnectSpeed"
149 #define CONNECTTIME "ConnectTime"
150 #define CONSOLEUSER "ConsoleUser"
151 #define CURRENTSET "CurrentSet"
152 #define DATACOMPRESSION "DataCompression"
153 #define DEFAULTSERVERTAG "DefaultServerTag"
154 #define DEFAULTZONE "DefaultZone"
155 #define DESTADDRESSES "DestAddresses"
156 #define DETACHING "Detaching"
157 #define DEVICE "Device"
158 #define DEVICENAME "DeviceName"
159 #define DHCP "DHCP"
160 #define DHCPCLIENTID "DHCPClientID"
161 #define DIALMODE "DialMode"
162 #define DIALONDEMAND "DialOnDemand"
163 #define DISCONNECTONANSWER "DisconnectOnAnswer"
164 #define DISCONNECTONIDLE "DisconnectOnIdle"
165 #define DISCONNECTONIDLETIMER "DisconnectOnIdleTimer"
166 #define DISCONNECTONLOGOUT "DisconnectOnLogout"
167 #define DISCONNECTONSLEEP "DisconnectOnSleep"
168 #define DISCONNECTTIME "DisconnectTime"
169 #define DISPLAYTERMINALWINDOW "DisplayTerminalWindow"
170 #define DNS "DNS"
171 #define DOMAIN "Domain"
172 #define DOMAINNAME "DomainName"
173 #define DOMAINSEPARATOR "DomainSeparator"
174 #define EAP "EAP"
175 #define ECHOENABLED "EchoEnabled"
176 #define ECHOFAILURE "EchoFailure"
177 #define ECHOINTERVAL "EchoInterval"
178 #define ENABLED "Enabled"
179 #define ENCODING "Encoding"
180 #define ENCRYPTION "Encryption"
181 #define ERRORCORRECTION "ErrorCorrection"
182 #define ETHERNET "Ethernet"
183 #define EXCEPTIONSLIST "ExceptionsList"
184 #define FILE "File"
185 #define FIREWIRE "FireWire"
186 #define FLAGS "Flags"
187 #define FTPENABLE "FTPEnable"
188 #define FTPPASSIVE "FTPPassive"
189 #define FTPPORT "FTPPort"
190 #define FTPPROXY "FTPProxy"
191 #define GID "GID"
192 #define GLOBAL "Global"
193 #define GOPHERENABLE "GopherEnable"
194 #define GOPHERPORT "GopherPort"
195 #define GOPHERPROXY "GopherProxy"
196 #define HARDWARE "Hardware"
197 #define HOLD "Hold"
198 #define HOSTNAMES "HostNames"
199 #define HTTPENABLE "HTTPEnable"
200 #define HTTPPORT "HTTPPort"
201 #define HTTPPROXY "HTTPProxy"
202 #define HTTPSENABLE "HTTPSEnable"
203 #define HTTPSPORT "HTTPSPort"
204 #define HTTPSPROXY "HTTPSProxy"
205 #define IDLEREMINDER "IdleReminder"
206 #define IDLEREMINDERTIMER "IdleReminderTimer"
207 #define IGNOREDIALTONE "IgnoreDialTone"
208 #define INACTIVE "Inactive"
209 #define INFORM "INFORM"
210 #define INTERFACE "Interface"
211 #define INTERFACENAME "InterfaceName"
212 #define INTERFACES "Interfaces"
213 #define IP "IP"
214 #define IPCP "IPCP"
215 #define IPV4 "IPv4"
216 #define IPV6 "IPv6"
217 #define IPSEC "IPSec"
218 #define JOINMODE "JoinMode"
219 #define KEYCHAIN "Keychain"
220 #define L2TP "L2TP"
221 #define LASTCAUSE "LastCause"
222 #define LASTUPDATED "LastUpdated"
223 #define LCP "LCP"
224 #define LINK "Link"
225 #define LINKLOCAL "LinkLocal"
226 #define LOCALHOSTNAME "LocalHostName"
227 #define LOGFILE "Logfile"
228 #define MACADDRESS "MACAddress"
229 #define MANUAL "Manual"
230 #define MEDIA "Media"
231 #define OPTIONS "Options"
232 #define MODEM "Modem"
233 #define MRU "MRU"
234 #define MSCHAP1 "MSCHAP1"
235 #define MSCHAP2 "MSCHAP2"
236 #define MTU "MTU"
237 #define NAME "Name"
238 #define NETINFO "NetInfo"
239 #define NETWORK "Network"
240 #define NETWORKID "NetworkID"
241 #define NETWORKRANGE "NetworkRange"
242 #define NETWORKSERVICES "NetworkServices"
243 #define NIS "NIS"
244 #define NODE "Node"
245 #define NODEID "NodeID"
246 #define NOTE "Note"
247 #define OVERRIDEPRIMARY "OverridePrimary"
248 #define PAP "PAP"
249 #define PASSWORD "Password"
250 #define PLUGIN "Plugin"
251 #define PLUGINS "Plugins"
252 #define POWERENABLED "PowerEnabled"
253 #define PPP "PPP"
254 #define PPPOE "PPPoE"
255 #define PPPOVERRIDEPRIMARY "PPPOverridePrimary"
256 #define PPPSERIAL "PPPSerial"
257 #define PPTP "PPTP"
258 #define PREFERRED "Preferred"
259 #define PREFERREDNETWORK "PreferredNetwork"
260 #define PREFIXLENGTH "PrefixLength"
261 #define PREFS "Prefs"
262 #define PRIMARYINTERFACE "PrimaryInterface"
263 #define PRIMARYSERVICE "PrimaryService"
264 #define PROMPT "Prompt"
265 #define PROTOCOL "Protocol"
266 #define PROXIES "Proxies"
267 #define PROXYAUTOCONFIGENABLE "ProxyAutoConfigEnable"
268 #define PROXYAUTOCONFIGURLSTRING "ProxyAutoConfigURLString"
269 #define PULSEDIAL "PulseDial"
270 #define RECEIVEACCM "ReceiveACCM"
271 #define RECENT "Recent"
272 #define REDIALCOUNT "RedialCount"
273 #define REDIALENABLED "RedialEnabled"
274 #define REDIALINTERVAL "RedialInterval"
275 #define RELAY "Relay"
276 #define REMINDER "Reminder"
277 #define REMINDERTIME "ReminderTime"
278 #define REMOTEADDRESS "RemoteAddress"
279 #define RETRYCONNECTTIME "RetryConnectTime"
280 #define ROOTSEPARATOR "RootSeparator"
281 #define ROUTER "Router"
282 #define ROUTERADVERTISEMENT "RouterAdvertisement"
283 #define RTSPENABLE "RTSPEnable"
284 #define RTSPPORT "RTSPPort"
285 #define RTSPPROXY "RTSPProxy"
286 #define SAVEPASSWORDS "SavePasswords"
287 #define SEARCHDOMAINS "SearchDomains"
288 #define SEEDNETWORKRANGE "SeedNetworkRange"
289 #define SEEDROUTER "SeedRouter"
290 #define SEEDZONES "SeedZones"
291 #define SERVERADDRESSES "ServerAddresses"
292 #define SERVERTAGS "ServerTags"
293 #define SERVICE "Service"
294 #define SERVICEIDS "ServiceIDs"
295 #define SERVICEORDER "ServiceOrder"
296 #define SESSIONTIMER "SessionTimer"
297 #define SETS "Sets"
298 #define SETUP "Setup"
299 #define SHAREDSECRET "SharedSecret"
300 #define SOCKSENABLE "SOCKSEnable"
301 #define SOCKSPORT "SOCKSPort"
302 #define SOCKSPROXY "SOCKSProxy"
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 SUPPORTSMODEMONHOLD "SupportsModemOnHold"
313 #define SYSTEM "System"
314 #define TERMINALSCRIPT "TerminalScript"
315 #define TRANSMITACCM "TransmitACCM"
316 #define TRANSPORT "Transport"
317 #define TYPE "Type"
318 #define UID "UID"
319 #define USERDEFINEDNAME "UserDefinedName"
320 #define USE "Use"
321 #define USERS "Users"
322 #define VERBOSELOGGING "VerboseLogging"
323 #define WAITFORDIALTONE "WaitForDialTone"
324
325 struct {
326 int control;
327 const char * prefix;
328 const char * key;
329 const char * value;
330 const char * type;
331 } names[] = {
332 { COMMENT, "/*\n * Reserved Keys\n */", NULL, NULL },
333 { REGULAR, RESV, LINK, "__LINK__", CFSTRING },
334 { REGULAR, RESV, INACTIVE, "__INACTIVE__", NULL },
335 { COMMENT, "", NULL, NULL, NULL },
336
337 { COMMENT, "/*\n * Generic Keys\n */", NULL },
338 { DEFINE , PROP, INTERFACENAME, NULL, CFSTRING },
339 { REGULAR, PROP, MACADDRESS, NULL, CFSTRING },
340 { REGULAR, PROP, USERDEFINEDNAME, NULL, CFSTRING },
341 { DEFINE , PROP, VERSION, NULL, CFSTRING },
342 { COMMENT, "", NULL, NULL, NULL },
343
344 { COMMENT, "/*\n * Preference Keys\n */", NULL },
345 { REGULAR, PREF, CURRENTSET, NULL, CFSTRING },
346 { REGULAR, PREF, NETWORKSERVICES, NULL, CFDICTIONARY },
347 { REGULAR, PREF, SETS, NULL, CFDICTIONARY },
348 { REGULAR, PREF, SYSTEM, NULL, CFDICTIONARY },
349 { COMMENT, "", NULL, NULL, NULL },
350
351 { COMMENT, "/*\n * Component Keys\n */", NULL },
352 { REGULAR, COMP, NETWORK, NULL, NULL },
353 { REGULAR, COMP, SERVICE, NULL, NULL },
354 { REGULAR, COMP, GLOBAL, NULL, NULL },
355 { DEFINE , COMP, HOSTNAMES, NULL, NULL },
356 { REGULAR, COMP, INTERFACE, NULL, NULL },
357 { REGULAR, COMP, SYSTEM, NULL, NULL },
358 { REGULAR, COMP, USERS, NULL, NULL },
359 { COMMENT, "", NULL, NULL, NULL },
360
361 { COMMENT, "/*\n * Regex key which matches any component\n */", NULL },
362 { REGULAR, COMP, ANYREGEX, "[^/]+", NULL },
363 { COMMENT, "", NULL, NULL, NULL },
364
365 { COMMENT, "/*\n * Network Entity Keys\n */", NULL },
366 { REGULAR, NETENT, AIRPORT, NULL, CFDICTIONARY },
367 { REGULAR, NETENT, APPLETALK, NULL, CFDICTIONARY },
368 { DEFINE , NETENT, DHCP, NULL, CFDICTIONARY },
369 { REGULAR, NETENT, DNS, NULL, CFDICTIONARY },
370 { REGULAR, NETENT, ETHERNET, NULL, CFDICTIONARY },
371 { DEFINE , NETENT, FIREWIRE, NULL, CFDICTIONARY },
372 { REGULAR, NETENT, INTERFACE, NULL, CFDICTIONARY },
373 { REGULAR, NETENT, IPV4, NULL, CFDICTIONARY },
374 { REGULAR, NETENT, IPV6, NULL, CFDICTIONARY },
375 { DEFINE , NETENT, L2TP, NULL, CFDICTIONARY },
376 { REGULAR, NETENT, LINK, NULL, CFDICTIONARY },
377 { REGULAR, NETENT, MODEM, NULL, CFDICTIONARY },
378 { REGULAR, NETENT, NETINFO, NULL, CFDICTIONARY },
379 { FUTURE , NETENT, NIS, NULL, CFDICTIONARY },
380 { REGULAR, NETENT, PPP, NULL, CFDICTIONARY },
381 { REGULAR, NETENT, PPPOE, NULL, CFDICTIONARY },
382 { DEFINE , NETENT, PPPSERIAL, NULL, CFDICTIONARY },
383 { DEFINE , NETENT, PPTP, NULL, CFDICTIONARY },
384 { REGULAR, NETENT, PROXIES, NULL, CFDICTIONARY },
385 { DEFINE , NETENT, STF, NULL, CFDICTIONARY },
386 { COMMENT, "", NULL, NULL, NULL },
387
388 { COMMENT, "/*\n * " KEY_PREFIX COMP NETWORK " Properties\n */", NULL },
389 { DEFINE , NETPROP, OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
390 { REGULAR, NETPROP, SERVICEORDER, NULL, CFARRAY_CFSTRING },
391 { REGULAR, NETPROP, PPPOVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
392 { COMMENT, "", NULL, NULL, NULL },
393
394 { COMMENT, "/*\n * " KEY_PREFIX COMP NETWORK INTERFACE " Properties\n */", NULL },
395 { DEFINE , NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
396 { COMMENT, "", NULL, NULL, NULL },
397
398 { COMMENT, "/*\n * " KEY_PREFIX COMP NETWORK HOSTNAMES " Properties\n */", NULL },
399 { DEFINE , NETPROP, LOCALHOSTNAME, NULL, CFSTRING },
400 { COMMENT, "", NULL, NULL, NULL },
401
402 { COMMENT, "/*\n * " KEY_PREFIX NETENT AIRPORT " (Hardware) Entity Keys\n */", NULL, NULL, NULL },
403 { DEFINE , NETPROP AIRPORT, ALLOWNETCREATION, NULL, CFNUMBER_BOOL },
404 { REGULAR, NETPROP AIRPORT, AUTH PASSWORD, NULL, CFDATA },
405 { REGULAR, NETPROP AIRPORT, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
406 { DEFINE , NETPROP AIRPORT, JOINMODE, NULL, CFSTRING },
407 { REGULAR, NETPROP AIRPORT, POWERENABLED, NULL, CFNUMBER_BOOL },
408 { REGULAR, NETPROP AIRPORT, PREFERREDNETWORK, NULL, CFSTRING },
409 { DEFINE , NETPROP AIRPORT, SAVEPASSWORDS, NULL, CFNUMBER_BOOL },
410 { COMMENT, "", NULL, NULL, NULL },
411 { COMMENT, "/* " KEY_PREFIX NETPROP AIRPORT JOINMODE " values */", NULL, NULL, NULL },
412 { DEFINE , NETVAL AIRPORT JOINMODE, AUTOMATIC, NULL, NULL },
413 { DEFINE , NETVAL AIRPORT JOINMODE, PREFERRED, NULL, NULL },
414 { DEFINE , NETVAL AIRPORT JOINMODE, RECENT, NULL, NULL },
415 { DEFINE , NETVAL AIRPORT JOINMODE, STRONGEST, NULL, NULL },
416 { COMMENT, "", NULL, NULL, NULL },
417 { COMMENT, "/* " KEY_PREFIX NETPROP AIRPORT PASSWORD ENCRYPTION " values */", NULL, NULL, NULL },
418 { DEFINE , NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
419 { COMMENT, "", NULL, NULL, NULL },
420
421 { COMMENT, "/*\n * " KEY_PREFIX NETENT APPLETALK " Entity Keys\n */", NULL, NULL, NULL },
422 { REGULAR, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
423 { REGULAR, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
424 { REGULAR, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
425 { REGULAR, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
426 { REGULAR, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
427 { REGULAR, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
428 { REGULAR, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
429 { REGULAR, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
430 { REGULAR, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
431 { COMMENT, "", NULL, NULL, NULL },
432 { COMMENT, "/* " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values */", NULL, NULL, NULL },
433 { REGULAR, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
434 { REGULAR, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
435 { REGULAR, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
436 { COMMENT, "", NULL, NULL, NULL },
437
438 { COMMENT, "/*\n * " KEY_PREFIX NETENT DNS " Entity Keys\n */", NULL, NULL, NULL },
439 { REGULAR, NETPROP DNS, DOMAINNAME, NULL, CFSTRING },
440 { REGULAR, NETPROP DNS, SEARCHDOMAINS, NULL, CFARRAY_CFSTRING},
441 { REGULAR, NETPROP DNS, SERVERADDRESSES, NULL, CFARRAY_CFSTRING },
442 { DEFINE , NETPROP DNS, SORTLIST, NULL, CFARRAY_CFSTRING },
443 { COMMENT, "", NULL, NULL, NULL },
444
445 { COMMENT, "/*\n * " KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys\n */", NULL, NULL, NULL },
446 { DEFINE , NETPROP ETHERNET, MEDIA SUBTYPE, NULL, CFSTRING },
447 { DEFINE , NETPROP ETHERNET, MEDIA OPTIONS, NULL, CFARRAY_CFSTRING },
448 { DEFINE , NETPROP ETHERNET, MTU, NULL, CFNUMBER },
449 { COMMENT, "", NULL, NULL, NULL },
450
451 { COMMENT, "/*\n * " KEY_PREFIX NETENT FIREWIRE " (Hardware) Entity Keys\n */", NULL, NULL, NULL },
452 { COMMENT, "/* RESERVED FOR FUTURE USE */", NULL, NULL, NULL },
453 { COMMENT, "", NULL, NULL, NULL },
454
455 { COMMENT, "/*\n * " KEY_PREFIX NETENT INTERFACE " Entity Keys\n */", NULL },
456 { REGULAR, NETPROP INTERFACE, DEVICENAME, NULL, CFSTRING },
457 { REGULAR, NETPROP INTERFACE, HARDWARE, NULL, CFSTRING },
458 { REGULAR, NETPROP INTERFACE, TYPE, NULL, CFSTRING },
459 { REGULAR, NETPROP INTERFACE, SUBTYPE, NULL, CFSTRING },
460 { DEFINE , NETPROP INTERFACE, SUPPORTSMODEMONHOLD, NULL, CFNUMBER_BOOL },
461 { COMMENT, "", NULL, NULL, NULL },
462 { COMMENT, "/* " KEY_PREFIX NETPROP INTERFACE TYPE " values */", NULL, NULL, NULL },
463 { REGULAR, NETVAL INTERFACE TYPE, ETHERNET, NULL, NULL },
464 { DEFINE , NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
465 { REGULAR, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
466 { DEFINE , NETVAL INTERFACE TYPE, STF, NULL, NULL },
467 { COMMENT, "", NULL, NULL, NULL },
468 { COMMENT, "/* " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") */", NULL, NULL, NULL },
469 { REGULAR, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
470 { REGULAR, NETVAL INTERFACE SUBTYPE, PPPSERIAL, NULL, NULL },
471 { DEFINE , NETVAL INTERFACE SUBTYPE, PPTP, NULL, NULL },
472 { DEFINE , NETVAL INTERFACE SUBTYPE, L2TP, NULL, NULL },
473 { COMMENT, "", NULL, NULL, NULL },
474
475 { COMMENT, "/*\n * " KEY_PREFIX NETENT IPV4 " Entity Keys\n */", NULL, NULL, NULL },
476 { REGULAR, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
477 { REGULAR, NETPROP IPV4, CONFIGMETHOD, NULL, CFSTRING },
478 { REGULAR, NETPROP IPV4, DHCPCLIENTID, NULL, CFSTRING },
479 { REGULAR, NETPROP IPV4, ROUTER, NULL, CFSTRING },
480 { REGULAR, NETPROP IPV4, SUBNETMASKS, NULL, CFARRAY_CFSTRING },
481 { REGULAR, NETPROP IPV4, DESTADDRESSES, NULL, CFARRAY_CFSTRING },
482 { REGULAR, NETPROP IPV4, BROADCASTADDRESSES, NULL, CFARRAY_CFSTRING },
483 { COMMENT, "", NULL, NULL, NULL },
484 { COMMENT, "/* " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values */", NULL, NULL, NULL },
485 { REGULAR, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
486 { REGULAR, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
487 { REGULAR, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
488 { REGULAR, NETVAL IPV4 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
489 { REGULAR, NETVAL IPV4 CONFIGMETHOD, MANUAL, NULL, NULL },
490 { REGULAR, NETVAL IPV4 CONFIGMETHOD, PPP, NULL, NULL },
491 { COMMENT, "", NULL, NULL, NULL },
492
493 { COMMENT, "/*\n * " KEY_PREFIX NETENT IPV6 " Entity Keys\n */", NULL, NULL, NULL },
494 { REGULAR, NETPROP IPV6, ADDRESSES, NULL, CFARRAY_CFSTRING },
495 { REGULAR, NETPROP IPV6, CONFIGMETHOD, NULL, CFSTRING },
496 { DEFINE , NETPROP IPV6, DESTADDRESSES, NULL, CFARRAY_CFSTRING },
497 { DEFINE , NETPROP IPV6, FLAGS, NULL, CFNUMBER },
498 { DEFINE , NETPROP IPV6, PREFIXLENGTH, NULL, CFARRAY_CFNUMBER },
499 { DEFINE , NETPROP IPV6, ROUTER, NULL, CFSTRING },
500 { COMMENT, "", NULL, NULL, NULL },
501 { COMMENT, "/* " KEY_PREFIX NETPROP IPV6 CONFIGMETHOD " values */", NULL, NULL, NULL },
502 { DEFINE , NETVAL IPV6 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
503 { DEFINE , NETVAL IPV6 CONFIGMETHOD, MANUAL, NULL, NULL },
504 { DEFINE , NETVAL IPV6 CONFIGMETHOD, ROUTERADVERTISEMENT, NULL, NULL },
505 { DEFINE , NETVAL IPV6 CONFIGMETHOD, STF, NULL, NULL },
506 { COMMENT, "", NULL, NULL, NULL },
507
508 { COMMENT, "/*\n * " KEY_PREFIX NETENT STF " Entity Keys\n */", NULL, NULL, NULL },
509 { DEFINE , NETPROP STF, RELAY, NULL, CFSTRING },
510 { COMMENT, "", NULL, NULL, NULL },
511
512 { COMMENT, "/*\n * " KEY_PREFIX NETENT LINK " Entity Keys\n */", NULL, NULL, NULL },
513 { REGULAR, NETPROP LINK, ACTIVE, NULL, CFBOOLEAN },
514 { DEFINE , NETPROP LINK, DETACHING, NULL, CFBOOLEAN },
515 { COMMENT, "", NULL, NULL, NULL },
516
517 { COMMENT, "/*\n * " KEY_PREFIX NETENT MODEM " (Hardware) Entity Keys\n */", NULL, NULL, NULL },
518 { REGULAR, NETPROP MODEM, CONNECTIONSCRIPT, NULL, CFSTRING },
519 { DEFINE , NETPROP MODEM, CONNECTSPEED, NULL, CFNUMBER },
520 { DEFINE , NETPROP MODEM, DATACOMPRESSION, NULL, CFNUMBER_BOOL },
521 { REGULAR, NETPROP MODEM, DIALMODE, NULL, CFSTRING },
522 { DEFINE , NETPROP MODEM, ERRORCORRECTION, NULL, CFNUMBER_BOOL },
523 { DEFINE , NETPROP MODEM, HOLD CALLWAITINGAUDIBLEALERT, NULL, CFNUMBER_BOOL },
524 { DEFINE , NETPROP MODEM, HOLD DISCONNECTONANSWER, NULL, CFNUMBER_BOOL },
525 { DEFINE , NETPROP MODEM, HOLD ENABLED, NULL, CFNUMBER_BOOL },
526 { DEFINE , NETPROP MODEM, HOLD REMINDER, NULL, CFNUMBER_BOOL },
527 { DEFINE , NETPROP MODEM, HOLD REMINDERTIME, NULL, CFNUMBER },
528 { DEFINE , NETPROP MODEM, NOTE, NULL, CFSTRING },
529 { REGULAR, NETPROP MODEM, PULSEDIAL, NULL, CFNUMBER_BOOL },
530 { REGULAR, NETPROP MODEM, SPEAKER, NULL, CFNUMBER_BOOL },
531 { REGULAR, NETPROP MODEM, SPEED, NULL, CFNUMBER },
532 { COMMENT, "", NULL, NULL, NULL },
533 { COMMENT, "/* " KEY_PREFIX NETPROP MODEM DIALMODE " values */", NULL, NULL, NULL },
534 { REGULAR, NETVAL MODEM DIALMODE, IGNOREDIALTONE, NULL, NULL },
535 { REGULAR, NETVAL MODEM DIALMODE, MANUAL, NULL, NULL },
536 { REGULAR, NETVAL MODEM DIALMODE, WAITFORDIALTONE, NULL, NULL },
537 { COMMENT, "", NULL, NULL, NULL },
538
539 { COMMENT, "/*\n * " KEY_PREFIX NETENT NETINFO " Entity Keys\n */", NULL, NULL, NULL },
540 { REGULAR, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
541 { REGULAR, NETPROP NETINFO, SERVERADDRESSES, NULL, CFARRAY_CFSTRING },
542 { REGULAR, NETPROP NETINFO, SERVERTAGS, NULL, CFARRAY_CFSTRING },
543 { REGULAR, NETPROP NETINFO, BROADCASTSERVERTAG, NULL, CFSTRING },
544 { COMMENT, "", NULL, NULL, NULL },
545 { COMMENT, "/* " KEY_PREFIX NETPROP NETINFO BINDINGMETHODS " values */", NULL, NULL, NULL },
546 { REGULAR, NETVAL NETINFO BINDINGMETHODS, BROADCAST, NULL, NULL },
547 { REGULAR, NETVAL NETINFO BINDINGMETHODS, DHCP, NULL, NULL },
548 { REGULAR, NETVAL NETINFO BINDINGMETHODS, MANUAL, NULL, NULL },
549 { COMMENT, "", NULL, NULL, NULL },
550 { COMMENT, "/* " KEY_PREFIX NETPROP NETINFO BROADCASTSERVERTAG " default value */", NULL, NULL, NULL },
551 { REGULAR, NETVAL NETINFO, DEFAULTSERVERTAG, "network", NULL },
552 { COMMENT, "", NULL, NULL, NULL },
553
554 { COMMENT, "/*\n * " KEY_PREFIX NETENT NIS " Entity Keys\n */", NULL, NULL, NULL },
555 { COMMENT, "/* RESERVED FOR FUTURE USE */", NULL, NULL, NULL },
556 { COMMENT, "", NULL, NULL, NULL },
557
558 { COMMENT, "/*\n * " KEY_PREFIX NETENT PPP " Entity Keys\n */", NULL, NULL, NULL },
559 { DEFINE , NETPROP PPP, ACSPENABLED, NULL, CFNUMBER_BOOL },
560 { DEFINE , NETPROP PPP, CONNECTTIME, NULL, CFNUMBER },
561 { DEFINE , NETPROP PPP, DEVICE LASTCAUSE, NULL, CFNUMBER },
562 { REGULAR, NETPROP PPP, DIALONDEMAND, NULL, CFNUMBER_BOOL },
563 { REGULAR, NETPROP PPP, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
564 { REGULAR, NETPROP PPP, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
565 { REGULAR, NETPROP PPP, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
566 { DEFINE , NETPROP PPP, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
567 { DEFINE , NETPROP PPP, DISCONNECTTIME, NULL, CFNUMBER },
568 { REGULAR, NETPROP PPP, IDLEREMINDERTIMER, NULL, CFNUMBER },
569 { REGULAR, NETPROP PPP, IDLEREMINDER, NULL, CFNUMBER_BOOL },
570 { DEFINE , NETPROP PPP, LASTCAUSE, NULL, CFNUMBER },
571 { REGULAR, NETPROP PPP, LOGFILE, NULL, CFSTRING },
572 { DEFINE , NETPROP PPP, PLUGINS, NULL, CFARRAY_CFSTRING },
573 { DEFINE , NETPROP PPP, RETRYCONNECTTIME, NULL, CFNUMBER },
574 { DEFINE , NETPROP PPP, SESSIONTIMER, NULL, CFNUMBER },
575 { DEFINE , NETPROP PPP, STATUS, NULL, CFNUMBER },
576 { DEFINE , NETPROP PPP, USE SESSIONTIMER, NULL, CFNUMBER_BOOL },
577 { REGULAR, NETPROP PPP, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
578 { COMMENT, "", NULL, NULL, NULL },
579
580 { COMMENT, "/* " AUTH ": */", NULL, NULL, NULL },
581 { DEFINE , NETPROP PPP, AUTH EAP PLUGINS, NULL, CFARRAY_CFSTRING },
582 { REGULAR, NETPROP PPP, AUTH NAME, NULL, CFSTRING },
583 { REGULAR, NETPROP PPP, AUTH PASSWORD, NULL, CFSTRING },
584 { REGULAR, NETPROP PPP, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
585 { DEFINE , NETPROP PPP, AUTH PROMPT, NULL, CFSTRING },
586 { REGULAR, NETPROP PPP, AUTH PROTOCOL, NULL, CFARRAY_CFSTRING },
587 { COMMENT, "", NULL, NULL, NULL },
588 { COMMENT, "/* " KEY_PREFIX NETPROP PPP AUTH PASSWORD ENCRYPTION " values */", NULL, NULL, NULL },
589 { DEFINE , NETVAL PPP AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
590 { COMMENT, "", NULL, NULL, NULL },
591 { COMMENT, "/* " KEY_PREFIX NETPROP PPP AUTH PROMPT " values */", NULL, NULL, NULL },
592 { DEFINE , NETVAL PPP AUTH PROMPT, BEFORE, NULL, CFSTRING },
593 { DEFINE , NETVAL PPP AUTH PROMPT, AFTER, NULL, CFSTRING },
594 { COMMENT, "", NULL, NULL, NULL },
595 { COMMENT, "/* " KEY_PREFIX NETPROP PPP AUTH PROTOCOL " values */", NULL, NULL, NULL },
596 { REGULAR, NETVAL PPP AUTH PROTOCOL, CHAP, NULL, CFSTRING },
597 { DEFINE , NETVAL PPP AUTH PROTOCOL, EAP, NULL, CFSTRING },
598 { DEFINE , NETVAL PPP AUTH PROTOCOL, MSCHAP1, NULL, CFSTRING },
599 { DEFINE , NETVAL PPP AUTH PROTOCOL, MSCHAP2, NULL, CFSTRING },
600 { REGULAR, NETVAL PPP AUTH PROTOCOL, PAP, NULL, CFSTRING },
601
602 { COMMENT, "\n/* " COMM ": */", NULL, NULL, NULL },
603 { REGULAR, NETPROP PPP, COMM ALTERNATEREMOTEADDRESS, NULL, CFSTRING },
604 { REGULAR, NETPROP PPP, COMM CONNECTDELAY, NULL, CFNUMBER },
605 { REGULAR, NETPROP PPP, COMM DISPLAYTERMINALWINDOW, NULL, CFNUMBER_BOOL },
606 { REGULAR, NETPROP PPP, COMM REDIALCOUNT, NULL, CFNUMBER },
607 { REGULAR, NETPROP PPP, COMM REDIALENABLED, NULL, CFNUMBER_BOOL },
608 { REGULAR, NETPROP PPP, COMM REDIALINTERVAL, NULL, CFNUMBER },
609 { REGULAR, NETPROP PPP, COMM REMOTEADDRESS, NULL, CFSTRING },
610 { REGULAR, NETPROP PPP, COMM TERMINALSCRIPT, NULL, CFSTRING },
611 { DEFINE , NETPROP PPP, COMM USE TERMINALSCRIPT, NULL, CFNUMBER_BOOL },
612
613 { COMMENT, "\n/* " CCP ": */", NULL, NULL, NULL },
614 { DEFINE , NETPROP PPP, CCP ENABLED, NULL, CFNUMBER_BOOL },
615
616 { COMMENT, "\n/* " IPCP ": */", NULL, NULL, NULL },
617 { REGULAR, NETPROP PPP, IPCP COMPRESSIONVJ, NULL, CFNUMBER_BOOL },
618
619 { COMMENT, "\n/* " LCP ": */", NULL, NULL, NULL },
620 { REGULAR, NETPROP PPP, LCP ECHOENABLED, NULL, CFNUMBER_BOOL },
621 { REGULAR, NETPROP PPP, LCP ECHOFAILURE, NULL, CFNUMBER },
622 { REGULAR, NETPROP PPP, LCP ECHOINTERVAL, NULL, CFNUMBER },
623 { REGULAR, NETPROP PPP, LCP COMPRESSIONACFIELD, NULL, CFNUMBER_BOOL },
624 { REGULAR, NETPROP PPP, LCP COMPRESSIONPFIELD, NULL, CFNUMBER_BOOL },
625 { REGULAR, NETPROP PPP, LCP MRU, NULL, CFNUMBER },
626 { REGULAR, NETPROP PPP, LCP MTU, NULL, CFNUMBER },
627 { REGULAR, NETPROP PPP, LCP RECEIVEACCM, NULL, CFNUMBER },
628 { REGULAR, NETPROP PPP, LCP TRANSMITACCM, NULL, CFNUMBER },
629 { COMMENT, "", NULL, NULL, NULL },
630
631 { COMMENT, "/*\n * " KEY_PREFIX NETENT PPPOE " Entity Keys\n */", NULL, NULL, NULL },
632 { COMMENT, "/* RESERVED FOR FUTURE USE */", NULL, NULL, NULL },
633 { COMMENT, "", NULL, NULL, NULL },
634
635 { COMMENT, "/*\n * " KEY_PREFIX NETENT PPPSERIAL " Entity Keys\n */", NULL, NULL, NULL },
636 { COMMENT, "/* RESERVED FOR FUTURE USE */", NULL, NULL, NULL },
637 { COMMENT, "", NULL, NULL, NULL },
638
639 { COMMENT, "/*\n * " KEY_PREFIX NETENT PPTP " Entity Keys\n */", NULL, NULL, NULL },
640 { COMMENT, "/* RESERVED FOR FUTURE USE */", NULL, NULL, NULL },
641 { COMMENT, "", NULL, NULL, NULL },
642
643 { COMMENT, "/*\n * " KEY_PREFIX NETENT L2TP " Entity Keys\n */", NULL, NULL, NULL },
644 { DEFINE , NETPROP L2TP, IPSEC SHAREDSECRET, NULL, CFSTRING },
645 { DEFINE , NETPROP L2TP, IPSEC SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
646 { DEFINE , NETPROP L2TP, TRANSPORT, NULL, CFSTRING },
647 { COMMENT, "", NULL, NULL, NULL },
648 { COMMENT, "/* " KEY_PREFIX NETPROP L2TP IPSEC SHAREDSECRET ENCRYPTION " values */", NULL, NULL, NULL },
649 { DEFINE , NETVAL L2TP IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
650 { COMMENT, "", NULL, NULL, NULL },
651 { COMMENT, "/* " KEY_PREFIX NETPROP L2TP TRANSPORT " values */", NULL, NULL, NULL },
652 { DEFINE , NETVAL L2TP TRANSPORT, IP, NULL, NULL },
653 { DEFINE , NETVAL L2TP TRANSPORT, IPSEC, NULL, NULL },
654 { COMMENT, "", NULL, NULL, NULL },
655
656 { COMMENT, "/*\n * " KEY_PREFIX NETENT PROXIES " Entity Keys\n */", NULL, NULL, NULL },
657 { REGULAR, NETPROP PROXIES, EXCEPTIONSLIST, NULL, CFARRAY_CFSTRING },
658 { REGULAR, NETPROP PROXIES, FTPENABLE, NULL, CFNUMBER_BOOL },
659 { REGULAR, NETPROP PROXIES, FTPPASSIVE, NULL, CFNUMBER_BOOL },
660 { REGULAR, NETPROP PROXIES, FTPPORT, NULL, CFNUMBER },
661 { REGULAR, NETPROP PROXIES, FTPPROXY, NULL, CFSTRING },
662 { REGULAR, NETPROP PROXIES, GOPHERENABLE, NULL, CFNUMBER_BOOL },
663 { REGULAR, NETPROP PROXIES, GOPHERPORT, NULL, CFNUMBER },
664 { REGULAR, NETPROP PROXIES, GOPHERPROXY, NULL, CFSTRING },
665 { REGULAR, NETPROP PROXIES, HTTPENABLE, NULL, CFNUMBER_BOOL },
666 { REGULAR, NETPROP PROXIES, HTTPPORT, NULL, CFNUMBER },
667 { REGULAR, NETPROP PROXIES, HTTPPROXY, NULL, CFSTRING },
668 { DEFINE , NETPROP PROXIES, HTTPSENABLE, NULL, CFNUMBER_BOOL },
669 { DEFINE , NETPROP PROXIES, HTTPSPORT, NULL, CFNUMBER },
670 { DEFINE , NETPROP PROXIES, HTTPSPROXY, NULL, CFSTRING },
671 { REGULAR, NETPROP PROXIES, RTSPENABLE, NULL, CFNUMBER_BOOL },
672 { REGULAR, NETPROP PROXIES, RTSPPORT, NULL, CFNUMBER },
673 { REGULAR, NETPROP PROXIES, RTSPPROXY, NULL, CFSTRING },
674 { REGULAR, NETPROP PROXIES, SOCKSENABLE, NULL, CFNUMBER_BOOL },
675 { REGULAR, NETPROP PROXIES, SOCKSPORT, NULL, CFNUMBER },
676 { REGULAR, NETPROP PROXIES, SOCKSPROXY, NULL, CFSTRING },
677 { DEFINE , NETPROP PROXIES, PROXYAUTOCONFIGENABLE, NULL, CFNUMBER_BOOL },
678 { DEFINE , NETPROP PROXIES, PROXYAUTOCONFIGURLSTRING, NULL, CFSTRING },
679 { COMMENT, "", NULL, NULL, NULL },
680
681 { COMMENT, "/*\n " KEY_PREFIX COMP USERS " Entity Keys\n */", NULL, NULL, NULL },
682 { REGULAR, USERSENT, CONSOLEUSER, NULL, NULL },
683 { COMMENT, "", NULL, NULL, NULL },
684
685 { COMMENT, "/*\n * " KEY_PREFIX COMP SYSTEM " Properties\n */", NULL, NULL, NULL },
686 { REGULAR, SYSTEMPROP, COMPUTERNAME, NULL, CFSTRING },
687 { REGULAR, SYSTEMPROP, COMPUTERNAME ENCODING, NULL, CFNUMBER },
688 { COMMENT, "", NULL, NULL, NULL },
689
690 { COMMENT, "/*\n * Configuration Store Definitions\n */", NULL },
691 { COMMENT, "/* domain prefixes */", NULL },
692 { DEFINE , DYNAMICSTORE DOMAIN, FILE, "File:", NULL },
693 { DEFINE , DYNAMICSTORE DOMAIN, PLUGIN, "Plugin:", NULL },
694 { DEFINE , DYNAMICSTORE DOMAIN, SETUP, "Setup:", NULL },
695 { DEFINE , DYNAMICSTORE DOMAIN, STATE, "State:", NULL },
696 { DEFINE , DYNAMICSTORE DOMAIN, PREFS, "Prefs:", NULL },
697 { COMMENT, "", NULL, NULL, NULL },
698
699 { COMMENT, "/* " KEY_PREFIX DYNAMICSTORE DOMAIN SETUP " Properties */", NULL },
700 { DEFINE , DYNAMICSTORE SETUPPROP, CURRENTSET, NULL, CFSTRING },
701 { DEFINE , DYNAMICSTORE SETUPPROP, LASTUPDATED, NULL, NULL },
702 { COMMENT, "", NULL, NULL, NULL },
703
704 { COMMENT, "/* Properties */", NULL },
705 { DEFINE , DYNAMICSTORE NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
706 { DEFINE , DYNAMICSTORE NETPROP, PRIMARYINTERFACE, NULL, CFSTRING },
707 { DEFINE , DYNAMICSTORE NETPROP, PRIMARYSERVICE, NULL, CFSTRING },
708 { DEFINE , DYNAMICSTORE NETPROP, SERVICEIDS, NULL, CFARRAY_CFSTRING },
709 { COMMENT, "", NULL, NULL, NULL },
710
711 { COMMENT, "/*\n * Obsolete schema definitions which will be removed \"soon\".\n */", NULL },
712 { OBSOLETE, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
713 { OBSOLETE, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
714 { OBSOLETE, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
715 { COMMENT, "", NULL, NULL, NULL },
716
717 { END, NULL, NULL, NULL, NULL },
718 };
719
720 static inline void
721 setmax(int *max, char **maxstr, char *str)
722 {
723 int l;
724
725 l = strlen(str);
726 if (l > *max) {
727 if (*maxstr) free(*maxstr);
728 *maxstr = strdup(str);
729 *max = l;
730 }
731 return;
732 }
733
734 enum {
735 gen_header_e,
736 gen_hfile_e,
737 gen_cfile_e,
738 };
739
740 void
741 dump_names(int type)
742 {
743 int i;
744 int maxkbuf = 0;
745 char *maxkstr = NULL;
746 int maxvbuf = 0;
747 char *maxvstr = NULL;
748
749 for (i = 0; TRUE; i++) {
750 switch (names[i].control) {
751 case END: {
752 goto done;
753 break;
754 }
755 case COMMENT: {
756 switch (type) {
757 case gen_header_e:
758 case gen_hfile_e:
759 if (names[i].prefix)
760 printf("%s\n", names[i].prefix);
761 break;
762 default:
763 break;
764 }
765 break;
766 }
767 case DEFINE: {
768 char kbuf[256];
769 char vbuf[256];
770
771 switch (type) {
772 case gen_header_e:
773 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
774 names[i].prefix, names[i].key);
775
776 if (names[i].value)
777 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
778 names[i].value);
779 else
780 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
781 names[i].key);
782
783 if (names[i].type)
784 printf("#define %-40s %-40s /* %s */\n",
785 kbuf, vbuf, names[i].type);
786 else
787 printf("#define %-40s %-40s\n",
788 kbuf, vbuf);
789 break;
790 case gen_hfile_e:
791 snprintf(kbuf, sizeof(kbuf), "(" KEY_PREFIX "%s%s);",
792 names[i].prefix, names[i].key);
793 setmax(&maxkbuf, &maxkstr, kbuf);
794
795 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
796 names[i].value ? names[i].value : names[i].key);
797 setmax(&maxvbuf, &maxvstr, vbuf);
798
799 printf("SC_SCHEMA_DECLARATION%-42s /* %-17s %-30s */\n",
800 kbuf,
801 names[i].type ? names[i].type : "",
802 vbuf);
803 break;
804 case gen_cfile_e:
805 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
806 names[i].prefix, names[i].key);
807
808 if (names[i].value)
809 printf("const CFStringRef %-45s = CFSTR(\"%s\");\n",
810 kbuf, names[i].value);
811 else
812 printf("const CFStringRef %-45s = CFSTR(\"%s\");\n",
813 kbuf, names[i].key);
814 break;
815 default:
816 break;
817 }
818 break;
819 }
820 case REGULAR: {
821 char kbuf[256];
822 char vbuf[256];
823
824 switch (type) {
825 case gen_header_e:
826 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
827 names[i].prefix, names[i].key);
828
829 if (names[i].value)
830 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
831 names[i].value);
832 else
833 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
834 names[i].key);
835
836 if (names[i].type)
837 printf("#define %-40s %-40s /* %s */\n",
838 kbuf, vbuf, names[i].type);
839 else
840 printf("#define %-40s %-40s\n",
841 kbuf, vbuf);
842 break;
843 case gen_hfile_e:
844 snprintf(kbuf, sizeof(kbuf), "(" KEY_PREFIX "%s%s);",
845 names[i].prefix, names[i].key);
846 setmax(&maxkbuf, &maxkstr, kbuf);
847
848 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
849 names[i].value ? names[i].value : names[i].key);
850 setmax(&maxvbuf, &maxvstr, vbuf);
851
852 printf("SC_SCHEMA_DECLARATION%-42s /* %-17s %-30s */\n",
853 kbuf,
854 names[i].type ? names[i].type : "",
855 vbuf);
856 break;
857 case gen_cfile_e:
858 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
859 names[i].prefix, names[i].key);
860
861 if (names[i].value)
862 printf("const CFStringRef %-45s = CFSTR(\"%s\");\n",
863 kbuf, names[i].value);
864 else
865 printf("const CFStringRef %-45s = CFSTR(\"%s\");\n",
866 kbuf, names[i].key);
867 break;
868 default:
869 break;
870 }
871 break;
872 }
873 case OBSOLETE: {
874 static int nObsolete = 0;
875 char kbuf[256];
876 char vbuf[256];
877
878 switch (type) {
879 case gen_hfile_e:
880 if (nObsolete++ == 0) {
881 printf("#ifndef SCSTR\n");
882 printf("#include <CoreFoundation/CFString.h>\n");
883 printf("#define SCSTR(s) CFSTR(s)\n");
884 printf("#endif\n");
885 }
886
887 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
888 names[i].prefix, names[i].key);
889
890 if (names[i].value)
891 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
892 names[i].value);
893 else
894 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
895 names[i].key);
896
897 printf("#define %-40s %-40s /* %s */\n",
898 kbuf,
899 vbuf,
900 names[i].type ? names[i].type : "");
901 break;
902 default:
903 break;
904 }
905 break;
906 }
907 case FUTURE: {
908 char kbuf[256];
909
910 switch (type) {
911 case gen_header_e:
912 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
913 names[i].prefix, names[i].key);
914
915 printf("// #define %-37s %-40s /* %s */\n",
916 kbuf,
917 "SCSTR(\"???\") */",
918 "RESERVED FOR FUTURE USE");
919 break;
920 case gen_hfile_e:
921 snprintf(kbuf, sizeof(kbuf), "(" KEY_PREFIX "%s%s);",
922 names[i].prefix, names[i].key);
923 setmax(&maxkbuf, &maxkstr, kbuf);
924
925 printf("// SC_SCHEMA_DECLARATION%-39s /* %s */\n",
926 kbuf, "RESERVED FOR FUTURE USE");
927 break;
928 default:
929 break;
930 }
931 break;
932 }
933 default: {
934 break;
935 }
936 }
937 }
938 done:
939 switch (type) {
940 case gen_hfile_e:
941 fprintf(stderr, "max key: length = %2d, string = %s\n", maxkbuf, maxkstr);
942 fprintf(stderr, "max val: length = %2d, string = %s\n", maxvbuf, maxvstr);
943 break;
944 }
945 return;
946 }
947
948 int
949 main(int argc, char * argv[])
950 {
951 char * type = "";
952
953 if (argc >= 2)
954 type = argv[1];
955
956 if (strcmp(type, "header-x") == 0) {
957 printf("%s\n", copyright_string);
958 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
959
960 printf("/*\n");
961 printf(" * Note: For Cocoa/Obj-C/Foundation programs accessing these preference\n");
962 printf(" * keys you may want to consider the following:\n");
963 printf(" *\n");
964 printf(" * #define SCSTR(s) (NSString *)CFSTR(s)\n");
965 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
966 printf(" */\n\n");
967
968 printf("#ifndef _SCSCHEMADEFINITIONS_10_1_H\n#define _SCSCHEMADEFINITIONS_10_1_H\n\n");
969
970 printf("#ifndef SCSTR\n");
971 printf("#include <CoreFoundation/CFString.h>\n");
972 printf("#define SCSTR(s) CFSTR(s)\n");
973 printf("#endif\n");
974
975 printf("\n");
976 dump_names(gen_header_e);
977 printf("#endif /* _SCSCHEMADEFINITIONS_10_1_H */\n");
978 }
979 else if (strcmp(type, "header") == 0) {
980 printf("%s\n", copyright_string);
981 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
982
983 printf("/*\n");
984 printf(" * Note: For Cocoa/Obj-C/Foundation programs accessing these preference\n");
985 printf(" * keys you may want to consider the following:\n");
986 printf(" *\n");
987 printf(" * #define " SC_SCHEMA_DECLARATION "(x)\t\textern NSString * x\n");
988 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
989 printf(" */\n\n");
990
991 printf("#ifndef _SCSCHEMADEFINITIONS_H\n#define _SCSCHEMADEFINITIONS_H\n\n");
992
993 printf("#ifndef SC_SCHEMA_DECLARATION\n");
994 printf("#ifndef SCSTR\n");
995 printf("#include <CoreFoundation/CFString.h>\n");
996 printf("#define " SC_SCHEMA_DECLARATION "(x)\textern const CFStringRef x\n");
997 printf("#else\n");
998 printf("#import <Foundation/NSString.h>\n");
999 printf("#define " SC_SCHEMA_DECLARATION "(x)\textern NSString * x\n");
1000 printf("#endif\n");
1001 printf("#endif\n");
1002
1003 printf("\n");
1004 dump_names(gen_hfile_e);
1005
1006 printf("#include <AvailabilityMacros.h>\n");
1007 printf("#if MAC_OS_X_VERSION_10_3 > MAC_OS_X_VERSION_MIN_REQUIRED\n");
1008 printf(" #if MAC_OS_X_VERSION_10_1 <= MAC_OS_X_VERSION_MIN_REQUIRED\n");
1009 printf(" #include <SystemConfiguration/SCSchemaDefinitions_10_1.h>\n");
1010 printf(" #endif\n");
1011 printf("#endif\n\n");
1012
1013 printf("#endif /* _SCSCHEMADEFINITIONS_H */\n");
1014 }
1015 else if (strcmp(type, "cfile") == 0) {
1016 printf("/*\n");
1017 printf(" * This file is automatically generated\n");
1018 printf(" * DO NOT EDIT!\n");
1019 printf(" */\n");
1020 printf("\n");
1021 printf("#include <CoreFoundation/CFString.h>\n");
1022 printf("\n");
1023 dump_names(gen_cfile_e);
1024 }
1025 exit(0);
1026 return (0);
1027 }
1028