1 /* 2 * EDIT THIS FILE WITH CAUTION (sntp-opts.c) 3 * 4 * It has been AutoGen-ed June 6, 2023 at 04:35:52 AM by AutoGen 5.18.16 5 * From the definitions sntp-opts.def 6 * and the template file options 7 * 8 * Generated from AutoOpts 42:1:17 templates. 9 * 10 * AutoOpts is a copyrighted work. This source file is not encumbered 11 * by AutoOpts licensing, but is provided under the licensing terms chosen 12 * by the sntp author or copyright holder. AutoOpts is 13 * licensed under the terms of the LGPL. The redistributable library 14 * (``libopts'') is licensed under the terms of either the LGPL or, at the 15 * users discretion, the BSD license. See the AutoOpts and/or libopts sources 16 * for details. 17 * 18 * The sntp program is copyrighted and licensed 19 * under the following terms: 20 * 21 * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. 22 * This is free software. It is licensed for use, modification and 23 * redistribution under the terms of the NTP License, copies of which 24 * can be seen at: 25 * <http://ntp.org/license> 26 * <http://opensource.org/licenses/ntp-license.php> 27 * 28 * Permission to use, copy, modify, and distribute this software and its 29 * documentation for any purpose with or without fee is hereby granted, 30 * provided that the above copyright notice appears in all copies and that 31 * both the copyright notice and this permission notice appear in 32 * supporting documentation, and that the name The University of Delaware not be used in 33 * advertising or publicity pertaining to distribution of the software 34 * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no 35 * representations about the suitability this software for any purpose. It 36 * is provided "as is" without express or implied warranty. 37 */ 38 39 #ifndef __doxygen__ 40 #define OPTION_CODE_COMPILE 1 41 #include "sntp-opts.h" 42 #include <sys/types.h> 43 #include <sys/stat.h> 44 45 #include <errno.h> 46 #include <fcntl.h> 47 #include <limits.h> 48 #include <stdio.h> 49 #include <stdlib.h> 50 #include <string.h> 51 #include <unistd.h> 52 53 #ifdef __cplusplus 54 extern "C" { 55 #endif 56 extern FILE * option_usage_fp; 57 #define zCopyright (sntp_opt_strs+0) 58 #define zLicenseDescrip (sntp_opt_strs+341) 59 60 /* 61 * global included definitions 62 */ 63 #ifdef __windows 64 extern int atoi(const char*); 65 #else 66 # include <stdlib.h> 67 #endif 68 69 #ifndef NULL 70 # define NULL 0 71 #endif 72 73 /** 74 * static const strings for sntp options 75 */ 76 static char const sntp_opt_strs[2567] = 77 /* 0 */ "sntp 4.2.8p17\n" 78 "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n" 79 "This is free software. It is licensed for use, modification and\n" 80 "redistribution under the terms of the NTP License, copies of which\n" 81 "can be seen at:\n" 82 " <http://ntp.org/license>\n" 83 " <http://opensource.org/licenses/ntp-license.php>\n\0" 84 /* 341 */ "Permission to use, copy, modify, and distribute this software and its\n" 85 "documentation for any purpose with or without fee is hereby granted,\n" 86 "provided that the above copyright notice appears in all copies and that\n" 87 "both the copyright notice and this permission notice appear in supporting\n" 88 "documentation, and that the name The University of Delaware not be used in\n" 89 "advertising or publicity pertaining to distribution of the software without\n" 90 "specific, written prior permission. The University of Delaware and Network\n" 91 "Time Foundation makes no representations about the suitability this\n" 92 "software for any purpose. It is provided \"as is\" without express or\n" 93 "implied warranty.\n\0" 94 /* 1009 */ "Force IPv4 DNS name resolution\0" 95 /* 1040 */ "IPV4\0" 96 /* 1045 */ "ipv4\0" 97 /* 1050 */ "Force IPv6 DNS name resolution\0" 98 /* 1081 */ "IPV6\0" 99 /* 1086 */ "ipv6\0" 100 /* 1091 */ "Enable authentication with the key auth-keynumber\0" 101 /* 1141 */ "AUTHENTICATION\0" 102 /* 1156 */ "authentication\0" 103 /* 1171 */ "Listen to the address specified for broadcast time sync\0" 104 /* 1227 */ "BROADCAST\0" 105 /* 1237 */ "broadcast\0" 106 /* 1247 */ "Concurrently query all IPs returned for host-name\0" 107 /* 1297 */ "CONCURRENT\0" 108 /* 1308 */ "concurrent\0" 109 /* 1319 */ "Increase debug verbosity level\0" 110 /* 1350 */ "DEBUG_LEVEL\0" 111 /* 1362 */ "debug-level\0" 112 /* 1374 */ "Set the debug verbosity level\0" 113 /* 1404 */ "SET_DEBUG_LEVEL\0" 114 /* 1420 */ "set-debug-level\0" 115 /* 1436 */ "The gap (in milliseconds) between time requests\0" 116 /* 1484 */ "GAP\0" 117 /* 1488 */ "gap\0" 118 /* 1492 */ "KoD history filename\0" 119 /* 1513 */ "KOD\0" 120 /* 1517 */ "kod\0" 121 /* 1521 */ "/var/db/ntp-kod\0" 122 /* 1537 */ "Look in this file for the key specified with -a\0" 123 /* 1585 */ "KEYFILE\0" 124 /* 1593 */ "keyfile\0" 125 /* 1601 */ "/etc/ntp.keys\0" 126 /* 1615 */ "Log to specified logfile\0" 127 /* 1640 */ "LOGFILE\0" 128 /* 1648 */ "logfile\0" 129 /* 1656 */ "Adjustments less than steplimit msec will be slewed\0" 130 /* 1708 */ "STEPLIMIT\0" 131 /* 1718 */ "steplimit\0" 132 /* 1728 */ "Send int as our NTP protocol version\0" 133 /* 1765 */ "NTPVERSION\0" 134 /* 1776 */ "ntpversion\0" 135 /* 1787 */ "Use the NTP Reserved Port (port 123)\0" 136 /* 1824 */ "USERESERVEDPORT\0" 137 /* 1840 */ "usereservedport\0" 138 /* 1856 */ "OK to 'step' the time with settimeofday(2)\0" 139 /* 1899 */ "STEP\0" 140 /* 1904 */ "step\0" 141 /* 1909 */ "OK to 'slew' the time with adjtime(2)\0" 142 /* 1947 */ "SLEW\0" 143 /* 1952 */ "slew\0" 144 /* 1957 */ "The number of seconds to wait for responses\0" 145 /* 2001 */ "TIMEOUT\0" 146 /* 2009 */ "timeout\0" 147 /* 2017 */ "Wait for pending replies (if not setting the time)\0" 148 /* 2068 */ "WAIT\0" 149 /* 2073 */ "no-wait\0" 150 /* 2081 */ "no\0" 151 /* 2084 */ "display extended usage information and exit\0" 152 /* 2128 */ "help\0" 153 /* 2133 */ "extended usage information passed thru pager\0" 154 /* 2178 */ "more-help\0" 155 /* 2188 */ "output version information and exit\0" 156 /* 2224 */ "version\0" 157 /* 2232 */ "save the option state to a config file\0" 158 /* 2271 */ "save-opts\0" 159 /* 2281 */ "load options from a config file\0" 160 /* 2313 */ "LOAD_OPTS\0" 161 /* 2323 */ "no-load-opts\0" 162 /* 2336 */ "SNTP\0" 163 /* 2341 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p17\n" 164 "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" 165 "\t\t[ hostname-or-IP ...]\n\0" 166 /* 2501 */ "$HOME\0" 167 /* 2507 */ ".\0" 168 /* 2509 */ ".ntprc\0" 169 /* 2516 */ "https://bugs.ntp.org, bugs@ntp.org\0" 170 /* 2551 */ "\n\0" 171 /* 2553 */ "sntp 4.2.8p17"; 172 173 /** 174 * ipv4 option description with 175 * "Must also have options" and "Incompatible options": 176 */ 177 /** Descriptive text for the ipv4 option */ 178 #define IPV4_DESC (sntp_opt_strs+1009) 179 /** Upper-cased name for the ipv4 option */ 180 #define IPV4_NAME (sntp_opt_strs+1040) 181 /** Name string for the ipv4 option */ 182 #define IPV4_name (sntp_opt_strs+1045) 183 /** Other options that appear in conjunction with the ipv4 option */ 184 static int const aIpv4CantList[] = { 185 INDEX_OPT_IPV6, NO_EQUIVALENT }; 186 /** Compiled in flag settings for the ipv4 option */ 187 #define IPV4_FLAGS (OPTST_DISABLED) 188 189 /** 190 * ipv6 option description with 191 * "Must also have options" and "Incompatible options": 192 */ 193 /** Descriptive text for the ipv6 option */ 194 #define IPV6_DESC (sntp_opt_strs+1050) 195 /** Upper-cased name for the ipv6 option */ 196 #define IPV6_NAME (sntp_opt_strs+1081) 197 /** Name string for the ipv6 option */ 198 #define IPV6_name (sntp_opt_strs+1086) 199 /** Other options that appear in conjunction with the ipv6 option */ 200 static int const aIpv6CantList[] = { 201 INDEX_OPT_IPV4, NO_EQUIVALENT }; 202 /** Compiled in flag settings for the ipv6 option */ 203 #define IPV6_FLAGS (OPTST_DISABLED) 204 205 /** 206 * authentication option description: 207 */ 208 /** Descriptive text for the authentication option */ 209 #define AUTHENTICATION_DESC (sntp_opt_strs+1091) 210 /** Upper-cased name for the authentication option */ 211 #define AUTHENTICATION_NAME (sntp_opt_strs+1141) 212 /** Name string for the authentication option */ 213 #define AUTHENTICATION_name (sntp_opt_strs+1156) 214 /** Compiled in flag settings for the authentication option */ 215 #define AUTHENTICATION_FLAGS (OPTST_DISABLED \ 216 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 217 218 /** 219 * broadcast option description: 220 */ 221 /** Descriptive text for the broadcast option */ 222 #define BROADCAST_DESC (sntp_opt_strs+1171) 223 /** Upper-cased name for the broadcast option */ 224 #define BROADCAST_NAME (sntp_opt_strs+1227) 225 /** Name string for the broadcast option */ 226 #define BROADCAST_name (sntp_opt_strs+1237) 227 /** Compiled in flag settings for the broadcast option */ 228 #define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 229 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 230 231 /** 232 * concurrent option description: 233 */ 234 /** Descriptive text for the concurrent option */ 235 #define CONCURRENT_DESC (sntp_opt_strs+1247) 236 /** Upper-cased name for the concurrent option */ 237 #define CONCURRENT_NAME (sntp_opt_strs+1297) 238 /** Name string for the concurrent option */ 239 #define CONCURRENT_name (sntp_opt_strs+1308) 240 /** Compiled in flag settings for the concurrent option */ 241 #define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 242 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 243 244 /** 245 * debug-level option description: 246 */ 247 /** Descriptive text for the debug-level option */ 248 #define DEBUG_LEVEL_DESC (sntp_opt_strs+1319) 249 /** Upper-cased name for the debug-level option */ 250 #define DEBUG_LEVEL_NAME (sntp_opt_strs+1350) 251 /** Name string for the debug-level option */ 252 #define DEBUG_LEVEL_name (sntp_opt_strs+1362) 253 /** Compiled in flag settings for the debug-level option */ 254 #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 255 256 /** 257 * set-debug-level option description: 258 */ 259 /** Descriptive text for the set-debug-level option */ 260 #define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1374) 261 /** Upper-cased name for the set-debug-level option */ 262 #define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1404) 263 /** Name string for the set-debug-level option */ 264 #define SET_DEBUG_LEVEL_name (sntp_opt_strs+1420) 265 /** Compiled in flag settings for the set-debug-level option */ 266 #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 267 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 268 269 /** 270 * gap option description: 271 */ 272 /** Descriptive text for the gap option */ 273 #define GAP_DESC (sntp_opt_strs+1436) 274 /** Upper-cased name for the gap option */ 275 #define GAP_NAME (sntp_opt_strs+1484) 276 /** Name string for the gap option */ 277 #define GAP_name (sntp_opt_strs+1488) 278 /** The compiled in default value for the gap option argument */ 279 #define GAP_DFT_ARG ((char const*)50) 280 /** Compiled in flag settings for the gap option */ 281 #define GAP_FLAGS (OPTST_DISABLED \ 282 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 283 284 /** 285 * kod option description: 286 */ 287 /** Descriptive text for the kod option */ 288 #define KOD_DESC (sntp_opt_strs+1492) 289 /** Upper-cased name for the kod option */ 290 #define KOD_NAME (sntp_opt_strs+1513) 291 /** Name string for the kod option */ 292 #define KOD_name (sntp_opt_strs+1517) 293 /** The compiled in default value for the kod option argument */ 294 #define KOD_DFT_ARG (sntp_opt_strs+1521) 295 /** Compiled in flag settings for the kod option */ 296 #define KOD_FLAGS (OPTST_DISABLED \ 297 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 298 299 /** 300 * keyfile option description: 301 */ 302 /** Descriptive text for the keyfile option */ 303 #define KEYFILE_DESC (sntp_opt_strs+1537) 304 /** Upper-cased name for the keyfile option */ 305 #define KEYFILE_NAME (sntp_opt_strs+1585) 306 /** Name string for the keyfile option */ 307 #define KEYFILE_name (sntp_opt_strs+1593) 308 /** The compiled in default value for the keyfile option argument */ 309 #define KEYFILE_DFT_ARG (sntp_opt_strs+1601) 310 /** Compiled in flag settings for the keyfile option */ 311 #define KEYFILE_FLAGS (OPTST_DISABLED \ 312 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 313 314 /** 315 * logfile option description: 316 */ 317 /** Descriptive text for the logfile option */ 318 #define LOGFILE_DESC (sntp_opt_strs+1615) 319 /** Upper-cased name for the logfile option */ 320 #define LOGFILE_NAME (sntp_opt_strs+1640) 321 /** Name string for the logfile option */ 322 #define LOGFILE_name (sntp_opt_strs+1648) 323 /** Compiled in flag settings for the logfile option */ 324 #define LOGFILE_FLAGS (OPTST_DISABLED \ 325 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 326 327 /** 328 * steplimit option description: 329 */ 330 /** Descriptive text for the steplimit option */ 331 #define STEPLIMIT_DESC (sntp_opt_strs+1656) 332 /** Upper-cased name for the steplimit option */ 333 #define STEPLIMIT_NAME (sntp_opt_strs+1708) 334 /** Name string for the steplimit option */ 335 #define STEPLIMIT_name (sntp_opt_strs+1718) 336 /** Compiled in flag settings for the steplimit option */ 337 #define STEPLIMIT_FLAGS (OPTST_DISABLED \ 338 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 339 340 /** 341 * ntpversion option description: 342 */ 343 /** Descriptive text for the ntpversion option */ 344 #define NTPVERSION_DESC (sntp_opt_strs+1728) 345 /** Upper-cased name for the ntpversion option */ 346 #define NTPVERSION_NAME (sntp_opt_strs+1765) 347 /** Name string for the ntpversion option */ 348 #define NTPVERSION_name (sntp_opt_strs+1776) 349 /** The compiled in default value for the ntpversion option argument */ 350 #define NTPVERSION_DFT_ARG ((char const*)4) 351 /** Compiled in flag settings for the ntpversion option */ 352 #define NTPVERSION_FLAGS (OPTST_DISABLED \ 353 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 354 355 /** 356 * usereservedport option description: 357 */ 358 /** Descriptive text for the usereservedport option */ 359 #define USERESERVEDPORT_DESC (sntp_opt_strs+1787) 360 /** Upper-cased name for the usereservedport option */ 361 #define USERESERVEDPORT_NAME (sntp_opt_strs+1824) 362 /** Name string for the usereservedport option */ 363 #define USERESERVEDPORT_name (sntp_opt_strs+1840) 364 /** Compiled in flag settings for the usereservedport option */ 365 #define USERESERVEDPORT_FLAGS (OPTST_DISABLED) 366 367 /** 368 * step option description: 369 */ 370 /** Descriptive text for the step option */ 371 #define STEP_DESC (sntp_opt_strs+1856) 372 /** Upper-cased name for the step option */ 373 #define STEP_NAME (sntp_opt_strs+1899) 374 /** Name string for the step option */ 375 #define STEP_name (sntp_opt_strs+1904) 376 /** Compiled in flag settings for the step option */ 377 #define STEP_FLAGS (OPTST_DISABLED) 378 379 /** 380 * slew option description: 381 */ 382 /** Descriptive text for the slew option */ 383 #define SLEW_DESC (sntp_opt_strs+1909) 384 /** Upper-cased name for the slew option */ 385 #define SLEW_NAME (sntp_opt_strs+1947) 386 /** Name string for the slew option */ 387 #define SLEW_name (sntp_opt_strs+1952) 388 /** Compiled in flag settings for the slew option */ 389 #define SLEW_FLAGS (OPTST_DISABLED) 390 391 /** 392 * timeout option description: 393 */ 394 /** Descriptive text for the timeout option */ 395 #define TIMEOUT_DESC (sntp_opt_strs+1957) 396 /** Upper-cased name for the timeout option */ 397 #define TIMEOUT_NAME (sntp_opt_strs+2001) 398 /** Name string for the timeout option */ 399 #define TIMEOUT_name (sntp_opt_strs+2009) 400 /** The compiled in default value for the timeout option argument */ 401 #define TIMEOUT_DFT_ARG ((char const*)5) 402 /** Compiled in flag settings for the timeout option */ 403 #define TIMEOUT_FLAGS (OPTST_DISABLED \ 404 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 405 406 /** 407 * wait option description: 408 */ 409 /** Descriptive text for the wait option */ 410 #define WAIT_DESC (sntp_opt_strs+2017) 411 /** Upper-cased name for the wait option */ 412 #define WAIT_NAME (sntp_opt_strs+2068) 413 /** disablement name for the wait option */ 414 #define NOT_WAIT_name (sntp_opt_strs+2073) 415 /** disablement prefix for the wait option */ 416 #define NOT_WAIT_PFX (sntp_opt_strs+2081) 417 /** Name string for the wait option */ 418 #define WAIT_name (NOT_WAIT_name + 3) 419 /** Compiled in flag settings for the wait option */ 420 #define WAIT_FLAGS (OPTST_INITENABLED) 421 422 /* 423 * Help/More_Help/Version option descriptions: 424 */ 425 #define HELP_DESC (sntp_opt_strs+2084) 426 #define HELP_name (sntp_opt_strs+2128) 427 #ifdef HAVE_WORKING_FORK 428 #define MORE_HELP_DESC (sntp_opt_strs+2133) 429 #define MORE_HELP_name (sntp_opt_strs+2178) 430 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 431 #else 432 #define MORE_HELP_DESC HELP_DESC 433 #define MORE_HELP_name HELP_name 434 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 435 #endif 436 #ifdef NO_OPTIONAL_OPT_ARGS 437 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 438 #else 439 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 440 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 441 #endif 442 #define VER_DESC (sntp_opt_strs+2188) 443 #define VER_name (sntp_opt_strs+2224) 444 #define SAVE_OPTS_DESC (sntp_opt_strs+2232) 445 #define SAVE_OPTS_name (sntp_opt_strs+2271) 446 #define LOAD_OPTS_DESC (sntp_opt_strs+2281) 447 #define LOAD_OPTS_NAME (sntp_opt_strs+2313) 448 #define NO_LOAD_OPTS_name (sntp_opt_strs+2323) 449 #define LOAD_OPTS_pfx (sntp_opt_strs+2081) 450 #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) 451 /** 452 * Declare option callback procedures 453 */ 454 extern tOptProc 455 ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 456 optionNumericVal, optionPagedUsage, optionResetOpt, 457 optionStackArg, optionTimeDate, optionTimeVal, 458 optionUnstackArg, optionVendorOption; 459 static tOptProc 460 doOptDebug_Level, doOptKeyfile, doOptKod, doOptLogfile, 461 doOptNtpversion, doOptSteplimit, doUsageOpt; 462 #define VER_PROC ntpOptionPrintVersion 463 464 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 465 /** 466 * Define the sntp Option Descriptions. 467 * This is an array of OPTION_CT entries, one for each 468 * option that the sntp program responds to. 469 */ 470 static tOptDesc optDesc[OPTION_CT] = { 471 { /* entry idx, value */ 0, VALUE_OPT_IPV4, 472 /* equiv idx, value */ 0, VALUE_OPT_IPV4, 473 /* equivalenced to */ NO_EQUIVALENT, 474 /* min, max, act ct */ 0, 1, 0, 475 /* opt state flags */ IPV4_FLAGS, 0, 476 /* last opt argumnt */ { NULL }, /* --ipv4 */ 477 /* arg list/cookie */ NULL, 478 /* must/cannot opts */ NULL, aIpv4CantList, 479 /* option proc */ NULL, 480 /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name, 481 /* disablement strs */ NULL, NULL }, 482 483 { /* entry idx, value */ 1, VALUE_OPT_IPV6, 484 /* equiv idx, value */ 1, VALUE_OPT_IPV6, 485 /* equivalenced to */ NO_EQUIVALENT, 486 /* min, max, act ct */ 0, 1, 0, 487 /* opt state flags */ IPV6_FLAGS, 0, 488 /* last opt argumnt */ { NULL }, /* --ipv6 */ 489 /* arg list/cookie */ NULL, 490 /* must/cannot opts */ NULL, aIpv6CantList, 491 /* option proc */ NULL, 492 /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name, 493 /* disablement strs */ NULL, NULL }, 494 495 { /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION, 496 /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION, 497 /* equivalenced to */ NO_EQUIVALENT, 498 /* min, max, act ct */ 0, 1, 0, 499 /* opt state flags */ AUTHENTICATION_FLAGS, 0, 500 /* last opt argumnt */ { NULL }, /* --authentication */ 501 /* arg list/cookie */ NULL, 502 /* must/cannot opts */ NULL, NULL, 503 /* option proc */ optionNumericVal, 504 /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name, 505 /* disablement strs */ NULL, NULL }, 506 507 { /* entry idx, value */ 3, VALUE_OPT_BROADCAST, 508 /* equiv idx, value */ 3, VALUE_OPT_BROADCAST, 509 /* equivalenced to */ NO_EQUIVALENT, 510 /* min, max, act ct */ 0, NOLIMIT, 0, 511 /* opt state flags */ BROADCAST_FLAGS, 0, 512 /* last opt argumnt */ { NULL }, /* --broadcast */ 513 /* arg list/cookie */ NULL, 514 /* must/cannot opts */ NULL, NULL, 515 /* option proc */ optionStackArg, 516 /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name, 517 /* disablement strs */ NULL, NULL }, 518 519 { /* entry idx, value */ 4, VALUE_OPT_CONCURRENT, 520 /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT, 521 /* equivalenced to */ NO_EQUIVALENT, 522 /* min, max, act ct */ 0, NOLIMIT, 0, 523 /* opt state flags */ CONCURRENT_FLAGS, 0, 524 /* last opt argumnt */ { NULL }, /* --concurrent */ 525 /* arg list/cookie */ NULL, 526 /* must/cannot opts */ NULL, NULL, 527 /* option proc */ optionStackArg, 528 /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name, 529 /* disablement strs */ NULL, NULL }, 530 531 { /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 532 /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 533 /* equivalenced to */ NO_EQUIVALENT, 534 /* min, max, act ct */ 0, NOLIMIT, 0, 535 /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 536 /* last opt argumnt */ { NULL }, /* --debug-level */ 537 /* arg list/cookie */ NULL, 538 /* must/cannot opts */ NULL, NULL, 539 /* option proc */ doOptDebug_Level, 540 /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 541 /* disablement strs */ NULL, NULL }, 542 543 { /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 544 /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 545 /* equivalenced to */ NO_EQUIVALENT, 546 /* min, max, act ct */ 0, NOLIMIT, 0, 547 /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 548 /* last opt argumnt */ { NULL }, /* --set-debug-level */ 549 /* arg list/cookie */ NULL, 550 /* must/cannot opts */ NULL, NULL, 551 /* option proc */ optionNumericVal, 552 /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 553 /* disablement strs */ NULL, NULL }, 554 555 { /* entry idx, value */ 7, VALUE_OPT_GAP, 556 /* equiv idx, value */ 7, VALUE_OPT_GAP, 557 /* equivalenced to */ NO_EQUIVALENT, 558 /* min, max, act ct */ 0, 1, 0, 559 /* opt state flags */ GAP_FLAGS, 0, 560 /* last opt argumnt */ { GAP_DFT_ARG }, 561 /* arg list/cookie */ NULL, 562 /* must/cannot opts */ NULL, NULL, 563 /* option proc */ optionNumericVal, 564 /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name, 565 /* disablement strs */ NULL, NULL }, 566 567 { /* entry idx, value */ 8, VALUE_OPT_KOD, 568 /* equiv idx, value */ 8, VALUE_OPT_KOD, 569 /* equivalenced to */ NO_EQUIVALENT, 570 /* min, max, act ct */ 0, 1, 0, 571 /* opt state flags */ KOD_FLAGS, 0, 572 /* last opt argumnt */ { KOD_DFT_ARG }, 573 /* arg list/cookie */ NULL, 574 /* must/cannot opts */ NULL, NULL, 575 /* option proc */ doOptKod, 576 /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name, 577 /* disablement strs */ NULL, NULL }, 578 579 { /* entry idx, value */ 9, VALUE_OPT_KEYFILE, 580 /* equiv idx, value */ 9, VALUE_OPT_KEYFILE, 581 /* equivalenced to */ NO_EQUIVALENT, 582 /* min, max, act ct */ 0, 1, 0, 583 /* opt state flags */ KEYFILE_FLAGS, 0, 584 /* last opt argumnt */ { KEYFILE_DFT_ARG }, 585 /* arg list/cookie */ NULL, 586 /* must/cannot opts */ NULL, NULL, 587 /* option proc */ doOptKeyfile, 588 /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name, 589 /* disablement strs */ NULL, NULL }, 590 591 { /* entry idx, value */ 10, VALUE_OPT_LOGFILE, 592 /* equiv idx, value */ 10, VALUE_OPT_LOGFILE, 593 /* equivalenced to */ NO_EQUIVALENT, 594 /* min, max, act ct */ 0, 1, 0, 595 /* opt state flags */ LOGFILE_FLAGS, 0, 596 /* last opt argumnt */ { NULL }, /* --logfile */ 597 /* arg list/cookie */ NULL, 598 /* must/cannot opts */ NULL, NULL, 599 /* option proc */ doOptLogfile, 600 /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name, 601 /* disablement strs */ NULL, NULL }, 602 603 { /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT, 604 /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT, 605 /* equivalenced to */ NO_EQUIVALENT, 606 /* min, max, act ct */ 0, 1, 0, 607 /* opt state flags */ STEPLIMIT_FLAGS, 0, 608 /* last opt argumnt */ { NULL }, /* --steplimit */ 609 /* arg list/cookie */ NULL, 610 /* must/cannot opts */ NULL, NULL, 611 /* option proc */ doOptSteplimit, 612 /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name, 613 /* disablement strs */ NULL, NULL }, 614 615 { /* entry idx, value */ 12, VALUE_OPT_NTPVERSION, 616 /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION, 617 /* equivalenced to */ NO_EQUIVALENT, 618 /* min, max, act ct */ 0, 1, 0, 619 /* opt state flags */ NTPVERSION_FLAGS, 0, 620 /* last opt argumnt */ { NTPVERSION_DFT_ARG }, 621 /* arg list/cookie */ NULL, 622 /* must/cannot opts */ NULL, NULL, 623 /* option proc */ doOptNtpversion, 624 /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name, 625 /* disablement strs */ NULL, NULL }, 626 627 { /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 628 /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 629 /* equivalenced to */ NO_EQUIVALENT, 630 /* min, max, act ct */ 0, 1, 0, 631 /* opt state flags */ USERESERVEDPORT_FLAGS, 0, 632 /* last opt argumnt */ { NULL }, /* --usereservedport */ 633 /* arg list/cookie */ NULL, 634 /* must/cannot opts */ NULL, NULL, 635 /* option proc */ NULL, 636 /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name, 637 /* disablement strs */ NULL, NULL }, 638 639 { /* entry idx, value */ 14, VALUE_OPT_STEP, 640 /* equiv idx, value */ 14, VALUE_OPT_STEP, 641 /* equivalenced to */ NO_EQUIVALENT, 642 /* min, max, act ct */ 0, 1, 0, 643 /* opt state flags */ STEP_FLAGS, 0, 644 /* last opt argumnt */ { NULL }, /* --step */ 645 /* arg list/cookie */ NULL, 646 /* must/cannot opts */ NULL, NULL, 647 /* option proc */ NULL, 648 /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name, 649 /* disablement strs */ NULL, NULL }, 650 651 { /* entry idx, value */ 15, VALUE_OPT_SLEW, 652 /* equiv idx, value */ 15, VALUE_OPT_SLEW, 653 /* equivalenced to */ NO_EQUIVALENT, 654 /* min, max, act ct */ 0, 1, 0, 655 /* opt state flags */ SLEW_FLAGS, 0, 656 /* last opt argumnt */ { NULL }, /* --slew */ 657 /* arg list/cookie */ NULL, 658 /* must/cannot opts */ NULL, NULL, 659 /* option proc */ NULL, 660 /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name, 661 /* disablement strs */ NULL, NULL }, 662 663 { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT, 664 /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT, 665 /* equivalenced to */ NO_EQUIVALENT, 666 /* min, max, act ct */ 0, 1, 0, 667 /* opt state flags */ TIMEOUT_FLAGS, 0, 668 /* last opt argumnt */ { TIMEOUT_DFT_ARG }, 669 /* arg list/cookie */ NULL, 670 /* must/cannot opts */ NULL, NULL, 671 /* option proc */ optionNumericVal, 672 /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name, 673 /* disablement strs */ NULL, NULL }, 674 675 { /* entry idx, value */ 17, VALUE_OPT_WAIT, 676 /* equiv idx, value */ 17, VALUE_OPT_WAIT, 677 /* equivalenced to */ NO_EQUIVALENT, 678 /* min, max, act ct */ 0, 1, 0, 679 /* opt state flags */ WAIT_FLAGS, 0, 680 /* last opt argumnt */ { NULL }, /* --wait */ 681 /* arg list/cookie */ NULL, 682 /* must/cannot opts */ NULL, NULL, 683 /* option proc */ NULL, 684 /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name, 685 /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX }, 686 687 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 688 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 689 /* equivalenced to */ NO_EQUIVALENT, 690 /* min, max, act ct */ 0, 1, 0, 691 /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 692 /* last opt argumnt */ { NULL }, 693 /* arg list/cookie */ NULL, 694 /* must/cannot opts */ NULL, NULL, 695 /* option proc */ VER_PROC, 696 /* desc, NAME, name */ VER_DESC, NULL, VER_name, 697 /* disablement strs */ NULL, NULL }, 698 699 700 701 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 702 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 703 /* equivalenced to */ NO_EQUIVALENT, 704 /* min, max, act ct */ 0, 1, 0, 705 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 706 /* last opt argumnt */ { NULL }, 707 /* arg list/cookie */ NULL, 708 /* must/cannot opts */ NULL, NULL, 709 /* option proc */ doUsageOpt, 710 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 711 /* disablement strs */ NULL, NULL }, 712 713 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 714 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 715 /* equivalenced to */ NO_EQUIVALENT, 716 /* min, max, act ct */ 0, 1, 0, 717 /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 718 /* last opt argumnt */ { NULL }, 719 /* arg list/cookie */ NULL, 720 /* must/cannot opts */ NULL, NULL, 721 /* option proc */ optionPagedUsage, 722 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 723 /* disablement strs */ NULL, NULL }, 724 725 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, 726 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, 727 /* equivalenced to */ NO_EQUIVALENT, 728 /* min, max, act ct */ 0, 1, 0, 729 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 730 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, 731 /* last opt argumnt */ { NULL }, 732 /* arg list/cookie */ NULL, 733 /* must/cannot opts */ NULL, NULL, 734 /* option proc */ NULL, 735 /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, 736 /* disablement strs */ NULL, NULL }, 737 738 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, 739 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, 740 /* equivalenced to */ NO_EQUIVALENT, 741 /* min, max, act ct */ 0, NOLIMIT, 0, 742 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 743 | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, 744 /* last opt argumnt */ { NULL }, 745 /* arg list/cookie */ NULL, 746 /* must/cannot opts */ NULL, NULL, 747 /* option proc */ optionLoadOpt, 748 /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, 749 /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } 750 }; 751 752 753 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 754 /** Reference to the upper cased version of sntp. */ 755 #define zPROGNAME (sntp_opt_strs+2336) 756 /** Reference to the title line for sntp usage. */ 757 #define zUsageTitle (sntp_opt_strs+2341) 758 /** sntp configuration file name. */ 759 #define zRcName (sntp_opt_strs+2509) 760 /** Directories to search for sntp config files. */ 761 static char const * const apzHomeList[3] = { 762 sntp_opt_strs+2501, 763 sntp_opt_strs+2507, 764 NULL }; 765 /** The sntp program bug email address. */ 766 #define zBugsAddr (sntp_opt_strs+2516) 767 /** Clarification/explanation of what sntp does. */ 768 #define zExplain (sntp_opt_strs+2551) 769 /** Extra detail explaining what sntp does. */ 770 #define zDetail (NULL) 771 /** The full version string for sntp. */ 772 #define zFullVersion (sntp_opt_strs+2553) 773 /* extracted from optcode.tlib near line 342 */ 774 775 #if defined(ENABLE_NLS) 776 # define OPTPROC_BASE OPTPROC_TRANSLATE 777 static tOptionXlateProc translate_option_strings; 778 #else 779 # define OPTPROC_BASE OPTPROC_NONE 780 # define translate_option_strings NULL 781 #endif /* ENABLE_NLS */ 782 783 #define sntp_full_usage (NULL) 784 #define sntp_short_usage (NULL) 785 786 #endif /* not defined __doxygen__ */ 787 788 /* 789 * Create the static procedure(s) declared above. 790 */ 791 /** 792 * The callout function that invokes the optionUsage function. 793 * 794 * @param[in] opts the AutoOpts option description structure 795 * @param[in] od the descriptor for the "help" (usage) option. 796 * @noreturn 797 */ 798 static void 799 doUsageOpt(tOptions * opts, tOptDesc * od) 800 { 801 int ex_code; 802 ex_code = SNTP_EXIT_SUCCESS; 803 optionUsage(&sntpOptions, ex_code); 804 /* NOTREACHED */ 805 exit(SNTP_EXIT_FAILURE); 806 (void)opts; 807 (void)od; 808 } 809 810 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 811 /** 812 * Code to handle the debug-level option. 813 * 814 * @param[in] pOptions the sntp options data structure 815 * @param[in,out] pOptDesc the option descriptor for this option. 816 */ 817 static void 818 doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 819 { 820 /* 821 * Be sure the flag-code[0] handles special values for the options pointer 822 * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 823 * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 824 * reset its state. 825 */ 826 /* extracted from debug-opt.def, line 15 */ 827 OPT_VALUE_SET_DEBUG_LEVEL++; 828 (void)pOptDesc; 829 (void)pOptions; 830 } 831 832 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 833 /** 834 * Code to handle the kod option. 835 * Specifies the filename to be used for the persistent history of KoD 836 * responses received from servers. If the file does not exist, a 837 * warning message will be displayed. The file will not be created. 838 * @param[in] pOptions the sntp options data structure 839 * @param[in,out] pOptDesc the option descriptor for this option. 840 */ 841 static void 842 doOptKod(tOptions* pOptions, tOptDesc* pOptDesc) 843 { 844 static teOptFileType const type = 845 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 846 static tuFileMode mode; 847 #ifndef O_CLOEXEC 848 # define O_CLOEXEC 0 849 #endif 850 mode.file_flags = O_CLOEXEC; 851 852 /* 853 * This function handles special invalid values for "pOptions" 854 */ 855 optionFileCheck(pOptions, pOptDesc, type, mode); 856 } 857 858 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 859 /** 860 * Code to handle the keyfile option. 861 * This option specifies the keyfile. 862 * @code{sntp} will search for the key specified with @option{-a} 863 * @file{keyno} in this file. See @command{ntp.keys(5)} for more 864 * information. 865 * @param[in] pOptions the sntp options data structure 866 * @param[in,out] pOptDesc the option descriptor for this option. 867 */ 868 static void 869 doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc) 870 { 871 static teOptFileType const type = 872 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 873 static tuFileMode mode; 874 #ifndef O_CLOEXEC 875 # define O_CLOEXEC 0 876 #endif 877 mode.file_flags = O_CLOEXEC; 878 879 /* 880 * This function handles special invalid values for "pOptions" 881 */ 882 optionFileCheck(pOptions, pOptDesc, type, mode); 883 } 884 885 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 886 /** 887 * Code to handle the logfile option. 888 * This option causes the client to write log messages to the specified 889 * @file{logfile}. 890 * @param[in] pOptions the sntp options data structure 891 * @param[in,out] pOptDesc the option descriptor for this option. 892 */ 893 static void 894 doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc) 895 { 896 static teOptFileType const type = 897 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 898 static tuFileMode mode; 899 #ifndef O_CLOEXEC 900 # define O_CLOEXEC 0 901 #endif 902 mode.file_flags = O_CLOEXEC; 903 904 /* 905 * This function handles special invalid values for "pOptions" 906 */ 907 optionFileCheck(pOptions, pOptDesc, type, mode); 908 } 909 910 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 911 /** 912 * Code to handle the steplimit option. 913 * If the time adjustment is less than @file{steplimit} milliseconds, 914 * slew the amount using @command{adjtime(2)}. Otherwise, step the 915 * correction using @command{settimeofday(2)}. The default value is 0, 916 * which means all adjustments will be stepped. This is a feature, as 917 * different situations demand different values. 918 * @param[in] pOptions the sntp options data structure 919 * @param[in,out] pOptDesc the option descriptor for this option. 920 */ 921 static void 922 doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc) 923 { 924 static struct {long rmin, rmax;} const rng[1] = { 925 { 0, LONG_MAX } }; 926 int ix; 927 928 if (pOptions <= OPTPROC_EMIT_LIMIT) 929 goto emit_ranges; 930 optionNumericVal(pOptions, pOptDesc); 931 932 for (ix = 0; ix < 1; ix++) { 933 if (pOptDesc->optArg.argInt < rng[ix].rmin) 934 continue; /* ranges need not be ordered. */ 935 if (pOptDesc->optArg.argInt == rng[ix].rmin) 936 return; 937 if (rng[ix].rmax == LONG_MIN) 938 continue; 939 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 940 return; 941 } 942 943 option_usage_fp = stderr; 944 945 emit_ranges: 946 optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 947 } 948 949 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 950 /** 951 * Code to handle the ntpversion option. 952 * When sending requests to a remote server, tell them we are running 953 * NTP protocol version @file{ntpversion} . 954 * @param[in] pOptions the sntp options data structure 955 * @param[in,out] pOptDesc the option descriptor for this option. 956 */ 957 static void 958 doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc) 959 { 960 static struct {long rmin, rmax;} const rng[1] = { 961 { 0, 7 } }; 962 int ix; 963 964 if (pOptions <= OPTPROC_EMIT_LIMIT) 965 goto emit_ranges; 966 optionNumericVal(pOptions, pOptDesc); 967 968 for (ix = 0; ix < 1; ix++) { 969 if (pOptDesc->optArg.argInt < rng[ix].rmin) 970 continue; /* ranges need not be ordered. */ 971 if (pOptDesc->optArg.argInt == rng[ix].rmin) 972 return; 973 if (rng[ix].rmax == LONG_MIN) 974 continue; 975 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 976 return; 977 } 978 979 option_usage_fp = stderr; 980 981 emit_ranges: 982 optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 983 } 984 /* extracted from optmain.tlib near line 1250 */ 985 986 /** 987 * The directory containing the data associated with sntp. 988 */ 989 #ifndef PKGDATADIR 990 # define PKGDATADIR "" 991 #endif 992 993 /** 994 * Information about the person or institution that packaged sntp 995 * for the current distribution. 996 */ 997 #ifndef WITH_PACKAGER 998 # define sntp_packager_info NULL 999 #else 1000 /** Packager information for sntp. */ 1001 static char const sntp_packager_info[] = 1002 "Packaged by " WITH_PACKAGER 1003 1004 # ifdef WITH_PACKAGER_VERSION 1005 " ("WITH_PACKAGER_VERSION")" 1006 # endif 1007 1008 # ifdef WITH_PACKAGER_BUG_REPORTS 1009 "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS 1010 # endif 1011 "\n"; 1012 #endif 1013 #ifndef __doxygen__ 1014 1015 #endif /* __doxygen__ */ 1016 /** 1017 * The option definitions for sntp. The one structure that 1018 * binds them all. 1019 */ 1020 tOptions sntpOptions = { 1021 OPTIONS_STRUCT_VERSION, 1022 0, NULL, /* original argc + argv */ 1023 ( OPTPROC_BASE 1024 + OPTPROC_ERRSTOP 1025 + OPTPROC_SHORTOPT 1026 + OPTPROC_LONGOPT 1027 + OPTPROC_NO_REQ_OPT 1028 + OPTPROC_NEGATIONS 1029 + OPTPROC_ENVIRON 1030 + OPTPROC_MISUSE ), 1031 0, NULL, /* current option index, current option */ 1032 NULL, NULL, zPROGNAME, 1033 zRcName, zCopyright, zLicenseDescrip, 1034 zFullVersion, apzHomeList, zUsageTitle, 1035 zExplain, zDetail, optDesc, 1036 zBugsAddr, /* address to send bugs to */ 1037 NULL, NULL, /* extensions/saved state */ 1038 optionUsage, /* usage procedure */ 1039 translate_option_strings, /* translation procedure */ 1040 /* 1041 * Indexes to special options 1042 */ 1043 { INDEX_OPT_MORE_HELP, /* more-help option index */ 1044 INDEX_OPT_SAVE_OPTS, /* save option index */ 1045 NO_EQUIVALENT, /* '-#' option index */ 1046 NO_EQUIVALENT /* index of default opt */ 1047 }, 1048 23 /* full option count */, 18 /* user option count */, 1049 sntp_full_usage, sntp_short_usage, 1050 NULL, NULL, 1051 PKGDATADIR, sntp_packager_info 1052 }; 1053 1054 #if ENABLE_NLS 1055 /** 1056 * This code is designed to translate translatable option text for the 1057 * sntp program. These translations happen upon entry 1058 * to optionProcess(). 1059 */ 1060 #include <stdio.h> 1061 #include <stdlib.h> 1062 #include <string.h> 1063 #include <unistd.h> 1064 #ifdef HAVE_DCGETTEXT 1065 # include <gettext.h> 1066 #endif 1067 #include <autoopts/usage-txt.h> 1068 1069 static char * AO_gettext(char const * pz); 1070 static void coerce_it(void ** s); 1071 1072 /** 1073 * AutoGen specific wrapper function for gettext. It relies on the macro _() 1074 * to convert from English to the target language, then strdup-duplicates the 1075 * result string. It tries the "libopts" domain first, then whatever has been 1076 * set via the \a textdomain(3) call. 1077 * 1078 * @param[in] pz the input text used as a lookup key. 1079 * @returns the translated text (if there is one), 1080 * or the original text (if not). 1081 */ 1082 static char * 1083 AO_gettext(char const * pz) 1084 { 1085 char * res; 1086 if (pz == NULL) 1087 return NULL; 1088 #ifdef HAVE_DCGETTEXT 1089 /* 1090 * While processing the option_xlateable_txt data, try to use the 1091 * "libopts" domain. Once we switch to the option descriptor data, 1092 * do *not* use that domain. 1093 */ 1094 if (option_xlateable_txt.field_ct != 0) { 1095 res = dgettext("libopts", pz); 1096 if (res == pz) 1097 res = (char *)VOIDP(_(pz)); 1098 } else 1099 res = (char *)VOIDP(_(pz)); 1100 #else 1101 res = (char *)VOIDP(_(pz)); 1102 #endif 1103 if (res == pz) 1104 return res; 1105 res = strdup(res); 1106 if (res == NULL) { 1107 fputs(_("No memory for duping translated strings\n"), stderr); 1108 exit(SNTP_EXIT_FAILURE); 1109 } 1110 return res; 1111 } 1112 1113 /** 1114 * All the pointers we use are marked "* const", but they are stored in 1115 * writable memory. Coerce the mutability and set the pointer. 1116 */ 1117 static void coerce_it(void ** s) { *s = AO_gettext(*s); 1118 } 1119 1120 /** 1121 * Translate all the translatable strings in the sntpOptions 1122 * structure defined above. This is done only once. 1123 */ 1124 static void 1125 translate_option_strings(void) 1126 { 1127 tOptions * const opts = &sntpOptions; 1128 1129 /* 1130 * Guard against re-translation. It won't work. The strings will have 1131 * been changed by the first pass through this code. One shot only. 1132 */ 1133 if (option_xlateable_txt.field_ct != 0) { 1134 /* 1135 * Do the translations. The first pointer follows the field count 1136 * field. The field count field is the size of a pointer. 1137 */ 1138 char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); 1139 int ix = option_xlateable_txt.field_ct; 1140 1141 do { 1142 ppz++; /* skip over field_ct */ 1143 *ppz = AO_gettext(*ppz); 1144 } while (--ix > 0); 1145 /* prevent re-translation and disable "libopts" domain lookup */ 1146 option_xlateable_txt.field_ct = 0; 1147 1148 coerce_it(VOIDP(&(opts->pzCopyright))); 1149 coerce_it(VOIDP(&(opts->pzCopyNotice))); 1150 coerce_it(VOIDP(&(opts->pzFullVersion))); 1151 coerce_it(VOIDP(&(opts->pzUsageTitle))); 1152 coerce_it(VOIDP(&(opts->pzExplain))); 1153 coerce_it(VOIDP(&(opts->pzDetail))); 1154 { 1155 tOptDesc * od = opts->pOptDesc; 1156 for (ix = opts->optCt; ix > 0; ix--, od++) 1157 coerce_it(VOIDP(&(od->pzText))); 1158 } 1159 } 1160 } 1161 #endif /* ENABLE_NLS */ 1162 1163 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 1164 /** I18N function strictly for xgettext. Do not compile. */ 1165 static void bogus_function(void) { 1166 /* TRANSLATORS: 1167 1168 The following dummy function was crated solely so that xgettext can 1169 extract the correct strings. These strings are actually referenced 1170 by a field name in the sntpOptions structure noted in the 1171 comments below. The literal text is defined in sntp_opt_strs. 1172 1173 NOTE: the strings below are segmented with respect to the source string 1174 sntp_opt_strs. The strings above are handed off for translation 1175 at run time a paragraph at a time. Consequently, they are presented here 1176 for translation a paragraph at a time. 1177 1178 ALSO: often the description for an option will reference another option 1179 by name. These are set off with apostrophe quotes (I hope). Do not 1180 translate option names. 1181 */ 1182 /* referenced via sntpOptions.pzCopyright */ 1183 puts(_("sntp 4.2.8p17\n\ 1184 Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\ 1185 This is free software. It is licensed for use, modification and\n\ 1186 redistribution under the terms of the NTP License, copies of which\n\ 1187 can be seen at:\n")); 1188 puts(_(" <http://ntp.org/license>\n\ 1189 <http://opensource.org/licenses/ntp-license.php>\n")); 1190 1191 /* referenced via sntpOptions.pzCopyNotice */ 1192 puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 1193 documentation for any purpose with or without fee is hereby granted,\n\ 1194 provided that the above copyright notice appears in all copies and that\n\ 1195 both the copyright notice and this permission notice appear in supporting\n\ 1196 documentation, and that the name The University of Delaware not be used in\n\ 1197 advertising or publicity pertaining to distribution of the software without\n\ 1198 specific, written prior permission. The University of Delaware and Network\n\ 1199 Time Foundation makes no representations about the suitability this\n\ 1200 software for any purpose. It is provided \"as is\" without express or\n\ 1201 implied warranty.\n")); 1202 1203 /* referenced via sntpOptions.pOptDesc->pzText */ 1204 puts(_("Force IPv4 DNS name resolution")); 1205 1206 /* referenced via sntpOptions.pOptDesc->pzText */ 1207 puts(_("Force IPv6 DNS name resolution")); 1208 1209 /* referenced via sntpOptions.pOptDesc->pzText */ 1210 puts(_("Enable authentication with the key auth-keynumber")); 1211 1212 /* referenced via sntpOptions.pOptDesc->pzText */ 1213 puts(_("Listen to the address specified for broadcast time sync")); 1214 1215 /* referenced via sntpOptions.pOptDesc->pzText */ 1216 puts(_("Concurrently query all IPs returned for host-name")); 1217 1218 /* referenced via sntpOptions.pOptDesc->pzText */ 1219 puts(_("Increase debug verbosity level")); 1220 1221 /* referenced via sntpOptions.pOptDesc->pzText */ 1222 puts(_("Set the debug verbosity level")); 1223 1224 /* referenced via sntpOptions.pOptDesc->pzText */ 1225 puts(_("The gap (in milliseconds) between time requests")); 1226 1227 /* referenced via sntpOptions.pOptDesc->pzText */ 1228 puts(_("KoD history filename")); 1229 1230 /* referenced via sntpOptions.pOptDesc->pzText */ 1231 puts(_("Look in this file for the key specified with -a")); 1232 1233 /* referenced via sntpOptions.pOptDesc->pzText */ 1234 puts(_("Log to specified logfile")); 1235 1236 /* referenced via sntpOptions.pOptDesc->pzText */ 1237 puts(_("Adjustments less than steplimit msec will be slewed")); 1238 1239 /* referenced via sntpOptions.pOptDesc->pzText */ 1240 puts(_("Send int as our NTP protocol version")); 1241 1242 /* referenced via sntpOptions.pOptDesc->pzText */ 1243 puts(_("Use the NTP Reserved Port (port 123)")); 1244 1245 /* referenced via sntpOptions.pOptDesc->pzText */ 1246 puts(_("OK to 'step' the time with settimeofday(2)")); 1247 1248 /* referenced via sntpOptions.pOptDesc->pzText */ 1249 puts(_("OK to 'slew' the time with adjtime(2)")); 1250 1251 /* referenced via sntpOptions.pOptDesc->pzText */ 1252 puts(_("The number of seconds to wait for responses")); 1253 1254 /* referenced via sntpOptions.pOptDesc->pzText */ 1255 puts(_("Wait for pending replies (if not setting the time)")); 1256 1257 /* referenced via sntpOptions.pOptDesc->pzText */ 1258 puts(_("display extended usage information and exit")); 1259 1260 /* referenced via sntpOptions.pOptDesc->pzText */ 1261 puts(_("extended usage information passed thru pager")); 1262 1263 /* referenced via sntpOptions.pOptDesc->pzText */ 1264 puts(_("output version information and exit")); 1265 1266 /* referenced via sntpOptions.pOptDesc->pzText */ 1267 puts(_("save the option state to a config file")); 1268 1269 /* referenced via sntpOptions.pOptDesc->pzText */ 1270 puts(_("load options from a config file")); 1271 1272 /* referenced via sntpOptions.pzUsageTitle */ 1273 puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p17\n\ 1274 Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ 1275 \t\t[ hostname-or-IP ...]\n")); 1276 1277 /* referenced via sntpOptions.pzExplain */ 1278 puts(_("\n")); 1279 1280 /* referenced via sntpOptions.pzFullVersion */ 1281 puts(_("sntp 4.2.8p17")); 1282 1283 /* referenced via sntpOptions.pzFullUsage */ 1284 puts(_("<<<NOT-FOUND>>>")); 1285 1286 /* referenced via sntpOptions.pzShortUsage */ 1287 puts(_("<<<NOT-FOUND>>>")); 1288 /* LIBOPTS-MESSAGES: */ 1289 #line 67 "../autoopts.c" 1290 puts(_("allocation of %d bytes failed\n")); 1291 #line 89 "../autoopts.c" 1292 puts(_("allocation of %d bytes failed\n")); 1293 #line 48 "../init.c" 1294 puts(_("AutoOpts function called without option descriptor\n")); 1295 #line 81 "../init.c" 1296 puts(_("\tThis exceeds the compiled library version: ")); 1297 #line 79 "../init.c" 1298 puts(_("Automated Options Processing Error!\n" 1299 "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 1300 #line 78 "../autoopts.c" 1301 puts(_("realloc of %d bytes at 0x%p failed\n")); 1302 #line 83 "../init.c" 1303 puts(_("\tThis is less than the minimum library version: ")); 1304 #line 121 "../version.c" 1305 puts(_("Automated Options version %s\n" 1306 "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n")); 1307 #line 49 "../makeshell.c" 1308 puts(_("(AutoOpts bug): %s.\n")); 1309 #line 90 "../reset.c" 1310 puts(_("optionResetOpt() called, but reset-option not configured")); 1311 #line 241 "../usage.c" 1312 puts(_("could not locate the 'help' option")); 1313 #line 330 "../autoopts.c" 1314 puts(_("optionProcess() was called with invalid data")); 1315 #line 697 "../usage.c" 1316 puts(_("invalid argument type specified")); 1317 #line 568 "../find.c" 1318 puts(_("defaulted to option with optional arg")); 1319 #line 76 "../alias.c" 1320 puts(_("aliasing option is out of range.")); 1321 #line 210 "../enum.c" 1322 puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 1323 #line 78 "../find.c" 1324 puts(_(" The following options match:\n")); 1325 #line 263 "../find.c" 1326 puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 1327 #line 161 "../check.c" 1328 puts(_("%s: Command line arguments required\n")); 1329 #line 43 "../alias.c" 1330 puts(_("%d %s%s options allowed\n")); 1331 #line 56 "../makeshell.c" 1332 puts(_("%s error %d (%s) calling %s for '%s'\n")); 1333 #line 268 "../makeshell.c" 1334 puts(_("interprocess pipe")); 1335 #line 171 "../version.c" 1336 puts(_("error: version option argument '%c' invalid. Use:\n" 1337 "\t'v' - version only\n" 1338 "\t'c' - version and copyright\n" 1339 "\t'n' - version and full copyright notice\n")); 1340 #line 58 "../check.c" 1341 puts(_("%s error: the '%s' and '%s' options conflict\n")); 1342 #line 187 "../find.c" 1343 puts(_("%s: The '%s' option has been disabled.")); 1344 #line 400 "../find.c" 1345 puts(_("%s: The '%s' option has been disabled.")); 1346 #line 38 "../alias.c" 1347 puts(_("-equivalence")); 1348 #line 439 "../find.c" 1349 puts(_("%s: illegal option -- %c\n")); 1350 #line 110 "../reset.c" 1351 puts(_("%s: illegal option -- %c\n")); 1352 #line 241 "../find.c" 1353 puts(_("%s: illegal option -- %s\n")); 1354 #line 740 "../find.c" 1355 puts(_("%s: illegal option -- %s\n")); 1356 #line 118 "../reset.c" 1357 puts(_("%s: illegal option -- %s\n")); 1358 #line 305 "../find.c" 1359 puts(_("%s: unknown vendor extension option -- %s\n")); 1360 #line 135 "../enum.c" 1361 puts(_(" or an integer from %d through %d\n")); 1362 #line 145 "../enum.c" 1363 puts(_(" or an integer from %d through %d\n")); 1364 #line 696 "../usage.c" 1365 puts(_("%s error: invalid option descriptor for %s\n")); 1366 #line 1030 "../usage.c" 1367 puts(_("%s error: invalid option descriptor for %s\n")); 1368 #line 355 "../find.c" 1369 puts(_("%s: invalid option name: %s\n")); 1370 #line 497 "../find.c" 1371 puts(_("%s: The '%s' option requires an argument.\n")); 1372 #line 150 "../autoopts.c" 1373 puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 1374 "\t'%s' and '%s'.")); 1375 #line 94 "../check.c" 1376 puts(_("%s error: The %s option is required\n")); 1377 #line 602 "../find.c" 1378 puts(_("%s: The '%s' option cannot have an argument.\n")); 1379 #line 151 "../check.c" 1380 puts(_("%s: Command line arguments are not allowed.\n")); 1381 #line 568 "../save.c" 1382 puts(_("error %d (%s) creating %s\n")); 1383 #line 210 "../enum.c" 1384 puts(_("%s error: '%s' does not match any %s keywords.\n")); 1385 #line 93 "../reset.c" 1386 puts(_("%s error: The '%s' option requires an argument.\n")); 1387 #line 122 "../save.c" 1388 puts(_("error %d (%s) stat-ing %s\n")); 1389 #line 175 "../save.c" 1390 puts(_("error %d (%s) stat-ing %s\n")); 1391 #line 143 "../restore.c" 1392 puts(_("%s error: no saved option state\n")); 1393 #line 225 "../autoopts.c" 1394 puts(_("'%s' is not a command line option.\n")); 1395 #line 113 "../time.c" 1396 puts(_("%s error: '%s' is not a recognizable date/time.\n")); 1397 #line 50 "../time.c" 1398 puts(_("%s error: '%s' is not a recognizable time duration.\n")); 1399 #line 92 "../check.c" 1400 puts(_("%s error: The %s option must appear %d times.\n")); 1401 #line 165 "../numeric.c" 1402 puts(_("%s error: '%s' is not a recognizable number.\n")); 1403 #line 176 "../enum.c" 1404 puts(_("%s error: %s exceeds %s keyword count\n")); 1405 #line 279 "../usage.c" 1406 puts(_("Try '%s %s' for more information.\n")); 1407 #line 45 "../alias.c" 1408 puts(_("one %s%s option allowed\n")); 1409 #line 170 "../makeshell.c" 1410 puts(_("standard output")); 1411 #line 905 "../makeshell.c" 1412 puts(_("standard output")); 1413 #line 223 "../usage.c" 1414 puts(_("standard output")); 1415 #line 364 "../usage.c" 1416 puts(_("standard output")); 1417 #line 574 "../usage.c" 1418 puts(_("standard output")); 1419 #line 178 "../version.c" 1420 puts(_("standard output")); 1421 #line 223 "../usage.c" 1422 puts(_("standard error")); 1423 #line 364 "../usage.c" 1424 puts(_("standard error")); 1425 #line 574 "../usage.c" 1426 puts(_("standard error")); 1427 #line 178 "../version.c" 1428 puts(_("standard error")); 1429 #line 170 "../makeshell.c" 1430 puts(_("write")); 1431 #line 905 "../makeshell.c" 1432 puts(_("write")); 1433 #line 222 "../usage.c" 1434 puts(_("write")); 1435 #line 363 "../usage.c" 1436 puts(_("write")); 1437 #line 573 "../usage.c" 1438 puts(_("write")); 1439 #line 177 "../version.c" 1440 puts(_("write")); 1441 #line 60 "../numeric.c" 1442 puts(_("%s error: %s option value %ld is out of range.\n")); 1443 #line 44 "../check.c" 1444 puts(_("%s error: %s option requires the %s option\n")); 1445 #line 121 "../save.c" 1446 puts(_("%s warning: cannot save options - %s not regular file\n")); 1447 #line 174 "../save.c" 1448 puts(_("%s warning: cannot save options - %s not regular file\n")); 1449 #line 193 "../save.c" 1450 puts(_("%s warning: cannot save options - %s not regular file\n")); 1451 #line 567 "../save.c" 1452 puts(_("%s warning: cannot save options - %s not regular file\n")); 1453 /* END-LIBOPTS-MESSAGES */ 1454 1455 /* USAGE-TEXT: */ 1456 #line 822 "../usage.c" 1457 puts(_("\t\t\t\t- an alternate for '%s'\n")); 1458 #line 1097 "../usage.c" 1459 puts(_("Version, usage and configuration options:")); 1460 #line 873 "../usage.c" 1461 puts(_("\t\t\t\t- default option for unnamed options\n")); 1462 #line 786 "../usage.c" 1463 puts(_("\t\t\t\t- disabled as '--%s'\n")); 1464 #line 1066 "../usage.c" 1465 puts(_(" --- %-14s %s\n")); 1466 #line 1064 "../usage.c" 1467 puts(_("This option has been disabled")); 1468 #line 813 "../usage.c" 1469 puts(_("\t\t\t\t- enabled by default\n")); 1470 #line 40 "../alias.c" 1471 puts(_("%s error: only ")); 1472 #line 1143 "../usage.c" 1473 puts(_(" - examining environment variables named %s_*\n")); 1474 #line 168 "../file.c" 1475 puts(_("\t\t\t\t- file must not pre-exist\n")); 1476 #line 172 "../file.c" 1477 puts(_("\t\t\t\t- file must pre-exist\n")); 1478 #line 329 "../usage.c" 1479 puts(_("Options are specified by doubled hyphens and their name or by a single\n" 1480 "hyphen and the flag character.\n")); 1481 #line 882 "../makeshell.c" 1482 puts(_("\n" 1483 "= = = = = = = =\n\n" 1484 "This incarnation of genshell will produce\n" 1485 "a shell script to parse the options for %s:\n\n")); 1486 #line 142 "../enum.c" 1487 puts(_(" or an integer mask with any of the lower %d bits set\n")); 1488 #line 846 "../usage.c" 1489 puts(_("\t\t\t\t- is a set membership option\n")); 1490 #line 867 "../usage.c" 1491 puts(_("\t\t\t\t- must appear between %d and %d times\n")); 1492 #line 331 "../usage.c" 1493 puts(_("Options are specified by single or double hyphens and their name.\n")); 1494 #line 853 "../usage.c" 1495 puts(_("\t\t\t\t- may appear multiple times\n")); 1496 #line 840 "../usage.c" 1497 puts(_("\t\t\t\t- may not be preset\n")); 1498 #line 1258 "../usage.c" 1499 puts(_(" Arg Option-Name Description\n")); 1500 #line 1194 "../usage.c" 1501 puts(_(" Flg Arg Option-Name Description\n")); 1502 #line 1252 "../usage.c" 1503 puts(_(" Flg Arg Option-Name Description\n")); 1504 #line 1253 "../usage.c" 1505 puts(_(" %3s %s")); 1506 #line 1259 "../usage.c" 1507 puts(_(" %3s %s")); 1508 #line 336 "../usage.c" 1509 puts(_("The '-#<number>' option may omit the hash char\n")); 1510 #line 332 "../usage.c" 1511 puts(_("All arguments are named options.\n")); 1512 #line 920 "../usage.c" 1513 puts(_(" - reading file %s")); 1514 #line 358 "../usage.c" 1515 puts(_("\n" 1516 "Please send bug reports to: <%s>\n")); 1517 #line 100 "../version.c" 1518 puts(_("\n" 1519 "Please send bug reports to: <%s>\n")); 1520 #line 129 "../version.c" 1521 puts(_("\n" 1522 "Please send bug reports to: <%s>\n")); 1523 #line 852 "../usage.c" 1524 puts(_("\t\t\t\t- may NOT appear - preset only\n")); 1525 #line 893 "../usage.c" 1526 puts(_("\n" 1527 "The following option preset mechanisms are supported:\n")); 1528 #line 1141 "../usage.c" 1529 puts(_("\n" 1530 "The following option preset mechanisms are supported:\n")); 1531 #line 631 "../usage.c" 1532 puts(_("prohibits these options:\n")); 1533 #line 626 "../usage.c" 1534 puts(_("prohibits the option '%s'\n")); 1535 #line 81 "../numeric.c" 1536 puts(_("%s%ld to %ld")); 1537 #line 79 "../numeric.c" 1538 puts(_("%sgreater than or equal to %ld")); 1539 #line 75 "../numeric.c" 1540 puts(_("%s%ld exactly")); 1541 #line 68 "../numeric.c" 1542 puts(_("%sit must lie in one of the ranges:\n")); 1543 #line 68 "../numeric.c" 1544 puts(_("%sit must be in the range:\n")); 1545 #line 88 "../numeric.c" 1546 puts(_(", or\n")); 1547 #line 66 "../numeric.c" 1548 puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 1549 #line 77 "../numeric.c" 1550 puts(_("%sless than or equal to %ld")); 1551 #line 339 "../usage.c" 1552 puts(_("Operands and options may be intermixed. They will be reordered.\n")); 1553 #line 601 "../usage.c" 1554 puts(_("requires the option '%s'\n")); 1555 #line 604 "../usage.c" 1556 puts(_("requires these options:\n")); 1557 #line 1270 "../usage.c" 1558 puts(_(" Arg Option-Name Req? Description\n")); 1559 #line 1264 "../usage.c" 1560 puts(_(" Flg Arg Option-Name Req? Description\n")); 1561 #line 143 "../enum.c" 1562 puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 1563 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 1564 "will set them all. Multiple entries may be passed as an option\n" 1565 "argument list.\n")); 1566 #line 859 "../usage.c" 1567 puts(_("\t\t\t\t- may appear up to %d times\n")); 1568 #line 52 "../enum.c" 1569 puts(_("The valid \"%s\" option keywords are:\n")); 1570 #line 1101 "../usage.c" 1571 puts(_("The next option supports vendor supported extra options:")); 1572 #line 722 "../usage.c" 1573 puts(_("These additional options are:")); 1574 /* END-USAGE-TEXT */ 1575 } 1576 #endif /* uncompilable code */ 1577 #ifdef __cplusplus 1578 } 1579 #endif 1580 /* sntp-opts.c ends here */ 1581