ntpd-opts.c revision 1.13
1/* $NetBSD: ntpd-opts.c,v 1.13 2020/05/25 20:47:25 christos Exp $ */ 2 3/* 4 * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) 5 * 6 * It has been AutoGen-ed March 3, 2020 at 05:40:30 PM by AutoGen 5.18.5 7 * From the definitions ntpd-opts.def 8 * and the template file options 9 * 10 * Generated from AutoOpts 41:1:16 templates. 11 * 12 * AutoOpts is a copyrighted work. This source file is not encumbered 13 * by AutoOpts licensing, but is provided under the licensing terms chosen 14 * by the ntpd author or copyright holder. AutoOpts is 15 * licensed under the terms of the LGPL. The redistributable library 16 * (``libopts'') is licensed under the terms of either the LGPL or, at the 17 * users discretion, the BSD license. See the AutoOpts and/or libopts sources 18 * for details. 19 * 20 * The ntpd program is copyrighted and licensed 21 * under the following terms: 22 * 23 * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. 24 * This is free software. It is licensed for use, modification and 25 * redistribution under the terms of the NTP License, copies of which 26 * can be seen at: 27 * <http://ntp.org/license> 28 * <http://opensource.org/licenses/ntp-license.php> 29 * 30 * Permission to use, copy, modify, and distribute this software and its 31 * documentation for any purpose with or without fee is hereby granted, 32 * provided that the above copyright notice appears in all copies and that 33 * both the copyright notice and this permission notice appear in 34 * supporting documentation, and that the name The University of Delaware not be used in 35 * advertising or publicity pertaining to distribution of the software 36 * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no 37 * representations about the suitability this software for any purpose. It 38 * is provided "as is" without express or implied warranty. 39 */ 40 41#ifndef __doxygen__ 42#define OPTION_CODE_COMPILE 1 43#include "ntpd-opts.h" 44#include <sys/types.h> 45 46#include <limits.h> 47#include <stdio.h> 48#include <stdlib.h> 49 50#ifdef __cplusplus 51extern "C" { 52#endif 53extern FILE * option_usage_fp; 54#define zCopyright (ntpd_opt_strs+0) 55#define zLicenseDescrip (ntpd_opt_strs+341) 56 57/* 58 * global included definitions 59 */ 60#ifdef __windows 61 extern int atoi(const char *); 62#else 63# include <stdlib.h> 64#endif 65 66#ifdef __windows 67 extern int atoi(const char*); 68#else 69# include <stdlib.h> 70#endif 71 72#ifndef NULL 73# define NULL 0 74#endif 75 76/** 77 * static const strings for ntpd options 78 */ 79static char const ntpd_opt_strs[3132] = 80/* 0 */ "ntpd 4.2.8p14\n" 81 "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n" 82 "This is free software. It is licensed for use, modification and\n" 83 "redistribution under the terms of the NTP License, copies of which\n" 84 "can be seen at:\n" 85 " <http://ntp.org/license>\n" 86 " <http://opensource.org/licenses/ntp-license.php>\n\0" 87/* 341 */ "Permission to use, copy, modify, and distribute this software and its\n" 88 "documentation for any purpose with or without fee is hereby granted,\n" 89 "provided that the above copyright notice appears in all copies and that\n" 90 "both the copyright notice and this permission notice appear in supporting\n" 91 "documentation, and that the name The University of Delaware not be used in\n" 92 "advertising or publicity pertaining to distribution of the software without\n" 93 "specific, written prior permission. The University of Delaware and Network\n" 94 "Time Foundation makes no representations about the suitability this\n" 95 "software for any purpose. It is provided \"as is\" without express or\n" 96 "implied warranty.\n\0" 97/* 1009 */ "Force IPv4 DNS name resolution\0" 98/* 1040 */ "IPV4\0" 99/* 1045 */ "ipv4\0" 100/* 1050 */ "Force IPv6 DNS name resolution\0" 101/* 1081 */ "IPV6\0" 102/* 1086 */ "ipv6\0" 103/* 1091 */ "Require crypto authentication\0" 104/* 1121 */ "AUTHREQ\0" 105/* 1129 */ "authreq\0" 106/* 1137 */ "Do not require crypto authentication\0" 107/* 1174 */ "AUTHNOREQ\0" 108/* 1184 */ "authnoreq\0" 109/* 1194 */ "Allow us to sync to broadcast servers\0" 110/* 1232 */ "BCASTSYNC\0" 111/* 1242 */ "bcastsync\0" 112/* 1252 */ "configuration file name\0" 113/* 1276 */ "CONFIGFILE\0" 114/* 1287 */ "configfile\0" 115/* 1298 */ "Increase debug verbosity level\0" 116/* 1329 */ "DEBUG_LEVEL\0" 117/* 1341 */ "debug-level\0" 118/* 1353 */ "Set the debug verbosity level\0" 119/* 1383 */ "SET_DEBUG_LEVEL\0" 120/* 1399 */ "set-debug-level\0" 121/* 1415 */ "frequency drift file name\0" 122/* 1441 */ "DRIFTFILE\0" 123/* 1451 */ "driftfile\0" 124/* 1461 */ "Allow the first adjustment to be Big\0" 125/* 1498 */ "PANICGATE\0" 126/* 1508 */ "panicgate\0" 127/* 1518 */ "Step any initial offset correction.\0" 128/* 1554 */ "FORCE_STEP_ONCE\0" 129/* 1570 */ "force-step-once\0" 130/* 1586 */ "Jail directory\0" 131/* 1601 */ "JAILDIR\0" 132/* 1609 */ "jaildir\0" 133/* 1617 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0" 134/* 1696 */ "Listen on an interface name or address\0" 135/* 1735 */ "INTERFACE\0" 136/* 1745 */ "interface\0" 137/* 1755 */ "path to symmetric keys\0" 138/* 1778 */ "KEYFILE\0" 139/* 1786 */ "keyfile\0" 140/* 1794 */ "path to the log file\0" 141/* 1815 */ "LOGFILE\0" 142/* 1823 */ "logfile\0" 143/* 1831 */ "Do not listen to virtual interfaces\0" 144/* 1867 */ "NOVIRTUALIPS\0" 145/* 1880 */ "novirtualips\0" 146/* 1893 */ "Modify Multimedia Timer (Windows only)\0" 147/* 1932 */ "MODIFYMMTIMER\0" 148/* 1946 */ "modifymmtimer\0" 149/* 1960 */ "Do not fork\0" 150/* 1972 */ "NOFORK\0" 151/* 1979 */ "nofork\0" 152/* 1986 */ "Run at high priority\0" 153/* 2007 */ "NICE\0" 154/* 2012 */ "nice\0" 155/* 2017 */ "path to the PID file\0" 156/* 2038 */ "PIDFILE\0" 157/* 2046 */ "pidfile\0" 158/* 2054 */ "Process priority\0" 159/* 2071 */ "PRIORITY\0" 160/* 2080 */ "priority\0" 161/* 2089 */ "Set the time and quit\0" 162/* 2111 */ "QUIT\0" 163/* 2116 */ "quit\0" 164/* 2121 */ "Broadcast/propagation delay\0" 165/* 2149 */ "PROPAGATIONDELAY\0" 166/* 2166 */ "propagationdelay\0" 167/* 2183 */ "Save parsed configuration and quit\0" 168/* 2218 */ "SAVECONFIGQUIT\0" 169/* 2233 */ "saveconfigquit\0" 170/* 2248 */ "Statistics file location\0" 171/* 2273 */ "STATSDIR\0" 172/* 2282 */ "statsdir\0" 173/* 2291 */ "Trusted key number\0" 174/* 2310 */ "TRUSTEDKEY\0" 175/* 2321 */ "trustedkey\0" 176/* 2332 */ "Run as userid (or userid:groupid)\0" 177/* 2366 */ "USER\0" 178/* 2371 */ "user\0" 179/* 2376 */ "interval in seconds between scans for new or dropped interfaces\0" 180/* 2440 */ "UPDATEINTERVAL\0" 181/* 2455 */ "updateinterval\0" 182/* 2470 */ "make ARG an ntp variable (RW)\0" 183/* 2500 */ "VAR\0" 184/* 2504 */ "var\0" 185/* 2508 */ "make ARG an ntp variable (RW|DEF)\0" 186/* 2542 */ "DVAR\0" 187/* 2547 */ "dvar\0" 188/* 2552 */ "Seconds to wait for first clock sync\0" 189/* 2589 */ "WAIT_SYNC\0" 190/* 2599 */ "wait-sync\0" 191/* 2609 */ "Slew up to 600 seconds\0" 192/* 2632 */ "SLEW\0" 193/* 2637 */ "slew\0" 194/* 2642 */ "Use CPU cycle counter (Windows only)\0" 195/* 2679 */ "USEPCC\0" 196/* 2686 */ "usepcc\0" 197/* 2693 */ "Force CPU cycle counter use (Windows only)\0" 198/* 2736 */ "PCCFREQ\0" 199/* 2744 */ "pccfreq\0" 200/* 2752 */ "Register with mDNS as a NTP server\0" 201/* 2787 */ "MDNS\0" 202/* 2792 */ "mdns\0" 203/* 2797 */ "display extended usage information and exit\0" 204/* 2841 */ "help\0" 205/* 2846 */ "extended usage information passed thru pager\0" 206/* 2891 */ "more-help\0" 207/* 2901 */ "output version information and exit\0" 208/* 2937 */ "version\0" 209/* 2945 */ "NTPD\0" 210/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p14\n" 211 "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" 212 "\t\t[ <server1> ... <serverN> ]\n\0" 213/* 3082 */ "http://bugs.ntp.org, bugs@ntp.org\0" 214/* 3116 */ "\n\0" 215/* 3118 */ "ntpd 4.2.8p14"; 216 217/** 218 * ipv4 option description with 219 * "Must also have options" and "Incompatible options": 220 */ 221/** Descriptive text for the ipv4 option */ 222#define IPV4_DESC (ntpd_opt_strs+1009) 223/** Upper-cased name for the ipv4 option */ 224#define IPV4_NAME (ntpd_opt_strs+1040) 225/** Name string for the ipv4 option */ 226#define IPV4_name (ntpd_opt_strs+1045) 227/** Other options that appear in conjunction with the ipv4 option */ 228static int const aIpv4CantList[] = { 229 INDEX_OPT_IPV6, NO_EQUIVALENT }; 230/** Compiled in flag settings for the ipv4 option */ 231#define IPV4_FLAGS (OPTST_DISABLED) 232 233/** 234 * ipv6 option description with 235 * "Must also have options" and "Incompatible options": 236 */ 237/** Descriptive text for the ipv6 option */ 238#define IPV6_DESC (ntpd_opt_strs+1050) 239/** Upper-cased name for the ipv6 option */ 240#define IPV6_NAME (ntpd_opt_strs+1081) 241/** Name string for the ipv6 option */ 242#define IPV6_name (ntpd_opt_strs+1086) 243/** Other options that appear in conjunction with the ipv6 option */ 244static int const aIpv6CantList[] = { 245 INDEX_OPT_IPV4, NO_EQUIVALENT }; 246/** Compiled in flag settings for the ipv6 option */ 247#define IPV6_FLAGS (OPTST_DISABLED) 248 249/** 250 * authreq option description with 251 * "Must also have options" and "Incompatible options": 252 */ 253/** Descriptive text for the authreq option */ 254#define AUTHREQ_DESC (ntpd_opt_strs+1091) 255/** Upper-cased name for the authreq option */ 256#define AUTHREQ_NAME (ntpd_opt_strs+1121) 257/** Name string for the authreq option */ 258#define AUTHREQ_name (ntpd_opt_strs+1129) 259/** Other options that appear in conjunction with the authreq option */ 260static int const aAuthreqCantList[] = { 261 INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT }; 262/** Compiled in flag settings for the authreq option */ 263#define AUTHREQ_FLAGS (OPTST_DISABLED) 264 265/** 266 * authnoreq option description with 267 * "Must also have options" and "Incompatible options": 268 */ 269/** Descriptive text for the authnoreq option */ 270#define AUTHNOREQ_DESC (ntpd_opt_strs+1137) 271/** Upper-cased name for the authnoreq option */ 272#define AUTHNOREQ_NAME (ntpd_opt_strs+1174) 273/** Name string for the authnoreq option */ 274#define AUTHNOREQ_name (ntpd_opt_strs+1184) 275/** Other options that appear in conjunction with the authnoreq option */ 276static int const aAuthnoreqCantList[] = { 277 INDEX_OPT_AUTHREQ, NO_EQUIVALENT }; 278/** Compiled in flag settings for the authnoreq option */ 279#define AUTHNOREQ_FLAGS (OPTST_DISABLED) 280 281/** 282 * bcastsync option description: 283 */ 284/** Descriptive text for the bcastsync option */ 285#define BCASTSYNC_DESC (ntpd_opt_strs+1194) 286/** Upper-cased name for the bcastsync option */ 287#define BCASTSYNC_NAME (ntpd_opt_strs+1232) 288/** Name string for the bcastsync option */ 289#define BCASTSYNC_name (ntpd_opt_strs+1242) 290/** Compiled in flag settings for the bcastsync option */ 291#define BCASTSYNC_FLAGS (OPTST_DISABLED) 292 293/** 294 * configfile option description: 295 */ 296/** Descriptive text for the configfile option */ 297#define CONFIGFILE_DESC (ntpd_opt_strs+1252) 298/** Upper-cased name for the configfile option */ 299#define CONFIGFILE_NAME (ntpd_opt_strs+1276) 300/** Name string for the configfile option */ 301#define CONFIGFILE_name (ntpd_opt_strs+1287) 302/** Compiled in flag settings for the configfile option */ 303#define CONFIGFILE_FLAGS (OPTST_DISABLED \ 304 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 305 306/** 307 * debug-level option description: 308 */ 309/** Descriptive text for the debug-level option */ 310#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1298) 311/** Upper-cased name for the debug-level option */ 312#define DEBUG_LEVEL_NAME (ntpd_opt_strs+1329) 313/** Name string for the debug-level option */ 314#define DEBUG_LEVEL_name (ntpd_opt_strs+1341) 315/** Compiled in flag settings for the debug-level option */ 316#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 317 318/** 319 * set-debug-level option description: 320 */ 321/** Descriptive text for the set-debug-level option */ 322#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1353) 323/** Upper-cased name for the set-debug-level option */ 324#define SET_DEBUG_LEVEL_NAME (ntpd_opt_strs+1383) 325/** Name string for the set-debug-level option */ 326#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1399) 327/** Compiled in flag settings for the set-debug-level option */ 328#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 329 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 330 331/** 332 * driftfile option description: 333 */ 334/** Descriptive text for the driftfile option */ 335#define DRIFTFILE_DESC (ntpd_opt_strs+1415) 336/** Upper-cased name for the driftfile option */ 337#define DRIFTFILE_NAME (ntpd_opt_strs+1441) 338/** Name string for the driftfile option */ 339#define DRIFTFILE_name (ntpd_opt_strs+1451) 340/** Compiled in flag settings for the driftfile option */ 341#define DRIFTFILE_FLAGS (OPTST_DISABLED \ 342 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 343 344/** 345 * panicgate option description: 346 */ 347/** Descriptive text for the panicgate option */ 348#define PANICGATE_DESC (ntpd_opt_strs+1461) 349/** Upper-cased name for the panicgate option */ 350#define PANICGATE_NAME (ntpd_opt_strs+1498) 351/** Name string for the panicgate option */ 352#define PANICGATE_name (ntpd_opt_strs+1508) 353/** Compiled in flag settings for the panicgate option */ 354#define PANICGATE_FLAGS (OPTST_DISABLED) 355 356/** 357 * force_step_once option description: 358 */ 359/** Descriptive text for the force_step_once option */ 360#define FORCE_STEP_ONCE_DESC (ntpd_opt_strs+1518) 361/** Upper-cased name for the force_step_once option */ 362#define FORCE_STEP_ONCE_NAME (ntpd_opt_strs+1554) 363/** Name string for the force_step_once option */ 364#define FORCE_STEP_ONCE_name (ntpd_opt_strs+1570) 365/** Compiled in flag settings for the force_step_once option */ 366#define FORCE_STEP_ONCE_FLAGS (OPTST_DISABLED) 367 368/** 369 * jaildir option description: 370 */ 371#ifdef HAVE_DROPROOT 372/** Descriptive text for the jaildir option */ 373#define JAILDIR_DESC (ntpd_opt_strs+1586) 374/** Upper-cased name for the jaildir option */ 375#define JAILDIR_NAME (ntpd_opt_strs+1601) 376/** Name string for the jaildir option */ 377#define JAILDIR_name (ntpd_opt_strs+1609) 378/** Compiled in flag settings for the jaildir option */ 379#define JAILDIR_FLAGS (OPTST_DISABLED \ 380 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 381 382#else /* disable jaildir */ 383#define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 384#define JAILDIR_NAME NULL 385/** Descriptive text for the jaildir option */ 386#define JAILDIR_DESC (ntpd_opt_strs+1617) 387#define JAILDIR_name (ntpd_opt_strs+1609) 388#endif /* HAVE_DROPROOT */ 389 390/** 391 * interface option description: 392 */ 393/** Descriptive text for the interface option */ 394#define INTERFACE_DESC (ntpd_opt_strs+1696) 395/** Upper-cased name for the interface option */ 396#define INTERFACE_NAME (ntpd_opt_strs+1735) 397/** Name string for the interface option */ 398#define INTERFACE_name (ntpd_opt_strs+1745) 399/** Compiled in flag settings for the interface option */ 400#define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 401 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 402 403/** 404 * keyfile option description: 405 */ 406/** Descriptive text for the keyfile option */ 407#define KEYFILE_DESC (ntpd_opt_strs+1755) 408/** Upper-cased name for the keyfile option */ 409#define KEYFILE_NAME (ntpd_opt_strs+1778) 410/** Name string for the keyfile option */ 411#define KEYFILE_name (ntpd_opt_strs+1786) 412/** Compiled in flag settings for the keyfile option */ 413#define KEYFILE_FLAGS (OPTST_DISABLED \ 414 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 415 416/** 417 * logfile option description: 418 */ 419/** Descriptive text for the logfile option */ 420#define LOGFILE_DESC (ntpd_opt_strs+1794) 421/** Upper-cased name for the logfile option */ 422#define LOGFILE_NAME (ntpd_opt_strs+1815) 423/** Name string for the logfile option */ 424#define LOGFILE_name (ntpd_opt_strs+1823) 425/** Compiled in flag settings for the logfile option */ 426#define LOGFILE_FLAGS (OPTST_DISABLED \ 427 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 428 429/** 430 * novirtualips option description: 431 */ 432/** Descriptive text for the novirtualips option */ 433#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1831) 434/** Upper-cased name for the novirtualips option */ 435#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1867) 436/** Name string for the novirtualips option */ 437#define NOVIRTUALIPS_name (ntpd_opt_strs+1880) 438/** Compiled in flag settings for the novirtualips option */ 439#define NOVIRTUALIPS_FLAGS (OPTST_DISABLED) 440 441/** 442 * modifymmtimer option description: 443 */ 444#ifdef SYS_WINNT 445/** Descriptive text for the modifymmtimer option */ 446#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1893) 447/** Upper-cased name for the modifymmtimer option */ 448#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1932) 449/** Name string for the modifymmtimer option */ 450#define MODIFYMMTIMER_name (ntpd_opt_strs+1946) 451/** Compiled in flag settings for the modifymmtimer option */ 452#define MODIFYMMTIMER_FLAGS (OPTST_DISABLED) 453 454#else /* disable modifymmtimer */ 455#define MODIFYMMTIMER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 456#define MODIFYMMTIMER_NAME NULL 457#define MODIFYMMTIMER_DESC NULL 458#define MODIFYMMTIMER_name NULL 459#endif /* SYS_WINNT */ 460 461/** 462 * nofork option description with 463 * "Must also have options" and "Incompatible options": 464 */ 465/** Descriptive text for the nofork option */ 466#define NOFORK_DESC (ntpd_opt_strs+1960) 467/** Upper-cased name for the nofork option */ 468#define NOFORK_NAME (ntpd_opt_strs+1972) 469/** Name string for the nofork option */ 470#define NOFORK_name (ntpd_opt_strs+1979) 471/** Other options that appear in conjunction with the nofork option */ 472static int const aNoforkCantList[] = { 473 INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; 474/** Compiled in flag settings for the nofork option */ 475#define NOFORK_FLAGS (OPTST_DISABLED) 476 477/** 478 * nice option description: 479 */ 480/** Descriptive text for the nice option */ 481#define NICE_DESC (ntpd_opt_strs+1986) 482/** Upper-cased name for the nice option */ 483#define NICE_NAME (ntpd_opt_strs+2007) 484/** Name string for the nice option */ 485#define NICE_name (ntpd_opt_strs+2012) 486/** Compiled in flag settings for the nice option */ 487#define NICE_FLAGS (OPTST_DISABLED) 488 489/** 490 * pidfile option description: 491 */ 492/** Descriptive text for the pidfile option */ 493#define PIDFILE_DESC (ntpd_opt_strs+2017) 494/** Upper-cased name for the pidfile option */ 495#define PIDFILE_NAME (ntpd_opt_strs+2038) 496/** Name string for the pidfile option */ 497#define PIDFILE_name (ntpd_opt_strs+2046) 498/** Compiled in flag settings for the pidfile option */ 499#define PIDFILE_FLAGS (OPTST_DISABLED \ 500 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 501 502/** 503 * priority option description: 504 */ 505/** Descriptive text for the priority option */ 506#define PRIORITY_DESC (ntpd_opt_strs+2054) 507/** Upper-cased name for the priority option */ 508#define PRIORITY_NAME (ntpd_opt_strs+2071) 509/** Name string for the priority option */ 510#define PRIORITY_name (ntpd_opt_strs+2080) 511/** Compiled in flag settings for the priority option */ 512#define PRIORITY_FLAGS (OPTST_DISABLED \ 513 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 514 515/** 516 * quit option description with 517 * "Must also have options" and "Incompatible options": 518 */ 519/** Descriptive text for the quit option */ 520#define QUIT_DESC (ntpd_opt_strs+2089) 521/** Upper-cased name for the quit option */ 522#define QUIT_NAME (ntpd_opt_strs+2111) 523/** Name string for the quit option */ 524#define QUIT_name (ntpd_opt_strs+2116) 525/** Other options that appear in conjunction with the quit option */ 526static int const aQuitCantList[] = { 527 INDEX_OPT_SAVECONFIGQUIT, 528 INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; 529/** Compiled in flag settings for the quit option */ 530#define QUIT_FLAGS (OPTST_DISABLED) 531 532/** 533 * propagationdelay option description: 534 */ 535/** Descriptive text for the propagationdelay option */ 536#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2121) 537/** Upper-cased name for the propagationdelay option */ 538#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2149) 539/** Name string for the propagationdelay option */ 540#define PROPAGATIONDELAY_name (ntpd_opt_strs+2166) 541/** Compiled in flag settings for the propagationdelay option */ 542#define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \ 543 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 544 545/** 546 * saveconfigquit option description with 547 * "Must also have options" and "Incompatible options": 548 */ 549#ifdef SAVECONFIG 550/** Descriptive text for the saveconfigquit option */ 551#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2183) 552/** Upper-cased name for the saveconfigquit option */ 553#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2218) 554/** Name string for the saveconfigquit option */ 555#define SAVECONFIGQUIT_name (ntpd_opt_strs+2233) 556/** Other options that appear in conjunction with the saveconfigquit option */ 557static int const aSaveconfigquitCantList[] = { 558 INDEX_OPT_QUIT, 559 INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; 560/** Compiled in flag settings for the saveconfigquit option */ 561#define SAVECONFIGQUIT_FLAGS (OPTST_DISABLED \ 562 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 563 564#else /* disable saveconfigquit */ 565#define SAVECONFIGQUIT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 566#define aSaveconfigquitCantList NULL 567#define SAVECONFIGQUIT_NAME NULL 568#define SAVECONFIGQUIT_DESC NULL 569#define SAVECONFIGQUIT_name NULL 570#endif /* SAVECONFIG */ 571 572/** 573 * statsdir option description: 574 */ 575/** Descriptive text for the statsdir option */ 576#define STATSDIR_DESC (ntpd_opt_strs+2248) 577/** Upper-cased name for the statsdir option */ 578#define STATSDIR_NAME (ntpd_opt_strs+2273) 579/** Name string for the statsdir option */ 580#define STATSDIR_name (ntpd_opt_strs+2282) 581/** Compiled in flag settings for the statsdir option */ 582#define STATSDIR_FLAGS (OPTST_DISABLED \ 583 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 584 585/** 586 * trustedkey option description: 587 */ 588/** Descriptive text for the trustedkey option */ 589#define TRUSTEDKEY_DESC (ntpd_opt_strs+2291) 590/** Upper-cased name for the trustedkey option */ 591#define TRUSTEDKEY_NAME (ntpd_opt_strs+2310) 592/** Name string for the trustedkey option */ 593#define TRUSTEDKEY_name (ntpd_opt_strs+2321) 594/** Compiled in flag settings for the trustedkey option */ 595#define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 596 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 597 598/** 599 * user option description: 600 */ 601#ifdef HAVE_DROPROOT 602/** Descriptive text for the user option */ 603#define USER_DESC (ntpd_opt_strs+2332) 604/** Upper-cased name for the user option */ 605#define USER_NAME (ntpd_opt_strs+2366) 606/** Name string for the user option */ 607#define USER_name (ntpd_opt_strs+2371) 608/** Compiled in flag settings for the user option */ 609#define USER_FLAGS (OPTST_DISABLED \ 610 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 611 612#else /* disable user */ 613#define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 614#define USER_NAME NULL 615/** Descriptive text for the user option */ 616#define USER_DESC (ntpd_opt_strs+1617) 617#define USER_name (ntpd_opt_strs+2371) 618#endif /* HAVE_DROPROOT */ 619 620/** 621 * updateinterval option description: 622 */ 623/** Descriptive text for the updateinterval option */ 624#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2376) 625/** Upper-cased name for the updateinterval option */ 626#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2440) 627/** Name string for the updateinterval option */ 628#define UPDATEINTERVAL_name (ntpd_opt_strs+2455) 629/** Compiled in flag settings for the updateinterval option */ 630#define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \ 631 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 632 633/** 634 * var option description: 635 */ 636/** Descriptive text for the var option */ 637#define VAR_DESC (ntpd_opt_strs+2470) 638/** Upper-cased name for the var option */ 639#define VAR_NAME (ntpd_opt_strs+2500) 640/** Name string for the var option */ 641#define VAR_name (ntpd_opt_strs+2504) 642/** Compiled in flag settings for the var option */ 643#define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 644 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 645 646/** 647 * dvar option description: 648 */ 649/** Descriptive text for the dvar option */ 650#define DVAR_DESC (ntpd_opt_strs+2508) 651/** Upper-cased name for the dvar option */ 652#define DVAR_NAME (ntpd_opt_strs+2542) 653/** Name string for the dvar option */ 654#define DVAR_name (ntpd_opt_strs+2547) 655/** Compiled in flag settings for the dvar option */ 656#define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 657 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 658 659/** 660 * wait-sync option description with 661 * "Must also have options" and "Incompatible options": 662 */ 663#ifdef HAVE_WORKING_FORK 664/** Descriptive text for the wait-sync option */ 665#define WAIT_SYNC_DESC (ntpd_opt_strs+2552) 666/** Upper-cased name for the wait-sync option */ 667#define WAIT_SYNC_NAME (ntpd_opt_strs+2589) 668/** Name string for the wait-sync option */ 669#define WAIT_SYNC_name (ntpd_opt_strs+2599) 670/** Other options that appear in conjunction with the wait-sync option */ 671static int const aWait_SyncCantList[] = { 672 INDEX_OPT_NOFORK, 673 INDEX_OPT_QUIT, 674 INDEX_OPT_SAVECONFIGQUIT, NO_EQUIVALENT }; 675/** Compiled in flag settings for the wait-sync option */ 676#define WAIT_SYNC_FLAGS (OPTST_DISABLED \ 677 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 678 679#else /* disable wait-sync */ 680#define WAIT_SYNC_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 681#define aWait_SyncCantList NULL 682#define WAIT_SYNC_NAME NULL 683#define WAIT_SYNC_DESC NULL 684#define WAIT_SYNC_name NULL 685#endif /* HAVE_WORKING_FORK */ 686 687/** 688 * slew option description: 689 */ 690/** Descriptive text for the slew option */ 691#define SLEW_DESC (ntpd_opt_strs+2609) 692/** Upper-cased name for the slew option */ 693#define SLEW_NAME (ntpd_opt_strs+2632) 694/** Name string for the slew option */ 695#define SLEW_name (ntpd_opt_strs+2637) 696/** Compiled in flag settings for the slew option */ 697#define SLEW_FLAGS (OPTST_DISABLED) 698 699/** 700 * usepcc option description: 701 */ 702#ifdef SYS_WINNT 703/** Descriptive text for the usepcc option */ 704#define USEPCC_DESC (ntpd_opt_strs+2642) 705/** Upper-cased name for the usepcc option */ 706#define USEPCC_NAME (ntpd_opt_strs+2679) 707/** Name string for the usepcc option */ 708#define USEPCC_name (ntpd_opt_strs+2686) 709/** Compiled in flag settings for the usepcc option */ 710#define USEPCC_FLAGS (OPTST_DISABLED) 711 712#else /* disable usepcc */ 713#define USEPCC_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 714#define USEPCC_NAME NULL 715#define USEPCC_DESC NULL 716#define USEPCC_name NULL 717#endif /* SYS_WINNT */ 718 719/** 720 * pccfreq option description: 721 */ 722#ifdef SYS_WINNT 723/** Descriptive text for the pccfreq option */ 724#define PCCFREQ_DESC (ntpd_opt_strs+2693) 725/** Upper-cased name for the pccfreq option */ 726#define PCCFREQ_NAME (ntpd_opt_strs+2736) 727/** Name string for the pccfreq option */ 728#define PCCFREQ_name (ntpd_opt_strs+2744) 729/** Compiled in flag settings for the pccfreq option */ 730#define PCCFREQ_FLAGS (OPTST_DISABLED \ 731 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 732 733#else /* disable pccfreq */ 734#define PCCFREQ_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 735#define PCCFREQ_NAME NULL 736#define PCCFREQ_DESC NULL 737#define PCCFREQ_name NULL 738#endif /* SYS_WINNT */ 739 740/** 741 * mdns option description: 742 */ 743#ifdef HAVE_DNSREGISTRATION 744/** Descriptive text for the mdns option */ 745#define MDNS_DESC (ntpd_opt_strs+2752) 746/** Upper-cased name for the mdns option */ 747#define MDNS_NAME (ntpd_opt_strs+2787) 748/** Name string for the mdns option */ 749#define MDNS_name (ntpd_opt_strs+2792) 750/** Compiled in flag settings for the mdns option */ 751#define MDNS_FLAGS (OPTST_DISABLED) 752 753#else /* disable mdns */ 754#define MDNS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 755#define MDNS_NAME NULL 756#define MDNS_DESC NULL 757#define MDNS_name NULL 758#endif /* HAVE_DNSREGISTRATION */ 759 760/* 761 * Help/More_Help/Version option descriptions: 762 */ 763#define HELP_DESC (ntpd_opt_strs+2797) 764#define HELP_name (ntpd_opt_strs+2841) 765#ifdef HAVE_WORKING_FORK 766#define MORE_HELP_DESC (ntpd_opt_strs+2846) 767#define MORE_HELP_name (ntpd_opt_strs+2891) 768#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 769#else 770#define MORE_HELP_DESC HELP_DESC 771#define MORE_HELP_name HELP_name 772#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 773#endif 774#ifdef NO_OPTIONAL_OPT_ARGS 775# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 776#else 777# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 778 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 779#endif 780#define VER_DESC (ntpd_opt_strs+2901) 781#define VER_name (ntpd_opt_strs+2937) 782/** 783 * Declare option callback procedures 784 */ 785extern tOptProc 786 ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 787 optionNumericVal, optionPagedUsage, optionResetOpt, 788 optionStackArg, optionTimeDate, optionTimeVal, 789 optionUnstackArg, optionVendorOption; 790static tOptProc 791 doOptDebug_Level, doUsageOpt; 792#define VER_PROC ntpOptionPrintVersion 793 794/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 795/** 796 * Define the ntpd Option Descriptions. 797 * This is an array of OPTION_CT entries, one for each 798 * option that the ntpd program responds to. 799 */ 800static tOptDesc optDesc[OPTION_CT] = { 801 { /* entry idx, value */ 0, VALUE_OPT_IPV4, 802 /* equiv idx, value */ 0, VALUE_OPT_IPV4, 803 /* equivalenced to */ NO_EQUIVALENT, 804 /* min, max, act ct */ 0, 1, 0, 805 /* opt state flags */ IPV4_FLAGS, 0, 806 /* last opt argumnt */ { NULL }, /* --ipv4 */ 807 /* arg list/cookie */ NULL, 808 /* must/cannot opts */ NULL, aIpv4CantList, 809 /* option proc */ NULL, 810 /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name, 811 /* disablement strs */ NULL, NULL }, 812 813 { /* entry idx, value */ 1, VALUE_OPT_IPV6, 814 /* equiv idx, value */ 1, VALUE_OPT_IPV6, 815 /* equivalenced to */ NO_EQUIVALENT, 816 /* min, max, act ct */ 0, 1, 0, 817 /* opt state flags */ IPV6_FLAGS, 0, 818 /* last opt argumnt */ { NULL }, /* --ipv6 */ 819 /* arg list/cookie */ NULL, 820 /* must/cannot opts */ NULL, aIpv6CantList, 821 /* option proc */ NULL, 822 /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name, 823 /* disablement strs */ NULL, NULL }, 824 825 { /* entry idx, value */ 2, VALUE_OPT_AUTHREQ, 826 /* equiv idx, value */ 2, VALUE_OPT_AUTHREQ, 827 /* equivalenced to */ NO_EQUIVALENT, 828 /* min, max, act ct */ 0, 1, 0, 829 /* opt state flags */ AUTHREQ_FLAGS, 0, 830 /* last opt argumnt */ { NULL }, /* --authreq */ 831 /* arg list/cookie */ NULL, 832 /* must/cannot opts */ NULL, aAuthreqCantList, 833 /* option proc */ NULL, 834 /* desc, NAME, name */ AUTHREQ_DESC, AUTHREQ_NAME, AUTHREQ_name, 835 /* disablement strs */ NULL, NULL }, 836 837 { /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ, 838 /* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ, 839 /* equivalenced to */ NO_EQUIVALENT, 840 /* min, max, act ct */ 0, 1, 0, 841 /* opt state flags */ AUTHNOREQ_FLAGS, 0, 842 /* last opt argumnt */ { NULL }, /* --authnoreq */ 843 /* arg list/cookie */ NULL, 844 /* must/cannot opts */ NULL, aAuthnoreqCantList, 845 /* option proc */ NULL, 846 /* desc, NAME, name */ AUTHNOREQ_DESC, AUTHNOREQ_NAME, AUTHNOREQ_name, 847 /* disablement strs */ NULL, NULL }, 848 849 { /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC, 850 /* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC, 851 /* equivalenced to */ NO_EQUIVALENT, 852 /* min, max, act ct */ 0, 1, 0, 853 /* opt state flags */ BCASTSYNC_FLAGS, 0, 854 /* last opt argumnt */ { NULL }, /* --bcastsync */ 855 /* arg list/cookie */ NULL, 856 /* must/cannot opts */ NULL, NULL, 857 /* option proc */ NULL, 858 /* desc, NAME, name */ BCASTSYNC_DESC, BCASTSYNC_NAME, BCASTSYNC_name, 859 /* disablement strs */ NULL, NULL }, 860 861 { /* entry idx, value */ 5, VALUE_OPT_CONFIGFILE, 862 /* equiv idx, value */ 5, VALUE_OPT_CONFIGFILE, 863 /* equivalenced to */ NO_EQUIVALENT, 864 /* min, max, act ct */ 0, 1, 0, 865 /* opt state flags */ CONFIGFILE_FLAGS, 0, 866 /* last opt argumnt */ { NULL }, /* --configfile */ 867 /* arg list/cookie */ NULL, 868 /* must/cannot opts */ NULL, NULL, 869 /* option proc */ NULL, 870 /* desc, NAME, name */ CONFIGFILE_DESC, CONFIGFILE_NAME, CONFIGFILE_name, 871 /* disablement strs */ NULL, NULL }, 872 873 { /* entry idx, value */ 6, VALUE_OPT_DEBUG_LEVEL, 874 /* equiv idx, value */ 6, VALUE_OPT_DEBUG_LEVEL, 875 /* equivalenced to */ NO_EQUIVALENT, 876 /* min, max, act ct */ 0, NOLIMIT, 0, 877 /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 878 /* last opt argumnt */ { NULL }, /* --debug-level */ 879 /* arg list/cookie */ NULL, 880 /* must/cannot opts */ NULL, NULL, 881 /* option proc */ doOptDebug_Level, 882 /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 883 /* disablement strs */ NULL, NULL }, 884 885 { /* entry idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL, 886 /* equiv idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL, 887 /* equivalenced to */ NO_EQUIVALENT, 888 /* min, max, act ct */ 0, NOLIMIT, 0, 889 /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 890 /* last opt argumnt */ { NULL }, /* --set-debug-level */ 891 /* arg list/cookie */ NULL, 892 /* must/cannot opts */ NULL, NULL, 893 /* option proc */ optionNumericVal, 894 /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 895 /* disablement strs */ NULL, NULL }, 896 897 { /* entry idx, value */ 8, VALUE_OPT_DRIFTFILE, 898 /* equiv idx, value */ 8, VALUE_OPT_DRIFTFILE, 899 /* equivalenced to */ NO_EQUIVALENT, 900 /* min, max, act ct */ 0, 1, 0, 901 /* opt state flags */ DRIFTFILE_FLAGS, 0, 902 /* last opt argumnt */ { NULL }, /* --driftfile */ 903 /* arg list/cookie */ NULL, 904 /* must/cannot opts */ NULL, NULL, 905 /* option proc */ NULL, 906 /* desc, NAME, name */ DRIFTFILE_DESC, DRIFTFILE_NAME, DRIFTFILE_name, 907 /* disablement strs */ NULL, NULL }, 908 909 { /* entry idx, value */ 9, VALUE_OPT_PANICGATE, 910 /* equiv idx, value */ 9, VALUE_OPT_PANICGATE, 911 /* equivalenced to */ NO_EQUIVALENT, 912 /* min, max, act ct */ 0, NOLIMIT, 0, 913 /* opt state flags */ PANICGATE_FLAGS, 0, 914 /* last opt argumnt */ { NULL }, /* --panicgate */ 915 /* arg list/cookie */ NULL, 916 /* must/cannot opts */ NULL, NULL, 917 /* option proc */ NULL, 918 /* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name, 919 /* disablement strs */ NULL, NULL }, 920 921 { /* entry idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE, 922 /* equiv idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE, 923 /* equivalenced to */ NO_EQUIVALENT, 924 /* min, max, act ct */ 0, 1, 0, 925 /* opt state flags */ FORCE_STEP_ONCE_FLAGS, 0, 926 /* last opt argumnt */ { NULL }, /* --force_step_once */ 927 /* arg list/cookie */ NULL, 928 /* must/cannot opts */ NULL, NULL, 929 /* option proc */ NULL, 930 /* desc, NAME, name */ FORCE_STEP_ONCE_DESC, FORCE_STEP_ONCE_NAME, FORCE_STEP_ONCE_name, 931 /* disablement strs */ NULL, NULL }, 932 933 { /* entry idx, value */ 11, VALUE_OPT_JAILDIR, 934 /* equiv idx, value */ 11, VALUE_OPT_JAILDIR, 935 /* equivalenced to */ NO_EQUIVALENT, 936 /* min, max, act ct */ 0, 1, 0, 937 /* opt state flags */ JAILDIR_FLAGS, 0, 938 /* last opt argumnt */ { NULL }, /* --jaildir */ 939 /* arg list/cookie */ NULL, 940 /* must/cannot opts */ NULL, NULL, 941 /* option proc */ NULL, 942 /* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name, 943 /* disablement strs */ NULL, NULL }, 944 945 { /* entry idx, value */ 12, VALUE_OPT_INTERFACE, 946 /* equiv idx, value */ 12, VALUE_OPT_INTERFACE, 947 /* equivalenced to */ NO_EQUIVALENT, 948 /* min, max, act ct */ 0, NOLIMIT, 0, 949 /* opt state flags */ INTERFACE_FLAGS, 0, 950 /* last opt argumnt */ { NULL }, /* --interface */ 951 /* arg list/cookie */ NULL, 952 /* must/cannot opts */ NULL, NULL, 953 /* option proc */ optionStackArg, 954 /* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name, 955 /* disablement strs */ NULL, NULL }, 956 957 { /* entry idx, value */ 13, VALUE_OPT_KEYFILE, 958 /* equiv idx, value */ 13, VALUE_OPT_KEYFILE, 959 /* equivalenced to */ NO_EQUIVALENT, 960 /* min, max, act ct */ 0, 1, 0, 961 /* opt state flags */ KEYFILE_FLAGS, 0, 962 /* last opt argumnt */ { NULL }, /* --keyfile */ 963 /* arg list/cookie */ NULL, 964 /* must/cannot opts */ NULL, NULL, 965 /* option proc */ NULL, 966 /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name, 967 /* disablement strs */ NULL, NULL }, 968 969 { /* entry idx, value */ 14, VALUE_OPT_LOGFILE, 970 /* equiv idx, value */ 14, VALUE_OPT_LOGFILE, 971 /* equivalenced to */ NO_EQUIVALENT, 972 /* min, max, act ct */ 0, 1, 0, 973 /* opt state flags */ LOGFILE_FLAGS, 0, 974 /* last opt argumnt */ { NULL }, /* --logfile */ 975 /* arg list/cookie */ NULL, 976 /* must/cannot opts */ NULL, NULL, 977 /* option proc */ NULL, 978 /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name, 979 /* disablement strs */ NULL, NULL }, 980 981 { /* entry idx, value */ 15, VALUE_OPT_NOVIRTUALIPS, 982 /* equiv idx, value */ 15, VALUE_OPT_NOVIRTUALIPS, 983 /* equivalenced to */ NO_EQUIVALENT, 984 /* min, max, act ct */ 0, 1, 0, 985 /* opt state flags */ NOVIRTUALIPS_FLAGS, 0, 986 /* last opt argumnt */ { NULL }, /* --novirtualips */ 987 /* arg list/cookie */ NULL, 988 /* must/cannot opts */ NULL, NULL, 989 /* option proc */ NULL, 990 /* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name, 991 /* disablement strs */ NULL, NULL }, 992 993 { /* entry idx, value */ 16, VALUE_OPT_MODIFYMMTIMER, 994 /* equiv idx, value */ 16, VALUE_OPT_MODIFYMMTIMER, 995 /* equivalenced to */ NO_EQUIVALENT, 996 /* min, max, act ct */ 0, 1, 0, 997 /* opt state flags */ MODIFYMMTIMER_FLAGS, 0, 998 /* last opt argumnt */ { NULL }, /* --modifymmtimer */ 999 /* arg list/cookie */ NULL, 1000 /* must/cannot opts */ NULL, NULL, 1001 /* option proc */ NULL, 1002 /* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name, 1003 /* disablement strs */ NULL, NULL }, 1004 1005 { /* entry idx, value */ 17, VALUE_OPT_NOFORK, 1006 /* equiv idx, value */ 17, VALUE_OPT_NOFORK, 1007 /* equivalenced to */ NO_EQUIVALENT, 1008 /* min, max, act ct */ 0, 1, 0, 1009 /* opt state flags */ NOFORK_FLAGS, 0, 1010 /* last opt argumnt */ { NULL }, /* --nofork */ 1011 /* arg list/cookie */ NULL, 1012 /* must/cannot opts */ NULL, aNoforkCantList, 1013 /* option proc */ NULL, 1014 /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name, 1015 /* disablement strs */ NULL, NULL }, 1016 1017 { /* entry idx, value */ 18, VALUE_OPT_NICE, 1018 /* equiv idx, value */ 18, VALUE_OPT_NICE, 1019 /* equivalenced to */ NO_EQUIVALENT, 1020 /* min, max, act ct */ 0, 1, 0, 1021 /* opt state flags */ NICE_FLAGS, 0, 1022 /* last opt argumnt */ { NULL }, /* --nice */ 1023 /* arg list/cookie */ NULL, 1024 /* must/cannot opts */ NULL, NULL, 1025 /* option proc */ NULL, 1026 /* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name, 1027 /* disablement strs */ NULL, NULL }, 1028 1029 { /* entry idx, value */ 19, VALUE_OPT_PIDFILE, 1030 /* equiv idx, value */ 19, VALUE_OPT_PIDFILE, 1031 /* equivalenced to */ NO_EQUIVALENT, 1032 /* min, max, act ct */ 0, 1, 0, 1033 /* opt state flags */ PIDFILE_FLAGS, 0, 1034 /* last opt argumnt */ { NULL }, /* --pidfile */ 1035 /* arg list/cookie */ NULL, 1036 /* must/cannot opts */ NULL, NULL, 1037 /* option proc */ NULL, 1038 /* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name, 1039 /* disablement strs */ NULL, NULL }, 1040 1041 { /* entry idx, value */ 20, VALUE_OPT_PRIORITY, 1042 /* equiv idx, value */ 20, VALUE_OPT_PRIORITY, 1043 /* equivalenced to */ NO_EQUIVALENT, 1044 /* min, max, act ct */ 0, 1, 0, 1045 /* opt state flags */ PRIORITY_FLAGS, 0, 1046 /* last opt argumnt */ { NULL }, /* --priority */ 1047 /* arg list/cookie */ NULL, 1048 /* must/cannot opts */ NULL, NULL, 1049 /* option proc */ optionNumericVal, 1050 /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name, 1051 /* disablement strs */ NULL, NULL }, 1052 1053 { /* entry idx, value */ 21, VALUE_OPT_QUIT, 1054 /* equiv idx, value */ 21, VALUE_OPT_QUIT, 1055 /* equivalenced to */ NO_EQUIVALENT, 1056 /* min, max, act ct */ 0, 1, 0, 1057 /* opt state flags */ QUIT_FLAGS, 0, 1058 /* last opt argumnt */ { NULL }, /* --quit */ 1059 /* arg list/cookie */ NULL, 1060 /* must/cannot opts */ NULL, aQuitCantList, 1061 /* option proc */ NULL, 1062 /* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name, 1063 /* disablement strs */ NULL, NULL }, 1064 1065 { /* entry idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY, 1066 /* equiv idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY, 1067 /* equivalenced to */ NO_EQUIVALENT, 1068 /* min, max, act ct */ 0, 1, 0, 1069 /* opt state flags */ PROPAGATIONDELAY_FLAGS, 0, 1070 /* last opt argumnt */ { NULL }, /* --propagationdelay */ 1071 /* arg list/cookie */ NULL, 1072 /* must/cannot opts */ NULL, NULL, 1073 /* option proc */ NULL, 1074 /* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name, 1075 /* disablement strs */ NULL, NULL }, 1076 1077 { /* entry idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT, 1078 /* equiv idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT, 1079 /* equivalenced to */ NO_EQUIVALENT, 1080 /* min, max, act ct */ 0, 1, 0, 1081 /* opt state flags */ SAVECONFIGQUIT_FLAGS, 0, 1082 /* last opt argumnt */ { NULL }, /* --saveconfigquit */ 1083 /* arg list/cookie */ NULL, 1084 /* must/cannot opts */ NULL, aSaveconfigquitCantList, 1085 /* option proc */ NULL, 1086 /* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name, 1087 /* disablement strs */ NULL, NULL }, 1088 1089 { /* entry idx, value */ 24, VALUE_OPT_STATSDIR, 1090 /* equiv idx, value */ 24, VALUE_OPT_STATSDIR, 1091 /* equivalenced to */ NO_EQUIVALENT, 1092 /* min, max, act ct */ 0, 1, 0, 1093 /* opt state flags */ STATSDIR_FLAGS, 0, 1094 /* last opt argumnt */ { NULL }, /* --statsdir */ 1095 /* arg list/cookie */ NULL, 1096 /* must/cannot opts */ NULL, NULL, 1097 /* option proc */ NULL, 1098 /* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name, 1099 /* disablement strs */ NULL, NULL }, 1100 1101 { /* entry idx, value */ 25, VALUE_OPT_TRUSTEDKEY, 1102 /* equiv idx, value */ 25, VALUE_OPT_TRUSTEDKEY, 1103 /* equivalenced to */ NO_EQUIVALENT, 1104 /* min, max, act ct */ 0, NOLIMIT, 0, 1105 /* opt state flags */ TRUSTEDKEY_FLAGS, 0, 1106 /* last opt argumnt */ { NULL }, /* --trustedkey */ 1107 /* arg list/cookie */ NULL, 1108 /* must/cannot opts */ NULL, NULL, 1109 /* option proc */ optionStackArg, 1110 /* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name, 1111 /* disablement strs */ NULL, NULL }, 1112 1113 { /* entry idx, value */ 26, VALUE_OPT_USER, 1114 /* equiv idx, value */ 26, VALUE_OPT_USER, 1115 /* equivalenced to */ NO_EQUIVALENT, 1116 /* min, max, act ct */ 0, 1, 0, 1117 /* opt state flags */ USER_FLAGS, 0, 1118 /* last opt argumnt */ { NULL }, /* --user */ 1119 /* arg list/cookie */ NULL, 1120 /* must/cannot opts */ NULL, NULL, 1121 /* option proc */ NULL, 1122 /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name, 1123 /* disablement strs */ NULL, NULL }, 1124 1125 { /* entry idx, value */ 27, VALUE_OPT_UPDATEINTERVAL, 1126 /* equiv idx, value */ 27, VALUE_OPT_UPDATEINTERVAL, 1127 /* equivalenced to */ NO_EQUIVALENT, 1128 /* min, max, act ct */ 0, 1, 0, 1129 /* opt state flags */ UPDATEINTERVAL_FLAGS, 0, 1130 /* last opt argumnt */ { NULL }, /* --updateinterval */ 1131 /* arg list/cookie */ NULL, 1132 /* must/cannot opts */ NULL, NULL, 1133 /* option proc */ optionNumericVal, 1134 /* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name, 1135 /* disablement strs */ NULL, NULL }, 1136 1137 { /* entry idx, value */ 28, VALUE_OPT_VAR, 1138 /* equiv idx, value */ 28, VALUE_OPT_VAR, 1139 /* equivalenced to */ NO_EQUIVALENT, 1140 /* min, max, act ct */ 0, NOLIMIT, 0, 1141 /* opt state flags */ VAR_FLAGS, 0, 1142 /* last opt argumnt */ { NULL }, /* --var */ 1143 /* arg list/cookie */ NULL, 1144 /* must/cannot opts */ NULL, NULL, 1145 /* option proc */ optionStackArg, 1146 /* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name, 1147 /* disablement strs */ NULL, NULL }, 1148 1149 { /* entry idx, value */ 29, VALUE_OPT_DVAR, 1150 /* equiv idx, value */ 29, VALUE_OPT_DVAR, 1151 /* equivalenced to */ NO_EQUIVALENT, 1152 /* min, max, act ct */ 0, NOLIMIT, 0, 1153 /* opt state flags */ DVAR_FLAGS, 0, 1154 /* last opt argumnt */ { NULL }, /* --dvar */ 1155 /* arg list/cookie */ NULL, 1156 /* must/cannot opts */ NULL, NULL, 1157 /* option proc */ optionStackArg, 1158 /* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name, 1159 /* disablement strs */ NULL, NULL }, 1160 1161 { /* entry idx, value */ 30, VALUE_OPT_WAIT_SYNC, 1162 /* equiv idx, value */ 30, VALUE_OPT_WAIT_SYNC, 1163 /* equivalenced to */ NO_EQUIVALENT, 1164 /* min, max, act ct */ 0, 1, 0, 1165 /* opt state flags */ WAIT_SYNC_FLAGS, 0, 1166 /* last opt argumnt */ { NULL }, /* --wait-sync */ 1167 /* arg list/cookie */ NULL, 1168 /* must/cannot opts */ NULL, aWait_SyncCantList, 1169 /* option proc */ optionNumericVal, 1170 /* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name, 1171 /* disablement strs */ NULL, NULL }, 1172 1173 { /* entry idx, value */ 31, VALUE_OPT_SLEW, 1174 /* equiv idx, value */ 31, VALUE_OPT_SLEW, 1175 /* equivalenced to */ NO_EQUIVALENT, 1176 /* min, max, act ct */ 0, 1, 0, 1177 /* opt state flags */ SLEW_FLAGS, 0, 1178 /* last opt argumnt */ { NULL }, /* --slew */ 1179 /* arg list/cookie */ NULL, 1180 /* must/cannot opts */ NULL, NULL, 1181 /* option proc */ NULL, 1182 /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name, 1183 /* disablement strs */ NULL, NULL }, 1184 1185 { /* entry idx, value */ 32, VALUE_OPT_USEPCC, 1186 /* equiv idx, value */ 32, VALUE_OPT_USEPCC, 1187 /* equivalenced to */ NO_EQUIVALENT, 1188 /* min, max, act ct */ 0, 1, 0, 1189 /* opt state flags */ USEPCC_FLAGS, 0, 1190 /* last opt argumnt */ { NULL }, /* --usepcc */ 1191 /* arg list/cookie */ NULL, 1192 /* must/cannot opts */ NULL, NULL, 1193 /* option proc */ NULL, 1194 /* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name, 1195 /* disablement strs */ NULL, NULL }, 1196 1197 { /* entry idx, value */ 33, VALUE_OPT_PCCFREQ, 1198 /* equiv idx, value */ 33, VALUE_OPT_PCCFREQ, 1199 /* equivalenced to */ NO_EQUIVALENT, 1200 /* min, max, act ct */ 0, 1, 0, 1201 /* opt state flags */ PCCFREQ_FLAGS, 0, 1202 /* last opt argumnt */ { NULL }, /* --pccfreq */ 1203 /* arg list/cookie */ NULL, 1204 /* must/cannot opts */ NULL, NULL, 1205 /* option proc */ NULL, 1206 /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name, 1207 /* disablement strs */ NULL, NULL }, 1208 1209 { /* entry idx, value */ 34, VALUE_OPT_MDNS, 1210 /* equiv idx, value */ 34, VALUE_OPT_MDNS, 1211 /* equivalenced to */ NO_EQUIVALENT, 1212 /* min, max, act ct */ 0, 1, 0, 1213 /* opt state flags */ MDNS_FLAGS, 0, 1214 /* last opt argumnt */ { NULL }, /* --mdns */ 1215 /* arg list/cookie */ NULL, 1216 /* must/cannot opts */ NULL, NULL, 1217 /* option proc */ NULL, 1218 /* desc, NAME, name */ MDNS_DESC, MDNS_NAME, MDNS_name, 1219 /* disablement strs */ NULL, NULL }, 1220 1221 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 1222 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 1223 /* equivalenced to */ NO_EQUIVALENT, 1224 /* min, max, act ct */ 0, 1, 0, 1225 /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 1226 /* last opt argumnt */ { NULL }, 1227 /* arg list/cookie */ NULL, 1228 /* must/cannot opts */ NULL, NULL, 1229 /* option proc */ VER_PROC, 1230 /* desc, NAME, name */ VER_DESC, NULL, VER_name, 1231 /* disablement strs */ NULL, NULL }, 1232 1233 1234 1235 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 1236 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 1237 /* equivalenced to */ NO_EQUIVALENT, 1238 /* min, max, act ct */ 0, 1, 0, 1239 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 1240 /* last opt argumnt */ { NULL }, 1241 /* arg list/cookie */ NULL, 1242 /* must/cannot opts */ NULL, NULL, 1243 /* option proc */ doUsageOpt, 1244 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 1245 /* disablement strs */ NULL, NULL }, 1246 1247 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 1248 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 1249 /* equivalenced to */ NO_EQUIVALENT, 1250 /* min, max, act ct */ 0, 1, 0, 1251 /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 1252 /* last opt argumnt */ { NULL }, 1253 /* arg list/cookie */ NULL, 1254 /* must/cannot opts */ NULL, NULL, 1255 /* option proc */ optionPagedUsage, 1256 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 1257 /* disablement strs */ NULL, NULL } 1258}; 1259 1260 1261/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1262/** Reference to the upper cased version of ntpd. */ 1263#define zPROGNAME (ntpd_opt_strs+2945) 1264/** Reference to the title line for ntpd usage. */ 1265#define zUsageTitle (ntpd_opt_strs+2950) 1266/** There is no ntpd configuration file. */ 1267#define zRcName NULL 1268/** There are no directories to search for ntpd config files. */ 1269#define apzHomeList NULL 1270/** The ntpd program bug email address. */ 1271#define zBugsAddr (ntpd_opt_strs+3082) 1272/** Clarification/explanation of what ntpd does. */ 1273#define zExplain (ntpd_opt_strs+3116) 1274/** Extra detail explaining what ntpd does. */ 1275#define zDetail (NULL) 1276/** The full version string for ntpd. */ 1277#define zFullVersion (ntpd_opt_strs+3118) 1278/* extracted from optcode.tlib near line 364 */ 1279 1280#if defined(ENABLE_NLS) 1281# define OPTPROC_BASE OPTPROC_TRANSLATE 1282 static tOptionXlateProc translate_option_strings; 1283#else 1284# define OPTPROC_BASE OPTPROC_NONE 1285# define translate_option_strings NULL 1286#endif /* ENABLE_NLS */ 1287 1288#define ntpd_full_usage (NULL) 1289#define ntpd_short_usage (NULL) 1290 1291#endif /* not defined __doxygen__ */ 1292 1293/* 1294 * Create the static procedure(s) declared above. 1295 */ 1296/** 1297 * The callout function that invokes the optionUsage function. 1298 * 1299 * @param[in] opts the AutoOpts option description structure 1300 * @param[in] od the descriptor for the "help" (usage) option. 1301 * @noreturn 1302 */ 1303static void 1304doUsageOpt(tOptions * opts, tOptDesc * od) 1305{ 1306 int ex_code; 1307 ex_code = NTPD_EXIT_SUCCESS; 1308 optionUsage(&ntpdOptions, ex_code); 1309 /* NOTREACHED */ 1310 exit(1); 1311 (void)opts; 1312 (void)od; 1313} 1314 1315/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1316/** 1317 * Code to handle the debug-level option. 1318 * 1319 * @param[in] pOptions the ntpd options data structure 1320 * @param[in,out] pOptDesc the option descriptor for this option. 1321 */ 1322static void 1323doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 1324{ 1325 /* 1326 * Be sure the flag-code[0] handles special values for the options pointer 1327 * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 1328 * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 1329 * reset its state. 1330 */ 1331 /* extracted from debug-opt.def, line 15 */ 1332OPT_VALUE_SET_DEBUG_LEVEL++; 1333 (void)pOptDesc; 1334 (void)pOptions; 1335} 1336/* extracted from optmain.tlib near line 1250 */ 1337 1338/** 1339 * The directory containing the data associated with ntpd. 1340 */ 1341#ifndef PKGDATADIR 1342# define PKGDATADIR "" 1343#endif 1344 1345/** 1346 * Information about the person or institution that packaged ntpd 1347 * for the current distribution. 1348 */ 1349#ifndef WITH_PACKAGER 1350# define ntpd_packager_info NULL 1351#else 1352/** Packager information for ntpd. */ 1353static char const ntpd_packager_info[] = 1354 "Packaged by " WITH_PACKAGER 1355 1356# ifdef WITH_PACKAGER_VERSION 1357 " ("WITH_PACKAGER_VERSION")" 1358# endif 1359 1360# ifdef WITH_PACKAGER_BUG_REPORTS 1361 "\nReport ntpd bugs to " WITH_PACKAGER_BUG_REPORTS 1362# endif 1363 "\n"; 1364#endif 1365#ifndef __doxygen__ 1366 1367#endif /* __doxygen__ */ 1368/** 1369 * The option definitions for ntpd. The one structure that 1370 * binds them all. 1371 */ 1372tOptions ntpdOptions = { 1373 OPTIONS_STRUCT_VERSION, 1374 0, NULL, /* original argc + argv */ 1375 ( OPTPROC_BASE 1376 + OPTPROC_ERRSTOP 1377 + OPTPROC_SHORTOPT 1378 + OPTPROC_LONGOPT 1379 + OPTPROC_NO_REQ_OPT 1380 + OPTPROC_ENVIRON 1381 + OPTPROC_MISUSE ), 1382 0, NULL, /* current option index, current option */ 1383 NULL, NULL, zPROGNAME, 1384 zRcName, zCopyright, zLicenseDescrip, 1385 zFullVersion, apzHomeList, zUsageTitle, 1386 zExplain, zDetail, optDesc, 1387 zBugsAddr, /* address to send bugs to */ 1388 NULL, NULL, /* extensions/saved state */ 1389 optionUsage, /* usage procedure */ 1390 translate_option_strings, /* translation procedure */ 1391 /* 1392 * Indexes to special options 1393 */ 1394 { INDEX_OPT_MORE_HELP, /* more-help option index */ 1395 NO_EQUIVALENT, /* save option index */ 1396 NO_EQUIVALENT, /* '-#' option index */ 1397 NO_EQUIVALENT /* index of default opt */ 1398 }, 1399 38 /* full option count */, 35 /* user option count */, 1400 ntpd_full_usage, ntpd_short_usage, 1401 NULL, NULL, 1402 PKGDATADIR, ntpd_packager_info 1403}; 1404 1405#if ENABLE_NLS 1406/** 1407 * This code is designed to translate translatable option text for the 1408 * ntpd program. These translations happen upon entry 1409 * to optionProcess(). 1410 */ 1411#include <stdio.h> 1412#include <stdlib.h> 1413#include <string.h> 1414#include <unistd.h> 1415#ifdef HAVE_DCGETTEXT 1416# include <gettext.h> 1417#endif 1418#include <autoopts/usage-txt.h> 1419 1420static char * AO_gettext(char const * pz); 1421static void coerce_it(void ** s); 1422 1423/** 1424 * AutoGen specific wrapper function for gettext. It relies on the macro _() 1425 * to convert from English to the target language, then strdup-duplicates the 1426 * result string. It tries the "libopts" domain first, then whatever has been 1427 * set via the \a textdomain(3) call. 1428 * 1429 * @param[in] pz the input text used as a lookup key. 1430 * @returns the translated text (if there is one), 1431 * or the original text (if not). 1432 */ 1433static char * 1434AO_gettext(char const * pz) 1435{ 1436 char * res; 1437 if (pz == NULL) 1438 return NULL; 1439#ifdef HAVE_DCGETTEXT 1440 /* 1441 * While processing the option_xlateable_txt data, try to use the 1442 * "libopts" domain. Once we switch to the option descriptor data, 1443 * do *not* use that domain. 1444 */ 1445 if (option_xlateable_txt.field_ct != 0) { 1446 res = dgettext("libopts", pz); 1447 if (res == pz) 1448 res = (char *)VOIDP(_(pz)); 1449 } else 1450 res = (char *)VOIDP(_(pz)); 1451#else 1452 res = (char *)VOIDP(_(pz)); 1453#endif 1454 if (res == pz) 1455 return res; 1456 res = strdup(res); 1457 if (res == NULL) { 1458 fputs(_("No memory for duping translated strings\n"), stderr); 1459 exit(NTPD_EXIT_FAILURE); 1460 } 1461 return res; 1462} 1463 1464/** 1465 * All the pointers we use are marked "* const", but they are stored in 1466 * writable memory. Coerce the mutability and set the pointer. 1467 */ 1468static void coerce_it(void ** s) { *s = AO_gettext(*s); 1469} 1470 1471/** 1472 * Translate all the translatable strings in the ntpdOptions 1473 * structure defined above. This is done only once. 1474 */ 1475static void 1476translate_option_strings(void) 1477{ 1478 tOptions * const opts = &ntpdOptions; 1479 1480 /* 1481 * Guard against re-translation. It won't work. The strings will have 1482 * been changed by the first pass through this code. One shot only. 1483 */ 1484 if (option_xlateable_txt.field_ct != 0) { 1485 /* 1486 * Do the translations. The first pointer follows the field count 1487 * field. The field count field is the size of a pointer. 1488 */ 1489 char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); 1490 int ix = option_xlateable_txt.field_ct; 1491 1492 do { 1493 ppz++; /* skip over field_ct */ 1494 *ppz = AO_gettext(*ppz); 1495 } while (--ix > 0); 1496 /* prevent re-translation and disable "libopts" domain lookup */ 1497 option_xlateable_txt.field_ct = 0; 1498 1499 coerce_it(VOIDP(&(opts->pzCopyright))); 1500 coerce_it(VOIDP(&(opts->pzCopyNotice))); 1501 coerce_it(VOIDP(&(opts->pzFullVersion))); 1502 coerce_it(VOIDP(&(opts->pzUsageTitle))); 1503 coerce_it(VOIDP(&(opts->pzExplain))); 1504 coerce_it(VOIDP(&(opts->pzDetail))); 1505 { 1506 tOptDesc * od = opts->pOptDesc; 1507 for (ix = opts->optCt; ix > 0; ix--, od++) 1508 coerce_it(VOIDP(&(od->pzText))); 1509 } 1510 } 1511} 1512#endif /* ENABLE_NLS */ 1513 1514#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 1515/** I18N function strictly for xgettext. Do not compile. */ 1516static void bogus_function(void) { 1517 /* TRANSLATORS: 1518 1519 The following dummy function was crated solely so that xgettext can 1520 extract the correct strings. These strings are actually referenced 1521 by a field name in the ntpdOptions structure noted in the 1522 comments below. The literal text is defined in ntpd_opt_strs. 1523 1524 NOTE: the strings below are segmented with respect to the source string 1525 ntpd_opt_strs. The strings above are handed off for translation 1526 at run time a paragraph at a time. Consequently, they are presented here 1527 for translation a paragraph at a time. 1528 1529 ALSO: often the description for an option will reference another option 1530 by name. These are set off with apostrophe quotes (I hope). Do not 1531 translate option names. 1532 */ 1533 /* referenced via ntpdOptions.pzCopyright */ 1534 puts(_("ntpd 4.2.8p14\n\ 1535Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\ 1536This is free software. It is licensed for use, modification and\n\ 1537redistribution under the terms of the NTP License, copies of which\n\ 1538can be seen at:\n")); 1539 puts(_(" <http://ntp.org/license>\n\ 1540 <http://opensource.org/licenses/ntp-license.php>\n")); 1541 1542 /* referenced via ntpdOptions.pzCopyNotice */ 1543 puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 1544documentation for any purpose with or without fee is hereby granted,\n\ 1545provided that the above copyright notice appears in all copies and that\n\ 1546both the copyright notice and this permission notice appear in supporting\n\ 1547documentation, and that the name The University of Delaware not be used in\n\ 1548advertising or publicity pertaining to distribution of the software without\n\ 1549specific, written prior permission. The University of Delaware and Network\n\ 1550Time Foundation makes no representations about the suitability this\n\ 1551software for any purpose. It is provided \"as is\" without express or\n\ 1552implied warranty.\n")); 1553 1554 /* referenced via ntpdOptions.pOptDesc->pzText */ 1555 puts(_("Force IPv4 DNS name resolution")); 1556 1557 /* referenced via ntpdOptions.pOptDesc->pzText */ 1558 puts(_("Force IPv6 DNS name resolution")); 1559 1560 /* referenced via ntpdOptions.pOptDesc->pzText */ 1561 puts(_("Require crypto authentication")); 1562 1563 /* referenced via ntpdOptions.pOptDesc->pzText */ 1564 puts(_("Do not require crypto authentication")); 1565 1566 /* referenced via ntpdOptions.pOptDesc->pzText */ 1567 puts(_("Allow us to sync to broadcast servers")); 1568 1569 /* referenced via ntpdOptions.pOptDesc->pzText */ 1570 puts(_("configuration file name")); 1571 1572 /* referenced via ntpdOptions.pOptDesc->pzText */ 1573 puts(_("Increase debug verbosity level")); 1574 1575 /* referenced via ntpdOptions.pOptDesc->pzText */ 1576 puts(_("Set the debug verbosity level")); 1577 1578 /* referenced via ntpdOptions.pOptDesc->pzText */ 1579 puts(_("frequency drift file name")); 1580 1581 /* referenced via ntpdOptions.pOptDesc->pzText */ 1582 puts(_("Allow the first adjustment to be Big")); 1583 1584 /* referenced via ntpdOptions.pOptDesc->pzText */ 1585 puts(_("Step any initial offset correction.")); 1586 1587 /* referenced via ntpdOptions.pOptDesc->pzText */ 1588 puts(_("Jail directory")); 1589 1590 /* referenced via ntpdOptions.pOptDesc->pzText */ 1591 puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs")); 1592 1593 /* referenced via ntpdOptions.pOptDesc->pzText */ 1594 puts(_("Listen on an interface name or address")); 1595 1596 /* referenced via ntpdOptions.pOptDesc->pzText */ 1597 puts(_("path to symmetric keys")); 1598 1599 /* referenced via ntpdOptions.pOptDesc->pzText */ 1600 puts(_("path to the log file")); 1601 1602 /* referenced via ntpdOptions.pOptDesc->pzText */ 1603 puts(_("Do not listen to virtual interfaces")); 1604 1605 /* referenced via ntpdOptions.pOptDesc->pzText */ 1606 puts(_("Modify Multimedia Timer (Windows only)")); 1607 1608 /* referenced via ntpdOptions.pOptDesc->pzText */ 1609 puts(_("Do not fork")); 1610 1611 /* referenced via ntpdOptions.pOptDesc->pzText */ 1612 puts(_("Run at high priority")); 1613 1614 /* referenced via ntpdOptions.pOptDesc->pzText */ 1615 puts(_("path to the PID file")); 1616 1617 /* referenced via ntpdOptions.pOptDesc->pzText */ 1618 puts(_("Process priority")); 1619 1620 /* referenced via ntpdOptions.pOptDesc->pzText */ 1621 puts(_("Set the time and quit")); 1622 1623 /* referenced via ntpdOptions.pOptDesc->pzText */ 1624 puts(_("Broadcast/propagation delay")); 1625 1626 /* referenced via ntpdOptions.pOptDesc->pzText */ 1627 puts(_("Save parsed configuration and quit")); 1628 1629 /* referenced via ntpdOptions.pOptDesc->pzText */ 1630 puts(_("Statistics file location")); 1631 1632 /* referenced via ntpdOptions.pOptDesc->pzText */ 1633 puts(_("Trusted key number")); 1634 1635 /* referenced via ntpdOptions.pOptDesc->pzText */ 1636 puts(_("Run as userid (or userid:groupid)")); 1637 1638 /* referenced via ntpdOptions.pOptDesc->pzText */ 1639 puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs")); 1640 1641 /* referenced via ntpdOptions.pOptDesc->pzText */ 1642 puts(_("interval in seconds between scans for new or dropped interfaces")); 1643 1644 /* referenced via ntpdOptions.pOptDesc->pzText */ 1645 puts(_("make ARG an ntp variable (RW)")); 1646 1647 /* referenced via ntpdOptions.pOptDesc->pzText */ 1648 puts(_("make ARG an ntp variable (RW|DEF)")); 1649 1650 /* referenced via ntpdOptions.pOptDesc->pzText */ 1651 puts(_("Seconds to wait for first clock sync")); 1652 1653 /* referenced via ntpdOptions.pOptDesc->pzText */ 1654 puts(_("Slew up to 600 seconds")); 1655 1656 /* referenced via ntpdOptions.pOptDesc->pzText */ 1657 puts(_("Use CPU cycle counter (Windows only)")); 1658 1659 /* referenced via ntpdOptions.pOptDesc->pzText */ 1660 puts(_("Force CPU cycle counter use (Windows only)")); 1661 1662 /* referenced via ntpdOptions.pOptDesc->pzText */ 1663 puts(_("Register with mDNS as a NTP server")); 1664 1665 /* referenced via ntpdOptions.pOptDesc->pzText */ 1666 puts(_("display extended usage information and exit")); 1667 1668 /* referenced via ntpdOptions.pOptDesc->pzText */ 1669 puts(_("extended usage information passed thru pager")); 1670 1671 /* referenced via ntpdOptions.pOptDesc->pzText */ 1672 puts(_("output version information and exit")); 1673 1674 /* referenced via ntpdOptions.pzUsageTitle */ 1675 puts(_("ntpd - NTP daemon program - Ver. 4.2.8p14\n\ 1676Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ 1677\t\t[ <server1> ... <serverN> ]\n")); 1678 1679 /* referenced via ntpdOptions.pzExplain */ 1680 puts(_("\n")); 1681 1682 /* referenced via ntpdOptions.pzFullVersion */ 1683 puts(_("ntpd 4.2.8p14")); 1684 1685 /* referenced via ntpdOptions.pzFullUsage */ 1686 puts(_("<<<NOT-FOUND>>>")); 1687 1688 /* referenced via ntpdOptions.pzShortUsage */ 1689 puts(_("<<<NOT-FOUND>>>")); 1690 /* LIBOPTS-MESSAGES: */ 1691#line 67 "../autoopts.c" 1692 puts(_("allocation of %d bytes failed\n")); 1693#line 93 "../autoopts.c" 1694 puts(_("allocation of %d bytes failed\n")); 1695#line 53 "../init.c" 1696 puts(_("AutoOpts function called without option descriptor\n")); 1697#line 86 "../init.c" 1698 puts(_("\tThis exceeds the compiled library version: ")); 1699#line 84 "../init.c" 1700 puts(_("Automated Options Processing Error!\n" 1701 "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 1702#line 80 "../autoopts.c" 1703 puts(_("realloc of %d bytes at 0x%p failed\n")); 1704#line 88 "../init.c" 1705 puts(_("\tThis is less than the minimum library version: ")); 1706#line 121 "../version.c" 1707 puts(_("Automated Options version %s\n" 1708 "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); 1709#line 87 "../makeshell.c" 1710 puts(_("(AutoOpts bug): %s.\n")); 1711#line 90 "../reset.c" 1712 puts(_("optionResetOpt() called, but reset-option not configured")); 1713#line 292 "../usage.c" 1714 puts(_("could not locate the 'help' option")); 1715#line 336 "../autoopts.c" 1716 puts(_("optionProcess() was called with invalid data")); 1717#line 748 "../usage.c" 1718 puts(_("invalid argument type specified")); 1719#line 598 "../find.c" 1720 puts(_("defaulted to option with optional arg")); 1721#line 76 "../alias.c" 1722 puts(_("aliasing option is out of range.")); 1723#line 234 "../enum.c" 1724 puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 1725#line 108 "../find.c" 1726 puts(_(" The following options match:\n")); 1727#line 293 "../find.c" 1728 puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 1729#line 161 "../check.c" 1730 puts(_("%s: Command line arguments required\n")); 1731#line 43 "../alias.c" 1732 puts(_("%d %s%s options allowed\n")); 1733#line 94 "../makeshell.c" 1734 puts(_("%s error %d (%s) calling %s for '%s'\n")); 1735#line 306 "../makeshell.c" 1736 puts(_("interprocess pipe")); 1737#line 168 "../version.c" 1738 puts(_("error: version option argument '%c' invalid. Use:\n" 1739 "\t'v' - version only\n" 1740 "\t'c' - version and copyright\n" 1741 "\t'n' - version and full copyright notice\n")); 1742#line 58 "../check.c" 1743 puts(_("%s error: the '%s' and '%s' options conflict\n")); 1744#line 217 "../find.c" 1745 puts(_("%s: The '%s' option has been disabled.")); 1746#line 430 "../find.c" 1747 puts(_("%s: The '%s' option has been disabled.")); 1748#line 38 "../alias.c" 1749 puts(_("-equivalence")); 1750#line 469 "../find.c" 1751 puts(_("%s: illegal option -- %c\n")); 1752#line 110 "../reset.c" 1753 puts(_("%s: illegal option -- %c\n")); 1754#line 271 "../find.c" 1755 puts(_("%s: illegal option -- %s\n")); 1756#line 755 "../find.c" 1757 puts(_("%s: illegal option -- %s\n")); 1758#line 118 "../reset.c" 1759 puts(_("%s: illegal option -- %s\n")); 1760#line 335 "../find.c" 1761 puts(_("%s: unknown vendor extension option -- %s\n")); 1762#line 159 "../enum.c" 1763 puts(_(" or an integer from %d through %d\n")); 1764#line 169 "../enum.c" 1765 puts(_(" or an integer from %d through %d\n")); 1766#line 747 "../usage.c" 1767 puts(_("%s error: invalid option descriptor for %s\n")); 1768#line 1081 "../usage.c" 1769 puts(_("%s error: invalid option descriptor for %s\n")); 1770#line 385 "../find.c" 1771 puts(_("%s: invalid option name: %s\n")); 1772#line 527 "../find.c" 1773 puts(_("%s: The '%s' option requires an argument.\n")); 1774#line 156 "../autoopts.c" 1775 puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 1776 "\t'%s' and '%s'.")); 1777#line 94 "../check.c" 1778 puts(_("%s error: The %s option is required\n")); 1779#line 632 "../find.c" 1780 puts(_("%s: The '%s' option cannot have an argument.\n")); 1781#line 151 "../check.c" 1782 puts(_("%s: Command line arguments are not allowed.\n")); 1783#line 535 "../save.c" 1784 puts(_("error %d (%s) creating %s\n")); 1785#line 234 "../enum.c" 1786 puts(_("%s error: '%s' does not match any %s keywords.\n")); 1787#line 93 "../reset.c" 1788 puts(_("%s error: The '%s' option requires an argument.\n")); 1789#line 184 "../save.c" 1790 puts(_("error %d (%s) stat-ing %s\n")); 1791#line 238 "../save.c" 1792 puts(_("error %d (%s) stat-ing %s\n")); 1793#line 143 "../restore.c" 1794 puts(_("%s error: no saved option state\n")); 1795#line 231 "../autoopts.c" 1796 puts(_("'%s' is not a command line option.\n")); 1797#line 111 "../time.c" 1798 puts(_("%s error: '%s' is not a recognizable date/time.\n")); 1799#line 132 "../save.c" 1800 puts(_("'%s' not defined\n")); 1801#line 50 "../time.c" 1802 puts(_("%s error: '%s' is not a recognizable time duration.\n")); 1803#line 92 "../check.c" 1804 puts(_("%s error: The %s option must appear %d times.\n")); 1805#line 164 "../numeric.c" 1806 puts(_("%s error: '%s' is not a recognizable number.\n")); 1807#line 200 "../enum.c" 1808 puts(_("%s error: %s exceeds %s keyword count\n")); 1809#line 330 "../usage.c" 1810 puts(_("Try '%s %s' for more information.\n")); 1811#line 45 "../alias.c" 1812 puts(_("one %s%s option allowed\n")); 1813#line 208 "../makeshell.c" 1814 puts(_("standard output")); 1815#line 943 "../makeshell.c" 1816 puts(_("standard output")); 1817#line 274 "../usage.c" 1818 puts(_("standard output")); 1819#line 415 "../usage.c" 1820 puts(_("standard output")); 1821#line 625 "../usage.c" 1822 puts(_("standard output")); 1823#line 175 "../version.c" 1824 puts(_("standard output")); 1825#line 274 "../usage.c" 1826 puts(_("standard error")); 1827#line 415 "../usage.c" 1828 puts(_("standard error")); 1829#line 625 "../usage.c" 1830 puts(_("standard error")); 1831#line 175 "../version.c" 1832 puts(_("standard error")); 1833#line 208 "../makeshell.c" 1834 puts(_("write")); 1835#line 943 "../makeshell.c" 1836 puts(_("write")); 1837#line 273 "../usage.c" 1838 puts(_("write")); 1839#line 414 "../usage.c" 1840 puts(_("write")); 1841#line 624 "../usage.c" 1842 puts(_("write")); 1843#line 174 "../version.c" 1844 puts(_("write")); 1845#line 60 "../numeric.c" 1846 puts(_("%s error: %s option value %ld is out of range.\n")); 1847#line 44 "../check.c" 1848 puts(_("%s error: %s option requires the %s option\n")); 1849#line 131 "../save.c" 1850 puts(_("%s warning: cannot save options - %s not regular file\n")); 1851#line 183 "../save.c" 1852 puts(_("%s warning: cannot save options - %s not regular file\n")); 1853#line 237 "../save.c" 1854 puts(_("%s warning: cannot save options - %s not regular file\n")); 1855#line 256 "../save.c" 1856 puts(_("%s warning: cannot save options - %s not regular file\n")); 1857#line 534 "../save.c" 1858 puts(_("%s warning: cannot save options - %s not regular file\n")); 1859 /* END-LIBOPTS-MESSAGES */ 1860 1861 /* USAGE-TEXT: */ 1862#line 873 "../usage.c" 1863 puts(_("\t\t\t\t- an alternate for '%s'\n")); 1864#line 1148 "../usage.c" 1865 puts(_("Version, usage and configuration options:")); 1866#line 924 "../usage.c" 1867 puts(_("\t\t\t\t- default option for unnamed options\n")); 1868#line 837 "../usage.c" 1869 puts(_("\t\t\t\t- disabled as '--%s'\n")); 1870#line 1117 "../usage.c" 1871 puts(_(" --- %-14s %s\n")); 1872#line 1115 "../usage.c" 1873 puts(_("This option has been disabled")); 1874#line 864 "../usage.c" 1875 puts(_("\t\t\t\t- enabled by default\n")); 1876#line 40 "../alias.c" 1877 puts(_("%s error: only ")); 1878#line 1194 "../usage.c" 1879 puts(_(" - examining environment variables named %s_*\n")); 1880#line 168 "../file.c" 1881 puts(_("\t\t\t\t- file must not pre-exist\n")); 1882#line 172 "../file.c" 1883 puts(_("\t\t\t\t- file must pre-exist\n")); 1884#line 380 "../usage.c" 1885 puts(_("Options are specified by doubled hyphens and their name or by a single\n" 1886 "hyphen and the flag character.\n")); 1887#line 921 "../makeshell.c" 1888 puts(_("\n" 1889 "= = = = = = = =\n\n" 1890 "This incarnation of genshell will produce\n" 1891 "a shell script to parse the options for %s:\n\n")); 1892#line 166 "../enum.c" 1893 puts(_(" or an integer mask with any of the lower %d bits set\n")); 1894#line 897 "../usage.c" 1895 puts(_("\t\t\t\t- is a set membership option\n")); 1896#line 918 "../usage.c" 1897 puts(_("\t\t\t\t- must appear between %d and %d times\n")); 1898#line 382 "../usage.c" 1899 puts(_("Options are specified by single or double hyphens and their name.\n")); 1900#line 904 "../usage.c" 1901 puts(_("\t\t\t\t- may appear multiple times\n")); 1902#line 891 "../usage.c" 1903 puts(_("\t\t\t\t- may not be preset\n")); 1904#line 1309 "../usage.c" 1905 puts(_(" Arg Option-Name Description\n")); 1906#line 1245 "../usage.c" 1907 puts(_(" Flg Arg Option-Name Description\n")); 1908#line 1303 "../usage.c" 1909 puts(_(" Flg Arg Option-Name Description\n")); 1910#line 1304 "../usage.c" 1911 puts(_(" %3s %s")); 1912#line 1310 "../usage.c" 1913 puts(_(" %3s %s")); 1914#line 387 "../usage.c" 1915 puts(_("The '-#<number>' option may omit the hash char\n")); 1916#line 383 "../usage.c" 1917 puts(_("All arguments are named options.\n")); 1918#line 971 "../usage.c" 1919 puts(_(" - reading file %s")); 1920#line 409 "../usage.c" 1921 puts(_("\n" 1922 "Please send bug reports to: <%s>\n")); 1923#line 100 "../version.c" 1924 puts(_("\n" 1925 "Please send bug reports to: <%s>\n")); 1926#line 129 "../version.c" 1927 puts(_("\n" 1928 "Please send bug reports to: <%s>\n")); 1929#line 903 "../usage.c" 1930 puts(_("\t\t\t\t- may NOT appear - preset only\n")); 1931#line 944 "../usage.c" 1932 puts(_("\n" 1933 "The following option preset mechanisms are supported:\n")); 1934#line 1192 "../usage.c" 1935 puts(_("\n" 1936 "The following option preset mechanisms are supported:\n")); 1937#line 682 "../usage.c" 1938 puts(_("prohibits these options:\n")); 1939#line 677 "../usage.c" 1940 puts(_("prohibits the option '%s'\n")); 1941#line 81 "../numeric.c" 1942 puts(_("%s%ld to %ld")); 1943#line 79 "../numeric.c" 1944 puts(_("%sgreater than or equal to %ld")); 1945#line 75 "../numeric.c" 1946 puts(_("%s%ld exactly")); 1947#line 68 "../numeric.c" 1948 puts(_("%sit must lie in one of the ranges:\n")); 1949#line 68 "../numeric.c" 1950 puts(_("%sit must be in the range:\n")); 1951#line 88 "../numeric.c" 1952 puts(_(", or\n")); 1953#line 66 "../numeric.c" 1954 puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 1955#line 77 "../numeric.c" 1956 puts(_("%sless than or equal to %ld")); 1957#line 390 "../usage.c" 1958 puts(_("Operands and options may be intermixed. They will be reordered.\n")); 1959#line 652 "../usage.c" 1960 puts(_("requires the option '%s'\n")); 1961#line 655 "../usage.c" 1962 puts(_("requires these options:\n")); 1963#line 1321 "../usage.c" 1964 puts(_(" Arg Option-Name Req? Description\n")); 1965#line 1315 "../usage.c" 1966 puts(_(" Flg Arg Option-Name Req? Description\n")); 1967#line 167 "../enum.c" 1968 puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 1969 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 1970 "will set them all. Multiple entries may be passed as an option\n" 1971 "argument list.\n")); 1972#line 910 "../usage.c" 1973 puts(_("\t\t\t\t- may appear up to %d times\n")); 1974#line 77 "../enum.c" 1975 puts(_("The valid \"%s\" option keywords are:\n")); 1976#line 1152 "../usage.c" 1977 puts(_("The next option supports vendor supported extra options:")); 1978#line 773 "../usage.c" 1979 puts(_("These additional options are:")); 1980 /* END-USAGE-TEXT */ 1981} 1982#endif /* uncompilable code */ 1983#ifdef __cplusplus 1984} 1985#endif 1986/* ntpd-opts.c ends here */ 1987