1280849Scy/* 2181834Sroberto * EDIT THIS FILE WITH CAUTION (sntp-opts.c) 3280849Scy * 4316722Sdelphij * It has been AutoGen-ed March 21, 2017 at 10:36:29 AM by AutoGen 5.18.5 5181834Sroberto * From the definitions sntp-opts.def 6181834Sroberto * and the template file options 7181834Sroberto * 8280849Scy * Generated from AutoOpts 41:0:16 templates. 9181834Sroberto * 10280849Scy * AutoOpts is a copyrighted work. This source file is not encumbered 11280849Scy * by AutoOpts licensing, but is provided under the licensing terms chosen 12280849Scy * by the sntp author or copyright holder. AutoOpts is 13280849Scy * licensed under the terms of the LGPL. The redistributable library 14280849Scy * (``libopts'') is licensed under the terms of either the LGPL or, at the 15280849Scy * users discretion, the BSD license. See the AutoOpts and/or libopts sources 16280849Scy * for details. 17181834Sroberto * 18280849Scy * The sntp program is copyrighted and licensed 19280849Scy * under the following terms: 20181834Sroberto * 21316722Sdelphij * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved. 22280849Scy * This is free software. It is licensed for use, modification and 23280849Scy * redistribution under the terms of the NTP License, copies of which 24280849Scy * can be seen at: 25280849Scy * <http://ntp.org/license> 26280849Scy * <http://opensource.org/licenses/ntp-license.php> 27280849Scy * 28280849Scy * Permission to use, copy, modify, and distribute this software and its 29280849Scy * documentation for any purpose with or without fee is hereby granted, 30280849Scy * provided that the above copyright notice appears in all copies and that 31280849Scy * both the copyright notice and this permission notice appear in 32280849Scy * supporting documentation, and that the name The University of Delaware not be used in 33280849Scy * advertising or publicity pertaining to distribution of the software 34280849Scy * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no 35280849Scy * representations about the suitability this software for any purpose. It 36280849Scy * is provided "as is" without express or implied warranty. 37181834Sroberto */ 38181834Sroberto 39280849Scy#ifndef __doxygen__ 40280849Scy#define OPTION_CODE_COMPILE 1 41280849Scy#include "sntp-opts.h" 42280849Scy#include <sys/types.h> 43181834Sroberto 44181834Sroberto#include <limits.h> 45280849Scy#include <stdio.h> 46280849Scy#include <stdlib.h> 47280849Scy#include <errno.h> 48181834Sroberto 49181834Sroberto#ifdef __cplusplus 50181834Srobertoextern "C" { 51181834Sroberto#endif 52280849Scyextern FILE * option_usage_fp; 53280849Scy#define zCopyright (sntp_opt_strs+0) 54316722Sdelphij#define zLicenseDescrip (sntp_opt_strs+341) 55181834Sroberto 56280849Scy/* 57280849Scy * global included definitions 58280849Scy */ 59280849Scy#ifdef __windows 60280849Scy extern int atoi(const char*); 61280849Scy#else 62280849Scy# include <stdlib.h> 63280849Scy#endif 64280849Scy 65181834Sroberto#ifndef NULL 66181834Sroberto# define NULL 0 67181834Sroberto#endif 68181834Sroberto 69280849Scy/** 70280849Scy * static const strings for sntp options 71181834Sroberto */ 72316722Sdelphijstatic char const sntp_opt_strs[2552] = 73316722Sdelphij/* 0 */ "sntp 4.2.8p10\n" 74316722Sdelphij "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n" 75280849Scy "This is free software. It is licensed for use, modification and\n" 76280849Scy "redistribution under the terms of the NTP License, copies of which\n" 77280849Scy "can be seen at:\n" 78280849Scy " <http://ntp.org/license>\n" 79280849Scy " <http://opensource.org/licenses/ntp-license.php>\n\0" 80316722Sdelphij/* 341 */ "Permission to use, copy, modify, and distribute this software and its\n" 81280849Scy "documentation for any purpose with or without fee is hereby granted,\n" 82280849Scy "provided that the above copyright notice appears in all copies and that\n" 83280849Scy "both the copyright notice and this permission notice appear in supporting\n" 84280849Scy "documentation, and that the name The University of Delaware not be used in\n" 85280849Scy "advertising or publicity pertaining to distribution of the software without\n" 86280849Scy "specific, written prior permission. The University of Delaware and Network\n" 87280849Scy "Time Foundation makes no representations about the suitability this\n" 88280849Scy "software for any purpose. It is provided \"as is\" without express or\n" 89280849Scy "implied warranty.\n\0" 90316722Sdelphij/* 1009 */ "Force IPv4 DNS name resolution\0" 91316722Sdelphij/* 1040 */ "IPV4\0" 92316722Sdelphij/* 1045 */ "ipv4\0" 93316722Sdelphij/* 1050 */ "Force IPv6 DNS name resolution\0" 94316722Sdelphij/* 1081 */ "IPV6\0" 95316722Sdelphij/* 1086 */ "ipv6\0" 96316722Sdelphij/* 1091 */ "Enable authentication with the key auth-keynumber\0" 97316722Sdelphij/* 1141 */ "AUTHENTICATION\0" 98316722Sdelphij/* 1156 */ "authentication\0" 99316722Sdelphij/* 1171 */ "Listen to the address specified for broadcast time sync\0" 100316722Sdelphij/* 1227 */ "BROADCAST\0" 101316722Sdelphij/* 1237 */ "broadcast\0" 102316722Sdelphij/* 1247 */ "Concurrently query all IPs returned for host-name\0" 103316722Sdelphij/* 1297 */ "CONCURRENT\0" 104316722Sdelphij/* 1308 */ "concurrent\0" 105316722Sdelphij/* 1319 */ "Increase debug verbosity level\0" 106316722Sdelphij/* 1350 */ "DEBUG_LEVEL\0" 107316722Sdelphij/* 1362 */ "debug-level\0" 108316722Sdelphij/* 1374 */ "Set the debug verbosity level\0" 109316722Sdelphij/* 1404 */ "SET_DEBUG_LEVEL\0" 110316722Sdelphij/* 1420 */ "set-debug-level\0" 111316722Sdelphij/* 1436 */ "The gap (in milliseconds) between time requests\0" 112316722Sdelphij/* 1484 */ "GAP\0" 113316722Sdelphij/* 1488 */ "gap\0" 114316722Sdelphij/* 1492 */ "KoD history filename\0" 115316722Sdelphij/* 1513 */ "KOD\0" 116316722Sdelphij/* 1517 */ "kod\0" 117316722Sdelphij/* 1521 */ "/var/db/ntp-kod\0" 118316722Sdelphij/* 1537 */ "Look in this file for the key specified with -a\0" 119316722Sdelphij/* 1585 */ "KEYFILE\0" 120316722Sdelphij/* 1593 */ "keyfile\0" 121316722Sdelphij/* 1601 */ "Log to specified logfile\0" 122316722Sdelphij/* 1626 */ "LOGFILE\0" 123316722Sdelphij/* 1634 */ "logfile\0" 124316722Sdelphij/* 1642 */ "Adjustments less than steplimit msec will be slewed\0" 125316722Sdelphij/* 1694 */ "STEPLIMIT\0" 126316722Sdelphij/* 1704 */ "steplimit\0" 127316722Sdelphij/* 1714 */ "Send int as our NTP protocol version\0" 128316722Sdelphij/* 1751 */ "NTPVERSION\0" 129316722Sdelphij/* 1762 */ "ntpversion\0" 130316722Sdelphij/* 1773 */ "Use the NTP Reserved Port (port 123)\0" 131316722Sdelphij/* 1810 */ "USERESERVEDPORT\0" 132316722Sdelphij/* 1826 */ "usereservedport\0" 133316722Sdelphij/* 1842 */ "OK to 'step' the time with settimeofday(2)\0" 134316722Sdelphij/* 1885 */ "STEP\0" 135316722Sdelphij/* 1890 */ "step\0" 136316722Sdelphij/* 1895 */ "OK to 'slew' the time with adjtime(2)\0" 137316722Sdelphij/* 1933 */ "SLEW\0" 138316722Sdelphij/* 1938 */ "slew\0" 139316722Sdelphij/* 1943 */ "The number of seconds to wait for responses\0" 140316722Sdelphij/* 1987 */ "TIMEOUT\0" 141316722Sdelphij/* 1995 */ "timeout\0" 142316722Sdelphij/* 2003 */ "Wait for pending replies (if not setting the time)\0" 143316722Sdelphij/* 2054 */ "WAIT\0" 144316722Sdelphij/* 2059 */ "no-wait\0" 145316722Sdelphij/* 2067 */ "no\0" 146316722Sdelphij/* 2070 */ "display extended usage information and exit\0" 147316722Sdelphij/* 2114 */ "help\0" 148316722Sdelphij/* 2119 */ "extended usage information passed thru pager\0" 149316722Sdelphij/* 2164 */ "more-help\0" 150316722Sdelphij/* 2174 */ "output version information and exit\0" 151316722Sdelphij/* 2210 */ "version\0" 152316722Sdelphij/* 2218 */ "save the option state to a config file\0" 153316722Sdelphij/* 2257 */ "save-opts\0" 154316722Sdelphij/* 2267 */ "load options from a config file\0" 155316722Sdelphij/* 2299 */ "LOAD_OPTS\0" 156316722Sdelphij/* 2309 */ "no-load-opts\0" 157316722Sdelphij/* 2322 */ "SNTP\0" 158316722Sdelphij/* 2327 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p10\n" 159280849Scy "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" 160280849Scy "\t\t[ hostname-or-IP ...]\n\0" 161316722Sdelphij/* 2487 */ "$HOME\0" 162316722Sdelphij/* 2493 */ ".\0" 163316722Sdelphij/* 2495 */ ".ntprc\0" 164316722Sdelphij/* 2502 */ "http://bugs.ntp.org, bugs@ntp.org\0" 165316722Sdelphij/* 2536 */ "\n\0" 166316722Sdelphij/* 2538 */ "sntp 4.2.8p10"; 167181834Sroberto 168280849Scy/** 169280849Scy * ipv4 option description with 170280849Scy * "Must also have options" and "Incompatible options": 171181834Sroberto */ 172280849Scy/** Descriptive text for the ipv4 option */ 173316722Sdelphij#define IPV4_DESC (sntp_opt_strs+1009) 174280849Scy/** Upper-cased name for the ipv4 option */ 175316722Sdelphij#define IPV4_NAME (sntp_opt_strs+1040) 176280849Scy/** Name string for the ipv4 option */ 177316722Sdelphij#define IPV4_name (sntp_opt_strs+1045) 178280849Scy/** Other options that appear in conjunction with the ipv4 option */ 179280849Scystatic int const aIpv4CantList[] = { 180280849Scy INDEX_OPT_IPV6, NO_EQUIVALENT }; 181280849Scy/** Compiled in flag settings for the ipv4 option */ 182280849Scy#define IPV4_FLAGS (OPTST_DISABLED) 183181834Sroberto 184280849Scy/** 185280849Scy * ipv6 option description with 186181834Sroberto * "Must also have options" and "Incompatible options": 187181834Sroberto */ 188280849Scy/** Descriptive text for the ipv6 option */ 189316722Sdelphij#define IPV6_DESC (sntp_opt_strs+1050) 190280849Scy/** Upper-cased name for the ipv6 option */ 191316722Sdelphij#define IPV6_NAME (sntp_opt_strs+1081) 192280849Scy/** Name string for the ipv6 option */ 193316722Sdelphij#define IPV6_name (sntp_opt_strs+1086) 194280849Scy/** Other options that appear in conjunction with the ipv6 option */ 195280849Scystatic int const aIpv6CantList[] = { 196280849Scy INDEX_OPT_IPV4, NO_EQUIVALENT }; 197280849Scy/** Compiled in flag settings for the ipv6 option */ 198280849Scy#define IPV6_FLAGS (OPTST_DISABLED) 199181834Sroberto 200280849Scy/** 201280849Scy * authentication option description: 202181834Sroberto */ 203280849Scy/** Descriptive text for the authentication option */ 204316722Sdelphij#define AUTHENTICATION_DESC (sntp_opt_strs+1091) 205280849Scy/** Upper-cased name for the authentication option */ 206316722Sdelphij#define AUTHENTICATION_NAME (sntp_opt_strs+1141) 207280849Scy/** Name string for the authentication option */ 208316722Sdelphij#define AUTHENTICATION_name (sntp_opt_strs+1156) 209280849Scy/** Compiled in flag settings for the authentication option */ 210280849Scy#define AUTHENTICATION_FLAGS (OPTST_DISABLED \ 211280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 212181834Sroberto 213280849Scy/** 214280849Scy * broadcast option description: 215181834Sroberto */ 216280849Scy/** Descriptive text for the broadcast option */ 217316722Sdelphij#define BROADCAST_DESC (sntp_opt_strs+1171) 218280849Scy/** Upper-cased name for the broadcast option */ 219316722Sdelphij#define BROADCAST_NAME (sntp_opt_strs+1227) 220280849Scy/** Name string for the broadcast option */ 221316722Sdelphij#define BROADCAST_name (sntp_opt_strs+1237) 222280849Scy/** Compiled in flag settings for the broadcast option */ 223280849Scy#define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 224280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 225181834Sroberto 226280849Scy/** 227280849Scy * concurrent option description: 228181834Sroberto */ 229280849Scy/** Descriptive text for the concurrent option */ 230316722Sdelphij#define CONCURRENT_DESC (sntp_opt_strs+1247) 231280849Scy/** Upper-cased name for the concurrent option */ 232316722Sdelphij#define CONCURRENT_NAME (sntp_opt_strs+1297) 233280849Scy/** Name string for the concurrent option */ 234316722Sdelphij#define CONCURRENT_name (sntp_opt_strs+1308) 235280849Scy/** Compiled in flag settings for the concurrent option */ 236280849Scy#define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 237280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 238181834Sroberto 239280849Scy/** 240280849Scy * debug-level option description: 241181834Sroberto */ 242280849Scy/** Descriptive text for the debug-level option */ 243316722Sdelphij#define DEBUG_LEVEL_DESC (sntp_opt_strs+1319) 244280849Scy/** Upper-cased name for the debug-level option */ 245316722Sdelphij#define DEBUG_LEVEL_NAME (sntp_opt_strs+1350) 246280849Scy/** Name string for the debug-level option */ 247316722Sdelphij#define DEBUG_LEVEL_name (sntp_opt_strs+1362) 248280849Scy/** Compiled in flag settings for the debug-level option */ 249280849Scy#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 250181834Sroberto 251280849Scy/** 252280849Scy * set-debug-level option description: 253181834Sroberto */ 254280849Scy/** Descriptive text for the set-debug-level option */ 255316722Sdelphij#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1374) 256280849Scy/** Upper-cased name for the set-debug-level option */ 257316722Sdelphij#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1404) 258280849Scy/** Name string for the set-debug-level option */ 259316722Sdelphij#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1420) 260280849Scy/** Compiled in flag settings for the set-debug-level option */ 261280849Scy#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 262280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 263181834Sroberto 264280849Scy/** 265280849Scy * gap option description: 266280849Scy */ 267280849Scy/** Descriptive text for the gap option */ 268316722Sdelphij#define GAP_DESC (sntp_opt_strs+1436) 269280849Scy/** Upper-cased name for the gap option */ 270316722Sdelphij#define GAP_NAME (sntp_opt_strs+1484) 271280849Scy/** Name string for the gap option */ 272316722Sdelphij#define GAP_name (sntp_opt_strs+1488) 273280849Scy/** The compiled in default value for the gap option argument */ 274280849Scy#define GAP_DFT_ARG ((char const*)50) 275280849Scy/** Compiled in flag settings for the gap option */ 276280849Scy#define GAP_FLAGS (OPTST_DISABLED \ 277280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 278181834Sroberto 279280849Scy/** 280280849Scy * kod option description: 281280849Scy */ 282280849Scy/** Descriptive text for the kod option */ 283316722Sdelphij#define KOD_DESC (sntp_opt_strs+1492) 284280849Scy/** Upper-cased name for the kod option */ 285316722Sdelphij#define KOD_NAME (sntp_opt_strs+1513) 286280849Scy/** Name string for the kod option */ 287316722Sdelphij#define KOD_name (sntp_opt_strs+1517) 288280849Scy/** The compiled in default value for the kod option argument */ 289316722Sdelphij#define KOD_DFT_ARG (sntp_opt_strs+1521) 290280849Scy/** Compiled in flag settings for the kod option */ 291280849Scy#define KOD_FLAGS (OPTST_DISABLED \ 292280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 293181834Sroberto 294280849Scy/** 295280849Scy * keyfile option description: 296181834Sroberto */ 297280849Scy/** Descriptive text for the keyfile option */ 298316722Sdelphij#define KEYFILE_DESC (sntp_opt_strs+1537) 299280849Scy/** Upper-cased name for the keyfile option */ 300316722Sdelphij#define KEYFILE_NAME (sntp_opt_strs+1585) 301280849Scy/** Name string for the keyfile option */ 302316722Sdelphij#define KEYFILE_name (sntp_opt_strs+1593) 303280849Scy/** Compiled in flag settings for the keyfile option */ 304280849Scy#define KEYFILE_FLAGS (OPTST_DISABLED \ 305280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 306181834Sroberto 307280849Scy/** 308280849Scy * logfile option description: 309280849Scy */ 310280849Scy/** Descriptive text for the logfile option */ 311316722Sdelphij#define LOGFILE_DESC (sntp_opt_strs+1601) 312280849Scy/** Upper-cased name for the logfile option */ 313316722Sdelphij#define LOGFILE_NAME (sntp_opt_strs+1626) 314280849Scy/** Name string for the logfile option */ 315316722Sdelphij#define LOGFILE_name (sntp_opt_strs+1634) 316280849Scy/** Compiled in flag settings for the logfile option */ 317280849Scy#define LOGFILE_FLAGS (OPTST_DISABLED \ 318280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 319181834Sroberto 320280849Scy/** 321280849Scy * steplimit option description: 322181834Sroberto */ 323280849Scy/** Descriptive text for the steplimit option */ 324316722Sdelphij#define STEPLIMIT_DESC (sntp_opt_strs+1642) 325280849Scy/** Upper-cased name for the steplimit option */ 326316722Sdelphij#define STEPLIMIT_NAME (sntp_opt_strs+1694) 327280849Scy/** Name string for the steplimit option */ 328316722Sdelphij#define STEPLIMIT_name (sntp_opt_strs+1704) 329280849Scy/** Compiled in flag settings for the steplimit option */ 330280849Scy#define STEPLIMIT_FLAGS (OPTST_DISABLED \ 331280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 332280849Scy 333280849Scy/** 334280849Scy * ntpversion option description: 335181834Sroberto */ 336280849Scy/** Descriptive text for the ntpversion option */ 337316722Sdelphij#define NTPVERSION_DESC (sntp_opt_strs+1714) 338280849Scy/** Upper-cased name for the ntpversion option */ 339316722Sdelphij#define NTPVERSION_NAME (sntp_opt_strs+1751) 340280849Scy/** Name string for the ntpversion option */ 341316722Sdelphij#define NTPVERSION_name (sntp_opt_strs+1762) 342280849Scy/** The compiled in default value for the ntpversion option argument */ 343280849Scy#define NTPVERSION_DFT_ARG ((char const*)4) 344280849Scy/** Compiled in flag settings for the ntpversion option */ 345280849Scy#define NTPVERSION_FLAGS (OPTST_DISABLED \ 346280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 347181834Sroberto 348280849Scy/** 349280849Scy * usereservedport option description: 350280849Scy */ 351280849Scy/** Descriptive text for the usereservedport option */ 352316722Sdelphij#define USERESERVEDPORT_DESC (sntp_opt_strs+1773) 353280849Scy/** Upper-cased name for the usereservedport option */ 354316722Sdelphij#define USERESERVEDPORT_NAME (sntp_opt_strs+1810) 355280849Scy/** Name string for the usereservedport option */ 356316722Sdelphij#define USERESERVEDPORT_name (sntp_opt_strs+1826) 357280849Scy/** Compiled in flag settings for the usereservedport option */ 358280849Scy#define USERESERVEDPORT_FLAGS (OPTST_DISABLED) 359280849Scy 360280849Scy/** 361280849Scy * step option description: 362280849Scy */ 363280849Scy/** Descriptive text for the step option */ 364316722Sdelphij#define STEP_DESC (sntp_opt_strs+1842) 365280849Scy/** Upper-cased name for the step option */ 366316722Sdelphij#define STEP_NAME (sntp_opt_strs+1885) 367280849Scy/** Name string for the step option */ 368316722Sdelphij#define STEP_name (sntp_opt_strs+1890) 369280849Scy/** Compiled in flag settings for the step option */ 370280849Scy#define STEP_FLAGS (OPTST_DISABLED) 371280849Scy 372280849Scy/** 373280849Scy * slew option description: 374280849Scy */ 375280849Scy/** Descriptive text for the slew option */ 376316722Sdelphij#define SLEW_DESC (sntp_opt_strs+1895) 377280849Scy/** Upper-cased name for the slew option */ 378316722Sdelphij#define SLEW_NAME (sntp_opt_strs+1933) 379280849Scy/** Name string for the slew option */ 380316722Sdelphij#define SLEW_name (sntp_opt_strs+1938) 381280849Scy/** Compiled in flag settings for the slew option */ 382280849Scy#define SLEW_FLAGS (OPTST_DISABLED) 383280849Scy 384280849Scy/** 385280849Scy * timeout option description: 386280849Scy */ 387280849Scy/** Descriptive text for the timeout option */ 388316722Sdelphij#define TIMEOUT_DESC (sntp_opt_strs+1943) 389280849Scy/** Upper-cased name for the timeout option */ 390316722Sdelphij#define TIMEOUT_NAME (sntp_opt_strs+1987) 391280849Scy/** Name string for the timeout option */ 392316722Sdelphij#define TIMEOUT_name (sntp_opt_strs+1995) 393280849Scy/** The compiled in default value for the timeout option argument */ 394280849Scy#define TIMEOUT_DFT_ARG ((char const*)5) 395280849Scy/** Compiled in flag settings for the timeout option */ 396280849Scy#define TIMEOUT_FLAGS (OPTST_DISABLED \ 397280849Scy | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 398280849Scy 399280849Scy/** 400280849Scy * wait option description: 401280849Scy */ 402280849Scy/** Descriptive text for the wait option */ 403316722Sdelphij#define WAIT_DESC (sntp_opt_strs+2003) 404280849Scy/** Upper-cased name for the wait option */ 405316722Sdelphij#define WAIT_NAME (sntp_opt_strs+2054) 406280849Scy/** disablement name for the wait option */ 407316722Sdelphij#define NOT_WAIT_name (sntp_opt_strs+2059) 408280849Scy/** disablement prefix for the wait option */ 409316722Sdelphij#define NOT_WAIT_PFX (sntp_opt_strs+2067) 410280849Scy/** Name string for the wait option */ 411280849Scy#define WAIT_name (NOT_WAIT_name + 3) 412280849Scy/** Compiled in flag settings for the wait option */ 413280849Scy#define WAIT_FLAGS (OPTST_INITENABLED) 414280849Scy 415181834Sroberto/* 416280849Scy * Help/More_Help/Version option descriptions: 417181834Sroberto */ 418316722Sdelphij#define HELP_DESC (sntp_opt_strs+2070) 419316722Sdelphij#define HELP_name (sntp_opt_strs+2114) 420280849Scy#ifdef HAVE_WORKING_FORK 421316722Sdelphij#define MORE_HELP_DESC (sntp_opt_strs+2119) 422316722Sdelphij#define MORE_HELP_name (sntp_opt_strs+2164) 423280849Scy#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 424280849Scy#else 425280849Scy#define MORE_HELP_DESC HELP_DESC 426280849Scy#define MORE_HELP_name HELP_name 427280849Scy#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 428280849Scy#endif 429280849Scy#ifdef NO_OPTIONAL_OPT_ARGS 430280849Scy# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 431280849Scy#else 432280849Scy# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 433280849Scy OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 434280849Scy#endif 435316722Sdelphij#define VER_DESC (sntp_opt_strs+2174) 436316722Sdelphij#define VER_name (sntp_opt_strs+2210) 437316722Sdelphij#define SAVE_OPTS_DESC (sntp_opt_strs+2218) 438316722Sdelphij#define SAVE_OPTS_name (sntp_opt_strs+2257) 439316722Sdelphij#define LOAD_OPTS_DESC (sntp_opt_strs+2267) 440316722Sdelphij#define LOAD_OPTS_NAME (sntp_opt_strs+2299) 441316722Sdelphij#define NO_LOAD_OPTS_name (sntp_opt_strs+2309) 442316722Sdelphij#define LOAD_OPTS_pfx (sntp_opt_strs+2067) 443280849Scy#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) 444280849Scy/** 445280849Scy * Declare option callback procedures 446280849Scy */ 447181834Srobertoextern tOptProc 448280849Scy ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 449280849Scy optionNumericVal, optionPagedUsage, optionResetOpt, 450280849Scy optionStackArg, optionTimeDate, optionTimeVal, 451280849Scy optionUnstackArg, optionVendorOption; 452181834Srobertostatic tOptProc 453280849Scy doOptDebug_Level, doOptKeyfile, doOptKod, doOptLogfile, 454280849Scy doOptNtpversion, doOptSteplimit, doUsageOpt; 455280849Scy#define VER_PROC ntpOptionPrintVersion 456181834Sroberto 457280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 458280849Scy/** 459280849Scy * Define the sntp Option Descriptions. 460280849Scy * This is an array of OPTION_CT entries, one for each 461280849Scy * option that the sntp program responds to. 462181834Sroberto */ 463280849Scystatic tOptDesc optDesc[OPTION_CT] = { 464181834Sroberto { /* entry idx, value */ 0, VALUE_OPT_IPV4, 465280849Scy /* equiv idx, value */ 0, VALUE_OPT_IPV4, 466181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 467181834Sroberto /* min, max, act ct */ 0, 1, 0, 468181834Sroberto /* opt state flags */ IPV4_FLAGS, 0, 469280849Scy /* last opt argumnt */ { NULL }, /* --ipv4 */ 470181834Sroberto /* arg list/cookie */ NULL, 471280849Scy /* must/cannot opts */ NULL, aIpv4CantList, 472181834Sroberto /* option proc */ NULL, 473280849Scy /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name, 474181834Sroberto /* disablement strs */ NULL, NULL }, 475181834Sroberto 476181834Sroberto { /* entry idx, value */ 1, VALUE_OPT_IPV6, 477280849Scy /* equiv idx, value */ 1, VALUE_OPT_IPV6, 478280849Scy /* equivalenced to */ NO_EQUIVALENT, 479181834Sroberto /* min, max, act ct */ 0, 1, 0, 480181834Sroberto /* opt state flags */ IPV6_FLAGS, 0, 481280849Scy /* last opt argumnt */ { NULL }, /* --ipv6 */ 482181834Sroberto /* arg list/cookie */ NULL, 483280849Scy /* must/cannot opts */ NULL, aIpv6CantList, 484181834Sroberto /* option proc */ NULL, 485280849Scy /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name, 486181834Sroberto /* disablement strs */ NULL, NULL }, 487181834Sroberto 488280849Scy { /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION, 489280849Scy /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION, 490181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 491181834Sroberto /* min, max, act ct */ 0, 1, 0, 492280849Scy /* opt state flags */ AUTHENTICATION_FLAGS, 0, 493280849Scy /* last opt argumnt */ { NULL }, /* --authentication */ 494181834Sroberto /* arg list/cookie */ NULL, 495181834Sroberto /* must/cannot opts */ NULL, NULL, 496280849Scy /* option proc */ optionNumericVal, 497280849Scy /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name, 498181834Sroberto /* disablement strs */ NULL, NULL }, 499181834Sroberto 500280849Scy { /* entry idx, value */ 3, VALUE_OPT_BROADCAST, 501280849Scy /* equiv idx, value */ 3, VALUE_OPT_BROADCAST, 502181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 503280849Scy /* min, max, act ct */ 0, NOLIMIT, 0, 504280849Scy /* opt state flags */ BROADCAST_FLAGS, 0, 505280849Scy /* last opt argumnt */ { NULL }, /* --broadcast */ 506280849Scy /* arg list/cookie */ NULL, 507280849Scy /* must/cannot opts */ NULL, NULL, 508280849Scy /* option proc */ optionStackArg, 509280849Scy /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name, 510280849Scy /* disablement strs */ NULL, NULL }, 511280849Scy 512280849Scy { /* entry idx, value */ 4, VALUE_OPT_CONCURRENT, 513280849Scy /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT, 514280849Scy /* equivalenced to */ NO_EQUIVALENT, 515280849Scy /* min, max, act ct */ 0, NOLIMIT, 0, 516280849Scy /* opt state flags */ CONCURRENT_FLAGS, 0, 517280849Scy /* last opt argumnt */ { NULL }, /* --concurrent */ 518280849Scy /* arg list/cookie */ NULL, 519280849Scy /* must/cannot opts */ NULL, NULL, 520280849Scy /* option proc */ optionStackArg, 521280849Scy /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name, 522280849Scy /* disablement strs */ NULL, NULL }, 523280849Scy 524280849Scy { /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 525280849Scy /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 526280849Scy /* equivalenced to */ NO_EQUIVALENT, 527280849Scy /* min, max, act ct */ 0, NOLIMIT, 0, 528280849Scy /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 529280849Scy /* last opt argumnt */ { NULL }, /* --debug-level */ 530280849Scy /* arg list/cookie */ NULL, 531280849Scy /* must/cannot opts */ NULL, NULL, 532280849Scy /* option proc */ doOptDebug_Level, 533280849Scy /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 534280849Scy /* disablement strs */ NULL, NULL }, 535280849Scy 536280849Scy { /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 537280849Scy /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 538280849Scy /* equivalenced to */ NO_EQUIVALENT, 539280849Scy /* min, max, act ct */ 0, NOLIMIT, 0, 540280849Scy /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 541280849Scy /* last opt argumnt */ { NULL }, /* --set-debug-level */ 542280849Scy /* arg list/cookie */ NULL, 543280849Scy /* must/cannot opts */ NULL, NULL, 544280849Scy /* option proc */ optionNumericVal, 545280849Scy /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 546280849Scy /* disablement strs */ NULL, NULL }, 547280849Scy 548280849Scy { /* entry idx, value */ 7, VALUE_OPT_GAP, 549280849Scy /* equiv idx, value */ 7, VALUE_OPT_GAP, 550280849Scy /* equivalenced to */ NO_EQUIVALENT, 551181834Sroberto /* min, max, act ct */ 0, 1, 0, 552280849Scy /* opt state flags */ GAP_FLAGS, 0, 553280849Scy /* last opt argumnt */ { GAP_DFT_ARG }, 554181834Sroberto /* arg list/cookie */ NULL, 555280849Scy /* must/cannot opts */ NULL, NULL, 556280849Scy /* option proc */ optionNumericVal, 557280849Scy /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name, 558181834Sroberto /* disablement strs */ NULL, NULL }, 559181834Sroberto 560280849Scy { /* entry idx, value */ 8, VALUE_OPT_KOD, 561280849Scy /* equiv idx, value */ 8, VALUE_OPT_KOD, 562181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 563181834Sroberto /* min, max, act ct */ 0, 1, 0, 564280849Scy /* opt state flags */ KOD_FLAGS, 0, 565280849Scy /* last opt argumnt */ { KOD_DFT_ARG }, 566181834Sroberto /* arg list/cookie */ NULL, 567280849Scy /* must/cannot opts */ NULL, NULL, 568280849Scy /* option proc */ doOptKod, 569280849Scy /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name, 570181834Sroberto /* disablement strs */ NULL, NULL }, 571181834Sroberto 572280849Scy { /* entry idx, value */ 9, VALUE_OPT_KEYFILE, 573280849Scy /* equiv idx, value */ 9, VALUE_OPT_KEYFILE, 574181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 575181834Sroberto /* min, max, act ct */ 0, 1, 0, 576280849Scy /* opt state flags */ KEYFILE_FLAGS, 0, 577280849Scy /* last opt argumnt */ { NULL }, /* --keyfile */ 578181834Sroberto /* arg list/cookie */ NULL, 579280849Scy /* must/cannot opts */ NULL, NULL, 580280849Scy /* option proc */ doOptKeyfile, 581280849Scy /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name, 582280849Scy /* disablement strs */ NULL, NULL }, 583280849Scy 584280849Scy { /* entry idx, value */ 10, VALUE_OPT_LOGFILE, 585280849Scy /* equiv idx, value */ 10, VALUE_OPT_LOGFILE, 586280849Scy /* equivalenced to */ NO_EQUIVALENT, 587280849Scy /* min, max, act ct */ 0, 1, 0, 588280849Scy /* opt state flags */ LOGFILE_FLAGS, 0, 589280849Scy /* last opt argumnt */ { NULL }, /* --logfile */ 590280849Scy /* arg list/cookie */ NULL, 591280849Scy /* must/cannot opts */ NULL, NULL, 592280849Scy /* option proc */ doOptLogfile, 593280849Scy /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name, 594280849Scy /* disablement strs */ NULL, NULL }, 595280849Scy 596280849Scy { /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT, 597280849Scy /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT, 598280849Scy /* equivalenced to */ NO_EQUIVALENT, 599280849Scy /* min, max, act ct */ 0, 1, 0, 600280849Scy /* opt state flags */ STEPLIMIT_FLAGS, 0, 601280849Scy /* last opt argumnt */ { NULL }, /* --steplimit */ 602280849Scy /* arg list/cookie */ NULL, 603280849Scy /* must/cannot opts */ NULL, NULL, 604280849Scy /* option proc */ doOptSteplimit, 605280849Scy /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name, 606280849Scy /* disablement strs */ NULL, NULL }, 607280849Scy 608280849Scy { /* entry idx, value */ 12, VALUE_OPT_NTPVERSION, 609280849Scy /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION, 610280849Scy /* equivalenced to */ NO_EQUIVALENT, 611280849Scy /* min, max, act ct */ 0, 1, 0, 612280849Scy /* opt state flags */ NTPVERSION_FLAGS, 0, 613280849Scy /* last opt argumnt */ { NTPVERSION_DFT_ARG }, 614280849Scy /* arg list/cookie */ NULL, 615280849Scy /* must/cannot opts */ NULL, NULL, 616280849Scy /* option proc */ doOptNtpversion, 617280849Scy /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name, 618280849Scy /* disablement strs */ NULL, NULL }, 619280849Scy 620280849Scy { /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 621280849Scy /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 622280849Scy /* equivalenced to */ NO_EQUIVALENT, 623280849Scy /* min, max, act ct */ 0, 1, 0, 624280849Scy /* opt state flags */ USERESERVEDPORT_FLAGS, 0, 625280849Scy /* last opt argumnt */ { NULL }, /* --usereservedport */ 626280849Scy /* arg list/cookie */ NULL, 627280849Scy /* must/cannot opts */ NULL, NULL, 628181834Sroberto /* option proc */ NULL, 629280849Scy /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name, 630181834Sroberto /* disablement strs */ NULL, NULL }, 631181834Sroberto 632280849Scy { /* entry idx, value */ 14, VALUE_OPT_STEP, 633280849Scy /* equiv idx, value */ 14, VALUE_OPT_STEP, 634181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 635181834Sroberto /* min, max, act ct */ 0, 1, 0, 636280849Scy /* opt state flags */ STEP_FLAGS, 0, 637280849Scy /* last opt argumnt */ { NULL }, /* --step */ 638181834Sroberto /* arg list/cookie */ NULL, 639280849Scy /* must/cannot opts */ NULL, NULL, 640181834Sroberto /* option proc */ NULL, 641280849Scy /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name, 642181834Sroberto /* disablement strs */ NULL, NULL }, 643181834Sroberto 644280849Scy { /* entry idx, value */ 15, VALUE_OPT_SLEW, 645280849Scy /* equiv idx, value */ 15, VALUE_OPT_SLEW, 646181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 647181834Sroberto /* min, max, act ct */ 0, 1, 0, 648280849Scy /* opt state flags */ SLEW_FLAGS, 0, 649280849Scy /* last opt argumnt */ { NULL }, /* --slew */ 650181834Sroberto /* arg list/cookie */ NULL, 651280849Scy /* must/cannot opts */ NULL, NULL, 652181834Sroberto /* option proc */ NULL, 653280849Scy /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name, 654181834Sroberto /* disablement strs */ NULL, NULL }, 655181834Sroberto 656280849Scy { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT, 657280849Scy /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT, 658280849Scy /* equivalenced to */ NO_EQUIVALENT, 659280849Scy /* min, max, act ct */ 0, 1, 0, 660280849Scy /* opt state flags */ TIMEOUT_FLAGS, 0, 661280849Scy /* last opt argumnt */ { TIMEOUT_DFT_ARG }, 662280849Scy /* arg list/cookie */ NULL, 663280849Scy /* must/cannot opts */ NULL, NULL, 664280849Scy /* option proc */ optionNumericVal, 665280849Scy /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name, 666280849Scy /* disablement strs */ NULL, NULL }, 667181834Sroberto 668280849Scy { /* entry idx, value */ 17, VALUE_OPT_WAIT, 669280849Scy /* equiv idx, value */ 17, VALUE_OPT_WAIT, 670280849Scy /* equivalenced to */ NO_EQUIVALENT, 671280849Scy /* min, max, act ct */ 0, 1, 0, 672280849Scy /* opt state flags */ WAIT_FLAGS, 0, 673280849Scy /* last opt argumnt */ { NULL }, /* --wait */ 674280849Scy /* arg list/cookie */ NULL, 675280849Scy /* must/cannot opts */ NULL, NULL, 676280849Scy /* option proc */ NULL, 677280849Scy /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name, 678280849Scy /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX }, 679280849Scy 680181834Sroberto { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 681280849Scy /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 682181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 683181834Sroberto /* min, max, act ct */ 0, 1, 0, 684280849Scy /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 685181834Sroberto /* last opt argumnt */ { NULL }, 686181834Sroberto /* arg list/cookie */ NULL, 687181834Sroberto /* must/cannot opts */ NULL, NULL, 688280849Scy /* option proc */ VER_PROC, 689280849Scy /* desc, NAME, name */ VER_DESC, NULL, VER_name, 690181834Sroberto /* disablement strs */ NULL, NULL }, 691181834Sroberto 692181834Sroberto 693181834Sroberto 694181834Sroberto { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 695280849Scy /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 696181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 697181834Sroberto /* min, max, act ct */ 0, 1, 0, 698280849Scy /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 699181834Sroberto /* last opt argumnt */ { NULL }, 700181834Sroberto /* arg list/cookie */ NULL, 701181834Sroberto /* must/cannot opts */ NULL, NULL, 702181834Sroberto /* option proc */ doUsageOpt, 703280849Scy /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 704181834Sroberto /* disablement strs */ NULL, NULL }, 705181834Sroberto 706181834Sroberto { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 707280849Scy /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 708181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 709181834Sroberto /* min, max, act ct */ 0, 1, 0, 710280849Scy /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 711181834Sroberto /* last opt argumnt */ { NULL }, 712181834Sroberto /* arg list/cookie */ NULL, 713181834Sroberto /* must/cannot opts */ NULL, NULL, 714181834Sroberto /* option proc */ optionPagedUsage, 715280849Scy /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 716181834Sroberto /* disablement strs */ NULL, NULL }, 717181834Sroberto 718181834Sroberto { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, 719280849Scy /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, 720181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 721181834Sroberto /* min, max, act ct */ 0, 1, 0, 722181834Sroberto /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 723280849Scy | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, 724181834Sroberto /* last opt argumnt */ { NULL }, 725181834Sroberto /* arg list/cookie */ NULL, 726181834Sroberto /* must/cannot opts */ NULL, NULL, 727181834Sroberto /* option proc */ NULL, 728280849Scy /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, 729181834Sroberto /* disablement strs */ NULL, NULL }, 730181834Sroberto 731181834Sroberto { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, 732280849Scy /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, 733181834Sroberto /* equivalenced to */ NO_EQUIVALENT, 734181834Sroberto /* min, max, act ct */ 0, NOLIMIT, 0, 735280849Scy /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 736280849Scy | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, 737181834Sroberto /* last opt argumnt */ { NULL }, 738181834Sroberto /* arg list/cookie */ NULL, 739181834Sroberto /* must/cannot opts */ NULL, NULL, 740181834Sroberto /* option proc */ optionLoadOpt, 741280849Scy /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, 742280849Scy /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } 743181834Sroberto}; 744181834Sroberto 745181834Sroberto 746280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 747280849Scy/** Reference to the upper cased version of sntp. */ 748316722Sdelphij#define zPROGNAME (sntp_opt_strs+2322) 749280849Scy/** Reference to the title line for sntp usage. */ 750316722Sdelphij#define zUsageTitle (sntp_opt_strs+2327) 751280849Scy/** sntp configuration file name. */ 752316722Sdelphij#define zRcName (sntp_opt_strs+2495) 753280849Scy/** Directories to search for sntp config files. */ 754280849Scystatic char const * const apzHomeList[3] = { 755316722Sdelphij sntp_opt_strs+2487, 756316722Sdelphij sntp_opt_strs+2493, 757280849Scy NULL }; 758280849Scy/** The sntp program bug email address. */ 759316722Sdelphij#define zBugsAddr (sntp_opt_strs+2502) 760280849Scy/** Clarification/explanation of what sntp does. */ 761316722Sdelphij#define zExplain (sntp_opt_strs+2536) 762280849Scy/** Extra detail explaining what sntp does. */ 763280849Scy#define zDetail (NULL) 764280849Scy/** The full version string for sntp. */ 765316722Sdelphij#define zFullVersion (sntp_opt_strs+2538) 766280849Scy/* extracted from optcode.tlib near line 364 */ 767181834Sroberto 768181834Sroberto#if defined(ENABLE_NLS) 769181834Sroberto# define OPTPROC_BASE OPTPROC_TRANSLATE 770181834Sroberto static tOptionXlateProc translate_option_strings; 771181834Sroberto#else 772181834Sroberto# define OPTPROC_BASE OPTPROC_NONE 773181834Sroberto# define translate_option_strings NULL 774181834Sroberto#endif /* ENABLE_NLS */ 775181834Sroberto 776280849Scy#define sntp_full_usage (NULL) 777280849Scy#define sntp_short_usage (NULL) 778280849Scy 779280849Scy#endif /* not defined __doxygen__ */ 780280849Scy 781280849Scy/* 782280849Scy * Create the static procedure(s) declared above. 783280849Scy */ 784280849Scy/** 785280849Scy * The callout function that invokes the optionUsage function. 786280849Scy * 787280849Scy * @param[in] opts the AutoOpts option description structure 788280849Scy * @param[in] od the descriptor for the "help" (usage) option. 789280849Scy * @noreturn 790280849Scy */ 791280849Scystatic void 792280849ScydoUsageOpt(tOptions * opts, tOptDesc * od) 793280849Scy{ 794280849Scy int ex_code; 795280849Scy ex_code = SNTP_EXIT_SUCCESS; 796280849Scy optionUsage(&sntpOptions, ex_code); 797280849Scy /* NOTREACHED */ 798280849Scy exit(1); 799280849Scy (void)opts; 800280849Scy (void)od; 801280849Scy} 802280849Scy 803280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 804280849Scy/** 805280849Scy * Code to handle the debug-level option. 806280849Scy * 807280849Scy * @param[in] pOptions the sntp options data structure 808280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 809280849Scy */ 810280849Scystatic void 811280849ScydoOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 812280849Scy{ 813280849Scy /* 814280849Scy * Be sure the flag-code[0] handles special values for the options pointer 815280849Scy * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 816280849Scy * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 817280849Scy * reset its state. 818280849Scy */ 819280849Scy /* extracted from debug-opt.def, line 15 */ 820280849ScyOPT_VALUE_SET_DEBUG_LEVEL++; 821280849Scy (void)pOptDesc; 822280849Scy (void)pOptions; 823280849Scy} 824280849Scy 825280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 826280849Scy/** 827280849Scy * Code to handle the kod option. 828280849Scy * Specifies the filename to be used for the persistent history of KoD 829280849Scy * responses received from servers. If the file does not exist, a 830280849Scy * warning message will be displayed. The file will not be created. 831280849Scy * @param[in] pOptions the sntp options data structure 832280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 833280849Scy */ 834280849Scystatic void 835280849ScydoOptKod(tOptions* pOptions, tOptDesc* pOptDesc) 836280849Scy{ 837280849Scy static teOptFileType const type = 838280849Scy FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 839280849Scy static tuFileMode mode; 840280849Scy#ifndef O_CLOEXEC 841280849Scy# define O_CLOEXEC 0 842280849Scy#endif 843280849Scy mode.file_flags = O_CLOEXEC; 844280849Scy 845280849Scy /* 846280849Scy * This function handles special invalid values for "pOptions" 847280849Scy */ 848280849Scy optionFileCheck(pOptions, pOptDesc, type, mode); 849280849Scy} 850280849Scy 851280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 852280849Scy/** 853280849Scy * Code to handle the keyfile option. 854280849Scy * This option specifies the keyfile. 855280849Scy * @code{sntp} will search for the key specified with @option{-a} 856280849Scy * @file{keyno} in this file. See @command{ntp.keys(5)} for more 857280849Scy * information. 858280849Scy * @param[in] pOptions the sntp options data structure 859280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 860280849Scy */ 861280849Scystatic void 862280849ScydoOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc) 863280849Scy{ 864280849Scy static teOptFileType const type = 865280849Scy FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 866280849Scy static tuFileMode mode; 867280849Scy#ifndef O_CLOEXEC 868280849Scy# define O_CLOEXEC 0 869280849Scy#endif 870280849Scy mode.file_flags = O_CLOEXEC; 871280849Scy 872280849Scy /* 873280849Scy * This function handles special invalid values for "pOptions" 874280849Scy */ 875280849Scy optionFileCheck(pOptions, pOptDesc, type, mode); 876280849Scy} 877280849Scy 878280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 879280849Scy/** 880280849Scy * Code to handle the logfile option. 881280849Scy * This option causes the client to write log messages to the specified 882280849Scy * @file{logfile}. 883280849Scy * @param[in] pOptions the sntp options data structure 884280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 885280849Scy */ 886280849Scystatic void 887280849ScydoOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc) 888280849Scy{ 889280849Scy static teOptFileType const type = 890280849Scy FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 891280849Scy static tuFileMode mode; 892280849Scy#ifndef O_CLOEXEC 893280849Scy# define O_CLOEXEC 0 894280849Scy#endif 895280849Scy mode.file_flags = O_CLOEXEC; 896280849Scy 897280849Scy /* 898280849Scy * This function handles special invalid values for "pOptions" 899280849Scy */ 900280849Scy optionFileCheck(pOptions, pOptDesc, type, mode); 901280849Scy} 902280849Scy 903280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 904280849Scy/** 905280849Scy * Code to handle the steplimit option. 906280849Scy * If the time adjustment is less than @file{steplimit} milliseconds, 907280849Scy * slew the amount using @command{adjtime(2)}. Otherwise, step the 908280849Scy * correction using @command{settimeofday(2)}. The default value is 0, 909280849Scy * which means all adjustments will be stepped. This is a feature, as 910280849Scy * different situations demand different values. 911280849Scy * @param[in] pOptions the sntp options data structure 912280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 913280849Scy */ 914280849Scystatic void 915280849ScydoOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc) 916280849Scy{ 917280849Scy static struct {long rmin, rmax;} const rng[1] = { 918280849Scy { 0, LONG_MAX } }; 919280849Scy int ix; 920280849Scy 921280849Scy if (pOptions <= OPTPROC_EMIT_LIMIT) 922280849Scy goto emit_ranges; 923280849Scy optionNumericVal(pOptions, pOptDesc); 924280849Scy 925280849Scy for (ix = 0; ix < 1; ix++) { 926280849Scy if (pOptDesc->optArg.argInt < rng[ix].rmin) 927280849Scy continue; /* ranges need not be ordered. */ 928280849Scy if (pOptDesc->optArg.argInt == rng[ix].rmin) 929280849Scy return; 930280849Scy if (rng[ix].rmax == LONG_MIN) 931280849Scy continue; 932280849Scy if (pOptDesc->optArg.argInt <= rng[ix].rmax) 933280849Scy return; 934280849Scy } 935280849Scy 936280849Scy option_usage_fp = stderr; 937280849Scy 938280849Scy emit_ranges: 939285169ScyoptionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 940280849Scy} 941280849Scy 942280849Scy/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 943280849Scy/** 944280849Scy * Code to handle the ntpversion option. 945280849Scy * When sending requests to a remote server, tell them we are running 946280849Scy * NTP protocol version @file{ntpversion} . 947280849Scy * @param[in] pOptions the sntp options data structure 948280849Scy * @param[in,out] pOptDesc the option descriptor for this option. 949280849Scy */ 950280849Scystatic void 951280849ScydoOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc) 952280849Scy{ 953280849Scy static struct {long rmin, rmax;} const rng[1] = { 954280849Scy { 0, 7 } }; 955280849Scy int ix; 956280849Scy 957280849Scy if (pOptions <= OPTPROC_EMIT_LIMIT) 958280849Scy goto emit_ranges; 959280849Scy optionNumericVal(pOptions, pOptDesc); 960280849Scy 961280849Scy for (ix = 0; ix < 1; ix++) { 962280849Scy if (pOptDesc->optArg.argInt < rng[ix].rmin) 963280849Scy continue; /* ranges need not be ordered. */ 964280849Scy if (pOptDesc->optArg.argInt == rng[ix].rmin) 965280849Scy return; 966280849Scy if (rng[ix].rmax == LONG_MIN) 967280849Scy continue; 968280849Scy if (pOptDesc->optArg.argInt <= rng[ix].rmax) 969280849Scy return; 970280849Scy } 971280849Scy 972280849Scy option_usage_fp = stderr; 973280849Scy 974280849Scy emit_ranges: 975285169ScyoptionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 976280849Scy} 977285169Scy/* extracted from optmain.tlib near line 1250 */ 978280849Scy 979280849Scy/** 980280849Scy * The directory containing the data associated with sntp. 981280849Scy */ 982280849Scy#ifndef PKGDATADIR 983280849Scy# define PKGDATADIR "" 984280849Scy#endif 985280849Scy 986280849Scy/** 987280849Scy * Information about the person or institution that packaged sntp 988280849Scy * for the current distribution. 989280849Scy */ 990280849Scy#ifndef WITH_PACKAGER 991280849Scy# define sntp_packager_info NULL 992280849Scy#else 993280849Scy/** Packager information for sntp. */ 994280849Scystatic char const sntp_packager_info[] = 995280849Scy "Packaged by " WITH_PACKAGER 996280849Scy 997280849Scy# ifdef WITH_PACKAGER_VERSION 998280849Scy " ("WITH_PACKAGER_VERSION")" 999280849Scy# endif 1000280849Scy 1001280849Scy# ifdef WITH_PACKAGER_BUG_REPORTS 1002280849Scy "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS 1003280849Scy# endif 1004280849Scy "\n"; 1005280849Scy#endif 1006280849Scy#ifndef __doxygen__ 1007280849Scy 1008280849Scy#endif /* __doxygen__ */ 1009280849Scy/** 1010280849Scy * The option definitions for sntp. The one structure that 1011280849Scy * binds them all. 1012280849Scy */ 1013181834SrobertotOptions sntpOptions = { 1014181834Sroberto OPTIONS_STRUCT_VERSION, 1015181834Sroberto 0, NULL, /* original argc + argv */ 1016181834Sroberto ( OPTPROC_BASE 1017181834Sroberto + OPTPROC_ERRSTOP 1018181834Sroberto + OPTPROC_SHORTOPT 1019181834Sroberto + OPTPROC_LONGOPT 1020181834Sroberto + OPTPROC_NO_REQ_OPT 1021280849Scy + OPTPROC_NEGATIONS 1022181834Sroberto + OPTPROC_ENVIRON 1023280849Scy + OPTPROC_MISUSE ), 1024181834Sroberto 0, NULL, /* current option index, current option */ 1025181834Sroberto NULL, NULL, zPROGNAME, 1026280849Scy zRcName, zCopyright, zLicenseDescrip, 1027181834Sroberto zFullVersion, apzHomeList, zUsageTitle, 1028181834Sroberto zExplain, zDetail, optDesc, 1029181834Sroberto zBugsAddr, /* address to send bugs to */ 1030181834Sroberto NULL, NULL, /* extensions/saved state */ 1031280849Scy optionUsage, /* usage procedure */ 1032181834Sroberto translate_option_strings, /* translation procedure */ 1033181834Sroberto /* 1034181834Sroberto * Indexes to special options 1035181834Sroberto */ 1036280849Scy { INDEX_OPT_MORE_HELP, /* more-help option index */ 1037280849Scy INDEX_OPT_SAVE_OPTS, /* save option index */ 1038280849Scy NO_EQUIVALENT, /* '-#' option index */ 1039181834Sroberto NO_EQUIVALENT /* index of default opt */ 1040181834Sroberto }, 1041280849Scy 23 /* full option count */, 18 /* user option count */, 1042280849Scy sntp_full_usage, sntp_short_usage, 1043280849Scy NULL, NULL, 1044280849Scy PKGDATADIR, sntp_packager_info 1045181834Sroberto}; 1046181834Sroberto 1047280849Scy#if ENABLE_NLS 1048280849Scy/** 1049280849Scy * This code is designed to translate translatable option text for the 1050280849Scy * sntp program. These translations happen upon entry 1051280849Scy * to optionProcess(). 1052181834Sroberto */ 1053181834Sroberto#include <stdio.h> 1054181834Sroberto#include <stdlib.h> 1055181834Sroberto#include <string.h> 1056181834Sroberto#include <unistd.h> 1057280849Scy#ifdef HAVE_DCGETTEXT 1058280849Scy# include <gettext.h> 1059280849Scy#endif 1060181834Sroberto#include <autoopts/usage-txt.h> 1061181834Sroberto 1062280849Scystatic char * AO_gettext(char const * pz); 1063280849Scystatic void coerce_it(void ** s); 1064181834Sroberto 1065280849Scy/** 1066280849Scy * AutoGen specific wrapper function for gettext. It relies on the macro _() 1067280849Scy * to convert from English to the target language, then strdup-duplicates the 1068280849Scy * result string. It tries the "libopts" domain first, then whatever has been 1069280849Scy * set via the \a textdomain(3) call. 1070280849Scy * 1071280849Scy * @param[in] pz the input text used as a lookup key. 1072280849Scy * @returns the translated text (if there is one), 1073280849Scy * or the original text (if not). 1074280849Scy */ 1075280849Scystatic char * 1076280849ScyAO_gettext(char const * pz) 1077181834Sroberto{ 1078280849Scy char * res; 1079181834Sroberto if (pz == NULL) 1080181834Sroberto return NULL; 1081280849Scy#ifdef HAVE_DCGETTEXT 1082280849Scy /* 1083280849Scy * While processing the option_xlateable_txt data, try to use the 1084280849Scy * "libopts" domain. Once we switch to the option descriptor data, 1085280849Scy * do *not* use that domain. 1086280849Scy */ 1087280849Scy if (option_xlateable_txt.field_ct != 0) { 1088280849Scy res = dgettext("libopts", pz); 1089280849Scy if (res == pz) 1090285169Scy res = (char *)VOIDP(_(pz)); 1091280849Scy } else 1092285169Scy res = (char *)VOIDP(_(pz)); 1093280849Scy#else 1094285169Scy res = (char *)VOIDP(_(pz)); 1095280849Scy#endif 1096280849Scy if (res == pz) 1097280849Scy return res; 1098280849Scy res = strdup(res); 1099280849Scy if (res == NULL) { 1100280849Scy fputs(_("No memory for duping translated strings\n"), stderr); 1101280849Scy exit(SNTP_EXIT_FAILURE); 1102181834Sroberto } 1103280849Scy return res; 1104181834Sroberto} 1105181834Sroberto 1106280849Scy/** 1107280849Scy * All the pointers we use are marked "* const", but they are stored in 1108280849Scy * writable memory. Coerce the mutability and set the pointer. 1109280849Scy */ 1110280849Scystatic void coerce_it(void ** s) { *s = AO_gettext(*s); 1111280849Scy} 1112181834Sroberto 1113280849Scy/** 1114280849Scy * Translate all the translatable strings in the sntpOptions 1115280849Scy * structure defined above. This is done only once. 1116181834Sroberto */ 1117181834Srobertostatic void 1118280849Scytranslate_option_strings(void) 1119181834Sroberto{ 1120280849Scy tOptions * const opts = &sntpOptions; 1121280849Scy 1122181834Sroberto /* 1123181834Sroberto * Guard against re-translation. It won't work. The strings will have 1124181834Sroberto * been changed by the first pass through this code. One shot only. 1125181834Sroberto */ 1126280849Scy if (option_xlateable_txt.field_ct != 0) { 1127280849Scy /* 1128280849Scy * Do the translations. The first pointer follows the field count 1129280849Scy * field. The field count field is the size of a pointer. 1130280849Scy */ 1131285169Scy char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); 1132280849Scy int ix = option_xlateable_txt.field_ct; 1133181834Sroberto 1134181834Sroberto do { 1135280849Scy ppz++; /* skip over field_ct */ 1136181834Sroberto *ppz = AO_gettext(*ppz); 1137181834Sroberto } while (--ix > 0); 1138280849Scy /* prevent re-translation and disable "libopts" domain lookup */ 1139280849Scy option_xlateable_txt.field_ct = 0; 1140181834Sroberto 1141285169Scy coerce_it(VOIDP(&(opts->pzCopyright))); 1142285169Scy coerce_it(VOIDP(&(opts->pzCopyNotice))); 1143285169Scy coerce_it(VOIDP(&(opts->pzFullVersion))); 1144285169Scy coerce_it(VOIDP(&(opts->pzUsageTitle))); 1145285169Scy coerce_it(VOIDP(&(opts->pzExplain))); 1146285169Scy coerce_it(VOIDP(&(opts->pzDetail))); 1147280849Scy { 1148280849Scy tOptDesc * od = opts->pOptDesc; 1149280849Scy for (ix = opts->optCt; ix > 0; ix--, od++) 1150285169Scy coerce_it(VOIDP(&(od->pzText))); 1151181834Sroberto } 1152181834Sroberto } 1153181834Sroberto} 1154181834Sroberto#endif /* ENABLE_NLS */ 1155181834Sroberto 1156280849Scy#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 1157280849Scy/** I18N function strictly for xgettext. Do not compile. */ 1158280849Scystatic void bogus_function(void) { 1159280849Scy /* TRANSLATORS: 1160280849Scy 1161280849Scy The following dummy function was crated solely so that xgettext can 1162280849Scy extract the correct strings. These strings are actually referenced 1163280849Scy by a field name in the sntpOptions structure noted in the 1164280849Scy comments below. The literal text is defined in sntp_opt_strs. 1165280849Scy 1166280849Scy NOTE: the strings below are segmented with respect to the source string 1167280849Scy sntp_opt_strs. The strings above are handed off for translation 1168280849Scy at run time a paragraph at a time. Consequently, they are presented here 1169280849Scy for translation a paragraph at a time. 1170280849Scy 1171280849Scy ALSO: often the description for an option will reference another option 1172280849Scy by name. These are set off with apostrophe quotes (I hope). Do not 1173280849Scy translate option names. 1174280849Scy */ 1175280849Scy /* referenced via sntpOptions.pzCopyright */ 1176316722Sdelphij puts(_("sntp 4.2.8p10\n\ 1177316722SdelphijCopyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\ 1178280849ScyThis is free software. It is licensed for use, modification and\n\ 1179280849Scyredistribution under the terms of the NTP License, copies of which\n\ 1180280849Scycan be seen at:\n")); 1181280849Scy puts(_(" <http://ntp.org/license>\n\ 1182280849Scy <http://opensource.org/licenses/ntp-license.php>\n")); 1183280849Scy 1184280849Scy /* referenced via sntpOptions.pzCopyNotice */ 1185280849Scy puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 1186280849Scydocumentation for any purpose with or without fee is hereby granted,\n\ 1187280849Scyprovided that the above copyright notice appears in all copies and that\n\ 1188280849Scyboth the copyright notice and this permission notice appear in supporting\n\ 1189280849Scydocumentation, and that the name The University of Delaware not be used in\n\ 1190280849Scyadvertising or publicity pertaining to distribution of the software without\n\ 1191280849Scyspecific, written prior permission. The University of Delaware and Network\n\ 1192280849ScyTime Foundation makes no representations about the suitability this\n\ 1193280849Scysoftware for any purpose. It is provided \"as is\" without express or\n\ 1194280849Scyimplied warranty.\n")); 1195280849Scy 1196280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1197280849Scy puts(_("Force IPv4 DNS name resolution")); 1198280849Scy 1199280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1200280849Scy puts(_("Force IPv6 DNS name resolution")); 1201280849Scy 1202280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1203280849Scy puts(_("Enable authentication with the key auth-keynumber")); 1204280849Scy 1205280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1206280849Scy puts(_("Listen to the address specified for broadcast time sync")); 1207280849Scy 1208280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1209280849Scy puts(_("Concurrently query all IPs returned for host-name")); 1210280849Scy 1211280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1212280849Scy puts(_("Increase debug verbosity level")); 1213280849Scy 1214280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1215280849Scy puts(_("Set the debug verbosity level")); 1216280849Scy 1217280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1218280849Scy puts(_("The gap (in milliseconds) between time requests")); 1219280849Scy 1220280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1221280849Scy puts(_("KoD history filename")); 1222280849Scy 1223280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1224280849Scy puts(_("Look in this file for the key specified with -a")); 1225280849Scy 1226280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1227280849Scy puts(_("Log to specified logfile")); 1228280849Scy 1229280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1230280849Scy puts(_("Adjustments less than steplimit msec will be slewed")); 1231280849Scy 1232280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1233280849Scy puts(_("Send int as our NTP protocol version")); 1234280849Scy 1235280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1236280849Scy puts(_("Use the NTP Reserved Port (port 123)")); 1237280849Scy 1238280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1239280849Scy puts(_("OK to 'step' the time with settimeofday(2)")); 1240280849Scy 1241280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1242280849Scy puts(_("OK to 'slew' the time with adjtime(2)")); 1243280849Scy 1244280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1245280849Scy puts(_("The number of seconds to wait for responses")); 1246280849Scy 1247280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1248280849Scy puts(_("Wait for pending replies (if not setting the time)")); 1249280849Scy 1250280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1251280849Scy puts(_("display extended usage information and exit")); 1252280849Scy 1253280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1254280849Scy puts(_("extended usage information passed thru pager")); 1255280849Scy 1256280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1257280849Scy puts(_("output version information and exit")); 1258280849Scy 1259280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1260280849Scy puts(_("save the option state to a config file")); 1261280849Scy 1262280849Scy /* referenced via sntpOptions.pOptDesc->pzText */ 1263280849Scy puts(_("load options from a config file")); 1264280849Scy 1265280849Scy /* referenced via sntpOptions.pzUsageTitle */ 1266316722Sdelphij puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p10\n\ 1267280849ScyUsage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ 1268280849Scy\t\t[ hostname-or-IP ...]\n")); 1269280849Scy 1270280849Scy /* referenced via sntpOptions.pzExplain */ 1271280849Scy puts(_("\n")); 1272280849Scy 1273280849Scy /* referenced via sntpOptions.pzFullVersion */ 1274316722Sdelphij puts(_("sntp 4.2.8p10")); 1275280849Scy 1276280849Scy /* referenced via sntpOptions.pzFullUsage */ 1277280849Scy puts(_("<<<NOT-FOUND>>>")); 1278280849Scy 1279280849Scy /* referenced via sntpOptions.pzShortUsage */ 1280280849Scy puts(_("<<<NOT-FOUND>>>")); 1281280849Scy /* LIBOPTS-MESSAGES: */ 1282280849Scy#line 67 "../autoopts.c" 1283280849Scy puts(_("allocation of %d bytes failed\n")); 1284280849Scy#line 93 "../autoopts.c" 1285280849Scy puts(_("allocation of %d bytes failed\n")); 1286280849Scy#line 53 "../init.c" 1287280849Scy puts(_("AutoOpts function called without option descriptor\n")); 1288280849Scy#line 86 "../init.c" 1289280849Scy puts(_("\tThis exceeds the compiled library version: ")); 1290280849Scy#line 84 "../init.c" 1291280849Scy puts(_("Automated Options Processing Error!\n" 1292280849Scy "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 1293280849Scy#line 80 "../autoopts.c" 1294280849Scy puts(_("realloc of %d bytes at 0x%p failed\n")); 1295280849Scy#line 88 "../init.c" 1296280849Scy puts(_("\tThis is less than the minimum library version: ")); 1297280849Scy#line 121 "../version.c" 1298280849Scy puts(_("Automated Options version %s\n" 1299280849Scy "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); 1300285169Scy#line 87 "../makeshell.c" 1301280849Scy puts(_("(AutoOpts bug): %s.\n")); 1302280849Scy#line 90 "../reset.c" 1303280849Scy puts(_("optionResetOpt() called, but reset-option not configured")); 1304280849Scy#line 292 "../usage.c" 1305280849Scy puts(_("could not locate the 'help' option")); 1306280849Scy#line 336 "../autoopts.c" 1307280849Scy puts(_("optionProcess() was called with invalid data")); 1308280849Scy#line 748 "../usage.c" 1309280849Scy puts(_("invalid argument type specified")); 1310280849Scy#line 598 "../find.c" 1311280849Scy puts(_("defaulted to option with optional arg")); 1312280849Scy#line 76 "../alias.c" 1313280849Scy puts(_("aliasing option is out of range.")); 1314280849Scy#line 234 "../enum.c" 1315280849Scy puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 1316280849Scy#line 108 "../find.c" 1317280849Scy puts(_(" The following options match:\n")); 1318280849Scy#line 293 "../find.c" 1319280849Scy puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 1320280849Scy#line 161 "../check.c" 1321280849Scy puts(_("%s: Command line arguments required\n")); 1322280849Scy#line 43 "../alias.c" 1323280849Scy puts(_("%d %s%s options allowed\n")); 1324285169Scy#line 94 "../makeshell.c" 1325280849Scy puts(_("%s error %d (%s) calling %s for '%s'\n")); 1326285169Scy#line 306 "../makeshell.c" 1327280849Scy puts(_("interprocess pipe")); 1328280849Scy#line 168 "../version.c" 1329280849Scy puts(_("error: version option argument '%c' invalid. Use:\n" 1330280849Scy "\t'v' - version only\n" 1331280849Scy "\t'c' - version and copyright\n" 1332280849Scy "\t'n' - version and full copyright notice\n")); 1333280849Scy#line 58 "../check.c" 1334280849Scy puts(_("%s error: the '%s' and '%s' options conflict\n")); 1335280849Scy#line 217 "../find.c" 1336280849Scy puts(_("%s: The '%s' option has been disabled.")); 1337280849Scy#line 430 "../find.c" 1338280849Scy puts(_("%s: The '%s' option has been disabled.")); 1339280849Scy#line 38 "../alias.c" 1340280849Scy puts(_("-equivalence")); 1341280849Scy#line 469 "../find.c" 1342280849Scy puts(_("%s: illegal option -- %c\n")); 1343280849Scy#line 110 "../reset.c" 1344280849Scy puts(_("%s: illegal option -- %c\n")); 1345280849Scy#line 271 "../find.c" 1346280849Scy puts(_("%s: illegal option -- %s\n")); 1347280849Scy#line 755 "../find.c" 1348280849Scy puts(_("%s: illegal option -- %s\n")); 1349280849Scy#line 118 "../reset.c" 1350280849Scy puts(_("%s: illegal option -- %s\n")); 1351280849Scy#line 335 "../find.c" 1352280849Scy puts(_("%s: unknown vendor extension option -- %s\n")); 1353280849Scy#line 159 "../enum.c" 1354280849Scy puts(_(" or an integer from %d through %d\n")); 1355280849Scy#line 169 "../enum.c" 1356280849Scy puts(_(" or an integer from %d through %d\n")); 1357280849Scy#line 747 "../usage.c" 1358280849Scy puts(_("%s error: invalid option descriptor for %s\n")); 1359280849Scy#line 1081 "../usage.c" 1360280849Scy puts(_("%s error: invalid option descriptor for %s\n")); 1361280849Scy#line 385 "../find.c" 1362280849Scy puts(_("%s: invalid option name: %s\n")); 1363280849Scy#line 527 "../find.c" 1364280849Scy puts(_("%s: The '%s' option requires an argument.\n")); 1365280849Scy#line 156 "../autoopts.c" 1366280849Scy puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 1367280849Scy "\t'%s' and '%s'.")); 1368280849Scy#line 94 "../check.c" 1369280849Scy puts(_("%s error: The %s option is required\n")); 1370280849Scy#line 632 "../find.c" 1371280849Scy puts(_("%s: The '%s' option cannot have an argument.\n")); 1372280849Scy#line 151 "../check.c" 1373280849Scy puts(_("%s: Command line arguments are not allowed.\n")); 1374280849Scy#line 535 "../save.c" 1375280849Scy puts(_("error %d (%s) creating %s\n")); 1376280849Scy#line 234 "../enum.c" 1377280849Scy puts(_("%s error: '%s' does not match any %s keywords.\n")); 1378280849Scy#line 93 "../reset.c" 1379280849Scy puts(_("%s error: The '%s' option requires an argument.\n")); 1380280849Scy#line 184 "../save.c" 1381280849Scy puts(_("error %d (%s) stat-ing %s\n")); 1382280849Scy#line 238 "../save.c" 1383280849Scy puts(_("error %d (%s) stat-ing %s\n")); 1384280849Scy#line 143 "../restore.c" 1385280849Scy puts(_("%s error: no saved option state\n")); 1386280849Scy#line 231 "../autoopts.c" 1387280849Scy puts(_("'%s' is not a command line option.\n")); 1388280849Scy#line 111 "../time.c" 1389280849Scy puts(_("%s error: '%s' is not a recognizable date/time.\n")); 1390280849Scy#line 132 "../save.c" 1391280849Scy puts(_("'%s' not defined\n")); 1392280849Scy#line 50 "../time.c" 1393280849Scy puts(_("%s error: '%s' is not a recognizable time duration.\n")); 1394280849Scy#line 92 "../check.c" 1395280849Scy puts(_("%s error: The %s option must appear %d times.\n")); 1396280849Scy#line 164 "../numeric.c" 1397280849Scy puts(_("%s error: '%s' is not a recognizable number.\n")); 1398280849Scy#line 200 "../enum.c" 1399280849Scy puts(_("%s error: %s exceeds %s keyword count\n")); 1400280849Scy#line 330 "../usage.c" 1401280849Scy puts(_("Try '%s %s' for more information.\n")); 1402280849Scy#line 45 "../alias.c" 1403280849Scy puts(_("one %s%s option allowed\n")); 1404285169Scy#line 208 "../makeshell.c" 1405280849Scy puts(_("standard output")); 1406285169Scy#line 943 "../makeshell.c" 1407280849Scy puts(_("standard output")); 1408280849Scy#line 274 "../usage.c" 1409280849Scy puts(_("standard output")); 1410280849Scy#line 415 "../usage.c" 1411280849Scy puts(_("standard output")); 1412280849Scy#line 625 "../usage.c" 1413280849Scy puts(_("standard output")); 1414280849Scy#line 175 "../version.c" 1415280849Scy puts(_("standard output")); 1416280849Scy#line 274 "../usage.c" 1417280849Scy puts(_("standard error")); 1418280849Scy#line 415 "../usage.c" 1419280849Scy puts(_("standard error")); 1420280849Scy#line 625 "../usage.c" 1421280849Scy puts(_("standard error")); 1422280849Scy#line 175 "../version.c" 1423280849Scy puts(_("standard error")); 1424285169Scy#line 208 "../makeshell.c" 1425280849Scy puts(_("write")); 1426285169Scy#line 943 "../makeshell.c" 1427280849Scy puts(_("write")); 1428280849Scy#line 273 "../usage.c" 1429280849Scy puts(_("write")); 1430280849Scy#line 414 "../usage.c" 1431280849Scy puts(_("write")); 1432280849Scy#line 624 "../usage.c" 1433280849Scy puts(_("write")); 1434280849Scy#line 174 "../version.c" 1435280849Scy puts(_("write")); 1436280849Scy#line 60 "../numeric.c" 1437280849Scy puts(_("%s error: %s option value %ld is out of range.\n")); 1438280849Scy#line 44 "../check.c" 1439280849Scy puts(_("%s error: %s option requires the %s option\n")); 1440280849Scy#line 131 "../save.c" 1441280849Scy puts(_("%s warning: cannot save options - %s not regular file\n")); 1442280849Scy#line 183 "../save.c" 1443280849Scy puts(_("%s warning: cannot save options - %s not regular file\n")); 1444280849Scy#line 237 "../save.c" 1445280849Scy puts(_("%s warning: cannot save options - %s not regular file\n")); 1446280849Scy#line 256 "../save.c" 1447280849Scy puts(_("%s warning: cannot save options - %s not regular file\n")); 1448280849Scy#line 534 "../save.c" 1449280849Scy puts(_("%s warning: cannot save options - %s not regular file\n")); 1450280849Scy /* END-LIBOPTS-MESSAGES */ 1451280849Scy 1452280849Scy /* USAGE-TEXT: */ 1453280849Scy#line 873 "../usage.c" 1454280849Scy puts(_("\t\t\t\t- an alternate for '%s'\n")); 1455280849Scy#line 1148 "../usage.c" 1456280849Scy puts(_("Version, usage and configuration options:")); 1457280849Scy#line 924 "../usage.c" 1458280849Scy puts(_("\t\t\t\t- default option for unnamed options\n")); 1459280849Scy#line 837 "../usage.c" 1460280849Scy puts(_("\t\t\t\t- disabled as '--%s'\n")); 1461280849Scy#line 1117 "../usage.c" 1462280849Scy puts(_(" --- %-14s %s\n")); 1463280849Scy#line 1115 "../usage.c" 1464280849Scy puts(_("This option has been disabled")); 1465280849Scy#line 864 "../usage.c" 1466280849Scy puts(_("\t\t\t\t- enabled by default\n")); 1467280849Scy#line 40 "../alias.c" 1468280849Scy puts(_("%s error: only ")); 1469280849Scy#line 1194 "../usage.c" 1470280849Scy puts(_(" - examining environment variables named %s_*\n")); 1471280849Scy#line 168 "../file.c" 1472280849Scy puts(_("\t\t\t\t- file must not pre-exist\n")); 1473280849Scy#line 172 "../file.c" 1474280849Scy puts(_("\t\t\t\t- file must pre-exist\n")); 1475280849Scy#line 380 "../usage.c" 1476280849Scy puts(_("Options are specified by doubled hyphens and their name or by a single\n" 1477280849Scy "hyphen and the flag character.\n")); 1478285169Scy#line 921 "../makeshell.c" 1479280849Scy puts(_("\n" 1480280849Scy "= = = = = = = =\n\n" 1481280849Scy "This incarnation of genshell will produce\n" 1482280849Scy "a shell script to parse the options for %s:\n\n")); 1483280849Scy#line 166 "../enum.c" 1484280849Scy puts(_(" or an integer mask with any of the lower %d bits set\n")); 1485280849Scy#line 897 "../usage.c" 1486280849Scy puts(_("\t\t\t\t- is a set membership option\n")); 1487280849Scy#line 918 "../usage.c" 1488280849Scy puts(_("\t\t\t\t- must appear between %d and %d times\n")); 1489280849Scy#line 382 "../usage.c" 1490280849Scy puts(_("Options are specified by single or double hyphens and their name.\n")); 1491280849Scy#line 904 "../usage.c" 1492280849Scy puts(_("\t\t\t\t- may appear multiple times\n")); 1493280849Scy#line 891 "../usage.c" 1494280849Scy puts(_("\t\t\t\t- may not be preset\n")); 1495280849Scy#line 1309 "../usage.c" 1496280849Scy puts(_(" Arg Option-Name Description\n")); 1497280849Scy#line 1245 "../usage.c" 1498280849Scy puts(_(" Flg Arg Option-Name Description\n")); 1499280849Scy#line 1303 "../usage.c" 1500280849Scy puts(_(" Flg Arg Option-Name Description\n")); 1501280849Scy#line 1304 "../usage.c" 1502280849Scy puts(_(" %3s %s")); 1503280849Scy#line 1310 "../usage.c" 1504280849Scy puts(_(" %3s %s")); 1505280849Scy#line 387 "../usage.c" 1506280849Scy puts(_("The '-#<number>' option may omit the hash char\n")); 1507280849Scy#line 383 "../usage.c" 1508280849Scy puts(_("All arguments are named options.\n")); 1509280849Scy#line 971 "../usage.c" 1510280849Scy puts(_(" - reading file %s")); 1511280849Scy#line 409 "../usage.c" 1512280849Scy puts(_("\n" 1513280849Scy "Please send bug reports to: <%s>\n")); 1514280849Scy#line 100 "../version.c" 1515280849Scy puts(_("\n" 1516280849Scy "Please send bug reports to: <%s>\n")); 1517280849Scy#line 129 "../version.c" 1518280849Scy puts(_("\n" 1519280849Scy "Please send bug reports to: <%s>\n")); 1520280849Scy#line 903 "../usage.c" 1521280849Scy puts(_("\t\t\t\t- may NOT appear - preset only\n")); 1522280849Scy#line 944 "../usage.c" 1523280849Scy puts(_("\n" 1524280849Scy "The following option preset mechanisms are supported:\n")); 1525280849Scy#line 1192 "../usage.c" 1526280849Scy puts(_("\n" 1527280849Scy "The following option preset mechanisms are supported:\n")); 1528280849Scy#line 682 "../usage.c" 1529280849Scy puts(_("prohibits these options:\n")); 1530280849Scy#line 677 "../usage.c" 1531280849Scy puts(_("prohibits the option '%s'\n")); 1532280849Scy#line 81 "../numeric.c" 1533280849Scy puts(_("%s%ld to %ld")); 1534280849Scy#line 79 "../numeric.c" 1535280849Scy puts(_("%sgreater than or equal to %ld")); 1536280849Scy#line 75 "../numeric.c" 1537280849Scy puts(_("%s%ld exactly")); 1538280849Scy#line 68 "../numeric.c" 1539280849Scy puts(_("%sit must lie in one of the ranges:\n")); 1540280849Scy#line 68 "../numeric.c" 1541280849Scy puts(_("%sit must be in the range:\n")); 1542280849Scy#line 88 "../numeric.c" 1543280849Scy puts(_(", or\n")); 1544280849Scy#line 66 "../numeric.c" 1545280849Scy puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 1546280849Scy#line 77 "../numeric.c" 1547280849Scy puts(_("%sless than or equal to %ld")); 1548280849Scy#line 390 "../usage.c" 1549280849Scy puts(_("Operands and options may be intermixed. They will be reordered.\n")); 1550280849Scy#line 652 "../usage.c" 1551280849Scy puts(_("requires the option '%s'\n")); 1552280849Scy#line 655 "../usage.c" 1553280849Scy puts(_("requires these options:\n")); 1554280849Scy#line 1321 "../usage.c" 1555280849Scy puts(_(" Arg Option-Name Req? Description\n")); 1556280849Scy#line 1315 "../usage.c" 1557280849Scy puts(_(" Flg Arg Option-Name Req? Description\n")); 1558280849Scy#line 167 "../enum.c" 1559280849Scy puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 1560280849Scy "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 1561280849Scy "will set them all. Multiple entries may be passed as an option\n" 1562280849Scy "argument list.\n")); 1563280849Scy#line 910 "../usage.c" 1564280849Scy puts(_("\t\t\t\t- may appear up to %d times\n")); 1565280849Scy#line 77 "../enum.c" 1566280849Scy puts(_("The valid \"%s\" option keywords are:\n")); 1567280849Scy#line 1152 "../usage.c" 1568280849Scy puts(_("The next option supports vendor supported extra options:")); 1569280849Scy#line 773 "../usage.c" 1570280849Scy puts(_("These additional options are:")); 1571280849Scy /* END-USAGE-TEXT */ 1572280849Scy} 1573280849Scy#endif /* uncompilable code */ 1574181834Sroberto#ifdef __cplusplus 1575181834Sroberto} 1576181834Sroberto#endif 1577181834Sroberto/* sntp-opts.c ends here */ 1578