]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/genSCPreferences.c
configd-204.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / genSCPreferences.c
1 /*
2 * Copyright (c) 2000-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 /*
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-2007 Apple 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_1_10_5, // deprecated in 10.5
91 SC_10_2,
92 SC_10_3,
93 SC_10_4,
94 SC_10_5,
95 COMMENT_PRIVATE,
96 GROUP_PRIVATE,
97 SC_10_5_PRIVATE,
98 COMMENT_DEPRECATED,
99 GROUP_DEPRECATED,
100 END
101 } controlType;
102
103 #define SC_SCHEMA_DECLARATION "SC_SCHEMA_DECLARATION"
104 #define SC_SCHEMA_KV "SC_SCHEMA_KV"
105
106 #define KEY_PREFIX "kSC"
107
108 #define COMP "Comp"
109 #define DYNAMICSTORE "DynamicStore"
110 #define PREF "Pref"
111 #define PROP "Prop"
112 #define PATH "Path"
113 #define NETENT "EntNet"
114 #define NETPROP "PropNet"
115 #define NETVAL "ValNet"
116 #define SETUPENT "EntSetup"
117 #define SETUPPROP "PropSetup"
118 #define SYSTEMENT "EntSystem"
119 #define SYSTEMPROP "PropSystem"
120 #define RESV "Resv"
121 #define USERSENT "EntUsers"
122 #define USERSPROP "PropUsers"
123 #define VERSION "Version"
124 #define VIRTUALPROP "PropVirtualNetworkInterfaces"
125
126 #define CFARRAY_CFNUMBER "CFArray[CFNumber]"
127 #define CFARRAY_CFSTRING "CFArray[CFString]"
128 #define CFBOOLEAN "CFBoolean"
129 #define CFDATA "CFData"
130 #define CFDICTIONARY "CFDictionary"
131 #define CFNUMBER "CFNumber"
132 #define CFNUMBER_BOOL "CFNumber (0 or 1)"
133 #define CFSTRING "CFString"
134
135 #define ACCESSPOINTNAME "AccessPointName"
136 #define ACSP "ACSP" // Apple Client Server Protocol
137 #define ACTIVE "Active"
138 #define ADDRESSES "Addresses"
139 #define AFTER "After"
140 #define AGGRESSIVE "Aggressive"
141 #define AIRPORT "AirPort"
142 #define ALERT "Alert"
143 #define ALLOWNETCREATION "AllowNetCreation"
144 #define ALTERNATEREMOTEADDRESS "AlternateRemoteAddress"
145 #define ANYREGEX "AnyRegex"
146 #define APPLETALK "AppleTalk"
147 #define AUTH "Auth"
148 #define AUTHENTICATIONMETHOD "AuthenticationMethod"
149 #define AUTOCONFIG "AutoConfig"
150 #define AUTODISCOVERY "AutoDiscovery"
151 #define AUTOMATIC "Automatic"
152 #define BEFORE "Before"
153 #define BINDINGMETHODS "BindingMethods"
154 #define BOND "Bond"
155 #define BOOTP "BOOTP"
156 #define BROADCAST "Broadcast"
157 #define CALLWAITINGAUDIBLEALERT "CallWaitingAudibleAlert"
158 #define CAUSE "Cause"
159 #define CCP "CCP"
160 #define CHAP "CHAP"
161 #define CERTIFICATE "Certificate"
162 #define COMM "Comm"
163 #define COMPATIBLE "Compatible"
164 #define COMPRESSIONACFIELD "CompressionACField"
165 #define COMPRESSIONPFIELD "CompressionPField"
166 #define COMPRESSIONVJ "CompressionVJ"
167 #define COMPUTERNAME "ComputerName"
168 #define CONFIGMETHOD "ConfigMethod"
169 #define CONNECTDELAY "ConnectDelay"
170 #define CONNECTION "Connection"
171 #define CONNECTSPEED "ConnectSpeed"
172 #define CONNECTTIME "ConnectTime"
173 #define CONSERVATIVE "Conservative"
174 #define CONSOLEUSER "ConsoleUser"
175 #define CONTEXTID "ContextID"
176 #define CURRENTSET "CurrentSet"
177 #define DATACOMPRESSION "DataCompression"
178 #define DEFAULT "Default"
179 #define DEFAULTZONE "DefaultZone"
180 #define DEST "Dest"
181 #define DETACHING "Detaching"
182 #define DEVICE "Device"
183 #define DEVICENAME "DeviceName"
184 #define DHCP "DHCP"
185 #define DHCPCLIENTID "DHCPClientID"
186 #define DIALMODE "DialMode"
187 #define DIALONDEMAND "DialOnDemand"
188 #define DISCONNECTONANSWER "DisconnectOnAnswer"
189 #define DISCONNECTONFASTUSERSWITCH "DisconnectOnFastUserSwitch"
190 #define DISCONNECTONIDLE "DisconnectOnIdle"
191 #define DISCONNECTONIDLETIMER "DisconnectOnIdleTimer"
192 #define DISCONNECTONLOGOUT "DisconnectOnLogout"
193 #define DISCONNECTONSLEEP "DisconnectOnSleep"
194 #define DISCONNECTTIME "DisconnectTime"
195 #define DISPLAYTERMINALWINDOW "DisplayTerminalWindow"
196 #define DNS "DNS"
197 #define DOMAIN "Domain"
198 #define DOMAINS "Domains"
199 #define EAP "EAP"
200 #define EAPOL "EAPOL"
201 #define ECHO "Echo"
202 #define ECHOFAILURE "EchoFailure"
203 #define ECHOINTERVAL "EchoInterval"
204 #define ENABLE "Enable"
205 #define ENABLED "Enabled"
206 #define ENCODING "Encoding"
207 #define ENCRYPTION "Encryption"
208 #define ERRORCORRECTION "ErrorCorrection"
209 #define ETHERNET "Ethernet"
210 #define EXCEPTIONSLIST "ExceptionsList"
211 #define EXCLUDESIMPLEHOSTNAMES "ExcludeSimpleHostnames"
212 #define FAILOVER "Failover"
213 #define FILE "File"
214 #define FIREWIRE "FireWire"
215 #define FIRST "First"
216 #define FLAGS "Flags"
217 #define FTP "FTP"
218 #define GID "GID"
219 #define GLOBAL "Global"
220 #define GOPHER "Gopher"
221 #define HARDWARE "Hardware"
222 #define HIGH "High"
223 #define HOLD "Hold"
224 #define HOSTNAME "HostName"
225 #define HOSTNAMES "HostNames"
226 #define HTTP "HTTP"
227 #define HTTPS "HTTPS"
228 #define HYBRID "Hybrid"
229 #define IDLEREMINDER "IdleReminder"
230 #define IDLEREMINDERTIMER "IdleReminderTimer"
231 #define IGNOREDIALTONE "IgnoreDialTone"
232 #define IGNORELINKSTATUS "IgnoreLinkStatus"
233 #define INACTIVE "Inactive"
234 #define INFORM "INFORM"
235 #define INTERFACE "Interface"
236 #define INTERFACENAME "InterfaceName"
237 #define INTERFACES "Interfaces"
238 #define IP "IP"
239 #define IPCP "IPCP"
240 #define IPV4 "IPv4"
241 #define IPV6 "IPv6"
242 #define IPSEC "IPSec"
243 #define JOIN "Join"
244 #define KEYCHAIN "Keychain"
245 #define KEYID "KeyID"
246 #define L2TP "L2TP"
247 #define LAST "Last"
248 #define LCP "LCP"
249 #define LINK "Link"
250 #define LINKLOCAL "LinkLocal"
251 #define LOCALCERTIFICATE "LocalCertificate"
252 #define LOCALHOSTNAME "LocalHostName"
253 #define LOCALIDENTIFIER "LocalIdentifier"
254 #define LOGFILE "Logfile"
255 #define LOW "Low"
256 #define MACADDRESS "MACAddress"
257 #define MANUAL "Manual"
258 #define MATCH "Match"
259 #define MEDIA "Media"
260 #define MIXED "Mixed"
261 #define MODEL "Model"
262 #define OPTIONS "Options"
263 #define MODE "Mode"
264 #define MODEM "Modem"
265 #define MPPE40 "MPPE40"
266 #define MPPE128 "MPPE128"
267 #define MRU "MRU"
268 #define MSCHAP1 "MSCHAP1"
269 #define MSCHAP2 "MSCHAP2"
270 #define MTU "MTU"
271 #define NAME "Name"
272 #define NETBIOS "NetBIOS"
273 #define NETINFO "NetInfo"
274 #define NETWORK "Network"
275 #define NETWORKID "NetworkID"
276 #define NETWORKRANGE "NetworkRange"
277 #define NETWORKSERVICES "NetworkServices"
278 #define NODE "Node"
279 #define NODEID "NodeID"
280 #define NOTE "Note"
281 #define ONDEMAND "OnDemand"
282 #define ORDER "Order"
283 #define ORDERS "Orders"
284 #define OVERRIDEPRIMARY "OverridePrimary"
285 #define PAP "PAP"
286 #define PASSIVE "Passive"
287 #define PASSWORD "Password"
288 #define PEER "Peer"
289 #define PERSONALITY "Personality"
290 #define PLUGIN "Plugin"
291 #define PLUGINS "Plugins"
292 #define POWER "Power"
293 #define PORT "Port"
294 #define PPP "PPP"
295 #define PPPOE "PPPoE"
296 #define PPPSERIAL "PPPSerial"
297 #define PPTP "PPTP"
298 #define PREFERRED "Preferred"
299 #define PREFIXLENGTH "PrefixLength"
300 #define PREFS "Prefs"
301 #define PRIMARYINTERFACE "PrimaryInterface"
302 #define PRIMARYSERVICE "PrimaryService"
303 #define PRIORITY "Priority"
304 #define PROMPT "Prompt"
305 #define PROTOCOL "Protocol"
306 #define PROXIES "Proxies"
307 #define PROXY "Proxy"
308 #define PULSEDIAL "PulseDial"
309 #define RANKED "Ranked"
310 #define RECEIVEACCM "ReceiveACCM"
311 #define RECENT "Recent"
312 #define REDIALCOUNT "RedialCount"
313 #define REDIAL "Redial"
314 #define REDIALINTERVAL "RedialInterval"
315 #define REGION "Region"
316 #define RELAY "Relay"
317 #define REMINDER "Reminder"
318 #define REMINDERTIME "ReminderTime"
319 #define REMOTEADDRESS "RemoteAddress"
320 #define RETRYCONNECTTIME "RetryConnectTime"
321 #define ROOTSEPARATOR "RootSeparator"
322 #define ROUTER "Router"
323 #define ROUTERADVERTISEMENT "RouterAdvertisement"
324 #define RTSP "RTSP"
325 #define SAVEPASSWORDS "SavePasswords"
326 #define SCOPE "Scope"
327 #define SCRIPT "Script"
328 #define SEARCH "Search"
329 #define SEEDNETWORKRANGE "SeedNetworkRange"
330 #define SEEDROUTER "SeedRouter"
331 #define SEEDZONES "SeedZones"
332 #define SERVER "Server"
333 #define SERVICE "Service"
334 #define SERVICEIDS "ServiceIDs"
335 #define SESSIONTIMER "SessionTimer"
336 #define SETS "Sets"
337 #define SETUP "Setup"
338 #define SHAREDSECRET "SharedSecret"
339 #define SMB "SMB"
340 #define SOCKS "SOCKS"
341 #define SORTLIST "SortList"
342 #define SPEAKER "Speaker"
343 #define SPEED "Speed"
344 #define STATE "State"
345 #define STATUS "Status"
346 #define STF "6to4"
347 #define STRONGEST "Strongest"
348 #define SUBNETMASKS "SubnetMasks"
349 #define SUBTYPE "SubType"
350 #define SUPPLEMENTAL "Supplemental"
351 #define SUPPORTSMODEMONHOLD "SupportsModemOnHold"
352 #define SYSTEM "System"
353 #define TAG "Tag"
354 #define TAGS "Tags"
355 #define TERMINALSCRIPT "TerminalScript"
356 #define TIMEOUT "Timeout"
357 #define TOKEN "Token"
358 #define TRANSMITACCM "TransmitACCM"
359 #define TRANSPORT "Transport"
360 #define TYPE "Type"
361 #define UID "UID"
362 #define UPDATED "Updated"
363 #define URLSTRING "URLString"
364 #define USERDEFINEDNAME "UserDefinedName"
365 #define USE "Use"
366 #define USERS "Users"
367 #define VENDOR "Vendor"
368 #define VERBOSELOGGING "VerboseLogging"
369 #define VIRTUALNETWORKINTERFACES "VirtualNetworkInterfaces"
370 #define VLAN "VLAN"
371 #define WAITFORDIALTONE "WaitForDialTone"
372 #define WINS "WINS"
373 #define WORKGROUP "Workgroup"
374
375 typedef struct {
376 int control;
377 const char * prefix;
378 const char * key;
379 const char * value;
380 const char * type;
381 } schemaDefinition;
382
383 static schemaDefinition names[] = {
384
385 { GROUP, NULL, "Reserved Keys", NULL, NULL },
386
387 { SC_10_1, RESV, LINK, "__LINK__", CFSTRING },
388 { SC_10_1, RESV, INACTIVE, "__INACTIVE__", NULL },
389 { COMMENT, "", NULL, NULL, NULL },
390
391 { GROUP, NULL, "Generic Keys", NULL, NULL },
392
393 { SC_10_1, PROP, INTERFACENAME, NULL, CFSTRING },
394 { SC_10_1, PROP, MACADDRESS, NULL, CFSTRING },
395 { SC_10_1, PROP, USERDEFINEDNAME, NULL, CFSTRING },
396 { SC_10_1, PROP, VERSION, NULL, CFSTRING },
397 { COMMENT, "", NULL, NULL, NULL },
398
399 { GROUP, PREF, "Preference Keys", NULL, NULL },
400
401 { SC_10_1, PREF, CURRENTSET, NULL, CFSTRING },
402 { SC_10_1, PREF, NETWORKSERVICES, NULL, CFDICTIONARY },
403 { SC_10_1, PREF, SETS, NULL, CFDICTIONARY },
404 { SC_10_1, PREF, SYSTEM, NULL, CFDICTIONARY },
405 { COMMENT, "", NULL, NULL, NULL },
406
407 { GROUP_PRIVATE, PREF, "Preference Keys", NULL, NULL },
408
409 { SC_10_5_PRIVATE, PREF, VIRTUALNETWORKINTERFACES, NULL, CFDICTIONARY },
410 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
411
412 { GROUP, COMP, "Component Keys", NULL, NULL },
413
414 { SC_10_1, COMP, NETWORK, NULL, NULL },
415 { SC_10_1, COMP, SERVICE, NULL, NULL },
416 { SC_10_1, COMP, GLOBAL, NULL, NULL },
417 { SC_10_2, COMP, HOSTNAMES, NULL, NULL },
418 { SC_10_1, COMP, INTERFACE, NULL, NULL },
419 { SC_10_1, COMP, SYSTEM, NULL, NULL },
420 { SC_10_1, COMP, USERS, NULL, NULL },
421 { COMMENT, "", NULL, NULL, NULL },
422
423 { COMMENT, "--- Regex pattern which matches any component ---", NULL },
424 { SC_10_1, COMP, ANYREGEX, "[^/]+", NULL },
425 { COMMENT, "", NULL, NULL, NULL },
426
427 { GROUP, NETENT, "Network Entity Keys", NULL, NULL },
428
429 { SC_10_1, NETENT, AIRPORT, NULL, CFDICTIONARY },
430 { SC_10_1, NETENT, APPLETALK, NULL, CFDICTIONARY },
431 { SC_10_1, NETENT, DHCP, NULL, CFDICTIONARY },
432 { SC_10_1, NETENT, DNS, NULL, CFDICTIONARY },
433 { SC_10_1, NETENT, ETHERNET, NULL, CFDICTIONARY },
434 { SC_10_3, NETENT, FIREWIRE, NULL, CFDICTIONARY },
435 { SC_10_1, NETENT, INTERFACE, NULL, CFDICTIONARY },
436 { SC_10_5, NETENT, IPSEC, NULL, CFDICTIONARY },
437 { SC_10_1, NETENT, IPV4, NULL, CFDICTIONARY },
438 { SC_10_1, NETENT, IPV6, NULL, CFDICTIONARY },
439 { SC_10_3, NETENT, L2TP, NULL, CFDICTIONARY },
440 { SC_10_1, NETENT, LINK, NULL, CFDICTIONARY },
441 { SC_10_1, NETENT, MODEM, NULL, CFDICTIONARY },
442 { SC_10_1_10_5, NETENT, NETINFO, NULL, CFDICTIONARY },
443 { SC_10_1, NETENT, PPP, NULL, CFDICTIONARY },
444 { SC_10_1, NETENT, PPPOE, NULL, CFDICTIONARY },
445 { SC_10_3, NETENT, PPPSERIAL, NULL, CFDICTIONARY },
446 { SC_10_3, NETENT, PPTP, NULL, CFDICTIONARY },
447 { SC_10_1, NETENT, PROXIES, NULL, CFDICTIONARY },
448 { SC_10_5, NETENT, SMB, NULL, CFDICTIONARY },
449 { SC_10_3, NETENT, STF, NULL, CFDICTIONARY },
450 { COMMENT, "", NULL, NULL, NULL },
451
452 { GROUP_PRIVATE, NETENT, "Network Entity Keys", NULL, NULL },
453
454 { SC_10_5_PRIVATE, NETENT, EAPOL, NULL, CFDICTIONARY },
455 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
456
457 { GROUP, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
458
459 { SC_10_2, NETPROP, OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
460 { SC_10_1, NETPROP, SERVICE ORDER, NULL, CFARRAY_CFSTRING },
461 { SC_10_1, NETPROP, PPP OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
462 { COMMENT, "", NULL, NULL, NULL },
463
464 { GROUP_PRIVATE, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
465
466 { SC_10_5_PRIVATE, NETPROP, IGNORELINKSTATUS, NULL, CFBOOLEAN },
467 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
468
469 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK INTERFACE " Properties", NULL, NULL },
470
471 { SC_10_2, NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
472 { COMMENT, "", NULL, NULL, NULL },
473
474 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK HOSTNAMES " Properties", NULL, NULL },
475
476 { SC_10_2, NETPROP, LOCALHOSTNAME, NULL, CFSTRING },
477 { COMMENT, "", NULL, NULL, NULL },
478
479 { GROUP, NETPROP AIRPORT, KEY_PREFIX NETENT AIRPORT " (Hardware) Entity Keys", NULL, NULL },
480
481 { SC_10_2, NETPROP AIRPORT, ALLOWNETCREATION, NULL, CFNUMBER_BOOL },
482 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD, NULL, CFDATA },
483 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
484 { SC_10_2, NETPROP AIRPORT, JOIN MODE, NULL, CFSTRING },
485 { SC_10_1, NETPROP AIRPORT, POWER ENABLED, NULL, CFNUMBER_BOOL },
486 { SC_10_1, NETPROP AIRPORT, PREFERRED NETWORK, NULL, CFSTRING },
487 { SC_10_2, NETPROP AIRPORT, SAVEPASSWORDS, NULL, CFNUMBER_BOOL },
488 { COMMENT, "", NULL, NULL, NULL },
489 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT JOIN MODE " values ---", NULL, NULL, NULL },
490 { SC_10_3, NETVAL AIRPORT JOIN MODE, AUTOMATIC, NULL, NULL },
491 { SC_10_2, NETVAL AIRPORT JOIN MODE, PREFERRED, NULL, NULL },
492 { SC_10_4, NETVAL AIRPORT JOIN MODE, RANKED, NULL, NULL },
493 { SC_10_2, NETVAL AIRPORT JOIN MODE, RECENT, NULL, NULL },
494 { SC_10_2, NETVAL AIRPORT JOIN MODE, STRONGEST, NULL, NULL },
495 { COMMENT, "", NULL, NULL, NULL },
496 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
497 { SC_10_3, NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
498 { COMMENT, "", NULL, NULL, NULL },
499
500 { GROUP, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },
501
502 { SC_10_1, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
503 { SC_10_1, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
504 { SC_10_1, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
505 { SC_10_1, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
506 { SC_10_1, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
507 { SC_10_2, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
508 { SC_10_1, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
509 { SC_10_1, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
510 { SC_10_1, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
511 { COMMENT, "", NULL, NULL, NULL },
512 { COMMENT, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
513 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
514 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
515 { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
516 { COMMENT, "", NULL, NULL, NULL },
517
518 { GROUP, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },
519
520 { SC_10_1, NETPROP DNS, DOMAIN NAME, NULL, CFSTRING },
521 { SC_10_4, NETPROP DNS, OPTIONS, NULL, CFSTRING },
522 { SC_10_1, NETPROP DNS, SEARCH DOMAINS, NULL, CFARRAY_CFSTRING},
523 { SC_10_4, NETPROP DNS, SEARCH ORDER, NULL, CFNUMBER},
524 { SC_10_1, NETPROP DNS, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
525 { SC_10_4, NETPROP DNS, SERVER PORT, NULL, CFNUMBER },
526 { SC_10_4, NETPROP DNS, SERVER TIMEOUT, NULL, CFNUMBER },
527 { SC_10_1, NETPROP DNS, SORTLIST, NULL, CFARRAY_CFSTRING },
528 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH DOMAINS, NULL, CFARRAY_CFSTRING},
529 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH ORDERS, NULL, CFARRAY_CFNUMBER},
530 { COMMENT, "", NULL, NULL, NULL },
531
532 { GROUP, NETPROP ETHERNET, KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys", NULL, NULL },
533
534 { SC_10_2, NETPROP ETHERNET, MEDIA SUBTYPE, NULL, CFSTRING },
535 { SC_10_2, NETPROP ETHERNET, MEDIA OPTIONS, NULL, CFARRAY_CFSTRING },
536 { SC_10_2, NETPROP ETHERNET, MTU, NULL, CFNUMBER },
537 { COMMENT, "", NULL, NULL, NULL },
538
539 { GROUP, NETPROP FIREWIRE, KEY_PREFIX NETENT FIREWIRE " (Hardware) Entity Keys", NULL, NULL },
540
541 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
542 { COMMENT, "", NULL, NULL, NULL },
543
544 { GROUP, NETPROP INTERFACE, KEY_PREFIX NETENT INTERFACE " Entity Keys", NULL, NULL },
545
546 { SC_10_1, NETPROP INTERFACE, DEVICENAME, NULL, CFSTRING },
547 { SC_10_1, NETPROP INTERFACE, HARDWARE, NULL, CFSTRING },
548 { SC_10_1, NETPROP INTERFACE, TYPE, NULL, CFSTRING },
549 { SC_10_1, NETPROP INTERFACE, SUBTYPE, NULL, CFSTRING },
550 { SC_10_2, NETPROP INTERFACE, SUPPORTSMODEMONHOLD, NULL, CFNUMBER_BOOL },
551 { COMMENT, "", NULL, NULL, NULL },
552 { COMMENT, "--- " KEY_PREFIX NETPROP INTERFACE TYPE " values ---", NULL, NULL, NULL },
553 { SC_10_1, NETVAL INTERFACE TYPE, ETHERNET, NULL, NULL },
554 { SC_10_3, NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
555 { SC_10_1, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
556 { SC_10_3, NETVAL INTERFACE TYPE, STF, NULL, NULL },
557 { COMMENT, "", NULL, NULL, NULL },
558 { COMMENT, "--- " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") ---", NULL, NULL, NULL },
559 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
560 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPSERIAL, NULL, NULL },
561 { SC_10_2, NETVAL INTERFACE SUBTYPE, PPTP, NULL, NULL },
562 { SC_10_3, NETVAL INTERFACE SUBTYPE, L2TP, NULL, NULL },
563 { COMMENT, "", NULL, NULL, NULL },
564
565 { GROUP, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },
566
567 { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER, NULL, CFSTRING },
568 { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER TYPE, NULL, CFSTRING },
569 { SC_10_5, NETPROP IPSEC, AUTHENTICATIONMETHOD, NULL, CFSTRING },
570 { SC_10_5, NETPROP IPSEC, SHAREDSECRET, NULL, CFSTRING },
571 { SC_10_5, NETPROP IPSEC, SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
572 { SC_10_5, NETPROP IPSEC, LOCALCERTIFICATE, NULL, CFDATA },
573 { COMMENT, "", NULL, NULL, NULL },
574 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC AUTHENTICATIONMETHOD " values ---", NULL, NULL, NULL },
575 { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, SHAREDSECRET, NULL, NULL },
576 { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, CERTIFICATE, NULL, NULL },
577 { COMMENT, "", NULL, NULL, NULL },
578 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
579 { SC_10_5, NETVAL IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
580 { COMMENT, "", NULL, NULL, NULL },
581 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC LOCALIDENTIFIER TYPE " values ---", NULL, NULL, NULL },
582 { SC_10_5, NETVAL IPSEC LOCALIDENTIFIER TYPE, KEYID, NULL, NULL },
583 { COMMENT, "", NULL, NULL, NULL },
584
585 { GROUP, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
586
587 { SC_10_1, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
588 { SC_10_1, NETPROP IPV4, CONFIGMETHOD, NULL, CFSTRING },
589 { SC_10_1, NETPROP IPV4, DHCPCLIENTID, NULL, CFSTRING },
590 { SC_10_1, NETPROP IPV4, ROUTER, NULL, CFSTRING },
591 { SC_10_1, NETPROP IPV4, SUBNETMASKS, NULL, CFARRAY_CFSTRING },
592 { SC_10_1, NETPROP IPV4, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
593 { SC_10_1, NETPROP IPV4, BROADCAST ADDRESSES, NULL, CFARRAY_CFSTRING },
594 { COMMENT, "", NULL, NULL, NULL },
595 { COMMENT, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
596 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
597 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
598 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
599 { SC_10_2, NETVAL IPV4 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
600 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, MANUAL, NULL, NULL },
601 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, PPP, NULL, NULL },
602 { COMMENT, "", NULL, NULL, NULL },
603
604 { GROUP_PRIVATE, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
605 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
606 { SC_10_5_PRIVATE, NETVAL IPV4 CONFIGMETHOD, FAILOVER, NULL, NULL },
607 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
608
609 { GROUP, NETPROP IPV6, KEY_PREFIX NETENT IPV6 " Entity Keys", NULL, NULL },
610
611 { SC_10_1, NETPROP IPV6, ADDRESSES, NULL, CFARRAY_CFSTRING },
612 { SC_10_1, NETPROP IPV6, CONFIGMETHOD, NULL, CFSTRING },
613 { SC_10_3, NETPROP IPV6, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
614 { SC_10_3, NETPROP IPV6, FLAGS, NULL, CFNUMBER },
615 { SC_10_3, NETPROP IPV6, PREFIXLENGTH, NULL, CFARRAY_CFNUMBER },
616 { SC_10_3, NETPROP IPV6, ROUTER, NULL, CFSTRING },
617 { COMMENT, "", NULL, NULL, NULL },
618 { COMMENT, "--- " KEY_PREFIX NETPROP IPV6 CONFIGMETHOD " values ---", NULL, NULL, NULL },
619 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
620 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, MANUAL, NULL, NULL },
621 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, ROUTERADVERTISEMENT, NULL, NULL },
622 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, STF, NULL, NULL },
623 { COMMENT, "", NULL, NULL, NULL },
624
625 { GROUP, NETPROP STF, KEY_PREFIX NETENT STF " Entity Keys", NULL, NULL },
626
627 { SC_10_3, NETPROP STF, RELAY, NULL, CFSTRING },
628 { COMMENT, "", NULL, NULL, NULL },
629
630 { GROUP, NETPROP LINK, KEY_PREFIX NETENT LINK " Entity Keys", NULL, NULL },
631
632 { SC_10_1, NETPROP LINK, ACTIVE, NULL, CFBOOLEAN },
633 { SC_10_2, NETPROP LINK, DETACHING, NULL, CFBOOLEAN },
634 { COMMENT, "", NULL, NULL, NULL },
635
636 { GROUP, NETPROP MODEM, KEY_PREFIX NETENT MODEM " (Hardware) Entity Keys", NULL, NULL },
637
638 { SC_10_5, NETPROP MODEM, ACCESSPOINTNAME, NULL, CFSTRING },
639 { SC_10_5, NETPROP MODEM, CONNECTION PERSONALITY, NULL, CFSTRING },
640 { SC_10_1, NETPROP MODEM, CONNECTION SCRIPT, NULL, CFSTRING },
641 { SC_10_2, NETPROP MODEM, CONNECTSPEED, NULL, CFNUMBER },
642 { SC_10_1, NETPROP MODEM, DATACOMPRESSION, NULL, CFNUMBER_BOOL },
643 { SC_10_5, NETPROP MODEM, DEVICE CONTEXTID, NULL, CFSTRING },
644 { SC_10_5, NETPROP MODEM, DEVICE MODEL, NULL, CFSTRING },
645 { SC_10_5, NETPROP MODEM, DEVICE VENDOR, NULL, CFSTRING },
646 { SC_10_1, NETPROP MODEM, DIALMODE, NULL, CFSTRING },
647 { SC_10_1, NETPROP MODEM, ERRORCORRECTION, NULL, CFNUMBER_BOOL },
648 { SC_10_2, NETPROP MODEM, HOLD CALLWAITINGAUDIBLEALERT, NULL, CFNUMBER_BOOL },
649 { SC_10_2, NETPROP MODEM, HOLD DISCONNECTONANSWER, NULL, CFNUMBER_BOOL },
650 { SC_10_2, NETPROP MODEM, HOLD ENABLED, NULL, CFNUMBER_BOOL },
651 { SC_10_2, NETPROP MODEM, HOLD REMINDER, NULL, CFNUMBER_BOOL },
652 { SC_10_2, NETPROP MODEM, HOLD REMINDERTIME, NULL, CFNUMBER },
653 { SC_10_2, NETPROP MODEM, NOTE, NULL, CFSTRING },
654 { SC_10_1, NETPROP MODEM, PULSEDIAL, NULL, CFNUMBER_BOOL },
655 { SC_10_1, NETPROP MODEM, SPEAKER, NULL, CFNUMBER_BOOL },
656 { SC_10_1, NETPROP MODEM, SPEED, NULL, CFNUMBER },
657 { COMMENT, "", NULL, NULL, NULL },
658 { COMMENT, "--- " KEY_PREFIX NETPROP MODEM DIALMODE " values ---", NULL, NULL, NULL },
659 { SC_10_1, NETVAL MODEM DIALMODE, IGNOREDIALTONE, NULL, NULL },
660 { SC_10_1, NETVAL MODEM DIALMODE, MANUAL, NULL, NULL },
661 { SC_10_1, NETVAL MODEM DIALMODE, WAITFORDIALTONE, NULL, NULL },
662 { COMMENT, "", NULL, NULL, NULL },
663
664 { GROUP_DEPRECATED, NETPROP NETINFO, KEY_PREFIX NETENT NETINFO " Entity Keys", NULL, NULL },
665
666 { SC_10_1_10_5, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
667 { SC_10_1_10_5, NETPROP NETINFO, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
668 { SC_10_1_10_5, NETPROP NETINFO, SERVER TAGS, NULL, CFARRAY_CFSTRING },
669 { SC_10_1_10_5, NETPROP NETINFO, BROADCAST SERVER TAG, NULL, CFSTRING },
670 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
671 { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BINDINGMETHODS " values ---", NULL, NULL, NULL },
672 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, BROADCAST, NULL, NULL },
673 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, DHCP, NULL, NULL },
674 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, MANUAL, NULL, NULL },
675 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
676 { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BROADCAST SERVER TAG " default value ---", NULL, NULL, NULL },
677 { SC_10_1_10_5, NETVAL NETINFO, DEFAULT SERVER TAG, "network", NULL },
678 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
679
680 { GROUP, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
681
682 { SC_10_3, NETPROP PPP, ACSP ENABLED, NULL, CFNUMBER_BOOL },
683 { SC_10_2, NETPROP PPP, CONNECTTIME, NULL, CFNUMBER },
684 { SC_10_2, NETPROP PPP, DEVICE LAST CAUSE, NULL, CFNUMBER },
685 { SC_10_1, NETPROP PPP, DIALONDEMAND, NULL, CFNUMBER_BOOL },
686 { SC_10_4, NETPROP PPP, DISCONNECTONFASTUSERSWITCH, NULL, CFNUMBER_BOOL },
687 { SC_10_1, NETPROP PPP, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
688 { SC_10_1, NETPROP PPP, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
689 { SC_10_1, NETPROP PPP, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
690 { SC_10_2, NETPROP PPP, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
691 { SC_10_3, NETPROP PPP, DISCONNECTTIME, NULL, CFNUMBER },
692 { SC_10_1, NETPROP PPP, IDLEREMINDERTIMER, NULL, CFNUMBER },
693 { SC_10_1, NETPROP PPP, IDLEREMINDER, NULL, CFNUMBER_BOOL },
694 { SC_10_2, NETPROP PPP, LAST CAUSE, NULL, CFNUMBER },
695 { SC_10_1, NETPROP PPP, LOGFILE, NULL, CFSTRING },
696 { SC_10_2, NETPROP PPP, PLUGINS, NULL, CFARRAY_CFSTRING },
697 { SC_10_3, NETPROP PPP, RETRYCONNECTTIME, NULL, CFNUMBER },
698 { SC_10_1, NETPROP PPP, SESSIONTIMER, NULL, CFNUMBER },
699 { SC_10_2, NETPROP PPP, STATUS, NULL, CFNUMBER },
700 { SC_10_2, NETPROP PPP, USE SESSIONTIMER, NULL, CFNUMBER_BOOL },
701 { SC_10_1, NETPROP PPP, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
702 { COMMENT, "", NULL, NULL, NULL },
703
704 { COMMENT, "--- " AUTH ": ---", NULL, NULL, NULL },
705 { SC_10_3, NETPROP PPP, AUTH EAP PLUGINS, NULL, CFARRAY_CFSTRING },
706 { SC_10_1, NETPROP PPP, AUTH NAME, NULL, CFSTRING },
707 { SC_10_1, NETPROP PPP, AUTH PASSWORD, NULL, CFSTRING },
708 { SC_10_1, NETPROP PPP, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
709 { SC_10_3, NETPROP PPP, AUTH PROMPT, NULL, CFSTRING },
710 { SC_10_1, NETPROP PPP, AUTH PROTOCOL, NULL, CFARRAY_CFSTRING },
711 { COMMENT, "", NULL, NULL, NULL },
712 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
713 { SC_10_3, NETVAL PPP AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
714 { SC_10_5, NETVAL PPP AUTH PASSWORD ENCRYPTION, TOKEN, NULL, NULL },
715 { COMMENT, "", NULL, NULL, NULL },
716 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROMPT " values ---", NULL, NULL, NULL },
717 { SC_10_3, NETVAL PPP AUTH PROMPT, BEFORE, NULL, CFSTRING },
718 { SC_10_3, NETVAL PPP AUTH PROMPT, AFTER, NULL, CFSTRING },
719 { COMMENT, "", NULL, NULL, NULL },
720 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROTOCOL " values ---", NULL, NULL, NULL },
721 { SC_10_1, NETVAL PPP AUTH PROTOCOL, CHAP, NULL, CFSTRING },
722 { SC_10_3, NETVAL PPP AUTH PROTOCOL, EAP, NULL, CFSTRING },
723 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP1, NULL, CFSTRING },
724 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP2, NULL, CFSTRING },
725 { SC_10_1, NETVAL PPP AUTH PROTOCOL, PAP, NULL, CFSTRING },
726 { COMMENT, "", NULL, NULL, NULL },
727
728 { COMMENT, "--- " COMM ": ---", NULL, NULL, NULL },
729 { SC_10_1, NETPROP PPP, COMM ALTERNATEREMOTEADDRESS, NULL, CFSTRING },
730 { SC_10_1, NETPROP PPP, COMM CONNECTDELAY, NULL, CFNUMBER },
731 { SC_10_1, NETPROP PPP, COMM DISPLAYTERMINALWINDOW, NULL, CFNUMBER_BOOL },
732 { SC_10_1, NETPROP PPP, COMM REDIALCOUNT, NULL, CFNUMBER },
733 { SC_10_1, NETPROP PPP, COMM REDIAL ENABLED, NULL, CFNUMBER_BOOL },
734 { SC_10_1, NETPROP PPP, COMM REDIALINTERVAL, NULL, CFNUMBER },
735 { SC_10_1, NETPROP PPP, COMM REMOTEADDRESS, NULL, CFSTRING },
736 { SC_10_1, NETPROP PPP, COMM TERMINALSCRIPT, NULL, CFSTRING },
737 { SC_10_2, NETPROP PPP, COMM USE TERMINALSCRIPT, NULL, CFNUMBER_BOOL },
738 { COMMENT, "", NULL, NULL, NULL },
739
740 { COMMENT, "--- " CCP ": ---", NULL, NULL, NULL },
741 { SC_10_2, NETPROP PPP, CCP ENABLED, NULL, CFNUMBER_BOOL },
742 { SC_10_4, NETPROP PPP, CCP MPPE40 ENABLED, NULL, CFNUMBER_BOOL },
743 { SC_10_4, NETPROP PPP, CCP MPPE128 ENABLED, NULL, CFNUMBER_BOOL },
744 { COMMENT, "", NULL, NULL, NULL },
745
746 { COMMENT, "--- " IPCP ": ---", NULL, NULL, NULL },
747 { SC_10_1, NETPROP PPP, IPCP COMPRESSIONVJ, NULL, CFNUMBER_BOOL },
748 { SC_10_4, NETPROP PPP, IPCP USE PEER DNS, NULL, CFNUMBER_BOOL },
749 { COMMENT, "", NULL, NULL, NULL },
750
751 { COMMENT, "--- " LCP ": ---", NULL, NULL, NULL },
752 { SC_10_1, NETPROP PPP, LCP ECHO ENABLED, NULL, CFNUMBER_BOOL },
753 { SC_10_1, NETPROP PPP, LCP ECHOFAILURE, NULL, CFNUMBER },
754 { SC_10_1, NETPROP PPP, LCP ECHOINTERVAL, NULL, CFNUMBER },
755 { SC_10_1, NETPROP PPP, LCP COMPRESSIONACFIELD, NULL, CFNUMBER_BOOL },
756 { SC_10_1, NETPROP PPP, LCP COMPRESSIONPFIELD, NULL, CFNUMBER_BOOL },
757 { SC_10_1, NETPROP PPP, LCP MRU, NULL, CFNUMBER },
758 { SC_10_1, NETPROP PPP, LCP MTU, NULL, CFNUMBER },
759 { SC_10_1, NETPROP PPP, LCP RECEIVEACCM, NULL, CFNUMBER },
760 { SC_10_1, NETPROP PPP, LCP TRANSMITACCM, NULL, CFNUMBER },
761 { COMMENT, "", NULL, NULL, NULL },
762
763 { GROUP_PRIVATE, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
764
765 { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
766 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND DOMAINS, NULL, CFARRAY_CFSTRING },
767 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
768 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND HOSTNAME, NULL, CFSTRING },
769 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND MODE, NULL, CFSTRING },
770 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND PRIORITY, NULL, CFSTRING },
771 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
772 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND MODE " values ---", NULL, NULL, NULL },
773 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, AGGRESSIVE, NULL, NULL },
774 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, CONSERVATIVE, NULL, NULL },
775 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, COMPATIBLE, NULL, NULL },
776 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
777 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND PRIORITY " values ---", NULL, NULL, NULL },
778 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, DEFAULT, NULL, NULL },
779 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, HIGH, NULL, NULL },
780 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, LOW, NULL, NULL },
781 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
782
783 { GROUP, NETPROP PPPOE, KEY_PREFIX NETENT PPPOE " Entity Keys", NULL, NULL },
784
785 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
786 { COMMENT, "", NULL, NULL, NULL },
787
788 { GROUP, NETPROP PPPSERIAL, KEY_PREFIX NETENT PPPSERIAL " Entity Keys", NULL, NULL },
789
790 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
791 { COMMENT, "", NULL, NULL, NULL },
792
793 { GROUP, NETPROP PPTP, KEY_PREFIX NETENT PPTP " Entity Keys", NULL, NULL },
794
795 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
796 { COMMENT, "", NULL, NULL, NULL },
797
798 { GROUP, NETPROP L2TP, KEY_PREFIX NETENT L2TP " Entity Keys", NULL, NULL },
799
800 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET, NULL, CFSTRING },
801 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
802 { SC_10_3, NETPROP L2TP, TRANSPORT, NULL, CFSTRING },
803 { COMMENT, "", NULL, NULL, NULL },
804 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
805 { SC_10_3, NETVAL L2TP IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
806 { COMMENT, "", NULL, NULL, NULL },
807 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP TRANSPORT " values ---", NULL, NULL, NULL },
808 { SC_10_3, NETVAL L2TP TRANSPORT, IP, NULL, NULL },
809 { SC_10_3, NETVAL L2TP TRANSPORT, IPSEC, NULL, NULL },
810 { COMMENT, "", NULL, NULL, NULL },
811
812 { GROUP, NETPROP PROXIES, KEY_PREFIX NETENT PROXIES " Entity Keys", NULL, NULL },
813
814 { SC_10_1, NETPROP PROXIES, EXCEPTIONSLIST, NULL, CFARRAY_CFSTRING },
815 { SC_10_4, NETPROP PROXIES, EXCLUDESIMPLEHOSTNAMES, NULL, CFNUMBER_BOOL },
816 { SC_10_1, NETPROP PROXIES, FTP ENABLE, NULL, CFNUMBER_BOOL },
817 { SC_10_1, NETPROP PROXIES, FTP PASSIVE, NULL, CFNUMBER_BOOL },
818 { SC_10_1, NETPROP PROXIES, FTP PORT, NULL, CFNUMBER },
819 { SC_10_1, NETPROP PROXIES, FTP PROXY, NULL, CFSTRING },
820 { SC_10_1, NETPROP PROXIES, GOPHER ENABLE, NULL, CFNUMBER_BOOL },
821 { SC_10_1, NETPROP PROXIES, GOPHER PORT, NULL, CFNUMBER },
822 { SC_10_1, NETPROP PROXIES, GOPHER PROXY, NULL, CFSTRING },
823 { SC_10_1, NETPROP PROXIES, HTTP ENABLE, NULL, CFNUMBER_BOOL },
824 { SC_10_1, NETPROP PROXIES, HTTP PORT, NULL, CFNUMBER },
825 { SC_10_1, NETPROP PROXIES, HTTP PROXY, NULL, CFSTRING },
826 { SC_10_1, NETPROP PROXIES, HTTPS ENABLE, NULL, CFNUMBER_BOOL },
827 { SC_10_1, NETPROP PROXIES, HTTPS PORT, NULL, CFNUMBER },
828 { SC_10_1, NETPROP PROXIES, HTTPS PROXY, NULL, CFSTRING },
829 { SC_10_1, NETPROP PROXIES, RTSP ENABLE, NULL, CFNUMBER_BOOL },
830 { SC_10_1, NETPROP PROXIES, RTSP PORT, NULL, CFNUMBER },
831 { SC_10_1, NETPROP PROXIES, RTSP PROXY, NULL, CFSTRING },
832 { SC_10_1, NETPROP PROXIES, SOCKS ENABLE, NULL, CFNUMBER_BOOL },
833 { SC_10_1, NETPROP PROXIES, SOCKS PORT, NULL, CFNUMBER },
834 { SC_10_1, NETPROP PROXIES, SOCKS PROXY, NULL, CFSTRING },
835 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG ENABLE, NULL, CFNUMBER_BOOL },
836 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG URLSTRING, NULL, CFSTRING },
837 { SC_10_4, NETPROP PROXIES, PROXY AUTODISCOVERY ENABLE, NULL, CFNUMBER_BOOL },
838 { COMMENT, "", NULL, NULL, NULL },
839
840 { GROUP, NETPROP SMB, KEY_PREFIX NETENT SMB " Entity Keys", NULL, NULL },
841
842 { SC_10_5, NETPROP SMB, NETBIOS NAME, NULL, CFSTRING },
843 { SC_10_5, NETPROP SMB, NETBIOS NODE TYPE, NULL, CFSTRING },
844 { SC_10_5, NETPROP SMB, NETBIOS SCOPE, NULL, CFSTRING },
845 { SC_10_5, NETPROP SMB, WINS ADDRESSES, NULL, CFARRAY_CFSTRING },
846 { SC_10_5, NETPROP SMB, WORKGROUP, NULL, CFSTRING },
847 { COMMENT, "", NULL, NULL, NULL },
848 { COMMENT, "--- " KEY_PREFIX NETPROP SMB NETBIOS NODE TYPE " values ---", NULL, NULL, NULL },
849 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, BROADCAST, NULL },
850 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, PEER, NULL },
851 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, MIXED, NULL },
852 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, HYBRID, NULL },
853 { COMMENT, "", NULL, NULL, NULL },
854
855 { GROUP, USERSENT CONSOLEUSER, KEY_PREFIX COMP USERS " Entity Keys", NULL, NULL },
856
857 { SC_10_1, USERSENT, CONSOLEUSER, NULL, NULL },
858 { COMMENT, "", NULL, NULL, NULL },
859
860 { GROUP, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
861
862 { SC_10_1, SYSTEMPROP, COMPUTERNAME, NULL, CFSTRING },
863 { SC_10_1, SYSTEMPROP, COMPUTERNAME ENCODING, NULL, CFNUMBER },
864 { COMMENT, "", NULL, NULL, NULL },
865
866 { GROUP_PRIVATE, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
867
868 { SC_10_5_PRIVATE, SYSTEMPROP, COMPUTERNAME REGION, NULL, CFNUMBER },
869 { SC_10_5_PRIVATE, SYSTEMPROP, HOSTNAME, NULL, CFSTRING },
870 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
871
872 { GROUP, DYNAMICSTORE DOMAIN, "SCDynamicStore \"domain\" prefixes", NULL, NULL },
873
874 { SC_10_1, DYNAMICSTORE DOMAIN, FILE, "File:", NULL },
875 { SC_10_1, DYNAMICSTORE DOMAIN, PLUGIN, "Plugin:", NULL },
876 { SC_10_1, DYNAMICSTORE DOMAIN, SETUP, "Setup:", NULL },
877 { SC_10_1, DYNAMICSTORE DOMAIN, STATE, "State:", NULL },
878 { SC_10_1, DYNAMICSTORE DOMAIN, PREFS, "Prefs:", NULL },
879 { COMMENT, "", NULL, NULL, NULL },
880
881 { GROUP, DYNAMICSTORE SETUPPROP, "Preference (\"location\") Keys", NULL, NULL },
882
883 { SC_10_1, DYNAMICSTORE SETUPPROP, CURRENTSET, NULL, CFSTRING },
884 { SC_10_1, DYNAMICSTORE SETUPPROP, LAST UPDATED, NULL, NULL },
885 { COMMENT, "", NULL, NULL, NULL },
886
887 { GROUP, DYNAMICSTORE NETPROP, "Common/shared Keys", NULL, NULL },
888
889 { SC_10_1, DYNAMICSTORE NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
890 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYINTERFACE, NULL, CFSTRING },
891 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYSERVICE, NULL, CFSTRING },
892 { SC_10_1, DYNAMICSTORE NETPROP, SERVICEIDS, NULL, CFARRAY_CFSTRING },
893 // { COMMENT, "", NULL, NULL, NULL },
894
895 { GROUP_PRIVATE, VIRTUALNETWORKINTERFACES, "Virtual Network Interface Keys", NULL, NULL },
896
897 { SC_10_5_PRIVATE, VIRTUALPROP BOND, INTERFACES, NULL, CFARRAY_CFSTRING },
898 { SC_10_5_PRIVATE, VIRTUALPROP BOND, MODE, NULL, CFNUMBER },
899 { SC_10_5_PRIVATE, VIRTUALPROP BOND, OPTIONS, NULL, CFDICTIONARY },
900 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
901 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, INTERFACE, NULL, CFSTRING },
902 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, TAG, NULL, CFNUMBER },
903 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, OPTIONS, NULL, CFDICTIONARY },
904 // { COMMENT_PRIVATE, "", NULL, NULL, NULL },
905
906 //{ GROUP, "DEPRECATED", "Deprecated schema definition keys", NULL, NULL },
907
908 { SC_10_1_10_4, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
909 { SC_10_1_10_4, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
910 { SC_10_1_10_4, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
911 // { COMMENT, "", NULL, NULL, NULL },
912
913 { END, NULL, NULL, NULL, NULL },
914 };
915
916 static int maxkbuf = 0;
917 static char *maxkstr = NULL;
918 static int maxvbuf = 0;
919 static char *maxvstr = NULL;
920
921 static inline void
922 setmax(int *max, char **maxstr, char *str)
923 {
924 int l;
925
926 l = strlen(str);
927 if (l > *max) {
928 if (*maxstr) free(*maxstr);
929 *maxstr = strdup(str);
930 *max = l;
931 }
932 return;
933 }
934
935 enum {
936 gen_header_e,
937 gen_comments_e,
938 gen_comments_private_e,
939 gen_headerdoc_e,
940 gen_headerdoc_private_e,
941 gen_hfile_e,
942 gen_hfile_private_e,
943 gen_cfile_e,
944 };
945
946 void
947 print_comment(schemaDefinition *def)
948 {
949 char kbuf[256];
950 char vbuf[256];
951
952 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
953 def->prefix, def->key);
954 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
955 def->value ? def->value : def->key);
956
957 if (def->type)
958 printf(" * %-50s %-30s %s\n",
959 kbuf, vbuf, def->type);
960 else
961 printf(" * %-50s %s\n",
962 kbuf, vbuf);
963
964 return;
965 }
966
967 void
968 print_headerdoc(schemaDefinition *def)
969 {
970 char kbuf[256];
971 char vbuf[256];
972
973 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
974 def->prefix, def->key);
975 setmax(&maxkbuf, &maxkstr, kbuf);
976
977 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
978 def->value ? def->value : def->key);
979 setmax(&maxvbuf, &maxvstr, vbuf);
980
981 printf("\n");
982
983 printf("/*!\n");
984 printf(" @const %s\n", kbuf);
985 switch (def->control) {
986 case SC_10_1:
987 printf(" @availability Introduced in Mac OS X 10.1.\n");
988 break;
989 case SC_10_2:
990 printf(" @availability Introduced in Mac OS X 10.2.\n");
991 break;
992 case SC_10_1_10_4:
993 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
994 break;
995 case SC_10_1_10_5:
996 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.5.\n");
997 break;
998 case SC_10_3:
999 printf(" @availability Introduced in Mac OS X 10.3.\n");
1000 break;
1001 case SC_10_4:
1002 printf(" @availability Introduced in Mac OS X 10.4.\n");
1003 break;
1004 case SC_10_5:
1005 case SC_10_5_PRIVATE:
1006 printf(" @availability Introduced in Mac OS X 10.5.\n");
1007 break;
1008 }
1009 printf(" */\n");
1010 printf("extern const CFStringRef %s;\n", kbuf);
1011
1012 return;
1013 }
1014
1015 void
1016 print_hfile(schemaDefinition *def)
1017 {
1018 char kbuf[256];
1019 char vbuf[256];
1020
1021 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1022 def->prefix, def->key);
1023 setmax(&maxkbuf, &maxkstr, kbuf);
1024
1025 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
1026 def->value ? def->value : def->key);
1027 setmax(&maxvbuf, &maxvstr, vbuf);
1028
1029 printf("\n");
1030
1031 switch (def->control) {
1032 case SC_10_1:
1033 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
1034 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)\n", kbuf);
1035 printf("#endif\n");
1036 break;
1037 case SC_10_2:
1038 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
1039 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)\n", kbuf);
1040 printf("#endif\n");
1041 break;
1042 case SC_10_3:
1043 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
1044 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)\n", kbuf);
1045 printf("#endif\n");
1046 break;
1047 case SC_10_1_10_4:
1048 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
1049 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);
1050 printf("#endif\n");
1051 break;
1052 case SC_10_1_10_5:
1053 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040\n");
1054 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)\n", kbuf);
1055 printf("#endif\n");
1056 break;
1057 case SC_10_4:
1058 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040\n");
1059 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)\n", kbuf);
1060 printf("#endif\n");
1061 break;
1062 case SC_10_5:
1063 case SC_10_5_PRIVATE:
1064 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050\n");
1065 printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)\n", kbuf);
1066 printf("#endif\n");
1067 break;
1068 default:
1069 printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
1070 printf(" " SC_SCHEMA_DECLARATION "(%s,)\n", kbuf);
1071 printf("#endif\n");
1072 break;
1073 }
1074
1075 switch (def->control) {
1076 case SC_10_1:
1077 case SC_10_1_10_4:
1078 case SC_10_1_10_5:
1079 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)\n");
1080 break;
1081 case SC_10_2:
1082 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)\n");
1083 break;
1084 case SC_10_3:
1085 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)\n");
1086 break;
1087 case SC_10_4:
1088 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)\n");
1089 break;
1090 case SC_10_5:
1091 case SC_10_5_PRIVATE:
1092 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)\n");
1093 break;
1094 }
1095
1096 printf(" #define %-48s \\\n",
1097 kbuf);
1098 printf(" " SC_SCHEMA_KV "(%-48s \\\n",
1099 kbuf);
1100 printf(" ,%-48s \\\n",
1101 vbuf);
1102 printf(" ,%-48s )\n",
1103 def->type ? def->type : "");
1104
1105 switch (def->control) {
1106 case SC_10_1:
1107 case SC_10_1_10_4:
1108 case SC_10_1_10_5:
1109 case SC_10_2:
1110 case SC_10_3:
1111 case SC_10_4:
1112 case SC_10_5:
1113 case SC_10_5_PRIVATE:
1114 printf("#endif\n");
1115 break;
1116 }
1117
1118 return;
1119 }
1120
1121 void
1122 dump_names(int type)
1123 {
1124 int i;
1125
1126 for (i = 0; TRUE; i++) {
1127 switch (names[i].control) {
1128 case END: {
1129 goto done;
1130 }
1131
1132 case COMMENT: {
1133 switch (type) {
1134 case gen_comments_e:
1135 if (names[i].prefix)
1136 if (strlen(names[i].prefix) > 0)
1137 printf(" * %s\n", names[i].prefix);
1138 else
1139 printf(" *\n");
1140 break;
1141 default:
1142 break;
1143 }
1144 break;
1145 }
1146
1147 case COMMENT_PRIVATE: {
1148 switch (type) {
1149 case gen_comments_private_e:
1150 if (names[i].prefix)
1151 if (strlen(names[i].prefix) > 0)
1152 printf(" * %s\n", names[i].prefix);
1153 else
1154 printf(" *\n");
1155 break;
1156 default:
1157 break;
1158 }
1159 break;
1160 }
1161
1162 case COMMENT_DEPRECATED: {
1163 break;
1164 }
1165
1166 case GROUP:
1167 case GROUP_DEPRECATED: {
1168 switch (type) {
1169 case gen_comments_e:
1170 if (names[i].control == GROUP) {
1171 if (names[i].key)
1172 printf(" * %s\n *\n", names[i].key);
1173 }
1174 break;
1175 case gen_headerdoc_e:
1176 if (names[i].prefix)
1177 printf("\n/*!\n @group %s\n */\n", names[i].key);
1178 break;
1179 default:
1180 break;
1181 }
1182 break;
1183 }
1184
1185 case GROUP_PRIVATE: {
1186 switch (type) {
1187 case gen_comments_private_e:
1188 if (names[i].key)
1189 printf(" * %s\n *\n", names[i].key);
1190 break;
1191 case gen_headerdoc_private_e:
1192 if (names[i].prefix)
1193 printf("\n/*!\n @group %s\n */\n", names[i].key);
1194 break;
1195 default:
1196 break;
1197 }
1198 break;
1199 }
1200
1201 default: {
1202 char kbuf[256];
1203 char vbuf[256];
1204
1205 switch (type) {
1206 case gen_header_e:
1207 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1208 names[i].prefix, names[i].key);
1209
1210 if (names[i].value)
1211 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
1212 names[i].value);
1213 else
1214 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
1215 names[i].key);
1216
1217 printf("#define %-50s %s\n",
1218 kbuf, vbuf);
1219 break;
1220
1221 case gen_comments_e:
1222 switch (names[i].control) {
1223 case SC_10_1_10_4:
1224 case SC_10_1_10_5:
1225 // don't report deprecated keys
1226 break;
1227 case SC_10_5_PRIVATE:
1228 // don't report private definitions
1229 break;
1230 default:
1231 print_comment(&names[i]);
1232 break;
1233 }
1234 break;
1235 case gen_comments_private_e:
1236 switch (names[i].control) {
1237 case SC_10_1_10_4:
1238 case SC_10_1_10_5:
1239 // don't report deprecated keys
1240 break;
1241 case SC_10_5_PRIVATE:
1242 print_comment(&names[i]);
1243 break;
1244 default:
1245 // don't report public definitions
1246 break;
1247 }
1248 break;
1249
1250 case gen_headerdoc_e:
1251 switch (names[i].control) {
1252 case SC_10_5_PRIVATE:
1253 break;
1254 // don't report private definitions
1255 default:
1256 print_headerdoc(&names[i]);
1257 break;
1258 }
1259 break;
1260 case gen_headerdoc_private_e:
1261 switch (names[i].control) {
1262 case SC_10_5_PRIVATE:
1263 print_headerdoc(&names[i]);
1264 break;
1265 default:
1266 // don't report public definitions
1267 break;
1268 }
1269 break;
1270
1271 case gen_hfile_e:
1272 switch (names[i].control) {
1273 case SC_10_5_PRIVATE:
1274 break;
1275 // don't report private definitions
1276 default:
1277 print_hfile(&names[i]);
1278 break;
1279 }
1280 break;
1281 case gen_hfile_private_e:
1282 switch (names[i].control) {
1283 case SC_10_5_PRIVATE:
1284 print_hfile(&names[i]);
1285 break;
1286 default:
1287 // don't report public definitions
1288 break;
1289 }
1290 break;
1291
1292 case gen_cfile_e:
1293 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1294 names[i].prefix, names[i].key);
1295
1296 if (names[i].value)
1297 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1298 kbuf, names[i].value);
1299 else
1300 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1301 kbuf, names[i].key);
1302 break;
1303 default:
1304 break;
1305 }
1306 break;
1307 }
1308 }
1309 }
1310 done:
1311 switch (type) {
1312 case gen_hfile_e:
1313 fprintf(stderr, "max key: length = %2d, string = %s\n", maxkbuf, maxkstr);
1314 fprintf(stderr, "max val: length = %2d, string = %s\n", maxvbuf, maxvstr);
1315 break;
1316 }
1317 return;
1318 }
1319
1320 int
1321 main(int argc, char * argv[])
1322 {
1323 char * type = "";
1324
1325 if (argc >= 2)
1326 type = argv[1];
1327
1328 if (strcmp(type, "header-x") == 0) {
1329 printf("%s\n", copyright_string);
1330 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1331
1332 printf("/*\n");
1333 printf(" * Note: For Cocoa/Obj-C/Foundation programs accessing these preference\n");
1334 printf(" * keys you may want to consider the following:\n");
1335 printf(" *\n");
1336 printf(" * #define SCSTR(s) (NSString *)CFSTR(s)\n");
1337 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
1338 printf(" */\n\n");
1339
1340 printf("#ifndef _SCSCHEMADEFINITIONS_10_1_H\n#define _SCSCHEMADEFINITIONS_10_1_H\n\n");
1341
1342 printf("#warning USE OF THIS HEADER HAS BEEN DEPRECATED\n");
1343
1344 printf("#ifndef _SCSCHEMADEFINITIONS_H\n");
1345 printf("#warning Please #include <SystemConfiguration/SystemConfiguration.h> instead\n");
1346 printf("#warning of including this file directly.\n");
1347 printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n");
1348 printf("#endif\n\n");
1349
1350 // printf("#ifndef SCSTR\n");
1351 // printf("#include <CoreFoundation/CFString.h>\n");
1352 // printf("#define SCSTR(s) CFSTR(s)\n");
1353 // printf("#endif\n\n");
1354 //
1355 // dump_names(gen_header_e);
1356 // printf("\n");
1357
1358 printf("#endif /* _SCSCHEMADEFINITIONS_10_1_H */\n");
1359 }
1360 else if (strcmp(type, "header") == 0) {
1361 printf("%s\n", copyright_string);
1362 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1363
1364 printf("/*\n");
1365 dump_names(gen_comments_e);
1366 printf(" */\n\n\n");
1367
1368 printf("/*\n");
1369 printf(" * Note: The MACOSX_DEPLOYMENT_TARGET environment variable should be used\n");
1370 printf(" * when building an application targeted for an earlier version of\n");
1371 printf(" * Mac OS X. Please reference Technical Note TN2064 for more details.\n");
1372 printf(" */\n\n");
1373
1374 printf("/*\n");
1375 printf(" * Note: For Cocoa/Obj-C/Foundation applications accessing these preference\n");
1376 printf(" * keys you may want to consider the following :\n");
1377 printf(" *\n");
1378 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k;\n");
1379 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
1380 printf(" */\n\n");
1381
1382 printf("/*\n");
1383 printf(" * Note: For CFM applications using these schema keys you may want to\n");
1384 printf(" * consider the following :\n");
1385 printf(" *\n");
1386 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\n");
1387 printf(" * #define " SC_SCHEMA_KV "(k,v,t)\tlookup_SC_key( CFSTR( #k ) )\n");
1388 printf(" * #include <SystemConfiguration/SystemConfiguration.h>\n");
1389 printf(" *\n");
1390 printf(" * CFStringRef lookup_SC_key(CFStringRef key)\n");
1391 printf(" * {\n");
1392 printf(" * // this function should [dynamically, on-demand] load the\n");
1393 printf(" * // SystemConfiguration.framework, look up the provided key,\n");
1394 printf(" * // and return the associated value.\n");
1395 printf(" * }\n");
1396 printf(" */\n\n");
1397
1398 printf("/*\n");
1399 printf(" * Note: Earlier versions of this header file defined a \"SCSTR\" macro\n");
1400 printf(" * which helped to facilitate Obj-C development. Use of this macro\n");
1401 printf(" * has been deprecated (in Mac OS X 10.4) in favor of the newer\n");
1402 printf(" * \"" SC_SCHEMA_DECLARATION "\" and \"" SC_SCHEMA_KV "\" macros\n");
1403 printf(" */\n\n\n");
1404
1405 printf("#ifndef _SCSCHEMADEFINITIONS_H\n#define _SCSCHEMADEFINITIONS_H\n\n");
1406
1407 printf("/* -------------------- Macro declarations -------------------- */\n\n");
1408
1409 printf("#include <AvailabilityMacros.h>\n\n");
1410
1411 printf("/*\n");
1412 printf(" * let's \"do the right thing\" for those wishing to build for\n");
1413 printf(" * Mac OS X 10.1.0 ... 10.2.x\n");
1414 printf(" */\n");
1415
1416 printf("#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1020\n");
1417 printf(" #ifndef SCSTR\n");
1418 printf(" #include <CoreFoundation/CFString.h>\n");
1419 printf(" #define SCSTR(s) CFSTR(s)\n");
1420 printf(" #endif\n");
1421 printf(" #ifndef " SC_SCHEMA_DECLARATION "\n");
1422 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1423 printf(" #endif\n");
1424 printf(" #ifndef " SC_SCHEMA_KV "\n");
1425 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tSCSTR( v )\n");
1426 printf(" #endif\n");
1427 printf("#endif\n\n");
1428
1429 printf("/*\n");
1430 printf(" * Define a schema key/value/type tuple\n");
1431 printf(" */\n");
1432 printf("#ifndef " SC_SCHEMA_KV "\n");
1433 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tk\n");
1434 printf("#endif\n\n");
1435
1436 printf("/*\n");
1437 printf(" * Provide an \"extern\" for the key/value\n");
1438 printf(" */\n");
1439 printf("#ifndef " SC_SCHEMA_DECLARATION "\n");
1440 printf(" #ifndef SCSTR\n");
1441 printf(" #include <CoreFoundation/CFString.h>\n");
1442 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1443 printf(" #else\n");
1444 printf(" #import <Foundation/NSString.h>\n");
1445 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k q;\n");
1446 printf(" #endif\n");
1447 printf("#endif\n");
1448
1449 // The SCSTR() macro should only be availble for Mac OS X 10.1.0 ... 10.4.x
1450 printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)\n");
1451 printf(" #ifndef SCSTR\n");
1452 printf(" #include <CoreFoundation/CFString.h>\n");
1453 printf(" #define SCSTR(s) CFSTR(s)\n");
1454 printf(" #endif\n");
1455 printf("#endif\n\n\n");
1456
1457 printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
1458 printf("#if\t0\n");
1459 printf("/*!\n");
1460 printf(" *\t@header SCSchemaDefinitions\n");
1461 printf(" */\n");
1462 dump_names(gen_headerdoc_e);
1463 printf("\n");
1464 printf("#endif\t/* 0 */\n\n\n");
1465
1466 printf("/* -------------------- Schema declarations -------------------- */\n\n");
1467 dump_names(gen_hfile_e);
1468 printf("\n");
1469
1470 printf("#endif /* _SCSCHEMADEFINITIONS_H */\n");
1471 }
1472 else if (strcmp(type, "private") == 0) {
1473 printf("%s\n", copyright_string);
1474 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1475
1476 printf("/*\n");
1477 dump_names(gen_comments_private_e);
1478 printf(" */\n\n\n");
1479
1480 printf("#ifndef _SCSCHEMADEFINITIONSPRIVATE_H\n#define _SCSCHEMADEFINITIONSPRIVATE_H\n\n");
1481
1482 printf("/* -------------------- Macro declarations -------------------- */\n\n");
1483
1484 printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n\n");
1485
1486 printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
1487 printf("#if\t0\n");
1488 printf("/*!\n");
1489 printf(" *\t@header SCSchemaDefinitionsPrivate\n");
1490 printf(" */\n");
1491 dump_names(gen_headerdoc_private_e);
1492 printf("\n");
1493 printf("#endif\t/* 0 */\n\n\n");
1494
1495 printf("/* -------------------- Schema declarations -------------------- */\n\n");
1496 dump_names(gen_hfile_private_e);
1497 printf("\n");
1498
1499 printf("#endif /* _SCSCHEMADEFINITIONSPRIVATE_H */\n");
1500 }
1501 else if (strcmp(type, "cfile") == 0) {
1502 printf("/*\n");
1503 printf(" * This file is automatically generated\n");
1504 printf(" * DO NOT EDIT!\n");
1505 printf(" */\n");
1506 printf("\n");
1507 printf("#include <CoreFoundation/CFString.h>\n");
1508 printf("\n");
1509 dump_names(gen_cfile_e);
1510 }
1511 exit(0);
1512 return (0);
1513 }
1514