From: Harlan Stenn Date: Sun, 12 Aug 2012 04:33:15 +0000 (+0000) Subject: Upgrade to autogen-5.16.2 and libopts-36.5.11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0bab9464bb1523a96094ae0ca87fa80a877cf64;p=thirdparty%2Fntp.git Upgrade to autogen-5.16.2 and libopts-36.5.11 bk: 5027320bUSXpebzr4AxcdfgowFNU1g --- diff --git a/ChangeLog b/ChangeLog index 1e5cbf433a..814179ce8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -* Upgrade to autogen-5.16.2 and libopts-36.4.11. +* Upgrade to autogen-5.16.2 and libopts-36.5.11. (4.2.7p295) 2012/08/11 Released by Harlan Stenn * Look for syslog's facilitynames[]. (4.2.7p294) 2012/08/08 Released by Harlan Stenn diff --git a/ntpd/invoke-ntpd.texi b/ntpd/invoke-ntpd.texi index 89dc8cfa35..8ecb6195cd 100644 --- a/ntpd/invoke-ntpd.texi +++ b/ntpd/invoke-ntpd.texi @@ -6,13 +6,80 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:31:48 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:57:43 PM by AutoGen 5.16.2 # From the definitions ntpd-opts.def # and the template file agtexi-cmd.tpl @end ignore +The +@code{ntpd} +utility is an operating system daemon which sets +and maintains the system time of day in synchronism with Internet +standard time servers. +It is a complete implementation of the +Network Time Protocol (NTP) version 4, as defined by RFC-5905, +but also retains compatibility with +version 3, as defined by RFC-1305, and versions 1 +and 2, as defined by RFC-1059 and RFC-1119, respectively. + +The +@code{ntpd} +utility does most computations in 64-bit floating point +arithmetic and does relatively clumsy 64-bit fixed point operations +only when necessary to preserve the ultimate precision, about 232 +picoseconds. +While the ultimate precision is not achievable with +ordinary workstations and networks of today, it may be required +with future gigahertz CPU clocks and gigabit LANs. + +Ordinarily, +@code{ntpd} +reads the +@code{ntp.conf(5)} +configuration file at startup time in order to determine the +synchronization sources and operating modes. +It is also possible to +specify a working, although limited, configuration entirely on the +command line, obviating the need for a configuration file. +This may +be particularly useful when the local host is to be configured as a +broadcast/multicast client, with all peers being determined by +listening to broadcasts at run time. + +If NetInfo support is built into +@code{ntpd}, +then +@code{ntpd} +will attempt to read its configuration from the +NetInfo if the default +@code{ntp.conf(5)} +file cannot be read and no file is +specified by the +@code{-c} option. + +Various internal +@code{ntpd} +variables can be displayed and +configuration options altered while the +@code{ntpd} +is running +using the +@code{ntpq(8)} +and +@code{ntpdc(8)} +utility programs. + +When +@code{ntpd} +starts it looks at the value of +@code{umask(2)}, +and if zero +@code{ntpd} +will set the +@code{umask(2)} +to 022. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpd} program. @@ -49,9 +116,9 @@ This software is released under the NTP license, . * ntpd slew:: slew option (-x) * ntpd usepcc:: usepcc option * ntpd pccfreq:: pccfreq option +* ntpd mdns:: mdns option (-m) * ntpd config:: presetting/configuring ntpd * ntpd exit status:: exit status -* ntpd Description:: Description * ntpd Usage:: Usage * ntpd Files:: Files * ntpd See Also:: See Also @@ -73,80 +140,7 @@ with a status code of 0. @exampleindent 0 @example -ntpd - NTP daemon program - Ver. 4.2.7p295 -USAGE: ntpd [ - [] | --[@{=| @}] ]... \ - [ ... ] - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -a no authreq Require crypto authentication - - prohibits these options: - authnoreq - -A no authnoreq Do not require crypto authentication - - prohibits these options: - authreq - -b no bcastsync Allow us to sync to broadcast servers - -c Str configfile configuration file name - -d no debug-level Increase output debug message level - - may appear multiple times - -D Str set-debug-level Set the output debug message level - - may appear multiple times - -f Str driftfile frequency drift file name - -g no panicgate Allow the first adjustment to be Big - - may appear multiple times - -i --- jaildir built without --enable-clockctl or --enable-linuxcaps - -I Str interface Listen on an interface name or address - - may appear multiple times - -k Str keyfile path to symmetric keys - -l Str logfile path to the log file - -L no novirtualips Do not listen to virtual interfaces - -n no nofork Do not fork - - prohibits these options: - wait-sync - -N no nice Run at high priority - -p Str pidfile path to the PID file - -P Num priority Process priority - -q no quit Set the time and quit - - prohibits these options: - saveconfigquit - wait-sync - -r Str propagationdelay Broadcast/propagation delay - Str saveconfigquit Save parsed configuration and quit - - prohibits these options: - quit - wait-sync - -s Str statsdir Statistics file location - -t Str trustedkey Trusted key number - - may appear multiple times - -u --- user built without --enable-clockctl or --enable-linuxcaps - -U Num updateinterval interval in seconds between scans for new or dropped interfaces - Str var make ARG an ntp variable (RW) - - may appear multiple times - Str dvar make ARG an ntp variable (RW|DEF) - - may appear multiple times - -w Num wait-sync Seconds to wait for first clock sync - - prohibits these options: - nofork - quit - saveconfigquit - -x no slew Slew up to 600 seconds - -" opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -Options are specified by doubled hyphens and their name or by a single -hyphen and the flag character. - - - -The following option preset mechanisms are supported: - - examining environment variables named NTPD_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org +ntpd is unavailable - no -? @end example @exampleindent 4 @@ -610,6 +604,21 @@ must be compiled in by defining @code{SYS_WINNT} during the compilation. Force substitution the CPU counter for QueryPerformanceCounter. The CPU counter (RDTSC on x86) is used unconditionally with the given frequency (in Hz). +@node ntpd mdns +@subsection mdns option (-m) +@cindex ntpd-mdns + +This is the ``register with mdns as a ntp server'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{HAVE_DNSREGISTRATION} during the compilation. +@end itemize + +Registers as an NTP server with the local mDNS server which allows +the server to be discovered via mDNS client lookup. @node ntpd config @@ -651,58 +660,14 @@ Successful program execution. @item 1 (EXIT_FAILURE) The operation failed or the command syntax was not valid. @end table -@node ntpd Description -@subsection ntpd Description -The -utility is an operating system daemon which sets -and maintains the system time of day in synchronism with Internet -standard time servers. -It is a complete implementation of the -Network Time Protocol (NTP) version 4, as defined by RFC-5905, -but also retains compatibility with -version 3, as defined by RFC-1305, and versions 1 -and 2, as defined by RFC-1059 and RFC-1119, respectively. -The -utility does most computations in 64-bit floating point -arithmetic and does relatively clumsy 64-bit fixed point operations -only when necessary to preserve the ultimate precision, about 232 -picoseconds. -While the ultimate precision is not achievable with -ordinary workstations and networks of today, it may be required -with future gigahertz CPU clocks and gigabit LANs. -Ordinarily, -reads the -configuration file at startup time in order to determine the -synchronization sources and operating modes. -It is also possible to -specify a working, although limited, configuration entirely on the -command line, obviating the need for a configuration file. -This may -be particularly useful when the local host is to be configured as a -broadcast/multicast client, with all peers being determined by -listening to broadcasts at run time. -If NetInfo support is built into -then -will attempt to read its configuration from the -NetInfo if the default -file cannot be read and no file is -specified by the -option. -Various internal -variables can be displayed and -configuration options altered while the -is running -using the -and -utility programs. -When -starts it looks at the value of -and if zero -will set the -to 022. @node ntpd Usage @subsection ntpd Usage +.Ss +"How +NTP +Operates" The +@code{ntpd} utility operates by exchanging messages with one or more configured servers over a range of designated poll intervals. When @@ -718,9 +683,15 @@ interval of 64s, several minutes can elapse before the clock is set. This initial delay to set the clock can be safely and dramatically reduced using the +.Cm +iburst keyword with the +.Ic +server configuration command, as described in +@code{ntp.conf(5)}. + Most operating systems and hardware of today incorporate a time-of-year (TOY) chip to maintain the time during periods when the power is off. @@ -730,26 +701,32 @@ After the machine has synchronized to a NTP server, the operating system corrects the chip from time to time. In the default case, if +@code{ntpd} detects that the time on the host is more than 1000s from the server time, +@code{ntpd} assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. (Reasons for this include there is no TOY chip, or its battery is dead, or that the TOY chip is just of poor quality.) This causes +@code{ntpd} to exit with a panic message to the system log. The -option overrides this check and the +@code{-g} option overrides this check and the clock will be set to the server time regardless of the chip time (up to 68 years in the past or future \(em this is a limitation of the NTPv4 protocol). However, and to protect against broken hardware, such as when the CMOS battery fails or the clock counter becomes defective, once the clock has been set an error greater than 1000s will cause +@code{ntpd} to exit anyway. + Under ordinary conditions, +@code{ntpd} adjusts the clock in small steps so that the timescale is effectively continuous and without discontinuities. @@ -758,6 +735,7 @@ congestion, the roundtrip delay jitter can exceed three seconds and the synchronization distance, which is equal to one-half the roundtrip delay plus error budget terms, can become very large. The +@code{ntpd} algorithms discard sample offsets exceeding 128 ms, unless the interval during which no sample offset is less than 128 ms exceeds 900s. @@ -766,10 +744,12 @@ offset, steps the clock to the indicated time. In practice this reduces the false alarm rate where the clock is stepped in error to a vanishingly low incidence. + As the result of this behavior, once the clock has been set it very rarely strays more than 128 ms even under extreme cases of network path congestion and jitter. Sometimes, in particular when +@code{ntpd} is first started without a valid drift file on a system with a large intrinsic drift the error might grow to exceed 128 ms, @@ -779,12 +759,12 @@ in the future relative to the server. In some applications, this behavior may be unacceptable. There are several solutions, however. If the -option is included on the command line, the clock will +@code{-x} option is included on the command line, the clock will never be stepped and only slew corrections will be used. But this choice comes with a cost that should be carefully explored before deciding to use the -option. +@code{-x} option. The maximum slew rate possible is limited to 500 parts-per-million (PPM) as a consequence of the correctness principles on which the NTP protocol and algorithm design are @@ -796,6 +776,7 @@ During this interval the local clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time. + In spite of the above precautions, sometimes when large frequency errors are present the resulting time offsets stray outside the 128-ms range and an eventual step or slew time @@ -803,85 +784,142 @@ correction is required. If following such a correction the frequency error is so large that the first sample is outside the acceptable range, +@code{ntpd} enters the same state as when the +.Pa +ntp.drift file is not present. The intent of this behavior is to quickly correct the frequency and restore operation to the normal tracking mode. In the most extreme cases (the host +.Cm +time.ien.it comes to mind), there may be occasional step/slew corrections and subsequent frequency corrections. It helps in these cases to use the +.Cm +burst keyword when configuring the server, but ONLY when you have permission to do so from the owner of the target host. + Finally, in the past many startup scripts would run +@code{ntpdate(8)} to get the system clock close to correct before starting +@code{ntpd(8)}, but this was never more than a mediocre hack and is no longer needed. + There is a way to start +@code{ntpd(8)} that often addresses all of the problems mentioned above. +.Ss +"Starting +NTP +(Best +Current +Practice)" First, use the +.Cm +iburst option on your +.Cm +server entries. + If you can also keep a good +.Pa +ntp.drift file then +@code{ntpd(8)} will effectively "warm-start" and your system's clock will be stable in under 11 seconds' time. + As soon as possible in the startup sequence, start +@code{ntpd(8)} with at least the -and perhaps the -options. +@code{-g} and perhaps the +@code{-N} options. Then, start the rest of your "normal" processes. This will give +@code{ntpd(8)} as much time as possible to get the system's clock synchronized and stable. + Finally, if you have processes like +.Cm +dovecot or database servers that require monotonically-increasing time, run +@code{ntp-wait(8)} as late as possible in the boot sequence (perhaps with the -flag) +@code{-v} flag) and after +@code{ntp-wait(8)} exits successfully it is as safe as it will ever be to start any process that require stable time. +.Ss +"Frequency +Discipline" The +@code{ntpd} behavior at startup depends on whether the frequency file, usually +.Pa +ntp.drift +, exists. This file contains the latest estimate of clock frequency error. When the +@code{ntpd} is started and the file does not exist, the +@code{ntpd} enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the +@code{ntpd} enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the +@code{ntpd} is started and the file does exist, the +@code{ntpd} frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals. +.Ss +"Operating +Modes" The +@code{ntpd} utility can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the +.Qq +Association +Management page (available as part of the HTML documentation provided in +.Pa +/usr/share/doc/ntp +) +. It normally operates continuously while monitoring for small changes in frequency and trimming the clock for the ultimate precision. @@ -895,7 +933,9 @@ configure itself automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. + By default, +@code{ntpd} runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate state machine. @@ -910,24 +950,34 @@ avoid bunching at the servers. In addition, should a server become unreachable for some time, the poll interval is increased in steps to 1024s in order to reduce network overhead. + In some cases it may not be practical for +@code{ntpd} to run continuously. A common workaround has been to run the +@code{ntpdate(8)} program from a +@code{cron(8)} job at designated times. However, this program does not have the crafted signal processing, error checking and mitigation algorithms of +@code{ntpd}. The -option is intended for this purpose. +@code{-q} option is intended for this purpose. Setting this option will cause +@code{ntpd} to exit just after setting the clock for the first time. The procedure for initially setting the clock is the same as in continuous mode; most applications will probably want to specify the +.Cm +iburst keyword with the +.Ic +server configuration command. With this keyword a volley of messages are exchanged to groom the data and @@ -936,24 +986,34 @@ If nothing is heard after a couple of minutes, the daemon times out and exits. After a suitable period of mourning, the +@code{ntpdate(8)} program may be retired. + When kernel support is available to discipline the clock frequency, which is the case for stock Solaris, Tru64, Linux and +.Fx +, a useful feature is available to discipline the clock frequency. First, +@code{ntpd} is run in continuous mode with selected servers in order to measure and record the intrinsic clock frequency offset in the frequency file. It may take some hours for the frequency and offset to settle down. Then the +@code{ntpd} is stopped and run in one-time mode as required. At each startup, the frequency is read from the file and initializes the kernel frequency. +.Ss +"Poll +Interval +Control" This version of NTP includes an intricate state machine to reduce the network load while maintaining a quality of synchronization consistent with the observed jitter and wander. @@ -965,14 +1025,21 @@ the consequences of changing the poll adjustment range from the default minimum of 64 s to the default maximum of 1,024 s. The default minimum can be changed with the +.Ic +tinker +.Cm +minpoll command to a value not less than 16 s. This value is used for all configured associations, unless overridden by the +.Cm +minpoll option on the configuration command. Note that most device drivers will not operate properly if the poll interval is less than 64 s and that the broadcast server and manycast client associations will also use the default, unless overridden. + In some cases involving dial up or toll services, it may be useful to increase the minimum interval to a few tens of minutes and maximum interval to a day or so. @@ -989,12 +1056,18 @@ At a minimum of 1,024 s, for example, the capture range is only 31 PPM. If the intrinsic error is greater than this, the drift file +.Pa +ntp.drift will have to be specially tailored to reduce the residual error below this limit. Once this is done, the drift file is automatically updated once per hour and is available to initialize the frequency on subsequent daemon restarts. +.Ss +"The +huff-n'-puff +Filter" In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. @@ -1004,6 +1077,7 @@ In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer is in progress. + The huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation @@ -1020,9 +1094,15 @@ minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset. + The filter is activated by the +.Ic +tinker command and +.Cm +huffpuff keyword, as described in +@code{ntp.conf(5)}. @node ntpd Files @subsection ntpd Files @table @samp @@ -1036,16 +1116,164 @@ the default name of the key file @end multitable @node ntpd See Also @subsection ntpd See Also +@code{ntp.conf(5)}, +@code{ntpdate(8)}, +@code{ntpdc(8)}, +@code{ntpq(8)} + In addition to the manual pages provided, comprehensive documentation is available on the world wide web at +.Li +http://www.ntp.org/ +. A snapshot of this documentation is available in HTML format in +.Pa +/usr/share/doc/ntp +. +.Rs +.%A +David +L. +Mills +.%T +Network +Time +Protocol +(Version +1) +.%O +RFC1059 +.Re +.Rs +.%A +David +L. +Mills +.%T +Network +Time +Protocol +(Version +2) +.%O +RFC1119 +.Re +.Rs +.%A +David +L. +Mills +.%T +Network +Time +Protocol +(Version +3) +.%O +RFC1305 +.Re +.Rs +.%A +David +L. +Mills +.%A +J. +Martin, +Ed. +.%A +J. +Burbank +.%A +W. +Kasch +.%T +Network +Time +Protocol +Version +4: +Protocol +and +Algorithms +Specification +.%O +RFC5905 +.Re +.Rs +.%A +David +L. +Mills +.%A +B. +Haberman, +Ed. +.%T +Network +Time +Protocol +Version +4: +Autokey +Specification +.%O +RFC5906 +.Re +.Rs +.%A +H. +Gerstung +.%A +C. +Elliott +.%A +B. +Haberman, +Ed. +.%T +Definitions +of +Managed +Objects +for +Network +Time +Protocol +Version +4: +(NTPv4) +.%O +RFC5907 +.Re +.Rs +.%A +R. +Gayraud +.%A +B. +Lourdelet +.%T +Network +Time +Protocol +(NTP) +Server +Option +for +DHCPv6 +.%O +RFC5908 +.Re @node ntpd Bugs @subsection ntpd Bugs The +@code{ntpd} utility has gotten rather fat. While not huge, it has gotten larger than might be desirable for an elevated-priority +@code{ntpd} running on a workstation, particularly since many of the fancy features which consume the space were designed more with a busy primary server, rather than a high stratum workstation in diff --git a/ntpd/ntpd-opts.c b/ntpd/ntpd-opts.c index d818e1e3b4..0e3fe60e70 100644 --- a/ntpd/ntpd-opts.c +++ b/ntpd/ntpd-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:30:29 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:25 PM by AutoGen 5.16.2 * From the definitions ntpd-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,14 +36,15 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntpd-opts.h" #include #include #include #include -#define OPTION_CODE_COMPILE 1 -#include "ntpd-opts.h" #ifdef __cplusplus extern "C" { #endif @@ -54,10 +55,10 @@ extern FILE * option_usage_fp; #define zCopyright (ntpd_opt_strs+0) #define zLicenseDescrip (ntpd_opt_strs+314) -extern tUsageProc optionUsage; /* * global included definitions - */#ifdef __windows + */ +#ifdef __windows extern int atoi(const char *); #else # include @@ -70,7 +71,7 @@ extern tUsageProc optionUsage; /* * ntpd option static const strings */ -static char const ntpd_opt_strs[3053] = +static char const ntpd_opt_strs[3055] = /* 0 */ "ntpd 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -83,135 +84,135 @@ static char const ntpd_opt_strs[3053] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 952 */ "Force IPv4 DNS name resolution\0" -/* 983 */ "IPV4\0" -/* 988 */ "ipv4\0" -/* 993 */ "Force IPv6 DNS name resolution\0" -/* 1024 */ "IPV6\0" -/* 1029 */ "ipv6\0" -/* 1034 */ "Require crypto authentication\0" -/* 1064 */ "AUTHREQ\0" -/* 1072 */ "authreq\0" -/* 1080 */ "Do not require crypto authentication\0" -/* 1117 */ "AUTHNOREQ\0" -/* 1127 */ "authnoreq\0" -/* 1137 */ "Allow us to sync to broadcast servers\0" -/* 1175 */ "BCASTSYNC\0" -/* 1185 */ "bcastsync\0" -/* 1195 */ "configuration file name\0" -/* 1219 */ "CONFIGFILE\0" -/* 1230 */ "configfile\0" -/* 1241 */ "Increase output debug message level\0" -/* 1277 */ "DEBUG_LEVEL\0" -/* 1289 */ "debug-level\0" -/* 1301 */ "this package was built using 'configure --disable--debug'\0" -/* 1359 */ "Set the output debug message level\0" -/* 1394 */ "SET_DEBUG_LEVEL\0" -/* 1410 */ "set-debug-level\0" -/* 1426 */ "frequency drift file name\0" -/* 1452 */ "DRIFTFILE\0" -/* 1462 */ "driftfile\0" -/* 1472 */ "Allow the first adjustment to be Big\0" -/* 1509 */ "PANICGATE\0" -/* 1519 */ "panicgate\0" -/* 1529 */ "Jail directory\0" -/* 1544 */ "JAILDIR\0" -/* 1552 */ "jaildir\0" -/* 1560 */ "built without --enable-clockctl or --enable-linuxcaps\0" -/* 1614 */ "Listen on an interface name or address\0" -/* 1653 */ "INTERFACE\0" -/* 1663 */ "interface\0" -/* 1673 */ "path to symmetric keys\0" -/* 1696 */ "KEYFILE\0" -/* 1704 */ "keyfile\0" -/* 1712 */ "path to the log file\0" -/* 1733 */ "LOGFILE\0" -/* 1741 */ "logfile\0" -/* 1749 */ "Do not listen to virtual interfaces\0" -/* 1785 */ "NOVIRTUALIPS\0" -/* 1798 */ "novirtualips\0" -/* 1811 */ "Modify Multimedia Timer (Windows only)\0" -/* 1850 */ "MODIFYMMTIMER\0" -/* 1864 */ "modifymmtimer\0" -/* 1878 */ "Do not fork\0" -/* 1890 */ "NOFORK\0" -/* 1897 */ "nofork\0" -/* 1904 */ "Run at high priority\0" -/* 1925 */ "NICE\0" -/* 1930 */ "nice\0" -/* 1935 */ "path to the PID file\0" -/* 1956 */ "PIDFILE\0" -/* 1964 */ "pidfile\0" -/* 1972 */ "Process priority\0" -/* 1989 */ "PRIORITY\0" -/* 1998 */ "priority\0" -/* 2007 */ "Set the time and quit\0" -/* 2029 */ "QUIT\0" -/* 2034 */ "quit\0" -/* 2039 */ "Broadcast/propagation delay\0" -/* 2067 */ "PROPAGATIONDELAY\0" -/* 2084 */ "propagationdelay\0" -/* 2101 */ "Save parsed configuration and quit\0" -/* 2136 */ "SAVECONFIGQUIT\0" -/* 2151 */ "saveconfigquit\0" -/* 2166 */ "Statistics file location\0" -/* 2191 */ "STATSDIR\0" -/* 2200 */ "statsdir\0" -/* 2209 */ "Trusted key number\0" -/* 2228 */ "TRUSTEDKEY\0" -/* 2239 */ "trustedkey\0" -/* 2250 */ "Run as userid (or userid:groupid)\0" -/* 2284 */ "USER\0" -/* 2289 */ "user\0" -/* 2294 */ "interval in seconds between scans for new or dropped interfaces\0" -/* 2358 */ "UPDATEINTERVAL\0" -/* 2373 */ "updateinterval\0" -/* 2388 */ "make ARG an ntp variable (RW)\0" -/* 2418 */ "VAR\0" -/* 2422 */ "var\0" -/* 2426 */ "make ARG an ntp variable (RW|DEF)\0" -/* 2460 */ "DVAR\0" -/* 2465 */ "dvar\0" -/* 2470 */ "Seconds to wait for first clock sync\0" -/* 2507 */ "WAIT_SYNC\0" -/* 2517 */ "wait-sync\0" -/* 2527 */ "Slew up to 600 seconds\0" -/* 2550 */ "SLEW\0" -/* 2555 */ "slew\0" -/* 2560 */ "Use CPU cycle counter (Windows only)\0" -/* 2597 */ "USEPCC\0" -/* 2604 */ "usepcc\0" -/* 2611 */ "Force CPU cycle counter use (Windows only)\0" -/* 2654 */ "PCCFREQ\0" -/* 2662 */ "pccfreq\0" -/* 2670 */ "Register with mDNS as a NTP server\0" -/* 2705 */ "MDNS\0" -/* 2710 */ "mdns\0" -/* 2715 */ "Display extended usage information and exit\0" -/* 2759 */ "help\0" -/* 2764 */ "Extended usage information passed thru pager\0" -/* 2809 */ "more-help\0" -/* 2819 */ "Output version information and exit\0" -/* 2855 */ "version\0" -/* 2863 */ "NTPD\0" -/* 2868 */ "ntpd - NTP daemon program - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 954 */ "Force IPv4 DNS name resolution\0" +/* 985 */ "IPV4\0" +/* 990 */ "ipv4\0" +/* 995 */ "Force IPv6 DNS name resolution\0" +/* 1026 */ "IPV6\0" +/* 1031 */ "ipv6\0" +/* 1036 */ "Require crypto authentication\0" +/* 1066 */ "AUTHREQ\0" +/* 1074 */ "authreq\0" +/* 1082 */ "Do not require crypto authentication\0" +/* 1119 */ "AUTHNOREQ\0" +/* 1129 */ "authnoreq\0" +/* 1139 */ "Allow us to sync to broadcast servers\0" +/* 1177 */ "BCASTSYNC\0" +/* 1187 */ "bcastsync\0" +/* 1197 */ "configuration file name\0" +/* 1221 */ "CONFIGFILE\0" +/* 1232 */ "configfile\0" +/* 1243 */ "Increase output debug message level\0" +/* 1279 */ "DEBUG_LEVEL\0" +/* 1291 */ "debug-level\0" +/* 1303 */ "this package was built using 'configure --disable--debug'\0" +/* 1361 */ "Set the output debug message level\0" +/* 1396 */ "SET_DEBUG_LEVEL\0" +/* 1412 */ "set-debug-level\0" +/* 1428 */ "frequency drift file name\0" +/* 1454 */ "DRIFTFILE\0" +/* 1464 */ "driftfile\0" +/* 1474 */ "Allow the first adjustment to be Big\0" +/* 1511 */ "PANICGATE\0" +/* 1521 */ "panicgate\0" +/* 1531 */ "Jail directory\0" +/* 1546 */ "JAILDIR\0" +/* 1554 */ "jaildir\0" +/* 1562 */ "built without --enable-clockctl or --enable-linuxcaps\0" +/* 1616 */ "Listen on an interface name or address\0" +/* 1655 */ "INTERFACE\0" +/* 1665 */ "interface\0" +/* 1675 */ "path to symmetric keys\0" +/* 1698 */ "KEYFILE\0" +/* 1706 */ "keyfile\0" +/* 1714 */ "path to the log file\0" +/* 1735 */ "LOGFILE\0" +/* 1743 */ "logfile\0" +/* 1751 */ "Do not listen to virtual interfaces\0" +/* 1787 */ "NOVIRTUALIPS\0" +/* 1800 */ "novirtualips\0" +/* 1813 */ "Modify Multimedia Timer (Windows only)\0" +/* 1852 */ "MODIFYMMTIMER\0" +/* 1866 */ "modifymmtimer\0" +/* 1880 */ "Do not fork\0" +/* 1892 */ "NOFORK\0" +/* 1899 */ "nofork\0" +/* 1906 */ "Run at high priority\0" +/* 1927 */ "NICE\0" +/* 1932 */ "nice\0" +/* 1937 */ "path to the PID file\0" +/* 1958 */ "PIDFILE\0" +/* 1966 */ "pidfile\0" +/* 1974 */ "Process priority\0" +/* 1991 */ "PRIORITY\0" +/* 2000 */ "priority\0" +/* 2009 */ "Set the time and quit\0" +/* 2031 */ "QUIT\0" +/* 2036 */ "quit\0" +/* 2041 */ "Broadcast/propagation delay\0" +/* 2069 */ "PROPAGATIONDELAY\0" +/* 2086 */ "propagationdelay\0" +/* 2103 */ "Save parsed configuration and quit\0" +/* 2138 */ "SAVECONFIGQUIT\0" +/* 2153 */ "saveconfigquit\0" +/* 2168 */ "Statistics file location\0" +/* 2193 */ "STATSDIR\0" +/* 2202 */ "statsdir\0" +/* 2211 */ "Trusted key number\0" +/* 2230 */ "TRUSTEDKEY\0" +/* 2241 */ "trustedkey\0" +/* 2252 */ "Run as userid (or userid:groupid)\0" +/* 2286 */ "USER\0" +/* 2291 */ "user\0" +/* 2296 */ "interval in seconds between scans for new or dropped interfaces\0" +/* 2360 */ "UPDATEINTERVAL\0" +/* 2375 */ "updateinterval\0" +/* 2390 */ "make ARG an ntp variable (RW)\0" +/* 2420 */ "VAR\0" +/* 2424 */ "var\0" +/* 2428 */ "make ARG an ntp variable (RW|DEF)\0" +/* 2462 */ "DVAR\0" +/* 2467 */ "dvar\0" +/* 2472 */ "Seconds to wait for first clock sync\0" +/* 2509 */ "WAIT_SYNC\0" +/* 2519 */ "wait-sync\0" +/* 2529 */ "Slew up to 600 seconds\0" +/* 2552 */ "SLEW\0" +/* 2557 */ "slew\0" +/* 2562 */ "Use CPU cycle counter (Windows only)\0" +/* 2599 */ "USEPCC\0" +/* 2606 */ "usepcc\0" +/* 2613 */ "Force CPU cycle counter use (Windows only)\0" +/* 2656 */ "PCCFREQ\0" +/* 2664 */ "pccfreq\0" +/* 2672 */ "Register with mDNS as a NTP server\0" +/* 2707 */ "MDNS\0" +/* 2712 */ "mdns\0" +/* 2717 */ "Display extended usage information and exit\0" +/* 2761 */ "help\0" +/* 2766 */ "Extended usage information passed thru pager\0" +/* 2811 */ "more-help\0" +/* 2821 */ "Output version information and exit\0" +/* 2857 */ "version\0" +/* 2865 */ "NTPD\0" +/* 2870 */ "ntpd - NTP daemon program - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]... \\\n" "\t\t[ ... ]\n\0" -/* 3001 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 3035 */ "\n\n\0" -/* 3038 */ "ntpd 4.2.7p295"; +/* 3003 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 3037 */ "\n\n\0" +/* 3040 */ "ntpd 4.2.7p295"; /* * ipv4 option description with * "Must also have options" and "Incompatible options": */ -#define IPV4_DESC (ntpd_opt_strs+952) -#define IPV4_NAME (ntpd_opt_strs+983) -#define IPV4_name (ntpd_opt_strs+988) +#define IPV4_DESC (ntpd_opt_strs+954) +#define IPV4_NAME (ntpd_opt_strs+985) +#define IPV4_name (ntpd_opt_strs+990) static int const aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) @@ -220,9 +221,9 @@ static int const aIpv4CantList[] = { * ipv6 option description with * "Must also have options" and "Incompatible options": */ -#define IPV6_DESC (ntpd_opt_strs+993) -#define IPV6_NAME (ntpd_opt_strs+1024) -#define IPV6_name (ntpd_opt_strs+1029) +#define IPV6_DESC (ntpd_opt_strs+995) +#define IPV6_NAME (ntpd_opt_strs+1026) +#define IPV6_name (ntpd_opt_strs+1031) static int const aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) @@ -231,9 +232,9 @@ static int const aIpv6CantList[] = { * authreq option description with * "Must also have options" and "Incompatible options": */ -#define AUTHREQ_DESC (ntpd_opt_strs+1034) -#define AUTHREQ_NAME (ntpd_opt_strs+1064) -#define AUTHREQ_name (ntpd_opt_strs+1072) +#define AUTHREQ_DESC (ntpd_opt_strs+1036) +#define AUTHREQ_NAME (ntpd_opt_strs+1066) +#define AUTHREQ_name (ntpd_opt_strs+1074) static int const aAuthreqCantList[] = { INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT }; #define AUTHREQ_FLAGS (OPTST_DISABLED) @@ -242,9 +243,9 @@ static int const aAuthreqCantList[] = { * authnoreq option description with * "Must also have options" and "Incompatible options": */ -#define AUTHNOREQ_DESC (ntpd_opt_strs+1080) -#define AUTHNOREQ_NAME (ntpd_opt_strs+1117) -#define AUTHNOREQ_name (ntpd_opt_strs+1127) +#define AUTHNOREQ_DESC (ntpd_opt_strs+1082) +#define AUTHNOREQ_NAME (ntpd_opt_strs+1119) +#define AUTHNOREQ_name (ntpd_opt_strs+1129) static int const aAuthnoreqCantList[] = { INDEX_OPT_AUTHREQ, NO_EQUIVALENT }; #define AUTHNOREQ_FLAGS (OPTST_DISABLED) @@ -252,17 +253,17 @@ static int const aAuthnoreqCantList[] = { /* * bcastsync option description: */ -#define BCASTSYNC_DESC (ntpd_opt_strs+1137) -#define BCASTSYNC_NAME (ntpd_opt_strs+1175) -#define BCASTSYNC_name (ntpd_opt_strs+1185) +#define BCASTSYNC_DESC (ntpd_opt_strs+1139) +#define BCASTSYNC_NAME (ntpd_opt_strs+1177) +#define BCASTSYNC_name (ntpd_opt_strs+1187) #define BCASTSYNC_FLAGS (OPTST_DISABLED) /* * configfile option description: */ -#define CONFIGFILE_DESC (ntpd_opt_strs+1195) -#define CONFIGFILE_NAME (ntpd_opt_strs+1219) -#define CONFIGFILE_name (ntpd_opt_strs+1230) +#define CONFIGFILE_DESC (ntpd_opt_strs+1197) +#define CONFIGFILE_NAME (ntpd_opt_strs+1221) +#define CONFIGFILE_name (ntpd_opt_strs+1232) #define CONFIGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -270,111 +271,111 @@ static int const aAuthnoreqCantList[] = { * debug-level option description: */ #ifdef DEBUG -#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1241) -#define DEBUG_LEVEL_NAME (ntpd_opt_strs+1277) -#define DEBUG_LEVEL_name (ntpd_opt_strs+1289) +#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1243) +#define DEBUG_LEVEL_NAME (ntpd_opt_strs+1279) +#define DEBUG_LEVEL_name (ntpd_opt_strs+1291) #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) #else /* disable debug-level */ #define DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define DEBUG_LEVEL_NAME NULL -#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1301) -#define DEBUG_LEVEL_name (ntpd_opt_strs+1289) +#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1303) +#define DEBUG_LEVEL_name (ntpd_opt_strs+1291) #endif /* DEBUG */ /* * set-debug-level option description: */ #ifdef DEBUG -#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1359) -#define SET_DEBUG_LEVEL_NAME (ntpd_opt_strs+1394) -#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1410) +#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1361) +#define SET_DEBUG_LEVEL_NAME (ntpd_opt_strs+1396) +#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1412) #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable set-debug-level */ #define SET_DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define SET_DEBUG_LEVEL_NAME NULL -#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1301) -#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1410) +#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1303) +#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1412) #endif /* DEBUG */ /* * driftfile option description: */ -#define DRIFTFILE_DESC (ntpd_opt_strs+1426) -#define DRIFTFILE_NAME (ntpd_opt_strs+1452) -#define DRIFTFILE_name (ntpd_opt_strs+1462) +#define DRIFTFILE_DESC (ntpd_opt_strs+1428) +#define DRIFTFILE_NAME (ntpd_opt_strs+1454) +#define DRIFTFILE_name (ntpd_opt_strs+1464) #define DRIFTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * panicgate option description: */ -#define PANICGATE_DESC (ntpd_opt_strs+1472) -#define PANICGATE_NAME (ntpd_opt_strs+1509) -#define PANICGATE_name (ntpd_opt_strs+1519) +#define PANICGATE_DESC (ntpd_opt_strs+1474) +#define PANICGATE_NAME (ntpd_opt_strs+1511) +#define PANICGATE_name (ntpd_opt_strs+1521) #define PANICGATE_FLAGS (OPTST_DISABLED) /* * jaildir option description: */ #ifdef HAVE_DROPROOT -#define JAILDIR_DESC (ntpd_opt_strs+1529) -#define JAILDIR_NAME (ntpd_opt_strs+1544) -#define JAILDIR_name (ntpd_opt_strs+1552) +#define JAILDIR_DESC (ntpd_opt_strs+1531) +#define JAILDIR_NAME (ntpd_opt_strs+1546) +#define JAILDIR_name (ntpd_opt_strs+1554) #define JAILDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable jaildir */ #define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define JAILDIR_NAME NULL -#define JAILDIR_DESC (ntpd_opt_strs+1560) -#define JAILDIR_name (ntpd_opt_strs+1552) +#define JAILDIR_DESC (ntpd_opt_strs+1562) +#define JAILDIR_name (ntpd_opt_strs+1554) #endif /* HAVE_DROPROOT */ /* * interface option description: */ -#define INTERFACE_DESC (ntpd_opt_strs+1614) -#define INTERFACE_NAME (ntpd_opt_strs+1653) -#define INTERFACE_name (ntpd_opt_strs+1663) +#define INTERFACE_DESC (ntpd_opt_strs+1616) +#define INTERFACE_NAME (ntpd_opt_strs+1655) +#define INTERFACE_name (ntpd_opt_strs+1665) #define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * keyfile option description: */ -#define KEYFILE_DESC (ntpd_opt_strs+1673) -#define KEYFILE_NAME (ntpd_opt_strs+1696) -#define KEYFILE_name (ntpd_opt_strs+1704) +#define KEYFILE_DESC (ntpd_opt_strs+1675) +#define KEYFILE_NAME (ntpd_opt_strs+1698) +#define KEYFILE_name (ntpd_opt_strs+1706) #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * logfile option description: */ -#define LOGFILE_DESC (ntpd_opt_strs+1712) -#define LOGFILE_NAME (ntpd_opt_strs+1733) -#define LOGFILE_name (ntpd_opt_strs+1741) +#define LOGFILE_DESC (ntpd_opt_strs+1714) +#define LOGFILE_NAME (ntpd_opt_strs+1735) +#define LOGFILE_name (ntpd_opt_strs+1743) #define LOGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * novirtualips option description: */ -#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1749) -#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1785) -#define NOVIRTUALIPS_name (ntpd_opt_strs+1798) +#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1751) +#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1787) +#define NOVIRTUALIPS_name (ntpd_opt_strs+1800) #define NOVIRTUALIPS_FLAGS (OPTST_DISABLED) /* * modifymmtimer option description: */ #ifdef SYS_WINNT -#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1811) -#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1850) -#define MODIFYMMTIMER_name (ntpd_opt_strs+1864) +#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1813) +#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1852) +#define MODIFYMMTIMER_name (ntpd_opt_strs+1866) #define MODIFYMMTIMER_FLAGS (OPTST_DISABLED) #else /* disable modifymmtimer */ @@ -388,9 +389,9 @@ static int const aAuthnoreqCantList[] = { * nofork option description with * "Must also have options" and "Incompatible options": */ -#define NOFORK_DESC (ntpd_opt_strs+1878) -#define NOFORK_NAME (ntpd_opt_strs+1890) -#define NOFORK_name (ntpd_opt_strs+1897) +#define NOFORK_DESC (ntpd_opt_strs+1880) +#define NOFORK_NAME (ntpd_opt_strs+1892) +#define NOFORK_name (ntpd_opt_strs+1899) static int const aNoforkCantList[] = { INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; #define NOFORK_FLAGS (OPTST_DISABLED) @@ -398,26 +399,26 @@ static int const aNoforkCantList[] = { /* * nice option description: */ -#define NICE_DESC (ntpd_opt_strs+1904) -#define NICE_NAME (ntpd_opt_strs+1925) -#define NICE_name (ntpd_opt_strs+1930) +#define NICE_DESC (ntpd_opt_strs+1906) +#define NICE_NAME (ntpd_opt_strs+1927) +#define NICE_name (ntpd_opt_strs+1932) #define NICE_FLAGS (OPTST_DISABLED) /* * pidfile option description: */ -#define PIDFILE_DESC (ntpd_opt_strs+1935) -#define PIDFILE_NAME (ntpd_opt_strs+1956) -#define PIDFILE_name (ntpd_opt_strs+1964) +#define PIDFILE_DESC (ntpd_opt_strs+1937) +#define PIDFILE_NAME (ntpd_opt_strs+1958) +#define PIDFILE_name (ntpd_opt_strs+1966) #define PIDFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * priority option description: */ -#define PRIORITY_DESC (ntpd_opt_strs+1972) -#define PRIORITY_NAME (ntpd_opt_strs+1989) -#define PRIORITY_name (ntpd_opt_strs+1998) +#define PRIORITY_DESC (ntpd_opt_strs+1974) +#define PRIORITY_NAME (ntpd_opt_strs+1991) +#define PRIORITY_name (ntpd_opt_strs+2000) #define PRIORITY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -425,9 +426,9 @@ static int const aNoforkCantList[] = { * quit option description with * "Must also have options" and "Incompatible options": */ -#define QUIT_DESC (ntpd_opt_strs+2007) -#define QUIT_NAME (ntpd_opt_strs+2029) -#define QUIT_name (ntpd_opt_strs+2034) +#define QUIT_DESC (ntpd_opt_strs+2009) +#define QUIT_NAME (ntpd_opt_strs+2031) +#define QUIT_name (ntpd_opt_strs+2036) static int const aQuitCantList[] = { INDEX_OPT_SAVECONFIGQUIT, INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; @@ -436,9 +437,9 @@ static int const aQuitCantList[] = { /* * propagationdelay option description: */ -#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2039) -#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2067) -#define PROPAGATIONDELAY_name (ntpd_opt_strs+2084) +#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2041) +#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2069) +#define PROPAGATIONDELAY_name (ntpd_opt_strs+2086) #define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -447,9 +448,9 @@ static int const aQuitCantList[] = { * "Must also have options" and "Incompatible options": */ #ifdef SAVECONFIG -#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2101) -#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2136) -#define SAVECONFIGQUIT_name (ntpd_opt_strs+2151) +#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2103) +#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2138) +#define SAVECONFIGQUIT_name (ntpd_opt_strs+2153) static int const aSaveconfigquitCantList[] = { INDEX_OPT_QUIT, INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; @@ -467,18 +468,18 @@ static int const aSaveconfigquitCantList[] = { /* * statsdir option description: */ -#define STATSDIR_DESC (ntpd_opt_strs+2166) -#define STATSDIR_NAME (ntpd_opt_strs+2191) -#define STATSDIR_name (ntpd_opt_strs+2200) +#define STATSDIR_DESC (ntpd_opt_strs+2168) +#define STATSDIR_NAME (ntpd_opt_strs+2193) +#define STATSDIR_name (ntpd_opt_strs+2202) #define STATSDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * trustedkey option description: */ -#define TRUSTEDKEY_DESC (ntpd_opt_strs+2209) -#define TRUSTEDKEY_NAME (ntpd_opt_strs+2228) -#define TRUSTEDKEY_name (ntpd_opt_strs+2239) +#define TRUSTEDKEY_DESC (ntpd_opt_strs+2211) +#define TRUSTEDKEY_NAME (ntpd_opt_strs+2230) +#define TRUSTEDKEY_name (ntpd_opt_strs+2241) #define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -486,43 +487,43 @@ static int const aSaveconfigquitCantList[] = { * user option description: */ #ifdef HAVE_DROPROOT -#define USER_DESC (ntpd_opt_strs+2250) -#define USER_NAME (ntpd_opt_strs+2284) -#define USER_name (ntpd_opt_strs+2289) +#define USER_DESC (ntpd_opt_strs+2252) +#define USER_NAME (ntpd_opt_strs+2286) +#define USER_name (ntpd_opt_strs+2291) #define USER_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable user */ #define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define USER_NAME NULL -#define USER_DESC (ntpd_opt_strs+1560) -#define USER_name (ntpd_opt_strs+2289) +#define USER_DESC (ntpd_opt_strs+1562) +#define USER_name (ntpd_opt_strs+2291) #endif /* HAVE_DROPROOT */ /* * updateinterval option description: */ -#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2294) -#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2358) -#define UPDATEINTERVAL_name (ntpd_opt_strs+2373) +#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2296) +#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2360) +#define UPDATEINTERVAL_name (ntpd_opt_strs+2375) #define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * var option description: */ -#define VAR_DESC (ntpd_opt_strs+2388) -#define VAR_NAME (ntpd_opt_strs+2418) -#define VAR_name (ntpd_opt_strs+2422) +#define VAR_DESC (ntpd_opt_strs+2390) +#define VAR_NAME (ntpd_opt_strs+2420) +#define VAR_name (ntpd_opt_strs+2424) #define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * dvar option description: */ -#define DVAR_DESC (ntpd_opt_strs+2426) -#define DVAR_NAME (ntpd_opt_strs+2460) -#define DVAR_name (ntpd_opt_strs+2465) +#define DVAR_DESC (ntpd_opt_strs+2428) +#define DVAR_NAME (ntpd_opt_strs+2462) +#define DVAR_name (ntpd_opt_strs+2467) #define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -531,9 +532,9 @@ static int const aSaveconfigquitCantList[] = { * "Must also have options" and "Incompatible options": */ #ifdef HAVE_WORKING_FORK -#define WAIT_SYNC_DESC (ntpd_opt_strs+2470) -#define WAIT_SYNC_NAME (ntpd_opt_strs+2507) -#define WAIT_SYNC_name (ntpd_opt_strs+2517) +#define WAIT_SYNC_DESC (ntpd_opt_strs+2472) +#define WAIT_SYNC_NAME (ntpd_opt_strs+2509) +#define WAIT_SYNC_name (ntpd_opt_strs+2519) static int const aWait_SyncCantList[] = { INDEX_OPT_NOFORK, INDEX_OPT_QUIT, @@ -552,18 +553,18 @@ static int const aWait_SyncCantList[] = { /* * slew option description: */ -#define SLEW_DESC (ntpd_opt_strs+2527) -#define SLEW_NAME (ntpd_opt_strs+2550) -#define SLEW_name (ntpd_opt_strs+2555) +#define SLEW_DESC (ntpd_opt_strs+2529) +#define SLEW_NAME (ntpd_opt_strs+2552) +#define SLEW_name (ntpd_opt_strs+2557) #define SLEW_FLAGS (OPTST_DISABLED) /* * usepcc option description: */ #ifdef SYS_WINNT -#define USEPCC_DESC (ntpd_opt_strs+2560) -#define USEPCC_NAME (ntpd_opt_strs+2597) -#define USEPCC_name (ntpd_opt_strs+2604) +#define USEPCC_DESC (ntpd_opt_strs+2562) +#define USEPCC_NAME (ntpd_opt_strs+2599) +#define USEPCC_name (ntpd_opt_strs+2606) #define USEPCC_FLAGS (OPTST_DISABLED) #else /* disable usepcc */ @@ -577,9 +578,9 @@ static int const aWait_SyncCantList[] = { * pccfreq option description: */ #ifdef SYS_WINNT -#define PCCFREQ_DESC (ntpd_opt_strs+2611) -#define PCCFREQ_NAME (ntpd_opt_strs+2654) -#define PCCFREQ_name (ntpd_opt_strs+2662) +#define PCCFREQ_DESC (ntpd_opt_strs+2613) +#define PCCFREQ_NAME (ntpd_opt_strs+2656) +#define PCCFREQ_name (ntpd_opt_strs+2664) #define PCCFREQ_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -594,9 +595,9 @@ static int const aWait_SyncCantList[] = { * mdns option description: */ #ifdef HAVE_DNSREGISTRATION -#define MDNS_DESC (ntpd_opt_strs+2670) -#define MDNS_NAME (ntpd_opt_strs+2705) -#define MDNS_name (ntpd_opt_strs+2710) +#define MDNS_DESC (ntpd_opt_strs+2672) +#define MDNS_NAME (ntpd_opt_strs+2707) +#define MDNS_name (ntpd_opt_strs+2712) #define MDNS_FLAGS (OPTST_DISABLED) #else /* disable mdns */ @@ -609,11 +610,11 @@ static int const aWait_SyncCantList[] = { /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpd_opt_strs+2715) -#define HELP_name (ntpd_opt_strs+2759) +#define HELP_DESC (ntpd_opt_strs+2717) +#define HELP_name (ntpd_opt_strs+2761) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpd_opt_strs+2764) -#define MORE_HELP_name (ntpd_opt_strs+2809) +#define MORE_HELP_DESC (ntpd_opt_strs+2766) +#define MORE_HELP_name (ntpd_opt_strs+2811) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -626,8 +627,8 @@ static int const aWait_SyncCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpd_opt_strs+2819) -#define VER_name (ntpd_opt_strs+2855) +#define VER_DESC (ntpd_opt_strs+2821) +#define VER_name (ntpd_opt_strs+2857) /* * Declare option callback procedures */ @@ -667,13 +668,14 @@ static tOptProc */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_NTPD_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Ntpd Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntpd Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpd program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, @@ -1126,17 +1128,17 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Ntpd Option Environment + * Define the ntpd Option Environment */ -#define zPROGNAME (ntpd_opt_strs+2863) -#define zUsageTitle (ntpd_opt_strs+2868) +#define zPROGNAME (ntpd_opt_strs+2865) +#define zUsageTitle (ntpd_opt_strs+2870) #define zRcName NULL #define apzHomeList NULL -#define zBugsAddr (ntpd_opt_strs+3001) -#define zExplain (ntpd_opt_strs+3035) +#define zBugsAddr (ntpd_opt_strs+3003) +#define zExplain (ntpd_opt_strs+3037) #define zDetail (NULL) -#define zFullVersion (ntpd_opt_strs+3038) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (ntpd_opt_strs+3040) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -1151,21 +1153,35 @@ static tOptDesc optDesc[OPTION_CT] = { #define ntpd_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&ntpdOptions, NTPD_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(NTPD_EXIT_SUCCESS); } #if ! defined(TEST_NTPD_OPTS) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the set-debug-level option, when DEBUG is #define-d. * - * For the set-debug-level option, when DEBUG is #define-d. + * @param pOptions the ntpd options data structure + * @param pOptDesc the option descriptor for this option. */ #ifdef DEBUG static void @@ -1173,15 +1189,24 @@ doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from ntpdbase-opts.def, line 100 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); + (void)pOptions; } #endif /* defined DEBUG */ #endif /* defined(TEST_NTPD_OPTS) */ -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -1194,12 +1219,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTPD_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntpd. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntpd + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntpd_packager_info NULL #else @@ -1215,7 +1247,13 @@ static char const ntpd_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntpd. The one structure that + * binds them all. + */ tOptions ntpdOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -1259,7 +1297,16 @@ tOptions ntpdOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -1279,8 +1326,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntpdOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/ntpd/ntpd-opts.h b/ntpd/ntpd-opts.h index b351de7150..d46fd2c2ce 100644 --- a/ntpd/ntpd-opts.h +++ b/ntpd/ntpd-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:30:29 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:25 PM by AutoGen 5.16.2 * From the definitions ntpd-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -134,7 +134,8 @@ typedef enum { */ typedef enum { NTPD_EXIT_SUCCESS = 0, - NTPD_EXIT_FAILURE = 1 + NTPD_EXIT_FAILURE = 1, + NTPD_EXIT_LIBOPTS_FAILURE = 70 } ntpd_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -371,7 +372,7 @@ typedef enum { ntpdOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -387,6 +388,12 @@ extern tOptions ntpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/ntpd/ntpd.1ntpdman b/ntpd/ntpd.1ntpdman index 368a5ba86b..6af40464f8 100644 --- a/ntpd/ntpd.1ntpdman +++ b/ntpd/ntpd.1ntpdman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:31:44 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:57:48 PM by AutoGen 5.16.2 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .\" @@ -15,7 +15,7 @@ ntpd \- NTP daemon program .PP .SH DESCRIPTION The -.B +.B XXX Program Name utility is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. @@ -26,7 +26,7 @@ version 3, as defined by RFC-1305, and versions 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. .PP The -.B +.B XXX Program Name utility does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 @@ -36,7 +36,7 @@ ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs. .PP Ordinarily, -.B +.B XXX Program Name reads the .Xr ntp.conf 5 configuration file at startup time in order to determine the @@ -50,9 +50,9 @@ broadcast/multicast client, with all peers being determined by listening to broadcasts at run time. .PP If NetInfo support is built into -.B , +.B XXX Program Name , then -.B +.B XXX Program Name will attempt to read its configuration from the NetInfo if the default .Xr ntp.conf 5 @@ -62,10 +62,10 @@ c option. .PP Various internal -.B +.B XXX Program Name variables can be displayed and configuration options altered while the -.B +.B XXX Program Name is running using the .Xr ntpq 8 @@ -74,11 +74,11 @@ and utility programs. .PP When -.B +.B XXX Program Name starts it looks at the value of .Xr umask 2 , and if zero -.B +.B XXX Program Name will set the .Xr umask 2 to 022. @@ -197,7 +197,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -interface command, which is more versatile. +interface command, which is more versatile. .TP .BR \-k " \fIstring\fP, " \-\-keyfile "=" \fIstring\fP path to symmetric keys. @@ -413,9 +413,9 @@ by loading values from environment variables named: .fi .ad .SH USAGE -.Ss "How NTP Operates" +.SS "How NTP Operates" The -.B +.B XXX Program Name utility operates by exchanging messages with one or more configured servers over a range of designated poll intervals. When @@ -447,17 +447,17 @@ After the machine has synchronized to a NTP server, the operating system corrects the chip from time to time. In the default case, if -.B +.B XXX Program Name detects that the time on the host is more than 1000s from the server time, -.B +.B XXX Program Name assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. (Reasons for this include there is no TOY chip, or its battery is dead, or that the TOY chip is just of poor quality.) This causes -.B +.B XXX Program Name to exit with a panic message to the system log. The @@ -469,11 +469,11 @@ this is a limitation of the NTPv4 protocol). However, and to protect against broken hardware, such as when the CMOS battery fails or the clock counter becomes defective, once the clock has been set an error greater than 1000s will cause -.B +.B XXX Program Name to exit anyway. .PP Under ordinary conditions, -.B +.B XXX Program Name adjusts the clock in small steps so that the timescale is effectively continuous and without discontinuities. @@ -482,7 +482,7 @@ congestion, the roundtrip delay jitter can exceed three seconds and the synchronization distance, which is equal to one-half the roundtrip delay plus error budget terms, can become very large. The -.B +.B XXX Program Name algorithms discard sample offsets exceeding 128 ms, unless the interval during which no sample offset is less than 128 ms exceeds 900s. @@ -496,7 +496,7 @@ As the result of this behavior, once the clock has been set it very rarely strays more than 128 ms even under extreme cases of network path congestion and jitter. Sometimes, in particular when -.B +.B XXX Program Name is first started without a valid drift file on a system with a large intrinsic drift the error might grow to exceed 128 ms, @@ -533,7 +533,7 @@ correction is required. If following such a correction the frequency error is so large that the first sample is outside the acceptable range, -.B +.B XXX Program Name enters the same state as when the .Pa ntp.drift file is not present. @@ -563,7 +563,7 @@ but this was never more than a mediocre hack and is no longer needed. There is a way to start .Xr ntpd 8 that often addresses all of the problems mentioned above. -.Ss "Starting NTP (Best Current Practice)" +.SS "Starting NTP (Best Current Practice)" First, use the .Cm iburst option on your @@ -607,9 +607,9 @@ and after exits successfully it is as safe as it will ever be to start any process that require stable time. -.Ss "Frequency Discipline" +.SS "Frequency Discipline" The -.B +.B XXX Program Name behavior at startup depends on whether the frequency file, usually .Pa ntp.drift , @@ -617,30 +617,30 @@ exists. This file contains the latest estimate of clock frequency error. When the -.B +.B XXX Program Name is started and the file does not exist, the -.B +.B XXX Program Name enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the -.B +.B XXX Program Name enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the -.B +.B XXX Program Name is started and the file does exist, the -.B +.B XXX Program Name frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals. -.Ss "Operating Modes" +.SS "Operating Modes" The -.B +.B XXX Program Name utility can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the @@ -664,7 +664,7 @@ fleet of workstations without specifying configuration details specific to the local environment. .PP By default, -.B +.B XXX Program Name runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate state machine. @@ -681,7 +681,7 @@ unreachable for some time, the poll interval is increased in steps to 1024s in order to reduce network overhead. .PP In some cases it may not be practical for -.B +.B XXX Program Name to run continuously. A common workaround has been to run the @@ -692,12 +692,12 @@ job at designated times. However, this program does not have the crafted signal processing, error checking and mitigation algorithms of -.B . +.B XXX Program Name . The q option is intended for this purpose. Setting this option will cause -.B +.B XXX Program Name to exit just after setting the clock for the first time. The procedure for initially @@ -724,20 +724,20 @@ frequency, which is the case for stock Solaris, Tru64, Linux and a useful feature is available to discipline the clock frequency. First, -.B +.B XXX Program Name is run in continuous mode with selected servers in order to measure and record the intrinsic clock frequency offset in the frequency file. It may take some hours for the frequency and offset to settle down. Then the -.B +.B XXX Program Name is stopped and run in one-time mode as required. At each startup, the frequency is read from the file and initializes the kernel frequency. -.Ss "Poll Interval Control" +.SS "Poll Interval Control" This version of NTP includes an intricate state machine to reduce the network load while maintaining a quality of synchronization consistent with the observed jitter and wander. @@ -784,7 +784,7 @@ this limit. Once this is done, the drift file is automatically updated once per hour and is available to initialize the frequency on subsequent daemon restarts. -.Ss "The huff-n'-puff Filter" +.SS "The huff-n'-puff Filter" In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. @@ -833,10 +833,10 @@ the default name of the key file .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .SH "SEE ALSO" .Xr ntp.conf 5 , @@ -899,11 +899,11 @@ Copyright (C) 1970-2012 The University of Delaware all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS The -.B +.B XXX Program Name utility has gotten rather fat. While not huge, it has gotten larger than might be desirable for an elevated-priority -.B +.B XXX Program Name running on a workstation, particularly since many of the fancy features which consume the space were designed more with a busy primary server, rather than a high stratum workstation in diff --git a/ntpd/ntpd.1ntpdmdoc b/ntpd/ntpd.1ntpdmdoc index dd74b5065c..5b5665ce81 100644 --- a/ntpd/ntpd.1ntpdmdoc +++ b/ntpd/ntpd.1ntpdmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPD 1ntpdmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:31:48 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:57:39 PM by AutoGen 5.16.2 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -121,6 +121,7 @@ This is almost never a good idea. .It \-b ", " -\-bcastsync Allow us to sync to broadcast servers. .sp +.sp .It \-c " \fIstring\fP, " \-\-configfile "=" \fIstring\fP configuration file name. .sp @@ -178,9 +179,9 @@ option. This option is only available if the OS supports adjusting the clock without full root privileges. This option is supported under NetBSD (configure with ---enable-clockctl +-\-enable\-clockctl ) and Linux (configure with ---enable-linuxcaps +-\-enable\-linuxcaps ). .It \-I " \fIiface\fP, " \-\-interface "=" \fIiface\fP Listen on an interface name or address. @@ -190,7 +191,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -interface command, which is more versatile. +interface command, which is more versatile. .It \-k " \fIstring\fP, " \-\-keyfile "=" \fIstring\fP path to symmetric keys. .sp @@ -226,6 +227,7 @@ Do not fork. This option must not appear in combination with any of the following options: wait-sync. .sp +.sp .It \-N ", " -\-nice Run at high priority. .sp @@ -297,9 +299,9 @@ Specify a user, and optionally a group, to switch to. This option is only available if the OS supports adjusting the clock without full root privileges. This option is supported under NetBSD (configure with ---enable-clockctl +-\-enable\-clockctl ) and Linux (configure with ---enable-linuxcaps +-\-enable\-linuxcaps ). .It \-U " \fInumber\fP, " \-\-updateinterval "=" \fInumber\fP interval in seconds between scans for new or dropped interfaces. @@ -313,10 +315,12 @@ Use 0 to disable scanning. 60 seconds is the minimum time between scans. make ARG an ntp variable (RW). This option may appear an unlimited number of times. .sp +.sp .It \-\-dvar "=\fIndvar\fP" make ARG an ntp variable (RW|DEF). This option may appear an unlimited number of times. .sp +.sp .It \-w " \fInumber\fP, " \-\-wait\-sync "=" \fInumber\fP Seconds to wait for first clock sync. This option must not appear in combination with any of the following options: @@ -801,9 +805,9 @@ the default name of the key file .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .El .Sh "SEE ALSO" diff --git a/ntpd/ntpd.man.in b/ntpd/ntpd.man.in index 00799d4ca9..8c2ebecfab 100644 --- a/ntpd/ntpd.man.in +++ b/ntpd/ntpd.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:31:44 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:57:48 PM by AutoGen 5.16.2 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .\" @@ -15,7 +15,7 @@ ntpd \- NTP daemon program .PP .SH DESCRIPTION The -.B +.B XXX Program Name utility is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. @@ -26,7 +26,7 @@ version 3, as defined by RFC-1305, and versions 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. .PP The -.B +.B XXX Program Name utility does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 @@ -36,7 +36,7 @@ ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs. .PP Ordinarily, -.B +.B XXX Program Name reads the .Xr ntp.conf 5 configuration file at startup time in order to determine the @@ -50,9 +50,9 @@ broadcast/multicast client, with all peers being determined by listening to broadcasts at run time. .PP If NetInfo support is built into -.B , +.B XXX Program Name , then -.B +.B XXX Program Name will attempt to read its configuration from the NetInfo if the default .Xr ntp.conf 5 @@ -62,10 +62,10 @@ c option. .PP Various internal -.B +.B XXX Program Name variables can be displayed and configuration options altered while the -.B +.B XXX Program Name is running using the .Xr ntpq 8 @@ -74,11 +74,11 @@ and utility programs. .PP When -.B +.B XXX Program Name starts it looks at the value of .Xr umask 2 , and if zero -.B +.B XXX Program Name will set the .Xr umask 2 to 022. @@ -197,7 +197,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -interface command, which is more versatile. +interface command, which is more versatile. .TP .BR \-k " \fIstring\fP, " \-\-keyfile "=" \fIstring\fP path to symmetric keys. @@ -413,9 +413,9 @@ by loading values from environment variables named: .fi .ad .SH USAGE -.Ss "How NTP Operates" +.SS "How NTP Operates" The -.B +.B XXX Program Name utility operates by exchanging messages with one or more configured servers over a range of designated poll intervals. When @@ -447,17 +447,17 @@ After the machine has synchronized to a NTP server, the operating system corrects the chip from time to time. In the default case, if -.B +.B XXX Program Name detects that the time on the host is more than 1000s from the server time, -.B +.B XXX Program Name assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. (Reasons for this include there is no TOY chip, or its battery is dead, or that the TOY chip is just of poor quality.) This causes -.B +.B XXX Program Name to exit with a panic message to the system log. The @@ -469,11 +469,11 @@ this is a limitation of the NTPv4 protocol). However, and to protect against broken hardware, such as when the CMOS battery fails or the clock counter becomes defective, once the clock has been set an error greater than 1000s will cause -.B +.B XXX Program Name to exit anyway. .PP Under ordinary conditions, -.B +.B XXX Program Name adjusts the clock in small steps so that the timescale is effectively continuous and without discontinuities. @@ -482,7 +482,7 @@ congestion, the roundtrip delay jitter can exceed three seconds and the synchronization distance, which is equal to one-half the roundtrip delay plus error budget terms, can become very large. The -.B +.B XXX Program Name algorithms discard sample offsets exceeding 128 ms, unless the interval during which no sample offset is less than 128 ms exceeds 900s. @@ -496,7 +496,7 @@ As the result of this behavior, once the clock has been set it very rarely strays more than 128 ms even under extreme cases of network path congestion and jitter. Sometimes, in particular when -.B +.B XXX Program Name is first started without a valid drift file on a system with a large intrinsic drift the error might grow to exceed 128 ms, @@ -533,7 +533,7 @@ correction is required. If following such a correction the frequency error is so large that the first sample is outside the acceptable range, -.B +.B XXX Program Name enters the same state as when the .Pa ntp.drift file is not present. @@ -563,7 +563,7 @@ but this was never more than a mediocre hack and is no longer needed. There is a way to start .Xr ntpd 8 that often addresses all of the problems mentioned above. -.Ss "Starting NTP (Best Current Practice)" +.SS "Starting NTP (Best Current Practice)" First, use the .Cm iburst option on your @@ -607,9 +607,9 @@ and after exits successfully it is as safe as it will ever be to start any process that require stable time. -.Ss "Frequency Discipline" +.SS "Frequency Discipline" The -.B +.B XXX Program Name behavior at startup depends on whether the frequency file, usually .Pa ntp.drift , @@ -617,30 +617,30 @@ exists. This file contains the latest estimate of clock frequency error. When the -.B +.B XXX Program Name is started and the file does not exist, the -.B +.B XXX Program Name enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the -.B +.B XXX Program Name enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the -.B +.B XXX Program Name is started and the file does exist, the -.B +.B XXX Program Name frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals. -.Ss "Operating Modes" +.SS "Operating Modes" The -.B +.B XXX Program Name utility can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the @@ -664,7 +664,7 @@ fleet of workstations without specifying configuration details specific to the local environment. .PP By default, -.B +.B XXX Program Name runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate state machine. @@ -681,7 +681,7 @@ unreachable for some time, the poll interval is increased in steps to 1024s in order to reduce network overhead. .PP In some cases it may not be practical for -.B +.B XXX Program Name to run continuously. A common workaround has been to run the @@ -692,12 +692,12 @@ job at designated times. However, this program does not have the crafted signal processing, error checking and mitigation algorithms of -.B . +.B XXX Program Name . The q option is intended for this purpose. Setting this option will cause -.B +.B XXX Program Name to exit just after setting the clock for the first time. The procedure for initially @@ -724,20 +724,20 @@ frequency, which is the case for stock Solaris, Tru64, Linux and a useful feature is available to discipline the clock frequency. First, -.B +.B XXX Program Name is run in continuous mode with selected servers in order to measure and record the intrinsic clock frequency offset in the frequency file. It may take some hours for the frequency and offset to settle down. Then the -.B +.B XXX Program Name is stopped and run in one-time mode as required. At each startup, the frequency is read from the file and initializes the kernel frequency. -.Ss "Poll Interval Control" +.SS "Poll Interval Control" This version of NTP includes an intricate state machine to reduce the network load while maintaining a quality of synchronization consistent with the observed jitter and wander. @@ -784,7 +784,7 @@ this limit. Once this is done, the drift file is automatically updated once per hour and is available to initialize the frequency on subsequent daemon restarts. -.Ss "The huff-n'-puff Filter" +.SS "The huff-n'-puff Filter" In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. @@ -833,10 +833,10 @@ the default name of the key file .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .SH "SEE ALSO" .Xr ntp.conf 5 , @@ -899,11 +899,11 @@ Copyright (C) 1970-2012 The University of Delaware all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS The -.B +.B XXX Program Name utility has gotten rather fat. While not huge, it has gotten larger than might be desirable for an elevated-priority -.B +.B XXX Program Name running on a workstation, particularly since many of the fancy features which consume the space were designed more with a busy primary server, rather than a high stratum workstation in diff --git a/ntpd/ntpd.mdoc.in b/ntpd/ntpd.mdoc.in index 0b7154ef7a..10fbde8d1b 100644 --- a/ntpd/ntpd.mdoc.in +++ b/ntpd/ntpd.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPD @NTPD_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:31:48 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:57:39 PM by AutoGen 5.16.2 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -121,6 +121,7 @@ This is almost never a good idea. .It \-b ", " -\-bcastsync Allow us to sync to broadcast servers. .sp +.sp .It \-c " \fIstring\fP, " \-\-configfile "=" \fIstring\fP configuration file name. .sp @@ -178,9 +179,9 @@ option. This option is only available if the OS supports adjusting the clock without full root privileges. This option is supported under NetBSD (configure with ---enable-clockctl +-\-enable\-clockctl ) and Linux (configure with ---enable-linuxcaps +-\-enable\-linuxcaps ). .It \-I " \fIiface\fP, " \-\-interface "=" \fIiface\fP Listen on an interface name or address. @@ -190,7 +191,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -interface command, which is more versatile. +interface command, which is more versatile. .It \-k " \fIstring\fP, " \-\-keyfile "=" \fIstring\fP path to symmetric keys. .sp @@ -226,6 +227,7 @@ Do not fork. This option must not appear in combination with any of the following options: wait-sync. .sp +.sp .It \-N ", " -\-nice Run at high priority. .sp @@ -297,9 +299,9 @@ Specify a user, and optionally a group, to switch to. This option is only available if the OS supports adjusting the clock without full root privileges. This option is supported under NetBSD (configure with ---enable-clockctl +-\-enable\-clockctl ) and Linux (configure with ---enable-linuxcaps +-\-enable\-linuxcaps ). .It \-U " \fInumber\fP, " \-\-updateinterval "=" \fInumber\fP interval in seconds between scans for new or dropped interfaces. @@ -313,10 +315,12 @@ Use 0 to disable scanning. 60 seconds is the minimum time between scans. make ARG an ntp variable (RW). This option may appear an unlimited number of times. .sp +.sp .It \-\-dvar "=\fIndvar\fP" make ARG an ntp variable (RW|DEF). This option may appear an unlimited number of times. .sp +.sp .It \-w " \fInumber\fP, " \-\-wait\-sync "=" \fInumber\fP Seconds to wait for first clock sync. This option must not appear in combination with any of the following options: @@ -801,9 +805,9 @@ the default name of the key file .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .El .Sh "SEE ALSO" diff --git a/ntpd/ntpdsim-opts.c b/ntpd/ntpdsim-opts.c index 40fa92d44d..948d9a642d 100644 --- a/ntpd/ntpdsim-opts.c +++ b/ntpd/ntpdsim-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.c) * - * It has been AutoGen-ed May 1, 2012 at 09:18:07 AM by AutoGen 5.16pre31 + * It has been AutoGen-ed August 11, 2012 at 08:39:22 PM by AutoGen 5.16.2 * From the definitions ntpdsim-opts.def * and the template file options * - * Generated from AutoOpts 36:4:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,6 +36,7 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ #define OPTION_CODE_COMPILE 1 #include "ntpdsim-opts.h" #include @@ -70,8 +71,8 @@ extern FILE * option_usage_fp; /* * ntpdsim option static const strings */ -static char const ntpdsim_opt_strs[3123] = -/* 0 */ "ntpdsim 4.2.7p272\n" +static char const ntpdsim_opt_strs[3168] = +/* 0 */ "ntpdsim 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -188,27 +189,30 @@ static char const ntpdsim_opt_strs[3123] = /* 2616 */ "Force CPU cycle counter use (Windows only)\0" /* 2659 */ "PCCFREQ\0" /* 2667 */ "pccfreq\0" -/* 2675 */ "Display extended usage information and exit\0" -/* 2719 */ "help\0" -/* 2724 */ "Extended usage information passed thru pager\0" -/* 2769 */ "more-help\0" -/* 2779 */ "Output version information and exit\0" -/* 2815 */ "version\0" -/* 2823 */ "Save the option state to a config file\0" -/* 2862 */ "save-opts\0" -/* 2872 */ "Load options from a config file\0" -/* 2904 */ "LOAD_OPTS\0" -/* 2914 */ "no-load-opts\0" -/* 2927 */ "no\0" -/* 2930 */ "NTPDSIM\0" -/* 2938 */ "ntpdsim - NTP daemon simulation program - Ver. 4.2.7p272\n" +/* 2675 */ "Register with mDNS as a NTP server\0" +/* 2710 */ "MDNS\0" +/* 2715 */ "mdns\0" +/* 2720 */ "Display extended usage information and exit\0" +/* 2764 */ "help\0" +/* 2769 */ "Extended usage information passed thru pager\0" +/* 2814 */ "more-help\0" +/* 2824 */ "Output version information and exit\0" +/* 2860 */ "version\0" +/* 2868 */ "Save the option state to a config file\0" +/* 2907 */ "save-opts\0" +/* 2917 */ "Load options from a config file\0" +/* 2949 */ "LOAD_OPTS\0" +/* 2959 */ "no-load-opts\0" +/* 2972 */ "no\0" +/* 2975 */ "NTPDSIM\0" +/* 2983 */ "ntpdsim - NTP daemon simulation program - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]...\n\0" -/* 3053 */ "$HOME\0" -/* 3059 */ ".\0" -/* 3061 */ ".ntprc\0" -/* 3068 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 3102 */ "\n\n\0" -/* 3105 */ "ntpdsim 4.2.7p272"; +/* 3098 */ "$HOME\0" +/* 3104 */ ".\0" +/* 3106 */ ".ntprc\0" +/* 3113 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 3147 */ "\n\n\0" +/* 3150 */ "ntpdsim 4.2.7p295"; /* * ipv4 option description with @@ -595,14 +599,30 @@ static int const aWait_SyncCantList[] = { #define PCCFREQ_name NULL #endif /* SYS_WINNT */ +/* + * mdns option description: + */ +#ifdef HAVE_DNSREGISTRATION +#define MDNS_DESC (ntpdsim_opt_strs+2675) +#define MDNS_NAME (ntpdsim_opt_strs+2710) +#define MDNS_name (ntpdsim_opt_strs+2715) +#define MDNS_FLAGS (OPTST_DISABLED) + +#else /* disable mdns */ +#define MDNS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define MDNS_NAME NULL +#define MDNS_DESC NULL +#define MDNS_name NULL +#endif /* HAVE_DNSREGISTRATION */ + /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpdsim_opt_strs+2675) -#define HELP_name (ntpdsim_opt_strs+2719) +#define HELP_DESC (ntpdsim_opt_strs+2720) +#define HELP_name (ntpdsim_opt_strs+2764) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpdsim_opt_strs+2724) -#define MORE_HELP_name (ntpdsim_opt_strs+2769) +#define MORE_HELP_DESC (ntpdsim_opt_strs+2769) +#define MORE_HELP_name (ntpdsim_opt_strs+2814) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -615,14 +635,14 @@ static int const aWait_SyncCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpdsim_opt_strs+2779) -#define VER_name (ntpdsim_opt_strs+2815) -#define SAVE_OPTS_DESC (ntpdsim_opt_strs+2823) -#define SAVE_OPTS_name (ntpdsim_opt_strs+2862) -#define LOAD_OPTS_DESC (ntpdsim_opt_strs+2872) -#define LOAD_OPTS_NAME (ntpdsim_opt_strs+2904) -#define NO_LOAD_OPTS_name (ntpdsim_opt_strs+2914) -#define LOAD_OPTS_pfx (ntpdsim_opt_strs+2927) +#define VER_DESC (ntpdsim_opt_strs+2824) +#define VER_name (ntpdsim_opt_strs+2860) +#define SAVE_OPTS_DESC (ntpdsim_opt_strs+2868) +#define SAVE_OPTS_name (ntpdsim_opt_strs+2907) +#define LOAD_OPTS_DESC (ntpdsim_opt_strs+2917) +#define LOAD_OPTS_NAME (ntpdsim_opt_strs+2949) +#define NO_LOAD_OPTS_name (ntpdsim_opt_strs+2959) +#define LOAD_OPTS_pfx (ntpdsim_opt_strs+2972) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -666,9 +686,11 @@ static tOptProc #endif /* defined(TEST_NTPDSIM_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** * Define the ntpdsim Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpdsim program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, @@ -1067,6 +1089,18 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name, /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ 33, VALUE_OPT_MDNS, + /* equiv idx, value */ 33, VALUE_OPT_MDNS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MDNS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mdns */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MDNS_DESC, MDNS_NAME, MDNS_name, + /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, /* equivalenced to */ NO_EQUIVALENT, @@ -1137,18 +1171,18 @@ static tOptDesc optDesc[OPTION_CT] = { * * Define the ntpdsim Option Environment */ -#define zPROGNAME (ntpdsim_opt_strs+2930) -#define zUsageTitle (ntpdsim_opt_strs+2938) -#define zRcName (ntpdsim_opt_strs+3061) +#define zPROGNAME (ntpdsim_opt_strs+2975) +#define zUsageTitle (ntpdsim_opt_strs+2983) +#define zRcName (ntpdsim_opt_strs+3106) static char const * const apzHomeList[3] = { - ntpdsim_opt_strs+3053, - ntpdsim_opt_strs+3059, + ntpdsim_opt_strs+3098, + ntpdsim_opt_strs+3104, NULL }; -#define zBugsAddr (ntpdsim_opt_strs+3068) +#define zBugsAddr (ntpdsim_opt_strs+3113) #define zExplain (NULL) -#define zDetail (ntpdsim_opt_strs+3102) -#define zFullVersion (ntpdsim_opt_strs+3105) -/* extracted from optcode.tlib near line 349 */ +#define zDetail (ntpdsim_opt_strs+3147) +#define zFullVersion (ntpdsim_opt_strs+3150) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -1163,6 +1197,8 @@ static char const * const apzHomeList[3] = { #define ntpdsim_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ @@ -1201,7 +1237,7 @@ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined DEBUG */ #endif /* defined(TEST_NTPDSIM_OPTS) */ -/* extracted from optmain.tlib near line 35 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTPDSIM_OPTS) /* TEST MAIN PROCEDURE: */ @@ -1227,12 +1263,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTPDSIM_OPTS */ -/* extracted from optmain.tlib near line 1113 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntpdsim. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntpdsim + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntpdsim_packager_info NULL #else @@ -1248,7 +1291,13 @@ static char const ntpdsim_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntpdsim. The one structure that + * binds them all. + */ tOptions ntpdsimOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -1277,7 +1326,7 @@ tOptions ntpdsimOptions = { NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, - 38 /* full option count */, 33 /* user option count */, + 39 /* full option count */, 34 /* user option count */, ntpdsim_full_usage, ntpdsim_short_usage, NULL, NULL, PKGDATADIR, ntpdsim_packager_info @@ -1293,7 +1342,16 @@ tOptions ntpdsimOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -1313,8 +1371,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntpdsimOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/ntpd/ntpdsim-opts.h b/ntpd/ntpdsim-opts.h index f85fecd3ce..333549ceee 100644 --- a/ntpd/ntpdsim-opts.h +++ b/ntpd/ntpdsim-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.h) * - * It has been AutoGen-ed May 1, 2012 at 09:18:07 AM by AutoGen 5.16pre31 + * It has been AutoGen-ed August 11, 2012 at 08:39:22 PM by AutoGen 5.16.2 * From the definitions ntpdsim-opts.def * and the template file options * - * Generated from AutoOpts 36:4:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147460 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -97,16 +97,17 @@ typedef enum { INDEX_OPT_SLEW = 30, INDEX_OPT_USEPCC = 31, INDEX_OPT_PCCFREQ = 32, - INDEX_OPT_VERSION = 33, - INDEX_OPT_HELP = 34, - INDEX_OPT_MORE_HELP = 35, - INDEX_OPT_SAVE_OPTS = 36, - INDEX_OPT_LOAD_OPTS = 37 + INDEX_OPT_MDNS = 33, + INDEX_OPT_VERSION = 34, + INDEX_OPT_HELP = 35, + INDEX_OPT_MORE_HELP = 36, + INDEX_OPT_SAVE_OPTS = 37, + INDEX_OPT_LOAD_OPTS = 38 } teOptIndex; -#define OPTION_CT 38 -#define NTPDSIM_VERSION "4.2.7p272" -#define NTPDSIM_FULL_VERSION "ntpdsim 4.2.7p272" +#define OPTION_CT 39 +#define NTPDSIM_VERSION "4.2.7p295" +#define NTPDSIM_FULL_VERSION "ntpdsim 4.2.7p295" /* * Interface defines for all options. Replace "n" with the UPPER_CASED @@ -275,6 +276,10 @@ typedef enum { # warning undefining PCCFREQ due to option name conflict # undef PCCFREQ # endif +# ifdef MDNS +# warning undefining MDNS due to option name conflict +# undef MDNS +# endif #else /* NO_OPTION_NAME_WARNINGS */ # undef IPV4 # undef IPV6 @@ -309,6 +314,7 @@ typedef enum { # undef SLEW # undef USEPCC # undef PCCFREQ +# undef MDNS #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * @@ -355,6 +361,7 @@ typedef enum { #define VALUE_OPT_SLEW 'x' #define VALUE_OPT_USEPCC 31 #define VALUE_OPT_PCCFREQ 32 +#define VALUE_OPT_MDNS 'm' #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION @@ -390,6 +397,12 @@ extern tOptions ntpdsimOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/ntpdc/invoke-ntpdc.texi b/ntpdc/invoke-ntpdc.texi index 6feca5fa92..20071a9032 100644 --- a/ntpdc/invoke-ntpdc.texi +++ b/ntpdc/invoke-ntpdc.texi @@ -6,13 +6,30 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:32:06 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:58:03 PM by AutoGen 5.16.2 # From the definitions ntpdc-opts.def # and the template file agtexi-cmd.tpl @end ignore +@code{ntpdc} +is a utility program used to query +@code{ntpd(8)} +about its +current state and to request changes in that state. +It uses NTP mode 7 control message formats described in the source code. +The program may +be run either in interactive mode or controlled using command line +arguments. +Extensive state and statistics information is available +through the +@code{ntpdc} +interface. +In addition, nearly all the +configuration options which can be specified at startup using +ntpd's configuration file may also be specified at run time using +@code{ntpdc}. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpdc} program. @@ -30,7 +47,6 @@ This software is released under the NTP license, . * ntpdc showpeers:: showpeers option (-s) * ntpdc config:: presetting/configuring ntpdc * ntpdc exit status:: exit status -* ntpdc Description:: Description * ntpdc Usage:: Usage * ntpdc See Also:: See Also * ntpdc Authors:: Authors @@ -51,56 +67,7 @@ with a status code of 0. @exampleindent 0 @example -ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p295 -USAGE: ntpdc [ - [] | --[@{=| @}] ]... [ host ...] - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -c Str command run a command and exit - - may appear multiple times - -d no debug-level Increase debug verbosity level - - may appear multiple times - -D Str set-debug-level Set the debug verbosity level - - may appear multiple times - -i no interactive Force ntpq to operate in interactive mode - - prohibits these options: - command - listpeers - peers - showpeers - -l no listpeers Print a list of the peers - - prohibits these options: - command - -n no numeric numeric host addresses - -p no peers Print a list of the peers - - prohibits these options: - command - -s no showpeers Show a list of the peers - - prohibits these options: - command - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name or by a single -hyphen and the flag character. - - - -The following option preset mechanisms are supported: - - reading file $HOME/.ntprc - - reading file ./.ntprc - - examining environment variables named NTPDC_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org +ntpdc is unavailable - no -? @end example @exampleindent 4 @@ -321,38 +288,28 @@ A specified configuration file could not be loaded. libopts had an internal operational error. Please report it to autogen-users@@lists.sourceforge.net. Thank you. @end table -@node ntpdc Description -@subsection ntpdc Description -is a utility program used to query -about its -current state and to request changes in that state. -It uses NTP mode 7 control message formats described in the source code. -The program may -be run either in interactive mode or controlled using command line -arguments. -Extensive state and statistics information is available -through the -interface. -In addition, nearly all the -configuration options which can be specified at startup using -ntpd's configuration file may also be specified at run time using @node ntpdc Usage @subsection ntpdc Usage If one or more request options are included on the command line when +@code{ntpdc} is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, +@code{ntpdc} will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The +@code{ntpdc} utility will prompt for commands if the standard input is a terminal device. + The +@code{ntpdc} utility uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. @@ -360,32 +317,42 @@ Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The +@code{ntpdc} utility makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time. + The operation of +@code{ntpdc} are specific to the particular implementation of the +@code{ntpd(8)} daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote +@code{ntpdc} utility which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key identifier. + Note that in contexts where a host name is expected, a -qualifier preceding the host name forces DNS resolution to the IPv4 namespace, +@code{-4} qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -qualifier forces DNS resolution to the IPv6 namespace. +@code{-6} qualifier forces DNS resolution to the IPv6 namespace. Specifying a command line option other than -or -will cause the specified query (queries) to be sent to +@code{-i} or +@code{-n} will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, +@code{ntpdc} will attempt to read interactive format commands from the standard input. +.Ss +"Interactive +Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to @@ -393,9 +360,14 @@ uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a +.Ql +\&> +, followed by a file name, to the command line. + A number of interactive format commands are executed entirely within the +@code{ntpdc} utility itself and do not result in NTP mode 7 requests being sent to a server. These are described @@ -404,13 +376,21 @@ following. @item Ic @item Ic A +.Sq +Ic +\&? will print a list of all the command keywords known to this incarnation of +@code{ntpdc}. A +.Sq +Ic +\&? followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about +@code{ntpq(8)} than this manual page. @item Ic @@ -428,15 +408,22 @@ Hostname may be either a host name or a numeric address. @item Ic If +.Cm +yes is specified, host names are printed in information displays. If +.Cm +no is specified, numeric addresses are printed instead. The default is +.Cm +yes +, unless modified using the command line -switch. +@code{-n} switch. @item Ic This command allows the specification of a key number to be used to authenticate configuration requests. @@ -445,6 +432,7 @@ to a key number the server has been configured to use for this purpose. @item Ic Exit +@code{ntpdc}. @item Ic This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration @@ -457,10 +445,15 @@ Specify a timeout period for responses to server queries. The default is about 8000 milliseconds. Note that since +@code{ntpdc} retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. @end multitable +.Ss +"Control +Message +Commands" Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands @@ -484,39 +477,72 @@ stratum of the remote peer (a stratum of 16 indicates the remote peer is unsynchronized), the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in seconds. + The character in the left margin indicates the mode this peer entry is operating in. A +.Ql +\&+ denotes symmetric active, a +.Ql +\&- indicates symmetric passive, a +.Ql +\&= means the remote server is being polled in client mode, a +.Ql +\&^ indicates that the server is broadcasting to this address, a +.Ql +\&~ denotes that the remote peer is sending broadcasts and a +.Ql +\&~ denotes that the remote peer is sending broadcasts and a +.Ql +\&* marks the peer the server is currently synchronizing to. + The contents of the host field may be one of four forms. It may be a host name, an IP address, a reference clock implementation name with its parameter or +.Fn +REFCLK +"implementation_number" +"parameter" +. On +.Ic +hostnames +.Cm +no only IP-addresses will be displayed. @item Ic A slightly different peer summary list. Identical to the output of the +.Ic +peers command, except for the character in the leftmost column. Characters only appear beside peers which were included in the final stage of the clock selection algorithm. A +.Ql +\&. indicates that this peer was cast off in the falseticker detection, while a +.Ql +\&+ indicates that the peer made it through. A +.Ql +\&* denotes the peer the server is currently synchronizing with. @item Ic @@ -542,23 +568,38 @@ The loop filter is the part of NTP which deals with adjusting the local system clock. The +.Sq +offset is the last offset given to the loop filter by the packet processing code. The +.Sq +frequency is the frequency error of the local clock in parts-per-million (ppm). The +.Sq +time_const controls the stiffness of the phase-lock loop and thus the speed at which it can adapt to oscillator drift. The +.Sq +watchdog +timer value is the number of seconds which have elapsed since the last sample offset was given to the loop filter. The +.Cm +oneline and +.Cm +multiline options specify the format in which this information is to be printed, with +.Cm +multiline as the default. @item Ic @@ -566,29 +607,66 @@ Print a variety of system state variables, i.e., state related to the local server. All except the last four lines are described in the NTP Version 3 specification, RFC-1305. + The +.Sq +system +flags show various system flags, some of which can be set and cleared by the +.Ic +enable and +.Ic +disable configuration commands, respectively. These are the +.Cm +auth +, +.Cm +bclient +, +.Cm +monitor +, +.Cm +pll +, +.Cm +pps and +.Cm +stats flags. See the +@code{ntpd(8)} documentation for the meaning of these flags. There are two additional flags which are read only, the +.Cm +kernel_pll and +.Cm +kernel_pps +. These flags indicate the synchronization status when the precision time kernel modifications are in use. The +.Sq +kernel_pll indicates that the local clock is being disciplined by the kernel, while the +.Sq +kernel_pps indicates the kernel discipline is provided by the PPS signal. + The +.Sq +stability is the residual frequency error remaining after the system frequency correction is applied and is intended for maintenance and debugging. @@ -598,15 +676,27 @@ the range .01 to 0.1 ppm. If it remains high for some time after starting the daemon, something may be wrong with the local clock, or the value of the kernel variable +.Va +kern.clockrate.tick may be incorrect. + The +.Sq +broadcastdelay shows the default broadcast delay, as set by the +.Ic +broadcastdelay configuration command. + The +.Sq +authdelay shows the default authentication delay, as set by the +.Ic +authdelay configuration command. @item Ic Print statistics counters maintained in the protocol @@ -637,14 +727,23 @@ information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand. @end multitable +.Ss +"Runtime +Configuration +Requests" All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to +@code{ntpdc}. This can be done using the +.Ic +keyid and +.Ic +passwd commands, the latter of which will prompt at the terminal for a password to use as the encryption key. You will also be prompted @@ -654,6 +753,7 @@ server is given. Authentication not only provides verification that the requester has permission to make such changes, but also gives an extra degree of protection again transmission errors. + Authenticated requests always include a timestamp in the packet data, which is included in the computation of the authentication code. @@ -677,9 +777,20 @@ passwords are chosen, care is taken in the distribution and protection of keys and appropriate source address restrictions are applied, the run time reconfiguration facility should provide an adequate level of security. + The following commands all make authenticated requests. @table @samp @item Xo +.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc Add a configured peer association at the given address and operating in symmetric active mode. Note that an existing @@ -687,14 +798,20 @@ association with the same peer may be deleted when this command is executed, or may simply be converted to conform to the new configuration, as appropriate. If the optional +.Ar +keyid is a nonzero integer, all outgoing packets to the remote server will have an authentication field attached encrypted with this key. If the value is 0 (or not given) no authentication will be done. The +.Ar +version can be 1, 2 or 3 and defaults to 3. The +.Cm +prefer keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The @@ -702,14 +819,36 @@ preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. @item Xo +.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc Identical to the addpeer command, except that the operating mode is client. @item Xo +.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc Identical to the addpeer command, except that the operating mode is broadcast. In this case a valid key identifier and key are required. The +.Ar +peer_address parameter can be the broadcast address of the local network or a multicast group address assigned to NTP. @@ -724,14 +863,84 @@ When appropriate, however, the association may persist in an unconfigured mode if the remote peer is willing to continue on in this fashion. @item Xo +.Op +Cm +time1 +.Op +Cm +time2 +.Op +Ar +stratum +.Op +Ar +refid +.Xc This command provides a way to set certain data for a reference clock. See the source listing for further information. @item Xo +.Oo +.Cm +auth +| +Cm +bclient +| +.Cm +calibrate +| +Cm +kernel +| +.Cm +monitor +| +Cm +ntp +| +.Cm +pps +| +Cm +stats +.Oc +.Xc @item Xo +.Oo +.Cm +auth +| +Cm +bclient +| +.Cm +calibrate +| +Cm +kernel +| +.Cm +monitor +| +Cm +ntp +| +.Cm +pps +| +Cm +stats +.Oc +.Xc These commands operate in the same way as the +.Ic +enable and +.Ic +disable configuration file commands of +@code{ntpd(8)}. @table @samp @item Cm Enables the server to synchronize with unconfigured peers only @@ -752,6 +961,7 @@ The default for this flag is enable if support is available, otherwise disable. @item Cm Enables the monitoring facility. See the +@code{ntpdc(8)}. program and the monlist command or further information. The default for this flag is enable. @item Cm @@ -763,57 +973,195 @@ The default for this flag is enable. Enables the pulse-per-second (PPS) signal when frequency and time is disciplined by the precision time kernel modifications. See the +.Qq +A +Kernel +Model +for +Precision +Timekeeping (available as part of the HTML documentation provided in +.Pa +/usr/share/doc/ntp +) page for further information. The default for this flag is disable. @item Cm Enables the statistics facility. See the +.Sx +Monitoring +Options section of +@code{ntp.conf(5)} for further information. The default for this flag is disable. @end multitable +.It +Xo +Ic +restrict +Ar +address +Ar +mask +.Ar +flag +Oo +Ar +... +Oc +.Xc This command operates in the same way as the +.Ic +restrict configuration file commands of +@code{ntpd(8)}. +.It +Xo +Ic +unrestrict +Ar +address +Ar +mask +.Ar +flag +Oo +Ar +... +Oc +.Xc Unrestrict the matching entry from the restrict list. +.It +Xo +Ic +delrestrict +Ar +address +Ar +mask +.Op +Cm +ntpport +.Xc Delete the matching entry from the restrict list. +.It +Ic +readkeys Causes the current set of authentication keys to be purged and a new set to be obtained by rereading the keys file (which must have been specified in the +@code{ntpd(8)} configuration file). This allows encryption keys to be changed without restarting the server. +.It +Ic +trustedkey +Ar +keyid +Oo +Ar +... +Oc +.It +Ic +untrustedkey +Ar +keyid +Oo +Ar +... +Oc These commands operate in the same way as the +.Ic +trustedkey and +.Ic +untrustedkey configuration file commands of +@code{ntpd(8)}. +.It +Ic +authinfo Returns information concerning the authentication module, including known keys and counts of encryptions and decryptions which have been done. +.It +Ic +traps Display the traps set in the server. See the source listing for further information. +.It +Xo +Ic +addtrap +Ar +address +.Op +Ar +port +.Op +Ar +interface +.Xc Set a trap for asynchronous messages. See the source listing for further information. +.It +Xo +Ic +clrtrap +Ar +address +.Op +Ar +port +.Op +Ar +interface +.Xc Clear a trap for asynchronous messages. See the source listing for further information. +.It +Ic +reset Clear the statistics counters in various modules of the server. See the source listing for further information. @end multitable @node ntpdc See Also @subsection ntpdc See Also +@code{ntp.conf(5)}, +@code{ntpd(8)} +.Rs +.%A +David +L. +Mills +.%T +Network +Time +Protocol +(Version +3) +.%O +RFC1305 +.Re @node ntpdc Authors @subsection ntpdc Authors The formatting directives in this document came from FreeBSD. @node ntpdc Bugs @subsection ntpdc Bugs The +@code{ntpdc} utility is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. @@ -822,4 +1170,5 @@ program was designed so that new (and temporary) features were easy to hack in, at great expense to the program's ease of use. Despite this, the program is occasionally useful. + Please report bugs to http://bugs.ntp.org . diff --git a/ntpdc/ntpdc-opts.c b/ntpdc/ntpdc-opts.c index 182868a932..f9ae68cd12 100644 --- a/ntpdc/ntpdc-opts.c +++ b/ntpdc/ntpdc-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:31:53 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:27 PM by AutoGen 5.16.2 * From the definitions ntpdc-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,14 +36,15 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntpdc-opts.h" #include #include #include #include -#define OPTION_CODE_COMPILE 1 -#include "ntpdc-opts.h" #ifdef __cplusplus extern "C" { #endif @@ -54,10 +55,10 @@ extern FILE * option_usage_fp; #define zCopyright (ntpdc_opt_strs+0) #define zLicenseDescrip (ntpdc_opt_strs+315) -extern tUsageProc optionUsage; /* * global included definitions - */#ifdef __windows + */ +#ifdef __windows extern int atoi(const char*); #else # include @@ -70,7 +71,7 @@ extern tUsageProc optionUsage; /* * ntpdc option static const strings */ -static char const ntpdc_opt_strs[1860] = +static char const ntpdc_opt_strs[1862] = /* 0 */ "ntpdc 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -83,68 +84,68 @@ static char const ntpdc_opt_strs[1860] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 953 */ "Force IPv4 DNS name resolution\0" -/* 984 */ "IPV4\0" -/* 989 */ "ipv4\0" -/* 994 */ "Force IPv6 DNS name resolution\0" -/* 1025 */ "IPV6\0" -/* 1030 */ "ipv6\0" -/* 1035 */ "run a command and exit\0" -/* 1058 */ "COMMAND\0" -/* 1066 */ "command\0" -/* 1074 */ "Increase debug verbosity level\0" -/* 1105 */ "DEBUG_LEVEL\0" -/* 1117 */ "debug-level\0" -/* 1129 */ "Set the debug verbosity level\0" -/* 1159 */ "SET_DEBUG_LEVEL\0" -/* 1175 */ "set-debug-level\0" -/* 1191 */ "Force ntpq to operate in interactive mode\0" -/* 1233 */ "INTERACTIVE\0" -/* 1245 */ "interactive\0" -/* 1257 */ "Print a list of the peers\0" -/* 1283 */ "LISTPEERS\0" -/* 1293 */ "listpeers\0" -/* 1303 */ "numeric host addresses\0" -/* 1326 */ "NUMERIC\0" -/* 1334 */ "numeric\0" -/* 1342 */ "PEERS\0" -/* 1348 */ "peers\0" -/* 1354 */ "Show a list of the peers\0" -/* 1379 */ "SHOWPEERS\0" -/* 1389 */ "showpeers\0" -/* 1399 */ "Display extended usage information and exit\0" -/* 1443 */ "help\0" -/* 1448 */ "Extended usage information passed thru pager\0" -/* 1493 */ "more-help\0" -/* 1503 */ "Output version information and exit\0" -/* 1539 */ "version\0" -/* 1547 */ "Save the option state to a config file\0" -/* 1586 */ "save-opts\0" -/* 1596 */ "Load options from a config file\0" -/* 1628 */ "LOAD_OPTS\0" -/* 1638 */ "no-load-opts\0" -/* 1651 */ "no\0" -/* 1654 */ "NTPDC\0" -/* 1660 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 955 */ "Force IPv4 DNS name resolution\0" +/* 986 */ "IPV4\0" +/* 991 */ "ipv4\0" +/* 996 */ "Force IPv6 DNS name resolution\0" +/* 1027 */ "IPV6\0" +/* 1032 */ "ipv6\0" +/* 1037 */ "run a command and exit\0" +/* 1060 */ "COMMAND\0" +/* 1068 */ "command\0" +/* 1076 */ "Increase debug verbosity level\0" +/* 1107 */ "DEBUG_LEVEL\0" +/* 1119 */ "debug-level\0" +/* 1131 */ "Set the debug verbosity level\0" +/* 1161 */ "SET_DEBUG_LEVEL\0" +/* 1177 */ "set-debug-level\0" +/* 1193 */ "Force ntpq to operate in interactive mode\0" +/* 1235 */ "INTERACTIVE\0" +/* 1247 */ "interactive\0" +/* 1259 */ "Print a list of the peers\0" +/* 1285 */ "LISTPEERS\0" +/* 1295 */ "listpeers\0" +/* 1305 */ "numeric host addresses\0" +/* 1328 */ "NUMERIC\0" +/* 1336 */ "numeric\0" +/* 1344 */ "PEERS\0" +/* 1350 */ "peers\0" +/* 1356 */ "Show a list of the peers\0" +/* 1381 */ "SHOWPEERS\0" +/* 1391 */ "showpeers\0" +/* 1401 */ "Display extended usage information and exit\0" +/* 1445 */ "help\0" +/* 1450 */ "Extended usage information passed thru pager\0" +/* 1495 */ "more-help\0" +/* 1505 */ "Output version information and exit\0" +/* 1541 */ "version\0" +/* 1549 */ "Save the option state to a config file\0" +/* 1588 */ "save-opts\0" +/* 1598 */ "Load options from a config file\0" +/* 1630 */ "LOAD_OPTS\0" +/* 1640 */ "no-load-opts\0" +/* 1653 */ "no\0" +/* 1656 */ "NTPDC\0" +/* 1662 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]... [ host ...]\n\0" -/* 1792 */ ".ntprc\0" -/* 1799 */ "$HOME\0" -/* 1805 */ ".\0" -/* 1807 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 1841 */ "\n\n\0" -/* 1844 */ "ntpdc 4.2.7p295"; +/* 1794 */ "$HOME\0" +/* 1800 */ ".\0" +/* 1802 */ ".ntprc\0" +/* 1809 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 1843 */ "\n\n\0" +/* 1846 */ "ntpdc 4.2.7p295"; /* * ipv4 option description with * "Must also have options" and "Incompatible options": */ -#define IPV4_DESC (ntpdc_opt_strs+953) -#define IPV4_NAME (ntpdc_opt_strs+984) -#define IPV4_name (ntpdc_opt_strs+989) +#define IPV4_DESC (ntpdc_opt_strs+955) +#define IPV4_NAME (ntpdc_opt_strs+986) +#define IPV4_name (ntpdc_opt_strs+991) static int const aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) @@ -153,9 +154,9 @@ static int const aIpv4CantList[] = { * ipv6 option description with * "Must also have options" and "Incompatible options": */ -#define IPV6_DESC (ntpdc_opt_strs+994) -#define IPV6_NAME (ntpdc_opt_strs+1025) -#define IPV6_name (ntpdc_opt_strs+1030) +#define IPV6_DESC (ntpdc_opt_strs+996) +#define IPV6_NAME (ntpdc_opt_strs+1027) +#define IPV6_name (ntpdc_opt_strs+1032) static int const aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) @@ -163,26 +164,26 @@ static int const aIpv6CantList[] = { /* * command option description: */ -#define COMMAND_DESC (ntpdc_opt_strs+1035) -#define COMMAND_NAME (ntpdc_opt_strs+1058) -#define COMMAND_name (ntpdc_opt_strs+1066) +#define COMMAND_DESC (ntpdc_opt_strs+1037) +#define COMMAND_NAME (ntpdc_opt_strs+1060) +#define COMMAND_name (ntpdc_opt_strs+1068) #define COMMAND_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * debug-level option description: */ -#define DEBUG_LEVEL_DESC (ntpdc_opt_strs+1074) -#define DEBUG_LEVEL_NAME (ntpdc_opt_strs+1105) -#define DEBUG_LEVEL_name (ntpdc_opt_strs+1117) +#define DEBUG_LEVEL_DESC (ntpdc_opt_strs+1076) +#define DEBUG_LEVEL_NAME (ntpdc_opt_strs+1107) +#define DEBUG_LEVEL_name (ntpdc_opt_strs+1119) #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * set-debug-level option description: */ -#define SET_DEBUG_LEVEL_DESC (ntpdc_opt_strs+1129) -#define SET_DEBUG_LEVEL_NAME (ntpdc_opt_strs+1159) -#define SET_DEBUG_LEVEL_name (ntpdc_opt_strs+1175) +#define SET_DEBUG_LEVEL_DESC (ntpdc_opt_strs+1131) +#define SET_DEBUG_LEVEL_NAME (ntpdc_opt_strs+1161) +#define SET_DEBUG_LEVEL_name (ntpdc_opt_strs+1177) #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -190,9 +191,9 @@ static int const aIpv6CantList[] = { * interactive option description with * "Must also have options" and "Incompatible options": */ -#define INTERACTIVE_DESC (ntpdc_opt_strs+1191) -#define INTERACTIVE_NAME (ntpdc_opt_strs+1233) -#define INTERACTIVE_name (ntpdc_opt_strs+1245) +#define INTERACTIVE_DESC (ntpdc_opt_strs+1193) +#define INTERACTIVE_NAME (ntpdc_opt_strs+1235) +#define INTERACTIVE_name (ntpdc_opt_strs+1247) static int const aInteractiveCantList[] = { INDEX_OPT_COMMAND, INDEX_OPT_LISTPEERS, @@ -204,9 +205,9 @@ static int const aInteractiveCantList[] = { * listpeers option description with * "Must also have options" and "Incompatible options": */ -#define LISTPEERS_DESC (ntpdc_opt_strs+1257) -#define LISTPEERS_NAME (ntpdc_opt_strs+1283) -#define LISTPEERS_name (ntpdc_opt_strs+1293) +#define LISTPEERS_DESC (ntpdc_opt_strs+1259) +#define LISTPEERS_NAME (ntpdc_opt_strs+1285) +#define LISTPEERS_name (ntpdc_opt_strs+1295) static int const aListpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define LISTPEERS_FLAGS (OPTST_DISABLED) @@ -214,18 +215,18 @@ static int const aListpeersCantList[] = { /* * numeric option description: */ -#define NUMERIC_DESC (ntpdc_opt_strs+1303) -#define NUMERIC_NAME (ntpdc_opt_strs+1326) -#define NUMERIC_name (ntpdc_opt_strs+1334) +#define NUMERIC_DESC (ntpdc_opt_strs+1305) +#define NUMERIC_NAME (ntpdc_opt_strs+1328) +#define NUMERIC_name (ntpdc_opt_strs+1336) #define NUMERIC_FLAGS (OPTST_DISABLED) /* * peers option description with * "Must also have options" and "Incompatible options": */ -#define PEERS_DESC (ntpdc_opt_strs+1257) -#define PEERS_NAME (ntpdc_opt_strs+1342) -#define PEERS_name (ntpdc_opt_strs+1348) +#define PEERS_DESC (ntpdc_opt_strs+1259) +#define PEERS_NAME (ntpdc_opt_strs+1344) +#define PEERS_name (ntpdc_opt_strs+1350) static int const aPeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define PEERS_FLAGS (OPTST_DISABLED) @@ -234,9 +235,9 @@ static int const aPeersCantList[] = { * showpeers option description with * "Must also have options" and "Incompatible options": */ -#define SHOWPEERS_DESC (ntpdc_opt_strs+1354) -#define SHOWPEERS_NAME (ntpdc_opt_strs+1379) -#define SHOWPEERS_name (ntpdc_opt_strs+1389) +#define SHOWPEERS_DESC (ntpdc_opt_strs+1356) +#define SHOWPEERS_NAME (ntpdc_opt_strs+1381) +#define SHOWPEERS_name (ntpdc_opt_strs+1391) static int const aShowpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define SHOWPEERS_FLAGS (OPTST_DISABLED) @@ -244,11 +245,11 @@ static int const aShowpeersCantList[] = { /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpdc_opt_strs+1399) -#define HELP_name (ntpdc_opt_strs+1443) +#define HELP_DESC (ntpdc_opt_strs+1401) +#define HELP_name (ntpdc_opt_strs+1445) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpdc_opt_strs+1448) -#define MORE_HELP_name (ntpdc_opt_strs+1493) +#define MORE_HELP_DESC (ntpdc_opt_strs+1450) +#define MORE_HELP_name (ntpdc_opt_strs+1495) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -261,14 +262,14 @@ static int const aShowpeersCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpdc_opt_strs+1503) -#define VER_name (ntpdc_opt_strs+1539) -#define SAVE_OPTS_DESC (ntpdc_opt_strs+1547) -#define SAVE_OPTS_name (ntpdc_opt_strs+1586) -#define LOAD_OPTS_DESC (ntpdc_opt_strs+1596) -#define LOAD_OPTS_NAME (ntpdc_opt_strs+1628) -#define NO_LOAD_OPTS_name (ntpdc_opt_strs+1638) -#define LOAD_OPTS_pfx (ntpdc_opt_strs+1651) +#define VER_DESC (ntpdc_opt_strs+1505) +#define VER_name (ntpdc_opt_strs+1541) +#define SAVE_OPTS_DESC (ntpdc_opt_strs+1549) +#define SAVE_OPTS_name (ntpdc_opt_strs+1588) +#define LOAD_OPTS_DESC (ntpdc_opt_strs+1598) +#define LOAD_OPTS_NAME (ntpdc_opt_strs+1630) +#define NO_LOAD_OPTS_name (ntpdc_opt_strs+1640) +#define LOAD_OPTS_pfx (ntpdc_opt_strs+1653) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -304,13 +305,14 @@ static tOptProc */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_NTPDC_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Ntpdc Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntpdc Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpdc program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, @@ -501,20 +503,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Ntpdc Option Environment + * Define the ntpdc Option Environment */ -#define zPROGNAME (ntpdc_opt_strs+1654) -#define zUsageTitle (ntpdc_opt_strs+1660) -#define zRcName (ntpdc_opt_strs+1792) +#define zPROGNAME (ntpdc_opt_strs+1656) +#define zUsageTitle (ntpdc_opt_strs+1662) +#define zRcName (ntpdc_opt_strs+1802) static char const * const apzHomeList[3] = { - ntpdc_opt_strs+1799, - ntpdc_opt_strs+1805, + ntpdc_opt_strs+1794, + ntpdc_opt_strs+1800, NULL }; -#define zBugsAddr (ntpdc_opt_strs+1807) -#define zExplain (ntpdc_opt_strs+1841) +#define zBugsAddr (ntpdc_opt_strs+1809) +#define zExplain (ntpdc_opt_strs+1843) #define zDetail (NULL) -#define zFullVersion (ntpdc_opt_strs+1844) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (ntpdc_opt_strs+1846) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -529,35 +531,58 @@ static char const * const apzHomeList[3] = { #define ntpdc_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&ntpdcOptions, NTPDC_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(NTPDC_EXIT_SUCCESS); } #if ! defined(TEST_NTPDC_OPTS) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the set-debug-level option. * - * For the set-debug-level option. + * @param pOptions the ntpdc options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 26 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); + (void)pOptions; } #endif /* defined(TEST_NTPDC_OPTS) */ -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTPDC_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -570,12 +595,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTPDC_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntpdc. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntpdc + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntpdc_packager_info NULL #else @@ -591,7 +623,13 @@ static char const ntpdc_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntpdc. The one structure that + * binds them all. + */ tOptions ntpdcOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -635,7 +673,16 @@ tOptions ntpdcOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -655,8 +702,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntpdcOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/ntpdc/ntpdc-opts.h b/ntpdc/ntpdc-opts.h index aabca59abd..b5972ee3b4 100644 --- a/ntpdc/ntpdc-opts.h +++ b/ntpdc/ntpdc-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:31:53 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:27 PM by AutoGen 5.16.2 * From the definitions ntpdc-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -112,7 +112,9 @@ typedef enum { */ typedef enum { NTPDC_EXIT_SUCCESS = 0, - NTPDC_EXIT_FAILURE = 1 + NTPDC_EXIT_FAILURE = 1, + NTPDC_EXIT_NO_CONFIG_INPUT = 66, + NTPDC_EXIT_LIBOPTS_FAILURE = 70 } ntpdc_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -204,7 +206,7 @@ typedef enum { ntpdcOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -220,6 +222,12 @@ extern tOptions ntpdcOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/ntpdc/ntpdc.1ntpdcman b/ntpdc/ntpdc.1ntpdcman index 65bc3a01fc..914ee9893d 100644 --- a/ntpdc/ntpdc.1ntpdcman +++ b/ntpdc/ntpdc.1ntpdcman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:03 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:05 PM by AutoGen 5.16.2 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ ntpdc \- vendor-specific NTPD control program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ host ...] .PP .SH DESCRIPTION -.B +.B XXX Program Name is a utility program used to query .Xr ntpd 8 about its @@ -25,12 +25,12 @@ be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the -.B +.B XXX Program Name interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using -.B . +.B XXX Program Name . .SH "OPTIONS" .TP .BR \-4 ", " -\-ipv4 @@ -87,7 +87,7 @@ their state. This is equivalent to the 'listpeers' interactive command. numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +converting to the canonical host names. .TP .BR \-p ", " -\-peers Print a list of the peers. @@ -141,24 +141,24 @@ is searched for within those directories. .SH USAGE If one or more request options are included on the command line when -.B +.B XXX Program Name is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, -.B +.B XXX Program Name will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The -.B +.B XXX Program Name utility will prompt for commands if the standard input is a terminal device. .PP The -.B +.B XXX Program Name utility uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. @@ -166,21 +166,21 @@ Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The -.B +.B XXX Program Name utility makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time. .PP The operation of -.B +.B XXX Program Name are specific to the particular implementation of the .Xr ntpd 8 daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote -.B +.B XXX Program Name utility which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key @@ -199,11 +199,11 @@ n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, -.B +.B XXX Program Name will attempt to read interactive format commands from the standard input. -.Ss "Interactive Commands" +.SS "Interactive Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to @@ -216,7 +216,7 @@ followed by a file name, to the command line. .PP A number of interactive format commands are executed entirely within the -.B +.B XXX Program Name utility itself and do not result in NTP mode 7 requests being sent to a server. These are described @@ -298,7 +298,7 @@ Note that since .Nm retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. -.Ss "Control Message Commands" +.SS "Control Message Commands" Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands @@ -535,14 +535,14 @@ Obtain debugging information for a reference clock driver. This information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand. -.Ss "Runtime Configuration Requests" +.SS "Runtime Configuration Requests" All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to -.B . +.B XXX Program Name . This can be done using the .Ic keyid and @@ -811,11 +811,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "SEE ALSO" .Xr ntp.conf 5 , .Xr ntpd 8 @@ -831,7 +838,7 @@ Copyright (C) 1970-2012 The University of Delaware all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS The -.B +.B XXX Program Name utility is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. diff --git a/ntpdc/ntpdc.1ntpdcmdoc b/ntpdc/ntpdc.1ntpdcmdoc index e3b7ed0859..3813bf82fe 100644 --- a/ntpdc/ntpdc.1ntpdcmdoc +++ b/ntpdc/ntpdc.1ntpdcmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPDC 1ntpdcmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:07 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:00 PM by AutoGen 5.16.2 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -62,10 +62,12 @@ host(s). Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-i ", " -\-interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -83,8 +85,8 @@ their state. This is equivalent to the 'listpeers' interactive command. .It \-n ", " -\-numeric numeric host addresses. .sp -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +Output all host addresses in dotted\-quad numeric format rather than +converting to the canonical host names. .It \-p ", " -\-peers Print a list of the peers. This option must not appear in combination with any of the following options: @@ -757,10 +759,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "SEE ALSO" .Xr ntp.conf 5 , diff --git a/ntpdc/ntpdc.html b/ntpdc/ntpdc.html index 458e90b81a..4b707777d7 100644 --- a/ntpdc/ntpdc.html +++ b/ntpdc/ntpdc.html @@ -3,7 +3,7 @@ ntpdc: NTPD Control User's Manual - + @@ -14,18 +14,20 @@ pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } - span.sc { font-variant:small-caps } - span.roman { font-family: serif; font-weight: normal; } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } -->

ntpdc: NTPD Control User's Manual

+


-Next: , +Next: , Previous: (dir), Up: (dir) -
+

ntpdc: NTPD Control User Manual

@@ -41,7 +43,7 @@ well. It can be run as an interactive command or from a cron job.

The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. -

+

Short Contents

-


-
+


+ +
@@ -76,322 +79,1238 @@ the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.
-


-
+


+ +

Invoking ntpdc

-

This section was generated by AutoGen, -the aginfo template and the option descriptions for the ntpdc program. It documents the ntpdc usage text and option meanings. +

ntpdc +is a utility program used to query +ntpd(8) +about its +current state and to request changes in that state. +It uses NTP mode 7 control message formats described in the source code. +The program may +be run either in interactive mode or controlled using command line +arguments. +Extensive state and statistics information is available +through the +ntpdc +interface. +In addition, nearly all the +configuration options which can be specified at startup using +ntpd's configuration file may also be specified at run time using +ntpdc. -

This software is released under a specialized copyright license. +

This section was generated by AutoGen, +using the agtexi-cmd template and the option descriptions for the ntpdc program. +This software is released under the NTP license, <http://ntp.org/license>.

+


-Next: , +Next: , Up: ntpdc Invocation -
+
-

ntpdc usage help (-?)

- -

-This is the automatically generated usage text for ntpdc: - -

ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p295
-USAGE:  ntpdc [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]
-  Flg Arg Option-Name    Description
-   -4 no  ipv4           Force IPv4 DNS name resolution
-                                - prohibits these options:
-                                ipv6
-   -6 no  ipv6           Force IPv6 DNS name resolution
-                                - prohibits these options:
-                                ipv4
-   -c Str command        run a command and exit
-                                - may appear multiple times
-   -d no  debug-level    Increase debug verbosity level
-                                - may appear multiple times
-   -D Str set-debug-level Set the debug verbosity level
-                                - may appear multiple times
-   -i no  interactive    Force ntpq to operate in interactive mode
-                                - prohibits these options:
-                                command
-                                listpeers
-                                peers
-                                showpeers
-   -l no  listpeers      Print a list of the peers
-                                - prohibits these options:
-                                command
-   -n no  numeric        numeric host addresses
-   -p no  peers          Print a list of the peers
-                                - prohibits these options:
-                                command
-   -s no  showpeers      Show a list of the peers
-                                - prohibits these options:
-                                command
-      opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-
-
-The following option preset mechanisms are supported:
- - reading file $HOME/.ntprc
- - reading file ./.ntprc
- - examining environment variables named NTPDC_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
+

ntpdc help/usage (-?)

+ +

+This is the automatically generated usage text for ntpdc. +The text printed is the same whether for the help option (-?) or the more-help option (-!). more-help will print +the usage text by passing it through a pager program. +more-help is disabled on platforms without a working +fork(2) function. The PAGER environment variable is +used to select the program, defaulting to more. Both will exit +with a status code of 0. + +

ntpdc is unavailable - no -?
 
+


-Next: , +Next: , Previous: ntpdc usage, Up: ntpdc Invocation -
-
- -

command option (-c)

- -

-This is the “run a command and exit” option. - -

This option has some usage constraints. It: -

    -
  • may appear an unlimited number of times. -
- -

The following argument is interpreted as an interactive format command -and is added to the list of commands to be executed on the specified -host(s). -

-


-Next: , -Previous: ntpdc command, -Up: ntpdc Invocation -
-

debug-level option (-d)

+

ipv4 option (-4)

-

-This is the “increase debug verbosity level” option. +

+This is the “force ipv4 dns name resolution” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

    -
  • may appear an unlimited number of times. +
  • must not appear in combination with any of the following options: +ipv6.
+

Force DNS resolution of following host names on the command line +to the IPv4 namespace.

+


-Next: , -Previous: ntpdc debug-level, +Next: , +Previous: ntpdc ipv4, Up: ntpdc Invocation -
+
-

interactive option (-i)

+

ipv6 option (-6)

-

-This is the “force ntpq to operate in interactive mode” option. +

+This is the “force ipv6 dns name resolution” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • must not appear in combination with any of the following options: -command, listpeers, peers, showpeers. +ipv4.
-

Force ntpq to operate in interactive mode. Prompts will be written -to the standard output and commands read from the standard input. - +

Force DNS resolution of following host names on the command line +to the IPv6 namespace.

+


-Next: , -Previous: ntpdc interactive, +Next: , +Previous: ntpdc ipv6, Up: ntpdc Invocation -
+
-

ipv4 option (-4)

+

command option (-c)

-

-This is the “force ipv4 dns name resolution” option. +

+This is the “run a command and exit” option. +This option takes an argument string cmd. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

    -
  • must not appear in combination with any of the following options: -ipv6. +
  • may appear an unlimited number of times.
-

Force DNS resolution of following host names on the command line -to the IPv4 namespace. - +

The following argument is interpreted as an interactive format command +and is added to the list of commands to be executed on the specified +host(s).

+


-Next: , -Previous: ntpdc ipv4, +Next: , +Previous: ntpdc command, Up: ntpdc Invocation -
+
-

ipv6 option (-6)

+

interactive option (-i)

-

-This is the “force ipv6 dns name resolution” option. +

+This is the “force ntpq to operate in interactive mode” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • must not appear in combination with any of the following options: -ipv4. +command, listpeers, peers, showpeers.
-

Force DNS resolution of following host names on the command line -to the IPv6 namespace. - +

Force ntpq to operate in interactive mode. Prompts will be written +to the standard output and commands read from the standard input.

+


-Next: , -Previous: ntpdc ipv6, +Next: , +Previous: ntpdc interactive, Up: ntpdc Invocation -
+

listpeers option (-l)

-

+

This is the “print a list of the peers” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • must not appear in combination with any of the following options: command.

Print a list of the peers known to the server as well as a summary of -their state. This is equivalent to the 'listpeers' interactive command. - +their state. This is equivalent to the 'listpeers' interactive command.

+


-Next: , +Next: , Previous: ntpdc listpeers, Up: ntpdc Invocation -
+

numeric option (-n)

-

+

This is the “numeric host addresses” option. Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. - +converting to the canonical host names.

+


-Next: , +Next: , Previous: ntpdc numeric, Up: ntpdc Invocation -
+

peers option (-p)

-

+

This is the “print a list of the peers” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • must not appear in combination with any of the following options: command.

Print a list of the peers known to the server as well as a summary -of their state. This is equivalent to the 'peers' interactive command. - +of their state. This is equivalent to the 'peers' interactive command.

+


-Next: , +Next: , Previous: ntpdc peers, Up: ntpdc Invocation -
+
-

set-debug-level option (-D)

+

showpeers option (-s)

-

-This is the “set the debug verbosity level” option. +

+This is the “show a list of the peers” option. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

    -
  • may appear an unlimited number of times. +
  • must not appear in combination with any of the following options: +command.
+

Print a list of the peers known to the server as well as a summary +of their state. This is equivalent to the 'dmpeers' interactive command. +

+


-Previous: ntpdc set-debug-level, +Next: , +Previous: ntpdc showpeers, Up: ntpdc Invocation -
+
-

showpeers option (-s)

+

presetting/configuring ntpdc

-

-This is the “show a list of the peers” option. +

Any option that is not marked as not presettable may be preset by +loading values from configuration ("rc" or "ini") files, and values from environment variables named NTPDC and NTPDC_<OPTION_NAME>. <OPTION_NAME> must be one of +the options listed above in upper case and segmented with underscores. +The NTPDC variable will be tokenized and parsed like +the command line. The remaining variables are tested for existence and their +values are treated like option arguments. -

This option has some usage constraints. It: +

libopts will search in 2 places for configuration files:

    -
  • must not appear in combination with any of the following options: -command. +
  • $HOME +
  • $PWD
+ The environment variables HOME, and PWD +are expanded and replaced when ntpdc runs. +For any of these that are plain files, they are simply processed. +For any that are directories, then a file named .ntprc is searched for +within that directory and processed. + +

Configuration files may be in a wide variety of formats. +The basic format is an option name followed by a value (argument) on the +same line. Values may be separated from the option name with a colon, +equal sign or simply white space. Values may be continued across multiple +lines by escaping the newline with a backslash. + +

Multiple programs may also share the same initialization file. +Common options are collected at the top, followed by program specific +segments. The segments are separated by lines like: +

    [NTPDC]
+
+

or by +

    <?program ntpdc>
+
+

Do not mix these styles within one configuration file. -

Print a list of the peers known to the server as well as a summary -of their state. This is equivalent to the 'dmpeers' interactive command. +

Compound values and carefully constructed string values may also be +specified using XML syntax: +

    <option-name>
+       <sub-opt>...&lt;...&gt;...</sub-opt>
+    </option-name>
+
+

yielding an option-name.sub-opt string value of +

    "...<...>..."
+
+

AutoOpts does not track suboptions. You simply note that it is a +hierarchicly valued option. AutoOpts does provide a means for searching +the associated name/value pair list (see: optionFindValue). + +

The command line options relating to configuration and/or usage help are: + +

version (-)
+ +

Print the program version to standard out, optionally with licensing +information, then exit 0. The optional argument specifies how much licensing +detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. Only the +first letter of the argument is examined: + +

+
version
Only print the version. This is the default. +
copyright
Name the copyright usage licensing terms. +
verbose
Print the full copyright usage licensing terms. +
+ +
+ +


+Next: , +Previous: ntpdc config, +Up: ntpdc Invocation + +
+ +

ntpdc exit status

+ +

One of the following exit values will be returned: +

+
0 (EXIT_SUCCESS)
Successful program execution. +
1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid. +
66 (EX_NOINPUT)
A specified configuration file could not be loaded. +
70 (EX_SOFTWARE)
libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +
+
+ +


+Next: , +Previous: ntpdc exit status, +Up: ntpdc Invocation + +
+ +

ntpdc Usage

+ +

If one or more request options are included on the command line +when +ntpdc +is executed, each of the requests will be sent +to the NTP servers running on each of the hosts given as command +line arguments, or on localhost by default. +If no request options +are given, +ntpdc +will attempt to read commands from the +standard input and execute these on the NTP server running on the +first host given on the command line, again defaulting to localhost +when no other host is specified. +The +ntpdc +utility will prompt for +commands if the standard input is a terminal device. + +

The +ntpdc +utility uses NTP mode 7 packets to communicate with the +NTP server, and hence can be used to query any compatible server on +the network which permits it. +Note that since NTP is a UDP protocol +this communication will be somewhat unreliable, especially over +large distances in terms of network topology. +The +ntpdc +utility makes +no attempt to retransmit requests, and will time requests out if +the remote host is not heard from within a suitable timeout +time. + +

The operation of +ntpdc +are specific to the particular +implementation of the +ntpd(8) +daemon and can be expected to +work only with this and maybe some previous versions of the daemon. +Requests from a remote +ntpdc +utility which affect the +state of the local server must be authenticated, which requires +both the remote program and local server share a common key and key +identifier. + +

Note that in contexts where a host name is expected, a +-4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, +while a +-6 qualifier forces DNS resolution to the IPv6 namespace. +Specifying a command line option other than +-i or +-n will cause the specified query (queries) to be sent to +the indicated host(s) immediately. +Otherwise, +ntpdc +will +attempt to read interactive format commands from the standard +input. +.Ss +"Interactive +Commands" +Interactive format commands consist of a keyword followed by zero +to four arguments. +Only enough characters of the full keyword to +uniquely identify the command need be typed. +The output of a +command is normally sent to the standard output, but optionally the +output of individual commands may be sent to a file by appending a +.Ql +\&> +, +followed by a file name, to the command line. + +

A number of interactive format commands are executed entirely +within the +ntpdc +utility itself and do not result in NTP +mode 7 requests being sent to a server. +These are described +following. +

+
Ic
Ic
A +.Sq +Ic +\&? +will print a list of all the command +keywords known to this incarnation of +ntpdc. +A +.Sq +Ic +\&? +followed by a command keyword will print function and usage +information about the command. +This command is probably a better +source of information about +ntpq(8) +than this manual +page. +
Ic
Specify a time interval to be added to timestamps included in +requests which require authentication. +This is used to enable +(unreliable) server reconfiguration over long delay network paths +or between machines whose clocks are unsynchronized. +Actually the +server does not now require timestamps in authenticated requests, +so this command may be obsolete. +
Ic
Set the host to which future queries will be sent. +Hostname may +be either a host name or a numeric address. +
Ic
If +.Cm +yes +is specified, host names are printed in +information displays. +If +.Cm +no +is specified, numeric +addresses are printed instead. +The default is +.Cm +yes +, +unless +modified using the command line +-n switch. +
Ic
This command allows the specification of a key number to be +used to authenticate configuration requests. +This must correspond +to a key number the server has been configured to use for this +purpose. +
Ic
Exit +ntpdc. +
Ic
This command prompts you to type in a password (which will not +be echoed) which will be used to authenticate configuration +requests. +The password must correspond to the key configured for +use by the NTP server for this purpose if such requests are to be +successful. +
Ic
Specify a timeout period for responses to server queries. +The +default is about 8000 milliseconds. +Note that since +ntpdc +retries each query once after a timeout, the total waiting time for +a timeout will be twice the timeout value set. + +

.Ss +"Control +Message +Commands" +Query commands result in NTP mode 7 packets containing requests for +information being sent to the server. +These are read-only commands +in that they make no modification of the server configuration +state. +

+
Ic
Obtains and prints a brief list of the peers for which the +server is maintaining state. +These should include all configured +peer associations as well as those peers whose stratum is such that +they are considered by the server to be possible future +synchronization candidates. +
Ic
Obtains a list of peers for which the server is maintaining +state, along with a summary of that state. +Summary information +includes the address of the remote peer, the local interface +address (0.0.0.0 if a local address has yet to be determined), the +stratum of the remote peer (a stratum of 16 indicates the remote +peer is unsynchronized), the polling interval, in seconds, the +reachability register, in octal, and the current estimated delay, +offset and dispersion of the peer, all in seconds. + +

The character in the left margin indicates the mode this peer +entry is operating in. +A +.Ql +\&+ +denotes symmetric active, a +.Ql +\&- +indicates symmetric passive, a +.Ql +\&= +means the +remote server is being polled in client mode, a +.Ql +\&^ +indicates that the server is broadcasting to this address, a +.Ql +\&~ +denotes that the remote peer is sending broadcasts and a +.Ql +\&~ +denotes that the remote peer is sending broadcasts and a +.Ql +\&* +marks the peer the server is currently synchronizing +to. + +

The contents of the host field may be one of four forms. +It may +be a host name, an IP address, a reference clock implementation +name with its parameter or +.Fn +REFCLK +"implementation_number" +"parameter" +. +On +.Ic +hostnames +.Cm +no +only IP-addresses +will be displayed. +

Ic
A slightly different peer summary list. +Identical to the output +of the +.Ic +peers +command, except for the character in the +leftmost column. +Characters only appear beside peers which were +included in the final stage of the clock selection algorithm. +A +.Ql +\&. +indicates that this peer was cast off in the falseticker +detection, while a +.Ql +\&+ +indicates that the peer made it +through. +A +.Ql +\&* +denotes the peer the server is currently +synchronizing with. +
Ic
Shows a detailed display of the current peer variables for one +or more peers. +Most of these values are described in the NTP +Version 2 specification. +
Ic
Show per-peer statistic counters associated with the specified +peer(s). +
Ic
Obtain and print information concerning a peer clock. +The +values obtained provide information on the setting of fudge factors +and other clock performance information. +
Ic
Obtain and print kernel phase-lock loop operating parameters. +This information is available only if the kernel has been specially +modified for a precision timekeeping function. +
Ic
Print the values of selected loop filter variables. +The loop +filter is the part of NTP which deals with adjusting the local +system clock. +The +.Sq +offset +is the last offset given to the +loop filter by the packet processing code. +The +.Sq +frequency +is the frequency error of the local clock in parts-per-million +(ppm). +The +.Sq +time_const +controls the stiffness of the +phase-lock loop and thus the speed at which it can adapt to +oscillator drift. +The +.Sq +watchdog +timer +value is the number +of seconds which have elapsed since the last sample offset was +given to the loop filter. +The +.Cm +oneline +and +.Cm +multiline +options specify the format in which this +information is to be printed, with +.Cm +multiline +as the +default. +
Ic
Print a variety of system state variables, i.e., state related +to the local server. +All except the last four lines are described +in the NTP Version 3 specification, RFC-1305. + +

The +.Sq +system +flags +show various system flags, some of +which can be set and cleared by the +.Ic +enable +and +.Ic +disable +configuration commands, respectively. +These are +the +.Cm +auth +, +.Cm +bclient +, +.Cm +monitor +, +.Cm +pll +, +.Cm +pps +and +.Cm +stats +flags. +See the +ntpd(8) +documentation for the meaning of these flags. +There +are two additional flags which are read only, the +.Cm +kernel_pll +and +.Cm +kernel_pps +. +These flags indicate +the synchronization status when the precision time kernel +modifications are in use. +The +.Sq +kernel_pll +indicates that +the local clock is being disciplined by the kernel, while the +.Sq +kernel_pps +indicates the kernel discipline is provided by the PPS +signal. + +

The +.Sq +stability +is the residual frequency error remaining +after the system frequency correction is applied and is intended for +maintenance and debugging. +In most architectures, this value will +initially decrease from as high as 500 ppm to a nominal value in +the range .01 to 0.1 ppm. +If it remains high for some time after +starting the daemon, something may be wrong with the local clock, +or the value of the kernel variable +.Va +kern.clockrate.tick +may be +incorrect. + +

The +.Sq +broadcastdelay +shows the default broadcast delay, +as set by the +.Ic +broadcastdelay +configuration command. + +

The +.Sq +authdelay +shows the default authentication delay, +as set by the +.Ic +authdelay +configuration command. +

Ic
Print statistics counters maintained in the protocol +module. +
Ic
Print statistics counters related to memory allocation +code. +
Ic
Print statistics counters maintained in the input-output +module. +
Ic
Print statistics counters maintained in the timer/event queue +support code. +
Ic
Obtain and print the server's restriction list. +This list is +(usually) printed in sorted order and may help to understand how +the restrictions are applied. +
Ic
Obtain and print traffic counts collected and maintained by the +monitor facility. +The version number should not normally need to be +specified. +
Ic
Obtain debugging information for a reference clock driver. +This +information is provided only by some clock drivers and is mostly +undecodable without a copy of the driver source in hand. + +

.Ss +"Runtime +Configuration +Requests" +All requests which cause state changes in the server are +authenticated by the server using a configured NTP key (the +facility can also be disabled by the server by not configuring a +key). +The key number and the corresponding key must also be made +known to +ntpdc. +This can be done using the +.Ic +keyid +and +.Ic +passwd +commands, the latter of which will prompt at the terminal for a +password to use as the encryption key. +You will also be prompted +automatically for both the key number and password the first time a +command which would result in an authenticated request to the +server is given. +Authentication not only provides verification that +the requester has permission to make such changes, but also gives +an extra degree of protection again transmission errors. + +

Authenticated requests always include a timestamp in the packet +data, which is included in the computation of the authentication +code. +This timestamp is compared by the server to its receive time +stamp. +If they differ by more than a small amount the request is +rejected. +This is done for two reasons. +First, it makes simple +replay attacks on the server, by someone who might be able to +overhear traffic on your LAN, much more difficult. +Second, it makes +it more difficult to request configuration changes to your server +from topologically remote hosts. +While the reconfiguration facility +will work well with a server on the local host, and may work +adequately between time-synchronized hosts on the same LAN, it will +work very poorly for more distant hosts. +As such, if reasonable +passwords are chosen, care is taken in the distribution and +protection of keys and appropriate source address restrictions are +applied, the run time reconfiguration facility should provide an +adequate level of security. + +

The following commands all make authenticated requests. +

+
Xo
.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc +Add a configured peer association at the given address and +operating in symmetric active mode. +Note that an existing +association with the same peer may be deleted when this command is +executed, or may simply be converted to conform to the new +configuration, as appropriate. +If the optional +.Ar +keyid +is a +nonzero integer, all outgoing packets to the remote server will +have an authentication field attached encrypted with this key. +If +the value is 0 (or not given) no authentication will be done. +The +.Ar +version +can be 1, 2 or 3 and defaults to 3. +The +.Cm +prefer +keyword indicates a preferred peer (and thus will +be used primarily for clock synchronisation if possible). +The +preferred peer also determines the validity of the PPS signal - if +the preferred peer is suitable for synchronisation so is the PPS +signal. +
Xo
.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc +Identical to the addpeer command, except that the operating +mode is client. +
Xo
.Op +Ar +keyid +.Op +Ar +version +.Op +Cm +prefer +.Xc +Identical to the addpeer command, except that the operating +mode is broadcast. +In this case a valid key identifier and key are +required. +The +.Ar +peer_address +parameter can be the broadcast +address of the local network or a multicast group address assigned +to NTP. +If a multicast address, a multicast-capable kernel is +required. +
Ic
This command causes the configured bit to be removed from the +specified peer(s). +In many cases this will cause the peer +association to be deleted. +When appropriate, however, the +association may persist in an unconfigured mode if the remote peer +is willing to continue on in this fashion. +
Xo
.Op +Cm +time1 +.Op +Cm +time2 +.Op +Ar +stratum +.Op +Ar +refid +.Xc +This command provides a way to set certain data for a reference +clock. +See the source listing for further information. +
Xo
.Oo +.Cm +auth +| +Cm +bclient +| +.Cm +calibrate +| +Cm +kernel +| +.Cm +monitor +| +Cm +ntp +| +.Cm +pps +| +Cm +stats +.Oc +.Xc +
Xo
.Oo +.Cm +auth +| +Cm +bclient +| +.Cm +calibrate +| +Cm +kernel +| +.Cm +monitor +| +Cm +ntp +| +.Cm +pps +| +Cm +stats +.Oc +.Xc +These commands operate in the same way as the +.Ic +enable +and +.Ic +disable +configuration file commands of +ntpd(8). +
+
Cm
Enables the server to synchronize with unconfigured peers only +if the peer has been correctly authenticated using either public key +or private key cryptography. +The default for this flag is enable. +
Cm
Enables the server to listen for a message from a broadcast or +multicast server, as in the multicastclient command with +default address. +The default for this flag is disable. +
Cm
Enables the calibrate feature for reference clocks. +The default for this flag is disable. +
Cm
Enables the kernel time discipline, if available. +The default for this flag is enable if support is available, otherwise disable. +
Cm
Enables the monitoring facility. +See the +ntpdc(8). +program and the monlist command or further information. +The default for this flag is enable. +
Cm
Enables time and frequency discipline. +In effect, this switch opens and closes the feedback loop, +which is useful for testing. +The default for this flag is enable. +
Cm
Enables the pulse-per-second (PPS) signal when frequency +and time is disciplined by the precision time kernel modifications. +See the +.Qq +A +Kernel +Model +for +Precision +Timekeeping +(available as part of the HTML documentation +provided in +.Pa +/usr/share/doc/ntp +) +page for further information. +The default for this flag is disable. +
Cm
Enables the statistics facility. +See the +.Sx +Monitoring +Options +section of +ntp.conf(5) +for further information. +The default for this flag is disable. + +

.It +Xo +Ic +restrict +Ar +address +Ar +mask +.Ar +flag +Oo +Ar +... +Oc +.Xc +This command operates in the same way as the +.Ic +restrict +configuration file commands of +ntpd(8). +.It +Xo +Ic +unrestrict +Ar +address +Ar +mask +.Ar +flag +Oo +Ar +... +Oc +.Xc +Unrestrict the matching entry from the restrict list. +.It +Xo +Ic +delrestrict +Ar +address +Ar +mask +.Op +Cm +ntpport +.Xc +Delete the matching entry from the restrict list. +.It +Ic +readkeys +Causes the current set of authentication keys to be purged and +a new set to be obtained by rereading the keys file (which must +have been specified in the +ntpd(8) +configuration file). +This +allows encryption keys to be changed without restarting the +server. +.It +Ic +trustedkey +Ar +keyid +Oo +Ar +... +Oc +.It +Ic +untrustedkey +Ar +keyid +Oo +Ar +... +Oc +These commands operate in the same way as the +.Ic +trustedkey +and +.Ic +untrustedkey +configuration file +commands of +ntpd(8). +.It +Ic +authinfo +Returns information concerning the authentication module, +including known keys and counts of encryptions and decryptions +which have been done. +.It +Ic +traps +Display the traps set in the server. +See the source listing for +further information. +.It +Xo +Ic +addtrap +Ar +address +.Op +Ar +port +.Op +Ar +interface +.Xc +Set a trap for asynchronous messages. +See the source listing +for further information. +.It +Xo +Ic +clrtrap +Ar +address +.Op +Ar +port +.Op +Ar +interface +.Xc +Clear a trap for asynchronous messages. +See the source listing +for further information. +.It +Ic +reset +Clear the statistics counters in various modules of the server. +See the source listing for further information.

+


+Next: , +Previous: ntpdc Usage, +Up: ntpdc Invocation + +
+ +

ntpdc See Also

+ +

ntp.conf(5), +ntpd(8) +.Rs +.%A +David +L. +Mills +.%T +Network +Time +Protocol +(Version +3) +.%O +RFC1305 +.Re +

+ +


+Next: , +Previous: ntpdc See Also, +Up: ntpdc Invocation + +
+ +

ntpdc Authors

+ +

The formatting directives in this document came from FreeBSD. +

+ +


+Previous: ntpdc Authors, +Up: ntpdc Invocation + +
+ +

ntpdc Bugs

+ +

The +ntpdc +utility is a crude hack. +Much of the information it shows is +deadly boring and could only be loved by its implementer. +The +program was designed so that new (and temporary) features were easy +to hack in, at great expense to the program's ease of use. +Despite +this, the program is occasionally useful. + +

Please report bugs to http://bugs.ntp.org . + +

-
+


+ +
- +

Usage

-

The simplest use of this program is as an unprivileged command to +

The simplest use of this program is as an unprivileged command to check the current time, offset, and error in the local clock. For example: -

    ntpdc ntpserver.somewhere
+                    
                        ntpdc ntpserver.somewhere
 
-

With suitable privilege, it can be run as a command or in a +

With suitable privilege, it can be run as a command or in a cron job to reset the local clock from a reliable server, like the ntpdate and rdate commands. For example: -

    ntpdc -a ntpserver.somewhere
+                    
                        ntpdc -a ntpserver.somewhere
 
- + diff --git a/ntpdc/ntpdc.man.in b/ntpdc/ntpdc.man.in index 574e1b171e..f99bcea65e 100644 --- a/ntpdc/ntpdc.man.in +++ b/ntpdc/ntpdc.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:03 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:05 PM by AutoGen 5.16.2 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ ntpdc \- vendor-specific NTPD control program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ host ...] .PP .SH DESCRIPTION -.B +.B XXX Program Name is a utility program used to query .Xr ntpd 8 about its @@ -25,12 +25,12 @@ be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the -.B +.B XXX Program Name interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using -.B . +.B XXX Program Name . .SH "OPTIONS" .TP .BR \-4 ", " -\-ipv4 @@ -87,7 +87,7 @@ their state. This is equivalent to the 'listpeers' interactive command. numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +converting to the canonical host names. .TP .BR \-p ", " -\-peers Print a list of the peers. @@ -141,24 +141,24 @@ is searched for within those directories. .SH USAGE If one or more request options are included on the command line when -.B +.B XXX Program Name is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, -.B +.B XXX Program Name will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The -.B +.B XXX Program Name utility will prompt for commands if the standard input is a terminal device. .PP The -.B +.B XXX Program Name utility uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. @@ -166,21 +166,21 @@ Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The -.B +.B XXX Program Name utility makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time. .PP The operation of -.B +.B XXX Program Name are specific to the particular implementation of the .Xr ntpd 8 daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote -.B +.B XXX Program Name utility which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key @@ -199,11 +199,11 @@ n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, -.B +.B XXX Program Name will attempt to read interactive format commands from the standard input. -.Ss "Interactive Commands" +.SS "Interactive Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to @@ -216,7 +216,7 @@ followed by a file name, to the command line. .PP A number of interactive format commands are executed entirely within the -.B +.B XXX Program Name utility itself and do not result in NTP mode 7 requests being sent to a server. These are described @@ -298,7 +298,7 @@ Note that since .Nm retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. -.Ss "Control Message Commands" +.SS "Control Message Commands" Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands @@ -535,14 +535,14 @@ Obtain debugging information for a reference clock driver. This information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand. -.Ss "Runtime Configuration Requests" +.SS "Runtime Configuration Requests" All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to -.B . +.B XXX Program Name . This can be done using the .Ic keyid and @@ -811,11 +811,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "SEE ALSO" .Xr ntp.conf 5 , .Xr ntpd 8 @@ -831,7 +838,7 @@ Copyright (C) 1970-2012 The University of Delaware all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS The -.B +.B XXX Program Name utility is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. diff --git a/ntpdc/ntpdc.mdoc.in b/ntpdc/ntpdc.mdoc.in index 49f09ba394..6a8e196534 100644 --- a/ntpdc/ntpdc.mdoc.in +++ b/ntpdc/ntpdc.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPDC @NTPDC_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:07 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:00 PM by AutoGen 5.16.2 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -62,10 +62,12 @@ host(s). Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-i ", " -\-interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -83,8 +85,8 @@ their state. This is equivalent to the 'listpeers' interactive command. .It \-n ", " -\-numeric numeric host addresses. .sp -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +Output all host addresses in dotted\-quad numeric format rather than +converting to the canonical host names. .It \-p ", " -\-peers Print a list of the peers. This option must not appear in combination with any of the following options: @@ -757,10 +759,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "SEE ALSO" .Xr ntp.conf 5 , diff --git a/ntpq/invoke-ntpq.texi b/ntpq/invoke-ntpq.texi index 76f9b47809..793f8b0b8b 100644 --- a/ntpq/invoke-ntpq.texi +++ b/ntpq/invoke-ntpq.texi @@ -6,12 +6,295 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:32:33 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:58:20 PM by AutoGen 5.16.2 # From the definitions ntpq-opts.def # and the template file agtexi-cmd.tpl @end ignore +The +@code{ntpq} +utility program is used to query NTP servers which +implement the standard NTP mode 6 control message formats defined +in Appendix B of the NTPv3 specification RFC1305, requesting +information about current state and/or changes in that state. +The same formats are used in NTPv4, although some of the +variables have changed and new ones added. The description on this +page is for the NTPv4 variables. +The program may be run either in interactive mode or controlled using +command line arguments. +Requests to read and write arbitrary +variables can be assembled, with raw and pretty-printed output +options being available. +The +@code{ntpq} +utility can also obtain and print a +list of peers in a common format by sending multiple queries to the +server. + +If one or more request options is included on the command line +when +@code{ntpq} +is executed, each of the requests will be sent +to the NTP servers running on each of the hosts given as command +line arguments, or on localhost by default. +If no request options +are given, +@code{ntpq} +will attempt to read commands from the +standard input and execute these on the NTP server running on the +first host given on the command line, again defaulting to localhost +when no other host is specified. +The +@code{ntpq} +utility will prompt for +commands if the standard input is a terminal device. + +@code{ntpq} +uses NTP mode 6 packets to communicate with the +NTP server, and hence can be used to query any compatible server on +the network which permits it. +Note that since NTP is a UDP protocol +this communication will be somewhat unreliable, especially over +large distances in terms of network topology. +The +@code{ntpq} +utility makes +one attempt to retransmit requests, and will time requests out if +the remote host is not heard from within a suitable timeout +time. + +Specifying a +command line option other than +@code{-i} or +@code{-n} will +cause the specified query (queries) to be sent to the indicated +host(s) immediately. +Otherwise, +@code{ntpq} +will attempt to read +interactive format commands from the standard input. +.Ss +"Internal +Commands" +Interactive format commands consist of a keyword followed by zero +to four arguments. +Only enough characters of the full keyword to +uniquely identify the command need be typed. + +A +number of interactive format commands are executed entirely within +the +@code{ntpq} +utility itself and do not result in NTP mode 6 +requests being sent to a server. +These are described following. +@table @samp +@item Ic +@item Ic +A +.Ql +\&? +by itself will print a list of all the command +keywords known to this incarnation of +@code{ntpq}. +A +.Ql +\&? +followed by a command keyword will print function and usage +information about the command. +This command is probably a better +source of information about +@code{ntpq} +than this manual +page. +@item Ic +.Ic +... +.Xc +@item Ic +@item Ic +The data carried by NTP mode 6 messages consists of a list of +items of the form +.Ql +variable_name=value +, +where the +.Ql +=value +is ignored, and can be omitted, +in requests to the server to read variables. +The +@code{ntpq} +utility maintains an internal list in which data to be included in control +messages can be assembled, and sent using the +.Ic +readlist +and +.Ic +writelist +commands described below. +The +.Ic +addvars +command allows variables and their optional values to be added to +the list. +If more than one variable is to be added, the list should +be comma-separated and not contain white space. +The +.Ic +rmvars +command can be used to remove individual variables from the list, +while the +.Ic +clearlist +command removes all variables from the +list. +@item Ic +Normally +@code{ntpq} +does not authenticate requests unless +they are write requests. +The command +.Ql +authenticate +yes +causes +@code{ntpq} +to send authentication with all requests it +makes. +Authenticated requests causes some servers to handle +requests slightly differently, and can occasionally melt the CPU in +fuzzballs if you turn authentication on before doing a +.Ic +peer +display. +The command +.Ql +authenticate +causes +@code{ntpq} +to display whether or not +@code{ntpq} +is currently autheinticating requests. +@item Ic +Causes output from query commands to be "cooked", so that +variables which are recognized by +@code{ntpq} +will have their +values reformatted for human consumption. +Variables which +@code{ntpq} +thinks should have a decodable value but didn't are +marked with a trailing +.Ql +\&? +. +@item Xo +.Ic +debug +.Oo +.Cm +more +| +.Cm +less +| +.Cm +off +.Oc +.Xc +With no argument, displays the current debug level. +Otherwise, the debug level is changed to the indicated level. +@item Ic +Specify a time interval to be added to timestamps included in +requests which require authentication. +This is used to enable +(unreliable) server reconfiguration over long delay network paths +or between machines whose clocks are unsynchronized. +Actually the +server does not now require timestamps in authenticated requests, +so this command may be obsolete. +@item Ic +Set the host to which future queries will be sent. +.Ar +hostname +may be either a host name or a numeric address. +@item Ic +If +.Cm +yes +is specified, host names are printed in +information displays. +If +.Cm +no +is specified, numeric +addresses are printed instead. +The default is +.Cm +yes +, +unless +modified using the command line +@code{-n} switch. +@item Ic +This command allows the specification of a key number to be +used to authenticate configuration requests. +This must correspond +to a key number the server has been configured to use for this +purpose. +@item Ic +.Cm +1 +| +.Cm +2 +| +.Cm +3 +| +.Cm +4 +.Oc +.Xc +Sets the NTP version number which +@code{ntpq} +claims in +packets. +Defaults to 3, and note that mode 6 control messages (and +modes, for that matter) didn't exist in NTP version 1. +There appear +to be no servers left which demand version 1. +With no argument, displays the current NTP version that will be used +when communicating with servers. +@item Ic +Exit +@code{ntpq} +@item Ic +This command prompts you to type in a password (which will not +be echoed) which will be used to authenticate configuration +requests. +The password must correspond to the key configured for +use by the NTP server for this purpose if such requests are to be +successful. +@item Ic +Causes all output from query commands is printed as received +from the remote server. +The only formating/interpretation done on +the data is to transform nonascii data into a printable (but barely +understandable) form. +@item Ic +Specify a timeout period for responses to server queries. +The +default is about 5000 milliseconds. +Note that since +@code{ntpq} +retries each query once after a timeout, the total waiting time for +a timeout will be twice the timeout value set. + +@end multitable + This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpq} program. This software is released under the NTP license, . @@ -27,7 +310,6 @@ This software is released under the NTP license, . * ntpq old-rv:: old-rv option * ntpq config:: presetting/configuring ntpq * ntpq exit status:: exit status -* ntpq Description:: Description @end menu @node ntpq usage @@ -44,47 +326,7 @@ with a status code of 0. @exampleindent 0 @example -ntpq - standard NTP query program - Ver. 4.2.7p295 -USAGE: ntpq [ - [] | --[@{=| @}] ]... [ host ...] - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -c Str command run a command and exit - - may appear multiple times - -d no debug-level Increase debug verbosity level - - may appear multiple times - -D Str set-debug-level Set the debug verbosity level - - may appear multiple times - -p no peers Print a list of the peers - - prohibits these options: - interactive - -i no interactive Force ntpq to operate in interactive mode - - prohibits these options: - command - peers - -n no numeric numeric host addresses - no old-rv Always output status line with readvar - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name or by a single -hyphen and the flag character. - -The following option preset mechanisms are supported: - - reading file $HOME/.ntprc - - reading file ./.ntprc - - examining environment variables named NTPQ_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org +ntpq is unavailable - no -? @end example @exampleindent 4 @@ -285,197 +527,3 @@ A specified configuration file could not be loaded. libopts had an internal operational error. Please report it to autogen-users@@lists.sourceforge.net. Thank you. @end table -@node ntpq Description -@subsection ntpq Description - -The -utility program is used to query NTP servers which -implement the standard NTP mode 6 control message formats defined -in Appendix B of the NTPv3 specification RFC1305, requesting -information about current state and/or changes in that state. -The same formats are used in NTPv4, although some of the -variables have changed and new ones added. The description on this -page is for the NTPv4 variables. -The program may be run either in interactive mode or controlled using -command line arguments. -Requests to read and write arbitrary -variables can be assembled, with raw and pretty-printed output -options being available. -The -utility can also obtain and print a -list of peers in a common format by sending multiple queries to the -server. - -If one or more request options is included on the command line -when -is executed, each of the requests will be sent -to the NTP servers running on each of the hosts given as command -line arguments, or on localhost by default. -If no request options -are given, -will attempt to read commands from the -standard input and execute these on the NTP server running on the -first host given on the command line, again defaulting to localhost -when no other host is specified. -The -utility will prompt for -commands if the standard input is a terminal device. - -uses NTP mode 6 packets to communicate with the -NTP server, and hence can be used to query any compatible server on -the network which permits it. -Note that since NTP is a UDP protocol -this communication will be somewhat unreliable, especially over -large distances in terms of network topology. -The -utility makes -one attempt to retransmit requests, and will time requests out if -the remote host is not heard from within a suitable timeout -time. - -Specifying a -command line option other than -or -will -cause the specified query (queries) to be sent to the indicated -host(s) immediately. -Otherwise, -will attempt to read -interactive format commands from the standard input. -Interactive format commands consist of a keyword followed by zero -to four arguments. -Only enough characters of the full keyword to -uniquely identify the command need be typed. - -A -number of interactive format commands are executed entirely within -the -utility itself and do not result in NTP mode 6 -requests being sent to a server. -These are described following. -@table @samp -@item Ic -@item Ic -A -by itself will print a list of all the command -keywords known to this incarnation of -A -followed by a command keyword will print function and usage -information about the command. -This command is probably a better -source of information about -than this manual -page. -@item Ic -@item Ic -@item Ic -The data carried by NTP mode 6 messages consists of a list of -items of the form -where the -is ignored, and can be omitted, -in requests to the server to read variables. -The -utility maintains an internal list in which data to be included in control -messages can be assembled, and sent using the -and -commands described below. -The -command allows variables and their optional values to be added to -the list. -If more than one variable is to be added, the list should -be comma-separated and not contain white space. -The -command can be used to remove individual variables from the list, -while the -command removes all variables from the -list. -@item Ic -Normally -does not authenticate requests unless -they are write requests. -The command -causes -to send authentication with all requests it -makes. -Authenticated requests causes some servers to handle -requests slightly differently, and can occasionally melt the CPU in -fuzzballs if you turn authentication on before doing a -display. -The command -causes -to display whether or not -is currently autheinticating requests. -@item Ic -Causes output from query commands to be "cooked", so that -variables which are recognized by -will have their -values reformatted for human consumption. -Variables which -thinks should have a decodable value but didn't are -marked with a trailing -@item Xo -With no argument, displays the current debug level. -Otherwise, the debug level is changed to the indicated level. -@item Ic -Specify a time interval to be added to timestamps included in -requests which require authentication. -This is used to enable -(unreliable) server reconfiguration over long delay network paths -or between machines whose clocks are unsynchronized. -Actually the -server does not now require timestamps in authenticated requests, -so this command may be obsolete. -@item Ic -Set the host to which future queries will be sent. -may be either a host name or a numeric address. -@item Ic -If -is specified, host names are printed in -information displays. -If -is specified, numeric -addresses are printed instead. -The default is -unless -modified using the command line -switch. -@item Ic -This command allows the specification of a key number to be -used to authenticate configuration requests. -This must correspond -to a key number the server has been configured to use for this -purpose. -@item Ic -Sets the NTP version number which -claims in -packets. -Defaults to 3, and note that mode 6 control messages (and -modes, for that matter) didn't exist in NTP version 1. -There appear -to be no servers left which demand version 1. -With no argument, displays the current NTP version that will be used -when communicating with servers. -@item Ic -Exit -@item Ic -This command prompts you to type in a password (which will not -be echoed) which will be used to authenticate configuration -requests. -The password must correspond to the key configured for -use by the NTP server for this purpose if such requests are to be -successful. -@item Ic -Causes all output from query commands is printed as received -from the remote server. -The only formating/interpretation done on -the data is to transform nonascii data into a printable (but barely -understandable) form. -@item Ic -Specify a timeout period for responses to server queries. -The -default is about 5000 milliseconds. -Note that since -retries each query once after a timeout, the total waiting time for -a timeout will be twice the timeout value set. - -@end multitable diff --git a/ntpq/ntpq-opts.c b/ntpq/ntpq-opts.c index 6964f2241b..ee9be232f2 100644 --- a/ntpq/ntpq-opts.c +++ b/ntpq/ntpq-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:32:08 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:29 PM by AutoGen 5.16.2 * From the definitions ntpq-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,14 +36,15 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntpq-opts.h" #include #include #include #include -#define OPTION_CODE_COMPILE 1 -#include "ntpq-opts.h" #ifdef __cplusplus extern "C" { #endif @@ -54,10 +55,10 @@ extern FILE * option_usage_fp; #define zCopyright (ntpq_opt_strs+0) #define zLicenseDescrip (ntpq_opt_strs+314) -extern tUsageProc optionUsage; /* * global included definitions - */#ifdef __windows + */ +#ifdef __windows extern int atoi(const char*); #else # include @@ -70,7 +71,7 @@ extern tUsageProc optionUsage; /* * ntpq option static const strings */ -static char const ntpq_opt_strs[1831] = +static char const ntpq_opt_strs[1833] = /* 0 */ "ntpq 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -83,65 +84,65 @@ static char const ntpq_opt_strs[1831] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 952 */ "Force IPv4 DNS name resolution\0" -/* 983 */ "IPV4\0" -/* 988 */ "ipv4\0" -/* 993 */ "Force IPv6 DNS name resolution\0" -/* 1024 */ "IPV6\0" -/* 1029 */ "ipv6\0" -/* 1034 */ "run a command and exit\0" -/* 1057 */ "COMMAND\0" -/* 1065 */ "command\0" -/* 1073 */ "Increase debug verbosity level\0" -/* 1104 */ "DEBUG_LEVEL\0" -/* 1116 */ "debug-level\0" -/* 1128 */ "Set the debug verbosity level\0" -/* 1158 */ "SET_DEBUG_LEVEL\0" -/* 1174 */ "set-debug-level\0" -/* 1190 */ "Print a list of the peers\0" -/* 1216 */ "PEERS\0" -/* 1222 */ "peers\0" -/* 1228 */ "Force ntpq to operate in interactive mode\0" -/* 1270 */ "INTERACTIVE\0" -/* 1282 */ "interactive\0" -/* 1294 */ "numeric host addresses\0" -/* 1317 */ "NUMERIC\0" -/* 1325 */ "numeric\0" -/* 1333 */ "Always output status line with readvar\0" -/* 1372 */ "OLD_RV\0" -/* 1379 */ "old-rv\0" -/* 1386 */ "Display extended usage information and exit\0" -/* 1430 */ "help\0" -/* 1435 */ "Extended usage information passed thru pager\0" -/* 1480 */ "more-help\0" -/* 1490 */ "Output version information and exit\0" -/* 1526 */ "version\0" -/* 1534 */ "Save the option state to a config file\0" -/* 1573 */ "save-opts\0" -/* 1583 */ "Load options from a config file\0" -/* 1615 */ "LOAD_OPTS\0" -/* 1625 */ "no-load-opts\0" -/* 1638 */ "no\0" -/* 1641 */ "NTPQ\0" -/* 1646 */ "ntpq - standard NTP query program - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 954 */ "Force IPv4 DNS name resolution\0" +/* 985 */ "IPV4\0" +/* 990 */ "ipv4\0" +/* 995 */ "Force IPv6 DNS name resolution\0" +/* 1026 */ "IPV6\0" +/* 1031 */ "ipv6\0" +/* 1036 */ "run a command and exit\0" +/* 1059 */ "COMMAND\0" +/* 1067 */ "command\0" +/* 1075 */ "Increase debug verbosity level\0" +/* 1106 */ "DEBUG_LEVEL\0" +/* 1118 */ "debug-level\0" +/* 1130 */ "Set the debug verbosity level\0" +/* 1160 */ "SET_DEBUG_LEVEL\0" +/* 1176 */ "set-debug-level\0" +/* 1192 */ "Print a list of the peers\0" +/* 1218 */ "PEERS\0" +/* 1224 */ "peers\0" +/* 1230 */ "Force ntpq to operate in interactive mode\0" +/* 1272 */ "INTERACTIVE\0" +/* 1284 */ "interactive\0" +/* 1296 */ "numeric host addresses\0" +/* 1319 */ "NUMERIC\0" +/* 1327 */ "numeric\0" +/* 1335 */ "Always output status line with readvar\0" +/* 1374 */ "OLD_RV\0" +/* 1381 */ "old-rv\0" +/* 1388 */ "Display extended usage information and exit\0" +/* 1432 */ "help\0" +/* 1437 */ "Extended usage information passed thru pager\0" +/* 1482 */ "more-help\0" +/* 1492 */ "Output version information and exit\0" +/* 1528 */ "version\0" +/* 1536 */ "Save the option state to a config file\0" +/* 1575 */ "save-opts\0" +/* 1585 */ "Load options from a config file\0" +/* 1617 */ "LOAD_OPTS\0" +/* 1627 */ "no-load-opts\0" +/* 1640 */ "no\0" +/* 1643 */ "NTPQ\0" +/* 1648 */ "ntpq - standard NTP query program - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]... [ host ...]\n\0" -/* 1767 */ ".ntprc\0" -/* 1774 */ "$HOME\0" -/* 1780 */ ".\0" -/* 1782 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 1816 */ "ntpq 4.2.7p295"; +/* 1769 */ "$HOME\0" +/* 1775 */ ".\0" +/* 1777 */ ".ntprc\0" +/* 1784 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 1818 */ "ntpq 4.2.7p295"; /* * ipv4 option description with * "Must also have options" and "Incompatible options": */ -#define IPV4_DESC (ntpq_opt_strs+952) -#define IPV4_NAME (ntpq_opt_strs+983) -#define IPV4_name (ntpq_opt_strs+988) +#define IPV4_DESC (ntpq_opt_strs+954) +#define IPV4_NAME (ntpq_opt_strs+985) +#define IPV4_name (ntpq_opt_strs+990) static int const aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) @@ -150,9 +151,9 @@ static int const aIpv4CantList[] = { * ipv6 option description with * "Must also have options" and "Incompatible options": */ -#define IPV6_DESC (ntpq_opt_strs+993) -#define IPV6_NAME (ntpq_opt_strs+1024) -#define IPV6_name (ntpq_opt_strs+1029) +#define IPV6_DESC (ntpq_opt_strs+995) +#define IPV6_NAME (ntpq_opt_strs+1026) +#define IPV6_name (ntpq_opt_strs+1031) static int const aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) @@ -160,26 +161,26 @@ static int const aIpv6CantList[] = { /* * command option description: */ -#define COMMAND_DESC (ntpq_opt_strs+1034) -#define COMMAND_NAME (ntpq_opt_strs+1057) -#define COMMAND_name (ntpq_opt_strs+1065) +#define COMMAND_DESC (ntpq_opt_strs+1036) +#define COMMAND_NAME (ntpq_opt_strs+1059) +#define COMMAND_name (ntpq_opt_strs+1067) #define COMMAND_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * debug-level option description: */ -#define DEBUG_LEVEL_DESC (ntpq_opt_strs+1073) -#define DEBUG_LEVEL_NAME (ntpq_opt_strs+1104) -#define DEBUG_LEVEL_name (ntpq_opt_strs+1116) +#define DEBUG_LEVEL_DESC (ntpq_opt_strs+1075) +#define DEBUG_LEVEL_NAME (ntpq_opt_strs+1106) +#define DEBUG_LEVEL_name (ntpq_opt_strs+1118) #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * set-debug-level option description: */ -#define SET_DEBUG_LEVEL_DESC (ntpq_opt_strs+1128) -#define SET_DEBUG_LEVEL_NAME (ntpq_opt_strs+1158) -#define SET_DEBUG_LEVEL_name (ntpq_opt_strs+1174) +#define SET_DEBUG_LEVEL_DESC (ntpq_opt_strs+1130) +#define SET_DEBUG_LEVEL_NAME (ntpq_opt_strs+1160) +#define SET_DEBUG_LEVEL_name (ntpq_opt_strs+1176) #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -187,9 +188,9 @@ static int const aIpv6CantList[] = { * peers option description with * "Must also have options" and "Incompatible options": */ -#define PEERS_DESC (ntpq_opt_strs+1190) -#define PEERS_NAME (ntpq_opt_strs+1216) -#define PEERS_name (ntpq_opt_strs+1222) +#define PEERS_DESC (ntpq_opt_strs+1192) +#define PEERS_NAME (ntpq_opt_strs+1218) +#define PEERS_name (ntpq_opt_strs+1224) static int const aPeersCantList[] = { INDEX_OPT_INTERACTIVE, NO_EQUIVALENT }; #define PEERS_FLAGS (OPTST_DISABLED) @@ -198,9 +199,9 @@ static int const aPeersCantList[] = { * interactive option description with * "Must also have options" and "Incompatible options": */ -#define INTERACTIVE_DESC (ntpq_opt_strs+1228) -#define INTERACTIVE_NAME (ntpq_opt_strs+1270) -#define INTERACTIVE_name (ntpq_opt_strs+1282) +#define INTERACTIVE_DESC (ntpq_opt_strs+1230) +#define INTERACTIVE_NAME (ntpq_opt_strs+1272) +#define INTERACTIVE_name (ntpq_opt_strs+1284) static int const aInteractiveCantList[] = { INDEX_OPT_COMMAND, INDEX_OPT_PEERS, NO_EQUIVALENT }; @@ -209,27 +210,27 @@ static int const aInteractiveCantList[] = { /* * numeric option description: */ -#define NUMERIC_DESC (ntpq_opt_strs+1294) -#define NUMERIC_NAME (ntpq_opt_strs+1317) -#define NUMERIC_name (ntpq_opt_strs+1325) +#define NUMERIC_DESC (ntpq_opt_strs+1296) +#define NUMERIC_NAME (ntpq_opt_strs+1319) +#define NUMERIC_name (ntpq_opt_strs+1327) #define NUMERIC_FLAGS (OPTST_DISABLED) /* * old-rv option description: */ -#define OLD_RV_DESC (ntpq_opt_strs+1333) -#define OLD_RV_NAME (ntpq_opt_strs+1372) -#define OLD_RV_name (ntpq_opt_strs+1379) +#define OLD_RV_DESC (ntpq_opt_strs+1335) +#define OLD_RV_NAME (ntpq_opt_strs+1374) +#define OLD_RV_name (ntpq_opt_strs+1381) #define OLD_RV_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpq_opt_strs+1386) -#define HELP_name (ntpq_opt_strs+1430) +#define HELP_DESC (ntpq_opt_strs+1388) +#define HELP_name (ntpq_opt_strs+1432) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpq_opt_strs+1435) -#define MORE_HELP_name (ntpq_opt_strs+1480) +#define MORE_HELP_DESC (ntpq_opt_strs+1437) +#define MORE_HELP_name (ntpq_opt_strs+1482) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -242,14 +243,14 @@ static int const aInteractiveCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpq_opt_strs+1490) -#define VER_name (ntpq_opt_strs+1526) -#define SAVE_OPTS_DESC (ntpq_opt_strs+1534) -#define SAVE_OPTS_name (ntpq_opt_strs+1573) -#define LOAD_OPTS_DESC (ntpq_opt_strs+1583) -#define LOAD_OPTS_NAME (ntpq_opt_strs+1615) -#define NO_LOAD_OPTS_name (ntpq_opt_strs+1625) -#define LOAD_OPTS_pfx (ntpq_opt_strs+1638) +#define VER_DESC (ntpq_opt_strs+1492) +#define VER_name (ntpq_opt_strs+1528) +#define SAVE_OPTS_DESC (ntpq_opt_strs+1536) +#define SAVE_OPTS_name (ntpq_opt_strs+1575) +#define LOAD_OPTS_DESC (ntpq_opt_strs+1585) +#define LOAD_OPTS_NAME (ntpq_opt_strs+1617) +#define NO_LOAD_OPTS_name (ntpq_opt_strs+1627) +#define LOAD_OPTS_pfx (ntpq_opt_strs+1640) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -292,15 +293,14 @@ static tOptProc #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #define PEERS_OPT_PROC ntpq_custom_opt_handler -#define COMMAND_OPT_PROC ntpq_custom_opt_handler -#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define PEERS_OPT_PROC ntpq_custom_opt_handler #endif /* defined(TEST_NTPQ_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Ntpq Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntpq Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpq program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, @@ -479,20 +479,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Ntpq Option Environment + * Define the ntpq Option Environment */ -#define zPROGNAME (ntpq_opt_strs+1641) -#define zUsageTitle (ntpq_opt_strs+1646) -#define zRcName (ntpq_opt_strs+1767) +#define zPROGNAME (ntpq_opt_strs+1643) +#define zUsageTitle (ntpq_opt_strs+1648) +#define zRcName (ntpq_opt_strs+1777) static char const * const apzHomeList[3] = { - ntpq_opt_strs+1774, - ntpq_opt_strs+1780, + ntpq_opt_strs+1769, + ntpq_opt_strs+1775, NULL }; -#define zBugsAddr (ntpq_opt_strs+1782) +#define zBugsAddr (ntpq_opt_strs+1784) #define zExplain (NULL) #define zDetail (NULL) -#define zFullVersion (ntpq_opt_strs+1816) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (ntpq_opt_strs+1818) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -507,35 +507,58 @@ static char const * const apzHomeList[3] = { #define ntpq_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&ntpqOptions, NTPQ_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(NTPQ_EXIT_SUCCESS); } #if ! defined(TEST_NTPQ_OPTS) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the set-debug-level option. * - * For the set-debug-level option. + * @param pOptions the ntpq options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 26 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); + (void)pOptions; } #endif /* defined(TEST_NTPQ_OPTS) */ -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTPQ_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -548,12 +571,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTPQ_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntpq. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntpq + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntpq_packager_info NULL #else @@ -569,7 +599,13 @@ static char const ntpq_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntpq. The one structure that + * binds them all. + */ tOptions ntpqOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -613,7 +649,16 @@ tOptions ntpqOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -633,8 +678,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntpqOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/ntpq/ntpq-opts.h b/ntpq/ntpq-opts.h index 4c69004480..75cf2a337a 100644 --- a/ntpq/ntpq-opts.h +++ b/ntpq/ntpq-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:32:08 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:29 PM by AutoGen 5.16.2 * From the definitions ntpq-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -111,7 +111,9 @@ typedef enum { */ typedef enum { NTPQ_EXIT_SUCCESS = 0, - NTPQ_EXIT_FAILURE = 1 + NTPQ_EXIT_FAILURE = 1, + NTPQ_EXIT_NO_CONFIG_INPUT = 66, + NTPQ_EXIT_LIBOPTS_FAILURE = 70 } ntpq_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -197,7 +199,7 @@ typedef enum { ntpqOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -213,6 +215,12 @@ extern tOptions ntpqOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/ntpq/ntpq.1ntpqman b/ntpq/ntpq.1ntpqman index 167eb496ee..f9891ac19f 100644 --- a/ntpq/ntpq.1ntpqman +++ b/ntpq/ntpq.1ntpqman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:31 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:21 PM by AutoGen 5.16.2 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ ntpq \- standard NTP query program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ host ...] .SH DESCRIPTION The -.B +.B XXX Program Name utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting @@ -28,28 +28,28 @@ Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The -.B +.B XXX Program Name utility can also obtain and print a list of peers in a common format by sending multiple queries to the server. If one or more request options is included on the command line when -.B +.B XXX Program Name is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, -.B +.B XXX Program Name will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The -.B +.B XXX Program Name utility will prompt for commands if the standard input is a terminal device. -.B +.B XXX Program Name uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. @@ -57,7 +57,7 @@ Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The -.B +.B XXX Program Name utility makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout @@ -71,10 +71,10 @@ will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, -.B +.B XXX Program Name will attempt to read interactive format commands from the standard input. -.Ss "Internal Commands" +.SS "Internal Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to @@ -82,7 +82,7 @@ uniquely identify the command need be typed. A number of interactive format commands are executed entirely within the -.B +.B XXX Program Name utility itself and do not result in NTP mode 6 requests being sent to a server. These are described following. @@ -327,14 +327,14 @@ to the standard output and commands read from the standard input. numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +converting to the canonical host names. .TP .BR \-\-old\-rv Always output status line with readvar. .sp By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single -variable is requested, such as ntpq -c "rv 0 offset". This +variable is requested, such as ntpq \-c "rv 0 offset". This option causes ntpq to include both lines of output for a single-variable readvar. Using an environment variable to preset this option in a script will enable both older and @@ -380,11 +380,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware .SH "COPYRIGHT" diff --git a/ntpq/ntpq.1ntpqmdoc b/ntpq/ntpq.1ntpqmdoc index 25de69f67e..7054046870 100644 --- a/ntpq/ntpq.1ntpqmdoc +++ b/ntpq/ntpq.1ntpqmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPQ 1ntpqmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:34 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:17 PM by AutoGen 5.16.2 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -288,10 +288,12 @@ host(s). Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-p ", " -\-peers Print a list of the peers. This option must not appear in combination with any of the following options: @@ -309,16 +311,16 @@ to the standard output and commands read from the standard input. .It \-n ", " -\-numeric numeric host addresses. .sp -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +Output all host addresses in dotted\-quad numeric format rather than +converting to the canonical host names. .It \-\-old\-rv Always output status line with readvar. .sp By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single -variable is requested, such as ntpq -c "rv 0 offset". This +variable is requested, such as ntpq \-c "rv 0 offset". This option causes ntpq to include both lines of output for a -single-variable readvar. Using an environment variable to +single\-variable readvar. Using an environment variable to preset this option in a script will enable both older and newer ntpq to behave identically in this regard. .It \-? , " \-\-help" @@ -358,10 +360,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "AUTHORS" The University of Delaware diff --git a/ntpq/ntpq.man.in b/ntpq/ntpq.man.in index 606d121dc8..5160a10a11 100644 --- a/ntpq/ntpq.man.in +++ b/ntpq/ntpq.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:31 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:21 PM by AutoGen 5.16.2 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ ntpq \- standard NTP query program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ host ...] .SH DESCRIPTION The -.B +.B XXX Program Name utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting @@ -28,28 +28,28 @@ Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The -.B +.B XXX Program Name utility can also obtain and print a list of peers in a common format by sending multiple queries to the server. If one or more request options is included on the command line when -.B +.B XXX Program Name is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, -.B +.B XXX Program Name will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The -.B +.B XXX Program Name utility will prompt for commands if the standard input is a terminal device. -.B +.B XXX Program Name uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. @@ -57,7 +57,7 @@ Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The -.B +.B XXX Program Name utility makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout @@ -71,10 +71,10 @@ will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, -.B +.B XXX Program Name will attempt to read interactive format commands from the standard input. -.Ss "Internal Commands" +.SS "Internal Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to @@ -82,7 +82,7 @@ uniquely identify the command need be typed. A number of interactive format commands are executed entirely within the -.B +.B XXX Program Name utility itself and do not result in NTP mode 6 requests being sent to a server. These are described following. @@ -327,14 +327,14 @@ to the standard output and commands read from the standard input. numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +converting to the canonical host names. .TP .BR \-\-old\-rv Always output status line with readvar. .sp By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single -variable is requested, such as ntpq -c "rv 0 offset". This +variable is requested, such as ntpq \-c "rv 0 offset". This option causes ntpq to include both lines of output for a single-variable readvar. Using an environment variable to preset this option in a script will enable both older and @@ -380,11 +380,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware .SH "COPYRIGHT" diff --git a/ntpq/ntpq.mdoc.in b/ntpq/ntpq.mdoc.in index 659160cce9..3da1117985 100644 --- a/ntpq/ntpq.mdoc.in +++ b/ntpq/ntpq.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPQ @NTPQ_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:34 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:17 PM by AutoGen 5.16.2 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -288,10 +288,12 @@ host(s). Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-p ", " -\-peers Print a list of the peers. This option must not appear in combination with any of the following options: @@ -309,16 +311,16 @@ to the standard output and commands read from the standard input. .It \-n ", " -\-numeric numeric host addresses. .sp -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. +Output all host addresses in dotted\-quad numeric format rather than +converting to the canonical host names. .It \-\-old\-rv Always output status line with readvar. .sp By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single -variable is requested, such as ntpq -c "rv 0 offset". This +variable is requested, such as ntpq \-c "rv 0 offset". This option causes ntpq to include both lines of output for a -single-variable readvar. Using an environment variable to +single\-variable readvar. Using an environment variable to preset this option in a script will enable both older and newer ntpq to behave identically in this regard. .It \-? , " \-\-help" @@ -358,10 +360,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "AUTHORS" The University of Delaware diff --git a/ntpsnmpd/invoke-ntpsnmpd.texi b/ntpsnmpd/invoke-ntpsnmpd.texi index 6f1a7da2ae..3759c50154 100644 --- a/ntpsnmpd/invoke-ntpsnmpd.texi +++ b/ntpsnmpd/invoke-ntpsnmpd.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:32:41 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:58:30 PM by AutoGen 5.16.2 # From the definitions ntpsnmpd-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -23,7 +23,6 @@ This software is released under the NTP license, . * ntpsnmpd agentxsocket:: agentxsocket option * ntpsnmpd config:: presetting/configuring ntpsnmpd * ntpsnmpd exit status:: exit status -* ntpsnmpd Description:: Description * ntpsnmpd Authors:: Authors @end menu @@ -41,31 +40,7 @@ with a status code of 0. @exampleindent 0 @example -ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p295 -USAGE: ntpsnmpd [ - [] | --[@{=| @}] ]... - Flg Arg Option-Name Description - -n no nofork Do not fork - -p no syslog Log to syslog() - Str agentxsocket The socket address ntpsnmpd uses to connect to net-snmpd - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name or by a single -hyphen and the flag character. - - - -The following option preset mechanisms are supported: - - reading file $HOME/.ntprc - - reading file ./.ntprc - - examining environment variables named NTPSNMPD_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org +ntpsnmpd is unavailable - no -? @end example @exampleindent 4 @@ -174,7 +149,8 @@ A specified configuration file could not be loaded. libopts had an internal operational error. Please report it to autogen-users@@lists.sourceforge.net. Thank you. @end table -@node ntpsnmpd Description -@subsection ntpsnmpd Description @node ntpsnmpd Authors @subsection ntpsnmpd Authors +.An +"Heiko +Gerstung" diff --git a/ntpsnmpd/ntpsnmpd-opts.c b/ntpsnmpd/ntpsnmpd-opts.c index 7b3864cc1e..e886f41d66 100644 --- a/ntpsnmpd/ntpsnmpd-opts.c +++ b/ntpsnmpd/ntpsnmpd-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:32:35 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:31 PM by AutoGen 5.16.2 * From the definitions ntpsnmpd-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,14 +36,15 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntpsnmpd-opts.h" #include #include #include #include -#define OPTION_CODE_COMPILE 1 -#include "ntpsnmpd-opts.h" #ifdef __cplusplus extern "C" { #endif @@ -54,7 +55,6 @@ extern FILE * option_usage_fp; #define zCopyright (ntpsnmpd_opt_strs+0) #define zLicenseDescrip (ntpsnmpd_opt_strs+318) -extern tUsageProc optionUsage; #ifndef NULL # define NULL 0 @@ -63,7 +63,7 @@ extern tUsageProc optionUsage; /* * ntpsnmpd option static const strings */ -static char const ntpsnmpd_opt_strs[1559] = +static char const ntpsnmpd_opt_strs[1561] = /* 0 */ "ntpsnmpd 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -76,76 +76,76 @@ static char const ntpsnmpd_opt_strs[1559] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 956 */ "Do not fork\0" -/* 968 */ "NOFORK\0" -/* 975 */ "nofork\0" -/* 982 */ "Log to syslog()\0" -/* 998 */ "SYSLOG\0" -/* 1005 */ "syslog\0" -/* 1012 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0" -/* 1069 */ "AGENTXSOCKET\0" -/* 1082 */ "agentxsocket\0" -/* 1095 */ "unix:/var/agentx/master\0" -/* 1119 */ "Display extended usage information and exit\0" -/* 1163 */ "help\0" -/* 1168 */ "Extended usage information passed thru pager\0" -/* 1213 */ "more-help\0" -/* 1223 */ "Output version information and exit\0" -/* 1259 */ "version\0" -/* 1267 */ "Save the option state to a config file\0" -/* 1306 */ "save-opts\0" -/* 1316 */ "Load options from a config file\0" -/* 1348 */ "LOAD_OPTS\0" -/* 1358 */ "no-load-opts\0" -/* 1371 */ "no\0" -/* 1374 */ "NTPSNMPD\0" -/* 1383 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 958 */ "Do not fork\0" +/* 970 */ "NOFORK\0" +/* 977 */ "nofork\0" +/* 984 */ "Log to syslog()\0" +/* 1000 */ "SYSLOG\0" +/* 1007 */ "syslog\0" +/* 1014 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0" +/* 1071 */ "AGENTXSOCKET\0" +/* 1084 */ "agentxsocket\0" +/* 1097 */ "unix:/var/agentx/master\0" +/* 1121 */ "Display extended usage information and exit\0" +/* 1165 */ "help\0" +/* 1170 */ "Extended usage information passed thru pager\0" +/* 1215 */ "more-help\0" +/* 1225 */ "Output version information and exit\0" +/* 1261 */ "version\0" +/* 1269 */ "Save the option state to a config file\0" +/* 1308 */ "save-opts\0" +/* 1318 */ "Load options from a config file\0" +/* 1350 */ "LOAD_OPTS\0" +/* 1360 */ "no-load-opts\0" +/* 1373 */ "no\0" +/* 1376 */ "NTPSNMPD\0" +/* 1385 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]...\n\0" -/* 1488 */ ".ntprc\0" -/* 1495 */ "$HOME\0" -/* 1501 */ ".\0" -/* 1503 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 1537 */ "\n\n\0" -/* 1540 */ "ntpsnmpd 4.2.7p295"; +/* 1490 */ "$HOME\0" +/* 1496 */ ".\0" +/* 1498 */ ".ntprc\0" +/* 1505 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 1539 */ "\n\n\0" +/* 1542 */ "ntpsnmpd 4.2.7p295"; /* * nofork option description: */ -#define NOFORK_DESC (ntpsnmpd_opt_strs+956) -#define NOFORK_NAME (ntpsnmpd_opt_strs+968) -#define NOFORK_name (ntpsnmpd_opt_strs+975) +#define NOFORK_DESC (ntpsnmpd_opt_strs+958) +#define NOFORK_NAME (ntpsnmpd_opt_strs+970) +#define NOFORK_name (ntpsnmpd_opt_strs+977) #define NOFORK_FLAGS (OPTST_DISABLED) /* * syslog option description: */ -#define SYSLOG_DESC (ntpsnmpd_opt_strs+982) -#define SYSLOG_NAME (ntpsnmpd_opt_strs+998) -#define SYSLOG_name (ntpsnmpd_opt_strs+1005) +#define SYSLOG_DESC (ntpsnmpd_opt_strs+984) +#define SYSLOG_NAME (ntpsnmpd_opt_strs+1000) +#define SYSLOG_name (ntpsnmpd_opt_strs+1007) #define SYSLOG_FLAGS (OPTST_DISABLED) /* * agentXSocket option description: */ -#define AGENTXSOCKET_DESC (ntpsnmpd_opt_strs+1012) -#define AGENTXSOCKET_NAME (ntpsnmpd_opt_strs+1069) -#define AGENTXSOCKET_name (ntpsnmpd_opt_strs+1082) -#define AGENTXSOCKET_DFT_ARG (ntpsnmpd_opt_strs+1095) +#define AGENTXSOCKET_DESC (ntpsnmpd_opt_strs+1014) +#define AGENTXSOCKET_NAME (ntpsnmpd_opt_strs+1071) +#define AGENTXSOCKET_name (ntpsnmpd_opt_strs+1084) +#define AGENTXSOCKET_DFT_ARG (ntpsnmpd_opt_strs+1097) #define AGENTXSOCKET_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpsnmpd_opt_strs+1119) -#define HELP_name (ntpsnmpd_opt_strs+1163) +#define HELP_DESC (ntpsnmpd_opt_strs+1121) +#define HELP_name (ntpsnmpd_opt_strs+1165) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpsnmpd_opt_strs+1168) -#define MORE_HELP_name (ntpsnmpd_opt_strs+1213) +#define MORE_HELP_DESC (ntpsnmpd_opt_strs+1170) +#define MORE_HELP_name (ntpsnmpd_opt_strs+1215) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -158,14 +158,14 @@ static char const ntpsnmpd_opt_strs[1559] = # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpsnmpd_opt_strs+1223) -#define VER_name (ntpsnmpd_opt_strs+1259) -#define SAVE_OPTS_DESC (ntpsnmpd_opt_strs+1267) -#define SAVE_OPTS_name (ntpsnmpd_opt_strs+1306) -#define LOAD_OPTS_DESC (ntpsnmpd_opt_strs+1316) -#define LOAD_OPTS_NAME (ntpsnmpd_opt_strs+1348) -#define NO_LOAD_OPTS_name (ntpsnmpd_opt_strs+1358) -#define LOAD_OPTS_pfx (ntpsnmpd_opt_strs+1371) +#define VER_DESC (ntpsnmpd_opt_strs+1225) +#define VER_name (ntpsnmpd_opt_strs+1261) +#define SAVE_OPTS_DESC (ntpsnmpd_opt_strs+1269) +#define SAVE_OPTS_name (ntpsnmpd_opt_strs+1308) +#define LOAD_OPTS_DESC (ntpsnmpd_opt_strs+1318) +#define LOAD_OPTS_NAME (ntpsnmpd_opt_strs+1350) +#define NO_LOAD_OPTS_name (ntpsnmpd_opt_strs+1360) +#define LOAD_OPTS_pfx (ntpsnmpd_opt_strs+1373) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -192,9 +192,11 @@ static tOptProc #endif /* defined(TEST_NTPSNMPD_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Ntpsnmpd Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntpsnmpd Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpsnmpd program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_NOFORK, @@ -301,20 +303,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Ntpsnmpd Option Environment + * Define the ntpsnmpd Option Environment */ -#define zPROGNAME (ntpsnmpd_opt_strs+1374) -#define zUsageTitle (ntpsnmpd_opt_strs+1383) -#define zRcName (ntpsnmpd_opt_strs+1488) +#define zPROGNAME (ntpsnmpd_opt_strs+1376) +#define zUsageTitle (ntpsnmpd_opt_strs+1385) +#define zRcName (ntpsnmpd_opt_strs+1498) static char const * const apzHomeList[3] = { - ntpsnmpd_opt_strs+1495, - ntpsnmpd_opt_strs+1501, + ntpsnmpd_opt_strs+1490, + ntpsnmpd_opt_strs+1496, NULL }; -#define zBugsAddr (ntpsnmpd_opt_strs+1503) -#define zExplain (ntpsnmpd_opt_strs+1537) +#define zBugsAddr (ntpsnmpd_opt_strs+1505) +#define zExplain (ntpsnmpd_opt_strs+1539) #define zDetail (NULL) -#define zFullVersion (ntpsnmpd_opt_strs+1540) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (ntpsnmpd_opt_strs+1542) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -329,21 +331,40 @@ static char const * const apzHomeList[3] = { #define ntpsnmpd_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&ntpsnmpdOptions, NTPSNMPD_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(NTPSNMPD_EXIT_SUCCESS); } -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -356,12 +377,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTPSNMPD_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntpsnmpd. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntpsnmpd + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntpsnmpd_packager_info NULL #else @@ -377,7 +405,13 @@ static char const ntpsnmpd_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntpsnmpd. The one structure that + * binds them all. + */ tOptions ntpsnmpdOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -422,7 +456,16 @@ tOptions ntpsnmpdOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -442,8 +485,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntpsnmpdOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/ntpsnmpd/ntpsnmpd-opts.h b/ntpsnmpd/ntpsnmpd-opts.h index 57b55ef42c..3260387563 100644 --- a/ntpsnmpd/ntpsnmpd-opts.h +++ b/ntpsnmpd/ntpsnmpd-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:32:35 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:31 PM by AutoGen 5.16.2 * From the definitions ntpsnmpd-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -105,7 +105,9 @@ typedef enum { */ typedef enum { NTPSNMPD_EXIT_SUCCESS = 0, - NTPSNMPD_EXIT_FAILURE = 1 + NTPSNMPD_EXIT_FAILURE = 1, + NTPSNMPD_EXIT_NO_CONFIG_INPUT = 66, + NTPSNMPD_EXIT_LIBOPTS_FAILURE = 70 } ntpsnmpd_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -155,7 +157,7 @@ typedef enum { ntpsnmpdOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -171,6 +173,12 @@ extern tOptions ntpsnmpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/ntpsnmpd/ntpsnmpd.1ntpsnmpdman index ed1c98251e..2d9cb552a6 100644 --- a/ntpsnmpd/ntpsnmpd.1ntpsnmpdman +++ b/ntpsnmpd/ntpsnmpd.1ntpsnmpdman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:39 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:32 PM by AutoGen 5.16.2 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman-cmd.tpl .\" @@ -75,11 +75,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH AUTHORS .An "Heiko Gerstung" .SH "COPYRIGHT" diff --git a/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc index 49136843ad..67f1c0f8aa 100644 --- a/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc +++ b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPSNMPD 1ntpsnmpdmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:42 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:28 PM by AutoGen 5.16.2 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -24,16 +24,18 @@ All arguments must be options. .It \-n ", " -\-nofork Do not fork. .sp +.sp .It \-p ", " -\-syslog Log to syslog(). .sp +.sp .It \-\-agentxsocket "=\fIstring\fP" -The socket address ntpsnmpd uses to connect to net-snmpd. +The socket address ntpsnmpd uses to connect to net\-snmpd. The default \fIstring\fP for this option is: .ti +4 unix:/var/agentx/master .sp -[:] +[:] The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. .It \-? , " \-\-help" Display usage information and exit. @@ -72,10 +74,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh AUTHORS .An "Heiko Gerstung" diff --git a/ntpsnmpd/ntpsnmpd.man.in b/ntpsnmpd/ntpsnmpd.man.in index 672dd50d2d..7f5eb34abb 100644 --- a/ntpsnmpd/ntpsnmpd.man.in +++ b/ntpsnmpd/ntpsnmpd.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:39 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:32 PM by AutoGen 5.16.2 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman-cmd.tpl .\" @@ -75,11 +75,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH AUTHORS .An "Heiko Gerstung" .SH "COPYRIGHT" diff --git a/ntpsnmpd/ntpsnmpd.mdoc.in b/ntpsnmpd/ntpsnmpd.mdoc.in index 1246c262c6..3d4bb411b5 100644 --- a/ntpsnmpd/ntpsnmpd.mdoc.in +++ b/ntpsnmpd/ntpsnmpd.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTPSNMPD @NTPSNMPD_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:42 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:28 PM by AutoGen 5.16.2 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -24,16 +24,18 @@ All arguments must be options. .It \-n ", " -\-nofork Do not fork. .sp +.sp .It \-p ", " -\-syslog Log to syslog(). .sp +.sp .It \-\-agentxsocket "=\fIstring\fP" -The socket address ntpsnmpd uses to connect to net-snmpd. +The socket address ntpsnmpd uses to connect to net\-snmpd. The default \fIstring\fP for this option is: .ti +4 unix:/var/agentx/master .sp -[:] +[:] The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. .It \-? , " \-\-help" Display usage information and exit. @@ -72,10 +74,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh AUTHORS .An "Heiko Gerstung" diff --git a/scripts/invoke-ntp-wait.texi b/scripts/invoke-ntp-wait.texi index 1f64e436de..94626572df 100644 --- a/scripts/invoke-ntp-wait.texi +++ b/scripts/invoke-ntp-wait.texi @@ -6,13 +6,29 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:29:48 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:55:31 PM by AutoGen 5.16.2 # From the definitions ntp-wait-opts.def # and the template file agtexi-cmd.tpl @end ignore +@code{ntp-wait} +will send at most +.Ar +num-tries +queries to +@code{ntpd(8)}, +sleeping for +.Ar +secs-between-tries +after each status return that says +@code{ntpd(8)} +has not yet produced a synchronized and stable system clock. + +@code{ntp-wait} +will do this quietly, unless the +@code{-v} flag is provided. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-wait} program. @@ -25,7 +41,6 @@ This software is released under the NTP license, . * ntp-wait :: option (-v) * ntp-wait config:: presetting/configuring ntp-wait * ntp-wait exit status:: exit status -* ntp-wait Description:: Description * ntp-wait Authors:: Authors @end menu @@ -43,19 +58,7 @@ with a status code of 0. @exampleindent 0 @example -/deacon/backroom/snaps/ntp-dev/A.snap/scripts/ntp-wait version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]), -running under Perl version 5.8.8. - -Usage: ntp-wait [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...] - -The following single-character options are accepted: - With arguments: -n -s - Boolean (without arguments): -v - -Options may be merged together. -- stops processing of options. -Space is not required between options and their arguments. - [Now continuing due to backward compatibility and excessive paranoia. - See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.] +Unknown option: ? @end example @exampleindent 4 @@ -123,14 +126,8 @@ Successful program execution. @item 1 (EXIT_FAILURE) The operation failed or the command syntax was not valid. @end table -@node ntp-wait Description -@subsection ntp-wait Description -will send at most -queries to -sleeping for -after each status return that says -has not yet produced a synchronized and stable system clock. -will do this quietly, unless the -flag is provided. @node ntp-wait Authors @subsection ntp-wait Authors +.An +"Harlan +Stenn" diff --git a/scripts/ntp-wait.1ntp-waitman b/scripts/ntp-wait.1ntp-waitman index d44542ebe0..f0591353a4 100644 --- a/scripts/ntp-wait.1ntp-waitman +++ b/scripts/ntp-wait.1ntp-waitman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:29:45 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:55:33 PM by AutoGen 5.16.2 .\" From the definitions ntp-wait-opts.def .\" and the template file agman-cmd.tpl .\" @@ -16,7 +16,7 @@ ntp-wait \- Wait for ntpd to stabilize the system clock All arguments must be options. .PP .SH DESCRIPTION -.B +.B XXX Program Name will send at most \fInum-tries\fR queries to @@ -27,7 +27,7 @@ after each status return that says .Xr ntpd 8 has not yet produced a synchronized and stable system clock. .PP -.B +.B XXX Program Name will do this quietly, unless the v flag is provided. @@ -50,7 +50,7 @@ The default \fIsecs\-between\-tries\fP for this option is: .ti +4 6 .sp -We will sleep for @file{secs-between-tries} after each query of ntpd +We will sleep for \fIsecs-between-tries\fP after each query of ntpd that returns "the time is not yet stable". .TP .BR \-v ", " -\- @@ -81,10 +81,10 @@ See \fBOPTION PRESETS\fP for configuration environment variables. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .SH AUTHORS .An "Harlan Stenn" diff --git a/scripts/ntp-wait.1ntp-waitmdoc b/scripts/ntp-wait.1ntp-waitmdoc index 8fc8a05f2e..f3cdfd5284 100644 --- a/scripts/ntp-wait.1ntp-waitmdoc +++ b/scripts/ntp-wait.1ntp-waitmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTP_WAIT 1ntp-waitmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:29:49 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:55:29 PM by AutoGen 5.16.2 .\" From the definitions ntp-wait-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -52,12 +52,12 @@ The default \fIsecs\-between\-tries\fP for this option is: .ti +4 6 .sp -We will sleep for @file{secs-between-tries} after each query of ntpd +We will sleep for \fIsecs\-between\-tries\fP after each query of ntpd that returns "the time is not yet stable". .It \-v ", " -\- Be verbose. .sp -By default, ntp-wait is silent. With this option, ntp-wait +By default, ntp\-wait is silent. With this option, ntp\-wait will provide status information. .It \-? , " \-\-help" Display usage information and exit. @@ -80,9 +80,9 @@ See \fBOPTION PRESETS\fP for configuration environment variables. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .El .Sh AUTHORS diff --git a/scripts/ntp-wait.html b/scripts/ntp-wait.html index b530b084b8..dc74b01e35 100644 --- a/scripts/ntp-wait.html +++ b/scripts/ntp-wait.html @@ -3,7 +3,7 @@ Ntp-wait User's Manual - + @@ -14,18 +14,20 @@ pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } - span.sc { font-variant:small-caps } - span.roman { font-family: serif; font-weight: normal; } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } -->

Ntp-wait User's Manual

+


-Next: , +Next: , Previous: (dir), Up: (dir) -
+

Simple Network Time Protocol User Manual

@@ -55,9 +57,11 @@ IETF specification.
-


+ -
+


+ +
@@ -76,71 +80,192 @@ the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.
-


+ -
+


+ +

Invoking ntp-wait

-

This section was generated by AutoGen, -the aginfo template and the option descriptions for the ntp-wait program. It documents the ntp-wait usage text and option meanings. +

ntp-wait +will send at most +.Ar +num-tries +queries to +ntpd(8), +sleeping for +.Ar +secs-between-tries +after each status return that says +ntpd(8) +has not yet produced a synchronized and stable system clock. -

This software is released under a specialized copyright license. +

ntp-wait +will do this quietly, unless the +-v flag is provided. + +

This section was generated by AutoGen, +using the agtexi-cmd template and the option descriptions for the ntp-wait program. +This software is released under the NTP license, <http://ntp.org/license>.

+ +


-Next: , +Next: , Up: ntp-wait Invocation -
+
-

ntp-wait usage help (-?)

+

ntp-wait help/usage (-?)

+ +

+This is the automatically generated usage text for ntp-wait. +The text printed is the same whether for the help option (-?) or the more-help option (-!). more-help will print +the usage text by passing it through a pager program. +more-help is disabled on platforms without a working +fork(2) function. The PAGER environment variable is +used to select the program, defaulting to more. Both will exit +with a status code of 0. + +

Unknown option: ?
+
+
+ + +


+Next: , +Previous: ntp-wait, +Up: ntp-wait Invocation -

-This is the automatically generated usage text for ntp-wait: +

-
/deacon/backroom/snaps/ntp-dev/A.snap/scripts/ntp-wait version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]),
-running under Perl version 5.8.8.
+

option (-n)

-Usage: ntp-wait [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...] +

+This is the “number of times to check ntpd” option. +This option takes an argument number num-tries. +The maximum number of times we will check ntpd to see if it +has been able to synchronize and stabilize the system clock. +

+ + +


+Next: , +Previous: ntp-wait, +Up: ntp-wait Invocation -The following single-character options are accepted: - With arguments: -n -s - Boolean (without arguments): -v +
-Options may be merged together. -- stops processing of options. -Space is not required between options and their arguments. - [Now continuing due to backward compatibility and excessive paranoia. - See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.] -
-
+

option (-s)

+ +

+This is the “how long to sleep between tries” option. +This option takes an argument number secs-between-tries. +We will sleep for secs-between-tries after each query of ntpd +that returns "the time is not yet stable". +

+ +


-Previous: ntp-wait, +Next: , +Previous: ntp-wait, Up: ntp-wait Invocation -
+

option (-v)

-

+

This is the “be verbose” option. By default, ntp-wait is silent. With this option, ntp-wait will provide status information.

+ + +


+Next: , +Previous: ntp-wait, +Up: ntp-wait Invocation + +
+ +

presetting/configuring ntp-wait

+ +

Any option that is not marked as not presettable may be preset by +loading values from environment variables named NTP-WAIT and NTP-WAIT_<OPTION_NAME>. <OPTION_NAME> must be one of +the options listed above in upper case and segmented with underscores. +The NTP-WAIT variable will be tokenized and parsed like +the command line. The remaining variables are tested for existence and their +values are treated like option arguments. + +

The command line options relating to configuration and/or usage help are: + +

version (-)
+ +

Print the program version to standard out, optionally with licensing +information, then exit 0. The optional argument specifies how much licensing +detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. Only the +first letter of the argument is examined: + +

+
version
Only print the version. This is the default. +
copyright
Name the copyright usage licensing terms. +
verbose
Print the full copyright usage licensing terms. +
+ +
+ + +


+Next: , +Previous: ntp-wait config, +Up: ntp-wait Invocation + +
+ +

ntp-wait exit status

+ +

One of the following exit values will be returned: +

+
0 (EXIT_SUCCESS)
Successful program execution. +
1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid. +
+
+ +


+Previous: ntp-wait exit status, +Up: ntp-wait Invocation + +
+ +

ntp-wait Authors

+ +

.An +"Harlan +Stenn" + +

-
+


+ +
diff --git a/scripts/ntp-wait.man.in b/scripts/ntp-wait.man.in index 2aca04bebb..631443811c 100644 --- a/scripts/ntp-wait.man.in +++ b/scripts/ntp-wait.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:29:45 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:55:33 PM by AutoGen 5.16.2 .\" From the definitions ntp-wait-opts.def .\" and the template file agman-cmd.tpl .\" @@ -16,7 +16,7 @@ ntp-wait \- Wait for ntpd to stabilize the system clock All arguments must be options. .PP .SH DESCRIPTION -.B +.B XXX Program Name will send at most \fInum-tries\fR queries to @@ -27,7 +27,7 @@ after each status return that says .Xr ntpd 8 has not yet produced a synchronized and stable system clock. .PP -.B +.B XXX Program Name will do this quietly, unless the v flag is provided. @@ -50,7 +50,7 @@ The default \fIsecs\-between\-tries\fP for this option is: .ti +4 6 .sp -We will sleep for @file{secs-between-tries} after each query of ntpd +We will sleep for \fIsecs-between-tries\fP after each query of ntpd that returns "the time is not yet stable". .TP .BR \-v ", " -\- @@ -81,10 +81,10 @@ See \fBOPTION PRESETS\fP for configuration environment variables. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .SH AUTHORS .An "Harlan Stenn" diff --git a/scripts/ntp-wait.mdoc.in b/scripts/ntp-wait.mdoc.in index cd223edfed..8d18a008ae 100644 --- a/scripts/ntp-wait.mdoc.in +++ b/scripts/ntp-wait.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTP_WAIT @NTP_WAIT_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:29:49 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:55:29 PM by AutoGen 5.16.2 .\" From the definitions ntp-wait-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -52,12 +52,12 @@ The default \fIsecs\-between\-tries\fP for this option is: .ti +4 6 .sp -We will sleep for @file{secs-between-tries} after each query of ntpd +We will sleep for \fIsecs\-between\-tries\fP after each query of ntpd that returns "the time is not yet stable". .It \-v ", " -\- Be verbose. .sp -By default, ntp-wait is silent. With this option, ntp-wait +By default, ntp\-wait is silent. With this option, ntp\-wait will provide status information. .It \-? , " \-\-help" Display usage information and exit. @@ -80,9 +80,9 @@ See \fBOPTION PRESETS\fP for configuration environment variables. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .El .Sh AUTHORS diff --git a/sntp/include/autogen-version.def b/sntp/include/autogen-version.def index 62ba4d2cef..7f0d0006f1 100644 --- a/sntp/include/autogen-version.def +++ b/sntp/include/autogen-version.def @@ -1,2 +1,2 @@ -#assert (version-compare >= autogen-version "5.16.1") +#assert (version-compare >= autogen-version "5.16.2") guard-option-names; diff --git a/sntp/invoke-sntp.texi b/sntp/invoke-sntp.texi index 605aff8355..1e2044d537 100644 --- a/sntp/invoke-sntp.texi +++ b/sntp/invoke-sntp.texi @@ -6,55 +6,81 @@ # # EDIT THIS FILE WITH CAUTION (invoke-sntp.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:33:04 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:59:07 PM by AutoGen 5.16.2 # From the definitions sntp-opts.def # and the template file agtexi-cmd.tpl @end ignore + @code{sntp} can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be -run as an interactive command or in a -@code{cron} +run as an interactive command or from a +.Ic +cron job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. -@indent +.PP The default is to write the estimated correct local date and time (i.e. not -UTC) to the standard output in a format like -@example -1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN -@end example -where the -@example +UTC) to the standard output in a format like: + +.Ic +"'1996-10-15 +20:17:25.123 (+0800) -@end example ++4.567 ++/- +0.089 +[host] +IP +sN'" + +where the +.Ic +"'(+0800)'" means that to get to UTC from the reported local time one must add 8 hours and 0 minutes, the -@example -+4.567 -@end example +.Ic +"'+4.567'" indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct). Note that the number of decimals printed for this value will change based on the reported precision of the server. -@example -+/- 0.089 -@end example -is the reported @file{synchronization distance} (in seconds), -which represents the maximum error due to all causes. +.Ic +"'+/- +0.089'" +is the reported +.Em +synchronization +distance +(in seconds), which represents the maximum error due to all causes. If the server does not report valid data needed to calculate the synchronization distance, this will be reported as -@example -+/- ? -@end example -If the @file{host} is different from the @file{IP}, both will be displayed. -Otherwise, only the @file{IP} is displayed. -Finally, the @file{stratum} is reported. +.Ic +"'+/- +?'" +. +If the +.Em +host +is different from the +.Em +IP +, +both will be displayed. +Otherwise, only the +.Em +IP +is displayed. +Finally, the +.Em +stratum +of the host is reported. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program. @@ -79,7 +105,6 @@ This software is released under the NTP license, . * sntp wait:: wait option * sntp config:: presetting/configuring sntp * sntp exit status:: exit status -* sntp Description:: Description * sntp Usage:: Usage * sntp Authors:: Authors * sntp Bugs:: Bugs @@ -437,39 +462,6 @@ A specified configuration file could not be loaded. libopts had an internal operational error. Please report it to autogen-users@@lists.sourceforge.net. Thank you. @end table -@node sntp Description -@subsection sntp Description -can be used as an SNTP client to query a NTP or SNTP server and either display -the time or set the local system's time (given suitable privilege). It can be -run as an interactive command or from a -job. - -NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) -are defined and described by RFC 5905. - -The default is to write the estimated correct local date and time (i.e. not -UTC) to the standard output in a format like: - - -where the -means that to get to UTC from the reported local time one must -add 8 hours and 0 minutes, -the -indicates the local clock is 4.567 seconds behind the correct time -(so 4.567 seconds must be added to the local clock to get it to be correct). -Note that the number of decimals printed for this value will change -based on the reported precision of the server. -is the reported -(in seconds), which represents the maximum error due to all causes. -If the server does not report valid data needed to calculate the -synchronization distance, this will be reported as -If the -is different from the -both will be displayed. -Otherwise, only the -is displayed. -Finally, the -of the host is reported. @node sntp Usage @subsection sntp Usage @table @samp @@ -481,15 +473,31 @@ to check the current time and error in the local clock. With suitable privilege, run as a command or from a +@code{cron(8)} job, +.Ic +"sntp +-a" will reset the local clock from a synchronized specified server, like the (deprecated) +@code{ntpdate(1ntpdatemdoc)}, or +@code{rdate(8)} commands. @end multitable @node sntp Authors @subsection sntp Authors +.An +"Johannes +Maximilian +Kuehn" +.An +"Harlan +Stenn" +.An +"Dave +Hart" @node sntp Bugs @subsection sntp Bugs Please report bugs to http://bugs.ntp.org . diff --git a/sntp/libopts/Makefile.am b/sntp/libopts/Makefile.am index 8e1ef316b5..cfce9e66c6 100644 --- a/sntp/libopts/Makefile.am +++ b/sntp/libopts/Makefile.am @@ -7,16 +7,16 @@ noinst_LTLIBRARIES = libopts.la endif libopts_la_SOURCES = libopts.c libopts_la_CPPFLAGS = -I$(top_srcdir) -libopts_la_LDFLAGS = -version-info 36:4:11 +libopts_la_LDFLAGS = -version-info 36:5:11 EXTRA_DIST = \ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \ MakeDefs.inc README ag-char-map.h \ alias.c ao-strs.c ao-strs.h \ autoopts/usage-txt.h autoopts/project.h autoopts/options.h \ autoopts.c autoopts.h boolean.c \ - check.c compat/compat.h compat/windows-config.h \ - compat/strdup.c compat/pathfind.c compat/snprintf.c \ - compat/strchr.c configfile.c cook.c \ + check.c compat/strchr.c compat/snprintf.c \ + compat/pathfind.c compat/compat.h compat/windows-config.h \ + compat/strdup.c configfile.c cook.c \ enum.c env.c file.c \ find.c genshell.c genshell.h \ load.c m4/liboptschk.m4 m4/libopts.m4 \ diff --git a/sntp/libopts/ag-char-map.h b/sntp/libopts/ag-char-map.h index a99c81bd90..0f8122573e 100644 --- a/sntp/libopts/ag-char-map.h +++ b/sntp/libopts/ag-char-map.h @@ -1,6 +1,6 @@ /* - * 28 bits for 44 character classifications - * generated by char-mapper on 06/17/12 at 15:47:34 + * 29 bits for 46 character classifications + * generated by char-mapper on 08/11/12 at 09:41:13 * * This file contains the character classifications * used by AutoGen and AutoOpts for identifying tokens. @@ -67,6 +67,7 @@ // underscore "_" // plus "+" // dollar "$" +// option-marker "-" // // horiz-white "\t " // alt-white "\v\f\r\b" @@ -105,322 +106,335 @@ // set-separator "|+" +end-list-entry // signed-number +inversion +dec-digit // make-script +dollar +newline +// load-line-skip +horiz-white +option-marker // #endif /* 0 -- mapping spec. source */ typedef uint32_t ag_char_map_mask_t; -#define IS_NEWLINE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000001) -#define SPN_NEWLINE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 0) -#define BRK_NEWLINE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 0) -#define SPN_NEWLINE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 0) -#define BRK_NEWLINE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 0) -#define IS_NUL_BYTE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000002) -#define SPN_NUL_BYTE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 1) -#define BRK_NUL_BYTE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 1) -#define SPN_NUL_BYTE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 1) -#define BRK_NUL_BYTE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 1) -#define IS_DIR_SEP_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000004) -#define SPN_DIR_SEP_CHARS(_s) spn_ag_char_map_chars((char *)_s, 2) -#define BRK_DIR_SEP_CHARS(_s) brk_ag_char_map_chars((char *)_s, 2) -#define SPN_DIR_SEP_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 2) -#define BRK_DIR_SEP_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 2) -#define IS_PERCENT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000008) -#define SPN_PERCENT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 3) -#define BRK_PERCENT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 3) -#define SPN_PERCENT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 3) -#define BRK_PERCENT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 3) -#define IS_COMMA_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000010) -#define SPN_COMMA_CHARS(_s) spn_ag_char_map_chars((char *)_s, 4) -#define BRK_COMMA_CHARS(_s) brk_ag_char_map_chars((char *)_s, 4) -#define SPN_COMMA_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 4) -#define BRK_COMMA_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 4) -#define IS_COLON_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000020) -#define SPN_COLON_CHARS(_s) spn_ag_char_map_chars((char *)_s, 5) -#define BRK_COLON_CHARS(_s) brk_ag_char_map_chars((char *)_s, 5) -#define SPN_COLON_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 5) -#define BRK_COLON_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 5) -#define IS_UNDERSCORE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000040) -#define SPN_UNDERSCORE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 6) -#define BRK_UNDERSCORE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 6) -#define SPN_UNDERSCORE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 6) -#define BRK_UNDERSCORE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 6) -#define IS_PLUS_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000080) -#define SPN_PLUS_CHARS(_s) spn_ag_char_map_chars((char *)_s, 7) -#define BRK_PLUS_CHARS(_s) brk_ag_char_map_chars((char *)_s, 7) -#define SPN_PLUS_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 7) -#define BRK_PLUS_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 7) -#define IS_DOLLAR_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000100) -#define SPN_DOLLAR_CHARS(_s) spn_ag_char_map_chars((char *)_s, 8) -#define BRK_DOLLAR_CHARS(_s) brk_ag_char_map_chars((char *)_s, 8) -#define SPN_DOLLAR_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 8) -#define BRK_DOLLAR_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 8) -#define IS_HORIZ_WHITE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000200) -#define SPN_HORIZ_WHITE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 9) -#define BRK_HORIZ_WHITE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 9) -#define SPN_HORIZ_WHITE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 9) -#define BRK_HORIZ_WHITE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 9) -#define IS_ALT_WHITE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000400) -#define SPN_ALT_WHITE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 10) -#define BRK_ALT_WHITE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 10) -#define SPN_ALT_WHITE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 10) -#define BRK_ALT_WHITE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 10) -#define IS_WHITESPACE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000601) -#define SPN_WHITESPACE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 11) -#define BRK_WHITESPACE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 11) -#define SPN_WHITESPACE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 11) -#define BRK_WHITESPACE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 11) -#define IS_NON_NL_WHITE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000600) -#define SPN_NON_NL_WHITE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 12) -#define BRK_NON_NL_WHITE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 12) -#define SPN_NON_NL_WHITE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 12) -#define BRK_NON_NL_WHITE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 12) -#define IS_QUOTE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000800) -#define SPN_QUOTE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 13) -#define BRK_QUOTE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 13) -#define SPN_QUOTE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 13) -#define BRK_QUOTE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 13) -#define IS_PARENTHESES_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0001000) -#define SPN_PARENTHESES_CHARS(_s) spn_ag_char_map_chars((char *)_s, 14) -#define BRK_PARENTHESES_CHARS(_s) brk_ag_char_map_chars((char *)_s, 14) -#define SPN_PARENTHESES_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 14) -#define BRK_PARENTHESES_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 14) -#define IS_GRAPHIC_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0002000) -#define SPN_GRAPHIC_CHARS(_s) spn_ag_char_map_chars((char *)_s, 15) -#define BRK_GRAPHIC_CHARS(_s) brk_ag_char_map_chars((char *)_s, 15) -#define SPN_GRAPHIC_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 15) -#define BRK_GRAPHIC_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 15) -#define IS_INVERSION_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0004000) -#define SPN_INVERSION_CHARS(_s) spn_ag_char_map_chars((char *)_s, 16) -#define BRK_INVERSION_CHARS(_s) brk_ag_char_map_chars((char *)_s, 16) -#define SPN_INVERSION_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 16) -#define BRK_INVERSION_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 16) -#define IS_OCT_DIGIT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0008000) -#define SPN_OCT_DIGIT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 17) -#define BRK_OCT_DIGIT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 17) -#define SPN_OCT_DIGIT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 17) -#define BRK_OCT_DIGIT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 17) -#define IS_DEC_DIGIT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0018000) -#define SPN_DEC_DIGIT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 18) -#define BRK_DEC_DIGIT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 18) -#define SPN_DEC_DIGIT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 18) -#define BRK_DEC_DIGIT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 18) -#define IS_HEX_DIGIT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0038000) -#define SPN_HEX_DIGIT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 19) -#define BRK_HEX_DIGIT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 19) -#define SPN_HEX_DIGIT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 19) -#define BRK_HEX_DIGIT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 19) -#define IS_LOWER_CASE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0040000) -#define SPN_LOWER_CASE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 20) -#define BRK_LOWER_CASE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 20) -#define SPN_LOWER_CASE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 20) -#define BRK_LOWER_CASE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 20) -#define IS_UPPER_CASE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0080000) -#define SPN_UPPER_CASE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 21) -#define BRK_UPPER_CASE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 21) -#define SPN_UPPER_CASE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 21) -#define BRK_UPPER_CASE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 21) -#define IS_ALPHABETIC_CHAR( _c) is_ag_char_map_char((char)( _c), 0x00C0000) -#define SPN_ALPHABETIC_CHARS(_s) spn_ag_char_map_chars((char *)_s, 22) -#define BRK_ALPHABETIC_CHARS(_s) brk_ag_char_map_chars((char *)_s, 22) -#define SPN_ALPHABETIC_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 22) -#define BRK_ALPHABETIC_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 22) -#define IS_ALPHANUMERIC_CHAR( _c) is_ag_char_map_char((char)( _c), 0x00D8000) -#define SPN_ALPHANUMERIC_CHARS(_s) spn_ag_char_map_chars((char *)_s, 23) -#define BRK_ALPHANUMERIC_CHARS(_s) brk_ag_char_map_chars((char *)_s, 23) -#define SPN_ALPHANUMERIC_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 23) -#define BRK_ALPHANUMERIC_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 23) -#define IS_VAR_FIRST_CHAR( _c) is_ag_char_map_char((char)( _c), 0x00C0040) -#define SPN_VAR_FIRST_CHARS(_s) spn_ag_char_map_chars((char *)_s, 24) -#define BRK_VAR_FIRST_CHARS(_s) brk_ag_char_map_chars((char *)_s, 24) -#define SPN_VAR_FIRST_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 24) -#define BRK_VAR_FIRST_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 24) -#define IS_VARIABLE_NAME_CHAR( _c) is_ag_char_map_char((char)( _c), 0x00D8040) -#define SPN_VARIABLE_NAME_CHARS(_s) spn_ag_char_map_chars((char *)_s, 25) -#define BRK_VARIABLE_NAME_CHARS(_s) brk_ag_char_map_chars((char *)_s, 25) -#define SPN_VARIABLE_NAME_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 25) -#define BRK_VARIABLE_NAME_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 25) -#define IS_OPTION_NAME_CHAR( _c) is_ag_char_map_char((char)( _c), 0x01D8040) -#define SPN_OPTION_NAME_CHARS(_s) spn_ag_char_map_chars((char *)_s, 26) -#define BRK_OPTION_NAME_CHARS(_s) brk_ag_char_map_chars((char *)_s, 26) -#define SPN_OPTION_NAME_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 26) -#define BRK_OPTION_NAME_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 26) -#define IS_VALUE_NAME_CHAR( _c) is_ag_char_map_char((char)( _c), 0x01D8060) -#define SPN_VALUE_NAME_CHARS(_s) spn_ag_char_map_chars((char *)_s, 27) -#define BRK_VALUE_NAME_CHARS(_s) brk_ag_char_map_chars((char *)_s, 27) -#define SPN_VALUE_NAME_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 27) -#define BRK_VALUE_NAME_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 27) -#define IS_NAME_SEP_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0200000) -#define SPN_NAME_SEP_CHARS(_s) spn_ag_char_map_chars((char *)_s, 28) -#define BRK_NAME_SEP_CHARS(_s) brk_ag_char_map_chars((char *)_s, 28) -#define SPN_NAME_SEP_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 28) -#define BRK_NAME_SEP_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 28) -#define IS_COMPOUND_NAME_CHAR( _c) is_ag_char_map_char((char)( _c), 0x03D8260) -#define SPN_COMPOUND_NAME_CHARS(_s) spn_ag_char_map_chars((char *)_s, 29) -#define BRK_COMPOUND_NAME_CHARS(_s) brk_ag_char_map_chars((char *)_s, 29) -#define SPN_COMPOUND_NAME_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 29) -#define BRK_COMPOUND_NAME_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 29) -#define IS_SCHEME_NOTE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0001800) -#define SPN_SCHEME_NOTE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 30) -#define BRK_SCHEME_NOTE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 30) -#define SPN_SCHEME_NOTE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 30) -#define BRK_SCHEME_NOTE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 30) -#define IS_UNQUOTABLE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0400000) -#define SPN_UNQUOTABLE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 31) -#define BRK_UNQUOTABLE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 31) -#define SPN_UNQUOTABLE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 31) -#define BRK_UNQUOTABLE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 31) -#define IS_END_XML_TOKEN_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0800601) -#define SPN_END_XML_TOKEN_CHARS(_s) spn_ag_char_map_chars((char *)_s, 32) -#define BRK_END_XML_TOKEN_CHARS(_s) brk_ag_char_map_chars((char *)_s, 32) -#define SPN_END_XML_TOKEN_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 32) -#define BRK_END_XML_TOKEN_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 32) -#define IS_PLUS_N_SPACE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000681) -#define SPN_PLUS_N_SPACE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 33) -#define BRK_PLUS_N_SPACE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 33) -#define SPN_PLUS_N_SPACE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 33) -#define BRK_PLUS_N_SPACE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 33) -#define IS_PUNCTUATION_CHAR( _c) is_ag_char_map_char((char)( _c), 0x1000000) -#define SPN_PUNCTUATION_CHARS(_s) spn_ag_char_map_chars((char *)_s, 34) -#define BRK_PUNCTUATION_CHARS(_s) brk_ag_char_map_chars((char *)_s, 34) -#define SPN_PUNCTUATION_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 34) -#define BRK_PUNCTUATION_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 34) -#define IS_SUFFIX_CHAR( _c) is_ag_char_map_char((char)( _c), 0x20D8000) -#define SPN_SUFFIX_CHARS(_s) spn_ag_char_map_chars((char *)_s, 35) -#define BRK_SUFFIX_CHARS(_s) brk_ag_char_map_chars((char *)_s, 35) -#define SPN_SUFFIX_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 35) -#define BRK_SUFFIX_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 35) -#define IS_SUFFIX_FMT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x20D800C) -#define SPN_SUFFIX_FMT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 36) -#define BRK_SUFFIX_FMT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 36) -#define SPN_SUFFIX_FMT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 36) -#define BRK_SUFFIX_FMT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 36) -#define IS_FALSE_TYPE_CHAR( _c) is_ag_char_map_char((char)( _c), 0x4000002) -#define SPN_FALSE_TYPE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 37) -#define BRK_FALSE_TYPE_CHARS(_s) brk_ag_char_map_chars((char *)_s, 37) -#define SPN_FALSE_TYPE_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 37) -#define BRK_FALSE_TYPE_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 37) -#define IS_FILE_NAME_CHAR( _c) is_ag_char_map_char((char)( _c), 0x20D8004) -#define SPN_FILE_NAME_CHARS(_s) spn_ag_char_map_chars((char *)_s, 38) -#define BRK_FILE_NAME_CHARS(_s) brk_ag_char_map_chars((char *)_s, 38) -#define SPN_FILE_NAME_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 38) -#define BRK_FILE_NAME_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 38) -#define IS_END_TOKEN_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000603) -#define SPN_END_TOKEN_CHARS(_s) spn_ag_char_map_chars((char *)_s, 39) -#define BRK_END_TOKEN_CHARS(_s) brk_ag_char_map_chars((char *)_s, 39) -#define SPN_END_TOKEN_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 39) -#define BRK_END_TOKEN_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 39) -#define IS_END_LIST_ENTRY_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000613) -#define SPN_END_LIST_ENTRY_CHARS(_s) spn_ag_char_map_chars((char *)_s, 40) -#define BRK_END_LIST_ENTRY_CHARS(_s) brk_ag_char_map_chars((char *)_s, 40) -#define SPN_END_LIST_ENTRY_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 40) -#define BRK_END_LIST_ENTRY_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 40) -#define IS_SET_SEPARATOR_CHAR( _c) is_ag_char_map_char((char)( _c), 0x8000613) -#define SPN_SET_SEPARATOR_CHARS(_s) spn_ag_char_map_chars((char *)_s, 41) -#define BRK_SET_SEPARATOR_CHARS(_s) brk_ag_char_map_chars((char *)_s, 41) -#define SPN_SET_SEPARATOR_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 41) -#define BRK_SET_SEPARATOR_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 41) -#define IS_SIGNED_NUMBER_CHAR( _c) is_ag_char_map_char((char)( _c), 0x001C000) -#define SPN_SIGNED_NUMBER_CHARS(_s) spn_ag_char_map_chars((char *)_s, 42) -#define BRK_SIGNED_NUMBER_CHARS(_s) brk_ag_char_map_chars((char *)_s, 42) -#define SPN_SIGNED_NUMBER_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 42) -#define BRK_SIGNED_NUMBER_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 42) -#define IS_MAKE_SCRIPT_CHAR( _c) is_ag_char_map_char((char)( _c), 0x0000101) -#define SPN_MAKE_SCRIPT_CHARS(_s) spn_ag_char_map_chars((char *)_s, 43) -#define BRK_MAKE_SCRIPT_CHARS(_s) brk_ag_char_map_chars((char *)_s, 43) -#define SPN_MAKE_SCRIPT_BACK(s,e) spn_ag_char_map_back((char *)s, (char *)e, 43) -#define BRK_MAKE_SCRIPT_BACK(s,e) brk_ag_char_map_back((char *)s, (char *)e, 43) +#define IS_NEWLINE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000001) +#define SPN_NEWLINE_CHARS(_s) spn_ag_char_map_chars(_s, 0) +#define BRK_NEWLINE_CHARS(_s) brk_ag_char_map_chars(_s, 0) +#define SPN_NEWLINE_BACK(s,e) spn_ag_char_map_back(s, e, 0) +#define BRK_NEWLINE_BACK(s,e) brk_ag_char_map_back(s, e, 0) +#define IS_NUL_BYTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000002) +#define SPN_NUL_BYTE_CHARS(_s) spn_ag_char_map_chars(_s, 1) +#define BRK_NUL_BYTE_CHARS(_s) brk_ag_char_map_chars(_s, 1) +#define SPN_NUL_BYTE_BACK(s,e) spn_ag_char_map_back(s, e, 1) +#define BRK_NUL_BYTE_BACK(s,e) brk_ag_char_map_back(s, e, 1) +#define IS_DIR_SEP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000004) +#define SPN_DIR_SEP_CHARS(_s) spn_ag_char_map_chars(_s, 2) +#define BRK_DIR_SEP_CHARS(_s) brk_ag_char_map_chars(_s, 2) +#define SPN_DIR_SEP_BACK(s,e) spn_ag_char_map_back(s, e, 2) +#define BRK_DIR_SEP_BACK(s,e) brk_ag_char_map_back(s, e, 2) +#define IS_PERCENT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000008) +#define SPN_PERCENT_CHARS(_s) spn_ag_char_map_chars(_s, 3) +#define BRK_PERCENT_CHARS(_s) brk_ag_char_map_chars(_s, 3) +#define SPN_PERCENT_BACK(s,e) spn_ag_char_map_back(s, e, 3) +#define BRK_PERCENT_BACK(s,e) brk_ag_char_map_back(s, e, 3) +#define IS_COMMA_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000010) +#define SPN_COMMA_CHARS(_s) spn_ag_char_map_chars(_s, 4) +#define BRK_COMMA_CHARS(_s) brk_ag_char_map_chars(_s, 4) +#define SPN_COMMA_BACK(s,e) spn_ag_char_map_back(s, e, 4) +#define BRK_COMMA_BACK(s,e) brk_ag_char_map_back(s, e, 4) +#define IS_COLON_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000020) +#define SPN_COLON_CHARS(_s) spn_ag_char_map_chars(_s, 5) +#define BRK_COLON_CHARS(_s) brk_ag_char_map_chars(_s, 5) +#define SPN_COLON_BACK(s,e) spn_ag_char_map_back(s, e, 5) +#define BRK_COLON_BACK(s,e) brk_ag_char_map_back(s, e, 5) +#define IS_UNDERSCORE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000040) +#define SPN_UNDERSCORE_CHARS(_s) spn_ag_char_map_chars(_s, 6) +#define BRK_UNDERSCORE_CHARS(_s) brk_ag_char_map_chars(_s, 6) +#define SPN_UNDERSCORE_BACK(s,e) spn_ag_char_map_back(s, e, 6) +#define BRK_UNDERSCORE_BACK(s,e) brk_ag_char_map_back(s, e, 6) +#define IS_PLUS_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000080) +#define SPN_PLUS_CHARS(_s) spn_ag_char_map_chars(_s, 7) +#define BRK_PLUS_CHARS(_s) brk_ag_char_map_chars(_s, 7) +#define SPN_PLUS_BACK(s,e) spn_ag_char_map_back(s, e, 7) +#define BRK_PLUS_BACK(s,e) brk_ag_char_map_back(s, e, 7) +#define IS_DOLLAR_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000100) +#define SPN_DOLLAR_CHARS(_s) spn_ag_char_map_chars(_s, 8) +#define BRK_DOLLAR_CHARS(_s) brk_ag_char_map_chars(_s, 8) +#define SPN_DOLLAR_BACK(s,e) spn_ag_char_map_back(s, e, 8) +#define BRK_DOLLAR_BACK(s,e) brk_ag_char_map_back(s, e, 8) +#define IS_OPTION_MARKER_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000200) +#define SPN_OPTION_MARKER_CHARS(_s) spn_ag_char_map_chars(_s, 9) +#define BRK_OPTION_MARKER_CHARS(_s) brk_ag_char_map_chars(_s, 9) +#define SPN_OPTION_MARKER_BACK(s,e) spn_ag_char_map_back(s, e, 9) +#define BRK_OPTION_MARKER_BACK(s,e) brk_ag_char_map_back(s, e, 9) +#define IS_HORIZ_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000400) +#define SPN_HORIZ_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 10) +#define BRK_HORIZ_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 10) +#define SPN_HORIZ_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 10) +#define BRK_HORIZ_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 10) +#define IS_ALT_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000800) +#define SPN_ALT_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 11) +#define BRK_ALT_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 11) +#define SPN_ALT_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 11) +#define BRK_ALT_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 11) +#define IS_WHITESPACE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C01) +#define SPN_WHITESPACE_CHARS(_s) spn_ag_char_map_chars(_s, 12) +#define BRK_WHITESPACE_CHARS(_s) brk_ag_char_map_chars(_s, 12) +#define SPN_WHITESPACE_BACK(s,e) spn_ag_char_map_back(s, e, 12) +#define BRK_WHITESPACE_BACK(s,e) brk_ag_char_map_back(s, e, 12) +#define IS_NON_NL_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C00) +#define SPN_NON_NL_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 13) +#define BRK_NON_NL_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 13) +#define SPN_NON_NL_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 13) +#define BRK_NON_NL_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 13) +#define IS_QUOTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00001000) +#define SPN_QUOTE_CHARS(_s) spn_ag_char_map_chars(_s, 14) +#define BRK_QUOTE_CHARS(_s) brk_ag_char_map_chars(_s, 14) +#define SPN_QUOTE_BACK(s,e) spn_ag_char_map_back(s, e, 14) +#define BRK_QUOTE_BACK(s,e) brk_ag_char_map_back(s, e, 14) +#define IS_PARENTHESES_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00002000) +#define SPN_PARENTHESES_CHARS(_s) spn_ag_char_map_chars(_s, 15) +#define BRK_PARENTHESES_CHARS(_s) brk_ag_char_map_chars(_s, 15) +#define SPN_PARENTHESES_BACK(s,e) spn_ag_char_map_back(s, e, 15) +#define BRK_PARENTHESES_BACK(s,e) brk_ag_char_map_back(s, e, 15) +#define IS_GRAPHIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00004000) +#define SPN_GRAPHIC_CHARS(_s) spn_ag_char_map_chars(_s, 16) +#define BRK_GRAPHIC_CHARS(_s) brk_ag_char_map_chars(_s, 16) +#define SPN_GRAPHIC_BACK(s,e) spn_ag_char_map_back(s, e, 16) +#define BRK_GRAPHIC_BACK(s,e) brk_ag_char_map_back(s, e, 16) +#define IS_INVERSION_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00008000) +#define SPN_INVERSION_CHARS(_s) spn_ag_char_map_chars(_s, 17) +#define BRK_INVERSION_CHARS(_s) brk_ag_char_map_chars(_s, 17) +#define SPN_INVERSION_BACK(s,e) spn_ag_char_map_back(s, e, 17) +#define BRK_INVERSION_BACK(s,e) brk_ag_char_map_back(s, e, 17) +#define IS_OCT_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00010000) +#define SPN_OCT_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 18) +#define BRK_OCT_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 18) +#define SPN_OCT_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 18) +#define BRK_OCT_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 18) +#define IS_DEC_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00030000) +#define SPN_DEC_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 19) +#define BRK_DEC_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 19) +#define SPN_DEC_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 19) +#define BRK_DEC_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 19) +#define IS_HEX_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00070000) +#define SPN_HEX_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 20) +#define BRK_HEX_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 20) +#define SPN_HEX_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 20) +#define BRK_HEX_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 20) +#define IS_LOWER_CASE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00080000) +#define SPN_LOWER_CASE_CHARS(_s) spn_ag_char_map_chars(_s, 21) +#define BRK_LOWER_CASE_CHARS(_s) brk_ag_char_map_chars(_s, 21) +#define SPN_LOWER_CASE_BACK(s,e) spn_ag_char_map_back(s, e, 21) +#define BRK_LOWER_CASE_BACK(s,e) brk_ag_char_map_back(s, e, 21) +#define IS_UPPER_CASE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00100000) +#define SPN_UPPER_CASE_CHARS(_s) spn_ag_char_map_chars(_s, 22) +#define BRK_UPPER_CASE_CHARS(_s) brk_ag_char_map_chars(_s, 22) +#define SPN_UPPER_CASE_BACK(s,e) spn_ag_char_map_back(s, e, 22) +#define BRK_UPPER_CASE_BACK(s,e) brk_ag_char_map_back(s, e, 22) +#define IS_ALPHABETIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00180000) +#define SPN_ALPHABETIC_CHARS(_s) spn_ag_char_map_chars(_s, 23) +#define BRK_ALPHABETIC_CHARS(_s) brk_ag_char_map_chars(_s, 23) +#define SPN_ALPHABETIC_BACK(s,e) spn_ag_char_map_back(s, e, 23) +#define BRK_ALPHABETIC_BACK(s,e) brk_ag_char_map_back(s, e, 23) +#define IS_ALPHANUMERIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x001B0000) +#define SPN_ALPHANUMERIC_CHARS(_s) spn_ag_char_map_chars(_s, 24) +#define BRK_ALPHANUMERIC_CHARS(_s) brk_ag_char_map_chars(_s, 24) +#define SPN_ALPHANUMERIC_BACK(s,e) spn_ag_char_map_back(s, e, 24) +#define BRK_ALPHANUMERIC_BACK(s,e) brk_ag_char_map_back(s, e, 24) +#define IS_VAR_FIRST_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00180040) +#define SPN_VAR_FIRST_CHARS(_s) spn_ag_char_map_chars(_s, 25) +#define BRK_VAR_FIRST_CHARS(_s) brk_ag_char_map_chars(_s, 25) +#define SPN_VAR_FIRST_BACK(s,e) spn_ag_char_map_back(s, e, 25) +#define BRK_VAR_FIRST_BACK(s,e) brk_ag_char_map_back(s, e, 25) +#define IS_VARIABLE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x001B0040) +#define SPN_VARIABLE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 26) +#define BRK_VARIABLE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 26) +#define SPN_VARIABLE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 26) +#define BRK_VARIABLE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 26) +#define IS_OPTION_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x003B0040) +#define SPN_OPTION_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 27) +#define BRK_OPTION_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 27) +#define SPN_OPTION_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 27) +#define BRK_OPTION_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 27) +#define IS_VALUE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x003B0060) +#define SPN_VALUE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 28) +#define BRK_VALUE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 28) +#define SPN_VALUE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 28) +#define BRK_VALUE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 28) +#define IS_NAME_SEP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00400000) +#define SPN_NAME_SEP_CHARS(_s) spn_ag_char_map_chars(_s, 29) +#define BRK_NAME_SEP_CHARS(_s) brk_ag_char_map_chars(_s, 29) +#define SPN_NAME_SEP_BACK(s,e) spn_ag_char_map_back(s, e, 29) +#define BRK_NAME_SEP_BACK(s,e) brk_ag_char_map_back(s, e, 29) +#define IS_COMPOUND_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x007B0460) +#define SPN_COMPOUND_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 30) +#define BRK_COMPOUND_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 30) +#define SPN_COMPOUND_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 30) +#define BRK_COMPOUND_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 30) +#define IS_SCHEME_NOTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00003000) +#define SPN_SCHEME_NOTE_CHARS(_s) spn_ag_char_map_chars(_s, 31) +#define BRK_SCHEME_NOTE_CHARS(_s) brk_ag_char_map_chars(_s, 31) +#define SPN_SCHEME_NOTE_BACK(s,e) spn_ag_char_map_back(s, e, 31) +#define BRK_SCHEME_NOTE_BACK(s,e) brk_ag_char_map_back(s, e, 31) +#define IS_UNQUOTABLE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00800000) +#define SPN_UNQUOTABLE_CHARS(_s) spn_ag_char_map_chars(_s, 32) +#define BRK_UNQUOTABLE_CHARS(_s) brk_ag_char_map_chars(_s, 32) +#define SPN_UNQUOTABLE_BACK(s,e) spn_ag_char_map_back(s, e, 32) +#define BRK_UNQUOTABLE_BACK(s,e) brk_ag_char_map_back(s, e, 32) +#define IS_END_XML_TOKEN_CHAR( _c) is_ag_char_map_char((char)(_c), 0x01000C01) +#define SPN_END_XML_TOKEN_CHARS(_s) spn_ag_char_map_chars(_s, 33) +#define BRK_END_XML_TOKEN_CHARS(_s) brk_ag_char_map_chars(_s, 33) +#define SPN_END_XML_TOKEN_BACK(s,e) spn_ag_char_map_back(s, e, 33) +#define BRK_END_XML_TOKEN_BACK(s,e) brk_ag_char_map_back(s, e, 33) +#define IS_PLUS_N_SPACE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C81) +#define SPN_PLUS_N_SPACE_CHARS(_s) spn_ag_char_map_chars(_s, 34) +#define BRK_PLUS_N_SPACE_CHARS(_s) brk_ag_char_map_chars(_s, 34) +#define SPN_PLUS_N_SPACE_BACK(s,e) spn_ag_char_map_back(s, e, 34) +#define BRK_PLUS_N_SPACE_BACK(s,e) brk_ag_char_map_back(s, e, 34) +#define IS_PUNCTUATION_CHAR( _c) is_ag_char_map_char((char)(_c), 0x02000000) +#define SPN_PUNCTUATION_CHARS(_s) spn_ag_char_map_chars(_s, 35) +#define BRK_PUNCTUATION_CHARS(_s) brk_ag_char_map_chars(_s, 35) +#define SPN_PUNCTUATION_BACK(s,e) spn_ag_char_map_back(s, e, 35) +#define BRK_PUNCTUATION_BACK(s,e) brk_ag_char_map_back(s, e, 35) +#define IS_SUFFIX_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B0000) +#define SPN_SUFFIX_CHARS(_s) spn_ag_char_map_chars(_s, 36) +#define BRK_SUFFIX_CHARS(_s) brk_ag_char_map_chars(_s, 36) +#define SPN_SUFFIX_BACK(s,e) spn_ag_char_map_back(s, e, 36) +#define BRK_SUFFIX_BACK(s,e) brk_ag_char_map_back(s, e, 36) +#define IS_SUFFIX_FMT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B000C) +#define SPN_SUFFIX_FMT_CHARS(_s) spn_ag_char_map_chars(_s, 37) +#define BRK_SUFFIX_FMT_CHARS(_s) brk_ag_char_map_chars(_s, 37) +#define SPN_SUFFIX_FMT_BACK(s,e) spn_ag_char_map_back(s, e, 37) +#define BRK_SUFFIX_FMT_BACK(s,e) brk_ag_char_map_back(s, e, 37) +#define IS_FALSE_TYPE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x08000002) +#define SPN_FALSE_TYPE_CHARS(_s) spn_ag_char_map_chars(_s, 38) +#define BRK_FALSE_TYPE_CHARS(_s) brk_ag_char_map_chars(_s, 38) +#define SPN_FALSE_TYPE_BACK(s,e) spn_ag_char_map_back(s, e, 38) +#define BRK_FALSE_TYPE_BACK(s,e) brk_ag_char_map_back(s, e, 38) +#define IS_FILE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B0004) +#define SPN_FILE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 39) +#define BRK_FILE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 39) +#define SPN_FILE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 39) +#define BRK_FILE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 39) +#define IS_END_TOKEN_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C03) +#define SPN_END_TOKEN_CHARS(_s) spn_ag_char_map_chars(_s, 40) +#define BRK_END_TOKEN_CHARS(_s) brk_ag_char_map_chars(_s, 40) +#define SPN_END_TOKEN_BACK(s,e) spn_ag_char_map_back(s, e, 40) +#define BRK_END_TOKEN_BACK(s,e) brk_ag_char_map_back(s, e, 40) +#define IS_END_LIST_ENTRY_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C13) +#define SPN_END_LIST_ENTRY_CHARS(_s) spn_ag_char_map_chars(_s, 41) +#define BRK_END_LIST_ENTRY_CHARS(_s) brk_ag_char_map_chars(_s, 41) +#define SPN_END_LIST_ENTRY_BACK(s,e) spn_ag_char_map_back(s, e, 41) +#define BRK_END_LIST_ENTRY_BACK(s,e) brk_ag_char_map_back(s, e, 41) +#define IS_SET_SEPARATOR_CHAR( _c) is_ag_char_map_char((char)(_c), 0x10000C13) +#define SPN_SET_SEPARATOR_CHARS(_s) spn_ag_char_map_chars(_s, 42) +#define BRK_SET_SEPARATOR_CHARS(_s) brk_ag_char_map_chars(_s, 42) +#define SPN_SET_SEPARATOR_BACK(s,e) spn_ag_char_map_back(s, e, 42) +#define BRK_SET_SEPARATOR_BACK(s,e) brk_ag_char_map_back(s, e, 42) +#define IS_SIGNED_NUMBER_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00038000) +#define SPN_SIGNED_NUMBER_CHARS(_s) spn_ag_char_map_chars(_s, 43) +#define BRK_SIGNED_NUMBER_CHARS(_s) brk_ag_char_map_chars(_s, 43) +#define SPN_SIGNED_NUMBER_BACK(s,e) spn_ag_char_map_back(s, e, 43) +#define BRK_SIGNED_NUMBER_BACK(s,e) brk_ag_char_map_back(s, e, 43) +#define IS_MAKE_SCRIPT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000101) +#define SPN_MAKE_SCRIPT_CHARS(_s) spn_ag_char_map_chars(_s, 44) +#define BRK_MAKE_SCRIPT_CHARS(_s) brk_ag_char_map_chars(_s, 44) +#define SPN_MAKE_SCRIPT_BACK(s,e) spn_ag_char_map_back(s, e, 44) +#define BRK_MAKE_SCRIPT_BACK(s,e) brk_ag_char_map_back(s, e, 44) +#define IS_LOAD_LINE_SKIP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000600) +#define SPN_LOAD_LINE_SKIP_CHARS(_s) spn_ag_char_map_chars(_s, 45) +#define BRK_LOAD_LINE_SKIP_CHARS(_s) brk_ag_char_map_chars(_s, 45) +#define SPN_LOAD_LINE_SKIP_BACK(s,e) spn_ag_char_map_back(s, e, 45) +#define BRK_LOAD_LINE_SKIP_BACK(s,e) brk_ag_char_map_back(s, e, 45) static ag_char_map_mask_t const ag_char_map_table[128] = { - /*NUL*/ 0x0000002, /*x01*/ 0x0000000, /*x02*/ 0x0000000, /*x03*/ 0x0000000, - /*x04*/ 0x0000000, /*x05*/ 0x0000000, /*x06*/ 0x0000000, /*BEL*/ 0x0000000, - /* BS*/ 0x0000400, /* HT*/ 0x0000200, /* NL*/ 0x0000001, /* VT*/ 0x0000400, - /* FF*/ 0x0000400, /* CR*/ 0x0000400, /*x0E*/ 0x0000000, /*x0F*/ 0x0000000, - /*x10*/ 0x0000000, /*x11*/ 0x0000000, /*x12*/ 0x0000000, /*x13*/ 0x0000000, - /*x14*/ 0x0000000, /*x15*/ 0x0000000, /*x16*/ 0x0000000, /*x17*/ 0x0000000, - /*x18*/ 0x0000000, /*x19*/ 0x0000000, /*x1A*/ 0x0000000, /*ESC*/ 0x0000000, - /*x1C*/ 0x0000000, /*x1D*/ 0x0000000, /*x1E*/ 0x0000000, /*x1F*/ 0x0000000, - /* */ 0x0000200, /* ! */ 0x1402000, /* " */ 0x1002800, /* # */ 0x1002000, - /* $ */ 0x1402100, /* % */ 0x1402008, /* & */ 0x1402000, /* ' */ 0x1002800, - /* ( */ 0x1003000, /* ) */ 0x1003000, /* * */ 0x1002000, /* + */ 0x9402080, - /* , */ 0x1002010, /* - */ 0x3506000, /* . */ 0x3602000, /* / */ 0x1C02004, - /* 0 */ 0x440A000, /* 1 */ 0x040A000, /* 2 */ 0x040A000, /* 3 */ 0x040A000, - /* 4 */ 0x040A000, /* 5 */ 0x040A000, /* 6 */ 0x040A000, /* 7 */ 0x040A000, - /* 8 */ 0x0412000, /* 9 */ 0x0412000, /* : */ 0x1402020, /* ; */ 0x1002000, - /* < */ 0x1002000, /* = */ 0x1002000, /* > */ 0x1802000, /* ? */ 0x1002000, - /* @ */ 0x1402000, /* A */ 0x04A2000, /* B */ 0x04A2000, /* C */ 0x04A2000, - /* D */ 0x04A2000, /* E */ 0x04A2000, /* F */ 0x44A2000, /* G */ 0x0482000, - /* H */ 0x0482000, /* I */ 0x0482000, /* J */ 0x0482000, /* K */ 0x0482000, - /* L */ 0x0482000, /* M */ 0x0482000, /* N */ 0x4482000, /* O */ 0x0482000, - /* P */ 0x0482000, /* Q */ 0x0482000, /* R */ 0x0482000, /* S */ 0x0482000, - /* T */ 0x0482000, /* U */ 0x0482000, /* V */ 0x0482000, /* W */ 0x0482000, - /* X */ 0x0482000, /* Y */ 0x0482000, /* Z */ 0x0482000, /* [ */ 0x1202000, - /* \ */ 0x1002004, /* ] */ 0x1202000, /* ^ */ 0x1502000, /* _ */ 0x2402040, - /* ` */ 0x1002000, /* a */ 0x0462000, /* b */ 0x0462000, /* c */ 0x0462000, - /* d */ 0x0462000, /* e */ 0x0462000, /* f */ 0x4462000, /* g */ 0x0442000, - /* h */ 0x0442000, /* i */ 0x0442000, /* j */ 0x0442000, /* k */ 0x0442000, - /* l */ 0x0442000, /* m */ 0x0442000, /* n */ 0x4442000, /* o */ 0x0442000, - /* p */ 0x0442000, /* q */ 0x0442000, /* r */ 0x0442000, /* s */ 0x0442000, - /* t */ 0x0442000, /* u */ 0x0442000, /* v */ 0x0442000, /* w */ 0x0442000, - /* x */ 0x0442000, /* y */ 0x0442000, /* z */ 0x0442000, /* { */ 0x1002000, - /* | */ 0x9402000, /* } */ 0x1002000, /* ~ */ 0x1406000, /*x7F*/ 0x0000000 + /*NUL*/ 0x00000002, /*x01*/ 0x00000000, /*x02*/ 0x00000000, /*x03*/ 0x00000000, + /*x04*/ 0x00000000, /*x05*/ 0x00000000, /*x06*/ 0x00000000, /*BEL*/ 0x00000000, + /* BS*/ 0x00000800, /* HT*/ 0x00000400, /* NL*/ 0x00000001, /* VT*/ 0x00000800, + /* FF*/ 0x00000800, /* CR*/ 0x00000800, /*x0E*/ 0x00000000, /*x0F*/ 0x00000000, + /*x10*/ 0x00000000, /*x11*/ 0x00000000, /*x12*/ 0x00000000, /*x13*/ 0x00000000, + /*x14*/ 0x00000000, /*x15*/ 0x00000000, /*x16*/ 0x00000000, /*x17*/ 0x00000000, + /*x18*/ 0x00000000, /*x19*/ 0x00000000, /*x1A*/ 0x00000000, /*ESC*/ 0x00000000, + /*x1C*/ 0x00000000, /*x1D*/ 0x00000000, /*x1E*/ 0x00000000, /*x1F*/ 0x00000000, + /* */ 0x00000400, /* ! */ 0x02804000, /* " */ 0x02005000, /* # */ 0x02004000, + /* $ */ 0x02804100, /* % */ 0x02804008, /* & */ 0x02804000, /* ' */ 0x02005000, + /* ( */ 0x02006000, /* ) */ 0x02006000, /* * */ 0x02004000, /* + */ 0x12804080, + /* , */ 0x02004010, /* - */ 0x06A0C200, /* . */ 0x06C04000, /* / */ 0x03804004, + /* 0 */ 0x08814000, /* 1 */ 0x00814000, /* 2 */ 0x00814000, /* 3 */ 0x00814000, + /* 4 */ 0x00814000, /* 5 */ 0x00814000, /* 6 */ 0x00814000, /* 7 */ 0x00814000, + /* 8 */ 0x00824000, /* 9 */ 0x00824000, /* : */ 0x02804020, /* ; */ 0x02004000, + /* < */ 0x02004000, /* = */ 0x02004000, /* > */ 0x03004000, /* ? */ 0x02004000, + /* @ */ 0x02804000, /* A */ 0x00944000, /* B */ 0x00944000, /* C */ 0x00944000, + /* D */ 0x00944000, /* E */ 0x00944000, /* F */ 0x08944000, /* G */ 0x00904000, + /* H */ 0x00904000, /* I */ 0x00904000, /* J */ 0x00904000, /* K */ 0x00904000, + /* L */ 0x00904000, /* M */ 0x00904000, /* N */ 0x08904000, /* O */ 0x00904000, + /* P */ 0x00904000, /* Q */ 0x00904000, /* R */ 0x00904000, /* S */ 0x00904000, + /* T */ 0x00904000, /* U */ 0x00904000, /* V */ 0x00904000, /* W */ 0x00904000, + /* X */ 0x00904000, /* Y */ 0x00904000, /* Z */ 0x00904000, /* [ */ 0x02404000, + /* \ */ 0x02004004, /* ] */ 0x02404000, /* ^ */ 0x02A04000, /* _ */ 0x04804040, + /* ` */ 0x02004000, /* a */ 0x008C4000, /* b */ 0x008C4000, /* c */ 0x008C4000, + /* d */ 0x008C4000, /* e */ 0x008C4000, /* f */ 0x088C4000, /* g */ 0x00884000, + /* h */ 0x00884000, /* i */ 0x00884000, /* j */ 0x00884000, /* k */ 0x00884000, + /* l */ 0x00884000, /* m */ 0x00884000, /* n */ 0x08884000, /* o */ 0x00884000, + /* p */ 0x00884000, /* q */ 0x00884000, /* r */ 0x00884000, /* s */ 0x00884000, + /* t */ 0x00884000, /* u */ 0x00884000, /* v */ 0x00884000, /* w */ 0x00884000, + /* x */ 0x00884000, /* y */ 0x00884000, /* z */ 0x00884000, /* { */ 0x02004000, + /* | */ 0x12804000, /* } */ 0x02004000, /* ~ */ 0x0280C000, /*x7F*/ 0x00000000 }; #include #include -static unsigned char const * ag_char_map_spanners[44]; +static unsigned char const * ag_char_map_spanners[46]; /** * Character category masks. Some categories may have multiple bits, * if their definition incorporates other character categories. * This mask array is only used by calc_ag_char_map_spanners(). */ -static ag_char_map_mask_t const ag_char_map_masks[44] = { - 0x0000001, /* NEWLINE */ - 0x0000002, /* NUL_BYTE */ - 0x0000004, /* DIR_SEP */ - 0x0000008, /* PERCENT */ - 0x0000010, /* COMMA */ - 0x0000020, /* COLON */ - 0x0000040, /* UNDERSCORE */ - 0x0000080, /* PLUS */ - 0x0000100, /* DOLLAR */ - 0x0000200, /* HORIZ_WHITE */ - 0x0000400, /* ALT_WHITE */ - 0x0000601, /* WHITESPACE */ - 0x0000600, /* NON_NL_WHITE */ - 0x0000800, /* QUOTE */ - 0x0001000, /* PARENTHESES */ - 0x0002000, /* GRAPHIC */ - 0x0004000, /* INVERSION */ - 0x0008000, /* OCT_DIGIT */ - 0x0018000, /* DEC_DIGIT */ - 0x0038000, /* HEX_DIGIT */ - 0x0040000, /* LOWER_CASE */ - 0x0080000, /* UPPER_CASE */ - 0x00C0000, /* ALPHABETIC */ - 0x00D8000, /* ALPHANUMERIC */ - 0x00C0040, /* VAR_FIRST */ - 0x00D8040, /* VARIABLE_NAME */ - 0x01D8040, /* OPTION_NAME */ - 0x01D8060, /* VALUE_NAME */ - 0x0200000, /* NAME_SEP */ - 0x03D8260, /* COMPOUND_NAME */ - 0x0001800, /* SCHEME_NOTE */ - 0x0400000, /* UNQUOTABLE */ - 0x0800601, /* END_XML_TOKEN */ - 0x0000681, /* PLUS_N_SPACE */ - 0x1000000, /* PUNCTUATION */ - 0x20D8000, /* SUFFIX */ - 0x20D800C, /* SUFFIX_FMT */ - 0x4000002, /* FALSE_TYPE */ - 0x20D8004, /* FILE_NAME */ - 0x0000603, /* END_TOKEN */ - 0x0000613, /* END_LIST_ENTRY */ - 0x8000613, /* SET_SEPARATOR */ - 0x001C000, /* SIGNED_NUMBER */ - 0x0000101, /* MAKE_SCRIPT */ +static ag_char_map_mask_t const ag_char_map_masks[46] = { + 0x00000001, /* NEWLINE */ + 0x00000002, /* NUL_BYTE */ + 0x00000004, /* DIR_SEP */ + 0x00000008, /* PERCENT */ + 0x00000010, /* COMMA */ + 0x00000020, /* COLON */ + 0x00000040, /* UNDERSCORE */ + 0x00000080, /* PLUS */ + 0x00000100, /* DOLLAR */ + 0x00000200, /* OPTION_MARKER */ + 0x00000400, /* HORIZ_WHITE */ + 0x00000800, /* ALT_WHITE */ + 0x00000C01, /* WHITESPACE */ + 0x00000C00, /* NON_NL_WHITE */ + 0x00001000, /* QUOTE */ + 0x00002000, /* PARENTHESES */ + 0x00004000, /* GRAPHIC */ + 0x00008000, /* INVERSION */ + 0x00010000, /* OCT_DIGIT */ + 0x00030000, /* DEC_DIGIT */ + 0x00070000, /* HEX_DIGIT */ + 0x00080000, /* LOWER_CASE */ + 0x00100000, /* UPPER_CASE */ + 0x00180000, /* ALPHABETIC */ + 0x001B0000, /* ALPHANUMERIC */ + 0x00180040, /* VAR_FIRST */ + 0x001B0040, /* VARIABLE_NAME */ + 0x003B0040, /* OPTION_NAME */ + 0x003B0060, /* VALUE_NAME */ + 0x00400000, /* NAME_SEP */ + 0x007B0460, /* COMPOUND_NAME */ + 0x00003000, /* SCHEME_NOTE */ + 0x00800000, /* UNQUOTABLE */ + 0x01000C01, /* END_XML_TOKEN */ + 0x00000C81, /* PLUS_N_SPACE */ + 0x02000000, /* PUNCTUATION */ + 0x041B0000, /* SUFFIX */ + 0x041B000C, /* SUFFIX_FMT */ + 0x08000002, /* FALSE_TYPE */ + 0x041B0004, /* FILE_NAME */ + 0x00000C03, /* END_TOKEN */ + 0x00000C13, /* END_LIST_ENTRY */ + 0x10000C13, /* SET_SEPARATOR */ + 0x00038000, /* SIGNED_NUMBER */ + 0x00000101, /* MAKE_SCRIPT */ + 0x00000600, /* LOAD_LINE_SKIP */ }; #define lock_ag_char_map_spanners() @@ -453,44 +467,44 @@ is_ag_char_map_char(char ch, ag_char_map_mask_t mask) } static inline char * -spn_ag_char_map_chars(char * p, unsigned int mask_ix) +spn_ag_char_map_chars(char const * p, unsigned int mask_ix) { unsigned char const * v = ag_char_map_spanners[mask_ix]; if (v == NULL) v = calc_ag_char_map_spanners(mask_ix); while (v[(unsigned)*p]) p++; - return p; + return (char *)(uintptr_t)p; } static inline char * -brk_ag_char_map_chars(char * p, unsigned int mask_ix) +brk_ag_char_map_chars(char const * p, unsigned int mask_ix) { unsigned char const * v = ag_char_map_spanners[mask_ix]; if (v == NULL) v = calc_ag_char_map_spanners(mask_ix); while ((*p != '\0') && (! v[(unsigned)*p])) p++; - return p; + return (char *)(uintptr_t)p; } static inline char * -spn_ag_char_map_back(char * s, char * e, unsigned int mask_ix) +spn_ag_char_map_back(char const * s, char const * e, unsigned int mask_ix) { unsigned char const * v = ag_char_map_spanners[mask_ix]; if (v == NULL) v = calc_ag_char_map_spanners(mask_ix); if (s >= e) e = s + strlen(s); while ((e > s) && v[(unsigned)e[-1]]) e--; - return e; + return (char *)(uintptr_t)e; } static inline char * -brk_ag_char_map_back(char * s, char * e, unsigned int mask_ix) +brk_ag_char_map_back(char const * s, char const * e, unsigned int mask_ix) { unsigned char const * v = ag_char_map_spanners[mask_ix]; if (v == NULL) v = calc_ag_char_map_spanners(mask_ix); if (s == e) e += strlen(e); while ((e > s) && (! v[(unsigned)e[-1]])) e--; - return e; + return (char *)(uintptr_t)e; } #endif /* AG_CHAR_MAP_H_GUARD */ diff --git a/sntp/libopts/alias.c b/sntp/libopts/alias.c index 18a2fd6e1e..f42b619607 100644 --- a/sntp/libopts/alias.c +++ b/sntp/libopts/alias.c @@ -2,7 +2,7 @@ /** * \file alias.c * - * Time-stamp: "2012-02-12 09:41:42 bkorb" + * Time-stamp: "2012-08-11 08:15:43 bkorb" * * Automated Options Paged Usage module. * @@ -47,7 +47,7 @@ optionAlias(tOptions * pOpts, tOptDesc * pOldOD, unsigned int alias) { tOptDesc * pOD; - if (pOpts == OPTPROC_EMIT_USAGE) + if (pOpts <= OPTPROC_EMIT_LIMIT) return 0; pOD = pOpts->pOptDesc + alias; diff --git a/sntp/libopts/ao-strs.c b/sntp/libopts/ao-strs.c index 8d9a11600e..5f16caacd0 100644 --- a/sntp/libopts/ao-strs.c +++ b/sntp/libopts/ao-strs.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (ao-strs.c) * - * It has been AutoGen-ed June 17, 2012 at 03:47:34 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:13 AM by AutoGen 5.16.2pre7 * From the definitions ao-strs.def * and the template file strings * @@ -38,7 +38,7 @@ */ #include "ao-strs.h" -char const ao_strs_strtable[6266] = +char const ao_strs_strtable[6265] = /* 0 */ " \t\n" ":=\0" /* 6 */ "INVALID-%d\0" @@ -101,14 +101,14 @@ char const ao_strs_strtable[6266] = /* 487 */ "%1$s /tmp/use.%2$lu ; rm -f /tmp/use.%2$lu\0" /* 530 */ "# # # # # # # # # # -- do not modify this marker --\n" "#\n" - "# DO NOT EDIT THIS SECTION\n\0" -/* 613 */ "%s OF %s\n" + "# DO NOT EDIT THIS SECTION\0" +/* 612 */ "%s OF %s\n" "#\n" "# From here to the next `-- do not modify this marker --',\n" "# the text has been generated %s\n\0" -/* 719 */ "# From the %s option definitions\n" +/* 718 */ "# From the %s option definitions\n" "#\n\0" -/* 756 */ "\n" +/* 755 */ "\n" "if test -z \"${%1$s_%2$s}\"\n" "then\n" " %1$s_%2$s_CT=0\n" @@ -117,15 +117,15 @@ char const ao_strs_strtable[6266] = " %1$s_%2$s_1=${%1$s_%2$s}\n" "fi\n" "export %1$s_%2$s_CT\0" -/* 877 */ "\n" +/* 876 */ "\n" "%1$s_%2$s=${%1$s_%2$s-'%3$s'}\n" "%1$s_%2$s_set=false\n" "export %1$s_%2$s\0" -/* 945 */ "\n" +/* 944 */ "\n" "%1$s_%2$s=${%1$s_%2$s}\n" "%1$s_%2$s_set=false\n" "export %1$s_%2$s\n\0" -/* 1007 */ "\n" +/* 1006 */ "\n" "OPT_PROCESS=true\n" "OPT_ARG=$1\n" "while ${OPT_PROCESS} && [ $# -gt 0 ]\n" @@ -137,14 +137,14 @@ char const ao_strs_strtable[6266] = " OPT_PROCESS=false\n" " shift\n" " ;;\n\0" -/* 1201 */ "\n" +/* 1200 */ "\n" "OPT_ARG=$1\n" "while [ $# -gt 0 ]\n" "do\n" " OPT_ELEMENT=''\n" " OPT_ARG_VAL=''\n" " OPT_ARG=${1}\n\0" -/* 1291 */ " if [ -n \"${OPT_ARG_VAL}\" ]\n" +/* 1290 */ " if [ -n \"${OPT_ARG_VAL}\" ]\n" " then\n" " eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n" " export %1$s_${OPT_NAME}${OPT_ELEMENT}\n" @@ -158,47 +158,47 @@ char const ao_strs_strtable[6266] = "unset OPT_CODE || :\n" "unset OPT_ARG_VAL || :\n" "%2$s\0" -/* 1621 */ "\n" +/* 1620 */ "\n" "# # # # # # # # # #\n" "#\n" "# END OF AUTOMATED OPTION PROCESSING\n" "#\n" "# # # # # # # # # # -- do not modify this marker --\n\0" -/* 1737 */ " case \"${OPT_CODE}\" in\n\0" -/* 1768 */ " '%s' | \\\n\0" -/* 1786 */ " '%s' )\n\0" -/* 1802 */ " '%c' )\n\0" -/* 1818 */ " ;;\n\n\0" -/* 1835 */ " * )\n" +/* 1736 */ " case \"${OPT_CODE}\" in\n\0" +/* 1767 */ " '%s' | \\\n\0" +/* 1785 */ " '%s' )\n\0" +/* 1801 */ " '%c' )\n\0" +/* 1817 */ " ;;\n\n\0" +/* 1834 */ " * )\n" " echo Unknown %s: \"${OPT_CODE}\" >&2\n" " echo \"$%s_USAGE_TEXT\"\n" " exit 1\n" " ;;\n" " esac\n\n\0" -/* 1977 */ " echo \"$%s_%s_TEXT\"\n" +/* 1976 */ " echo \"$%s_%s_TEXT\"\n" " exit 0\n\0" -/* 2028 */ " echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n" +/* 2027 */ " echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n" " exit 0\n\0" -/* 2102 */ " %s\n\0" -/* 2118 */ " if [ $%1$s_%2$s_CT -ge %3$d ] ; then\n" +/* 2101 */ " %s\n\0" +/* 2117 */ " if [ $%1$s_%2$s_CT -ge %3$d ] ; then\n" " echo Error: more than %3$d %2$s options >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n\0" -/* 2297 */ " %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n" +/* 2296 */ " %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n" " OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n" " OPT_NAME='%2$s'\n\0" -/* 2421 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" +/* 2420 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" " echo Error: duplicate %2$s option >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n" " %1$s_%2$s_set=true\n" " OPT_NAME='%2$s'\n\0" -/* 2668 */ " %1$s_%2$s_CT=0\n" +/* 2667 */ " %1$s_%2$s_CT=0\n" " OPT_ELEMENT=''\n" " %1$s_%2$s='%3$s'\n" " export %1$s_%2$s\n" " OPT_NAME='%2$s'\n\0" -/* 2809 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" +/* 2808 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" " echo 'Error: duplicate %2$s option' >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n" @@ -206,20 +206,20 @@ char const ao_strs_strtable[6266] = " %1$s_%2$s='%3$s'\n" " export %1$s_%2$s\n" " OPT_NAME='%2$s'\n\0" -/* 3116 */ " eval %1$s_%2$s${OPT_ELEMENT}=true\n" +/* 3115 */ " eval %1$s_%2$s${OPT_ELEMENT}=true\n" " export %1$s_%2$s${OPT_ELEMENT}\n" " OPT_ARG_NEEDED=OK\n\0" -/* 3236 */ " OPT_ARG_NEEDED=YES\n\0" -/* 3268 */ " eval %1$s_%2$s${OPT_ELEMENT}=true\n" +/* 3235 */ " OPT_ARG_NEEDED=YES\n\0" +/* 3267 */ " eval %1$s_%2$s${OPT_ELEMENT}=true\n" " export %1$s_%2$s${OPT_ELEMENT}\n" " OPT_ARG_NEEDED=NO\n\0" -/* 3388 */ " OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n" +/* 3387 */ " OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n" " shift\n" " OPT_ARG=$1\n" " case \"${OPT_CODE}\" in *=* )\n" " OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n" " OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\0" -/* 3639 */ " case \"${OPT_ARG_NEEDED}\" in\n" +/* 3638 */ " case \"${OPT_ARG_NEEDED}\" in\n" " NO )\n" " OPT_ARG_VAL=''\n" " ;;\n" @@ -247,9 +247,9 @@ char const ao_strs_strtable[6266] = " fi\n" " ;;\n" " esac\n\0" -/* 4418 */ " OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n" +/* 4417 */ " OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n" " OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\0" -/* 4535 */ " case \"${OPT_ARG_NEEDED}\" in\n" +/* 4534 */ " case \"${OPT_ARG_NEEDED}\" in\n" " NO )\n" " if [ -n \"${OPT_ARG}\" ]\n" " then\n" @@ -294,30 +294,30 @@ char const ao_strs_strtable[6266] = " fi\n" " ;;\n" " esac\n\0" -/* 5689 */ "%1$s_%2$s=%3$d # 0x%3$X\n" +/* 5688 */ "%1$s_%2$s=%3$d # 0x%3$X\n" "export %1$s_%2$s\n\0" -/* 5731 */ "%1$s_%2$s_CT=%3$d\n" +/* 5730 */ "%1$s_%2$s_CT=%3$d\n" "export %1$s_%2$s_CT\n\0" -/* 5770 */ "OPTION_CT=%d\n" +/* 5769 */ "OPTION_CT=%d\n" "export OPTION_CT\n\0" -/* 5801 */ "%1$s_%2$s=%3$s\n" +/* 5800 */ "%1$s_%2$s=%3$s\n" "export %1$s_%2$s\n\0" -/* 5834 */ "%1$s_%2$s='%3$s'\n" +/* 5833 */ "%1$s_%2$s='%3$s'\n" "export %1$s_%2$s\n\0" -/* 5869 */ "%1$s_%2$s_MODE='%3$s'\n" +/* 5868 */ "%1$s_%2$s_MODE='%3$s'\n" "export %1$s_%2$s_MODE\n\0" -/* 5914 */ "echo 'Warning: Cannot load options files' >&2\0" -/* 5961 */ "echo 'Warning: Cannot save options files' >&2\0" -/* 6008 */ "echo 'Warning: Cannot suppress the loading of options files' >&2\0" -/* 6074 */ "%1$s_%2$s_TEXT='no %2$s text'\n\0" -/* 6105 */ "%s WARNING: cannot save options - \0" -/* 6141 */ "<%s/>\n\0" -/* 6148 */ "<%s>\0" -/* 6153 */ "\n\0" -/* 6160 */ "<%s type=%s>\0" -/* 6173 */ "<%s type=nested>\n\0" -/* 6191 */ "#x%02X;\0" -/* 6199 */ "<%1$s type=boolean>%2$s\n\0" -/* 6231 */ "<%1$s type=integer>0x%2$lX\n"; +/* 5913 */ "echo 'Warning: Cannot load options files' >&2\0" +/* 5960 */ "echo 'Warning: Cannot save options files' >&2\0" +/* 6007 */ "echo 'Warning: Cannot suppress the loading of options files' >&2\0" +/* 6073 */ "%1$s_%2$s_TEXT='no %2$s text'\n\0" +/* 6104 */ "%s WARNING: cannot save options - \0" +/* 6140 */ "<%s/>\n\0" +/* 6147 */ "<%s>\0" +/* 6152 */ "\n\0" +/* 6159 */ "<%s type=%s>\0" +/* 6172 */ "<%s type=nested>\n\0" +/* 6190 */ "#x%02X;\0" +/* 6198 */ "<%1$s type=boolean>%2$s\n\0" +/* 6230 */ "<%1$s type=integer>0x%2$lX\n"; /* end of ao-strs.c */ diff --git a/sntp/libopts/ao-strs.h b/sntp/libopts/ao-strs.h index 3d7850a923..62d92ff8f4 100644 --- a/sntp/libopts/ao-strs.h +++ b/sntp/libopts/ao-strs.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (ao-strs.h) * - * It has been AutoGen-ed June 17, 2012 at 03:47:34 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:13 AM by AutoGen 5.16.2pre7 * From the definitions ao-strs.def * and the template file strings * @@ -41,211 +41,210 @@ /* * 102 strings in ao_strs_strtable string table */ -#define ARG_BREAK_STR (ao_strs_strtable+0) -#define ARG_BREAK_STR_LEN 5 -#define INVALID_FMT (ao_strs_strtable+6) -#define INVALID_FMT_LEN 10 -#define INVALID_STR (ao_strs_strtable+17) -#define INVALID_STR_LEN 9 -#define NONE_STR (ao_strs_strtable+27) -#define NONE_STR_LEN 4 -#define PLUS_STR (ao_strs_strtable+32) -#define PLUS_STR_LEN 3 -#define OR_STR (ao_strs_strtable+36) -#define OR_STR_LEN 3 -#define NLSTR_FMT (ao_strs_strtable+40) -#define NLSTR_FMT_LEN 3 -#define PAGER_NAME (ao_strs_strtable+44) -#define PAGER_NAME_LEN 5 -#define TMP_USAGE_FMT (ao_strs_strtable+50) -#define TMP_USAGE_FMT_LEN 12 -#define MORE_STR (ao_strs_strtable+63) -#define MORE_STR_LEN 4 -#define LONG_OPT_MARK (ao_strs_strtable+68) -#define LONG_OPT_MARK_LEN 10 -#define NLSTR_SPACE_FMT (ao_strs_strtable+79) -#define NLSTR_SPACE_FMT_LEN 5 -#define TWO_SPACES_STR (ao_strs_strtable+85) -#define TWO_SPACES_STR_LEN 2 -#define FLAG_OPT_MARK (ao_strs_strtable+88) -#define FLAG_OPT_MARK_LEN 9 -#define END_OPT_SEL_STR (ao_strs_strtable+98) -#define END_OPT_SEL_STR_LEN 12 -#define STDOUT (ao_strs_strtable+111) -#define STDOUT_LEN 6 -#define TIME_FMT (ao_strs_strtable+118) -#define TIME_FMT_LEN 21 -#define SHELL_MAGIC (ao_strs_strtable+140) -#define SHELL_MAGIC_LEN 6 -#define OPT_VAL_FMT (ao_strs_strtable+147) -#define OPT_VAL_FMT_LEN 6 -#define OPT_END_FMT (ao_strs_strtable+154) -#define OPT_END_FMT_LEN 14 -#define EMPTY_ARG (ao_strs_strtable+169) -#define EMPTY_ARG_LEN 2 -#define QUOT_APOS (ao_strs_strtable+172) -#define QUOT_APOS_LEN 2 -#define QUOT_ARG_FMT (ao_strs_strtable+175) -#define QUOT_ARG_FMT_LEN 4 -#define ARG_BY_NUM_FMT (ao_strs_strtable+180) -#define ARG_BY_NUM_FMT_LEN 9 -#define EXPORT_ARG_FMT (ao_strs_strtable+190) -#define EXPORT_ARG_FMT_LEN 17 -#define set_dash (ao_strs_strtable+208) -#define set_dash_LEN 6 -#define arg_fmt (ao_strs_strtable+215) -#define arg_fmt_LEN 5 -#define apostrophy (ao_strs_strtable+221) -#define apostrophy_LEN 4 -#define init_optct (ao_strs_strtable+226) -#define init_optct_LEN 13 -#define SHOW_VAL_FMT (ao_strs_strtable+240) -#define SHOW_VAL_FMT_LEN 17 -#define TRUE_STR (ao_strs_strtable+258) -#define TRUE_STR_LEN 4 -#define FALSE_STR (ao_strs_strtable+263) -#define FALSE_STR_LEN 5 -#define VER_STR (ao_strs_strtable+269) -#define VER_STR_LEN 7 -#define OK_NEED_OPT_ARG (ao_strs_strtable+277) -#define OK_NEED_OPT_ARG_LEN 17 -#define NO_ARG_NEEDED (ao_strs_strtable+295) -#define NO_ARG_NEEDED_LEN 17 -#define YES_NEED_OPT_ARG (ao_strs_strtable+313) -#define YES_NEED_OPT_ARG_LEN 18 -#define LONG_USE_STR (ao_strs_strtable+332) -#define LONG_USE_STR_LEN 9 -#define FLAG_STR (ao_strs_strtable+342) -#define FLAG_STR_LEN 4 -#define SET_TEXT_FMT (ao_strs_strtable+347) -#define SET_TEXT_FMT_LEN 12 -#define END_SET_TEXT (ao_strs_strtable+360) -#define END_SET_TEXT_LEN 3 -#define OPTION_STR (ao_strs_strtable+364) -#define OPTION_STR_LEN 6 -#define SHOW_PROG_ENV (ao_strs_strtable+371) -#define SHOW_PROG_ENV_LEN 19 -#define SET_OFF_FMT (ao_strs_strtable+391) -#define SET_OFF_FMT_LEN 6 -#define LONG_OPT_MARKER (ao_strs_strtable+398) -#define LONG_OPT_MARKER_LEN 2 -#define BULLET_STR (ao_strs_strtable+401) -#define BULLET_STR_LEN 6 -#define DEEP_INDENT_STR (ao_strs_strtable+408) -#define DEEP_INDENT_STR_LEN 6 -#define ONE_TAB_STR (ao_strs_strtable+415) -#define ONE_TAB_STR_LEN 1 -#define NOT_FOUND_STR (ao_strs_strtable+417) -#define NOT_FOUND_STR_LEN 56 -#define ENUM_ERR_SEP_LINE_FMT (ao_strs_strtable+474) -#define ENUM_ERR_SEP_LINE_FMT_LEN 5 -#define ENUM_ERR_STR_WIDTH_FMT (ao_strs_strtable+480) -#define ENUM_ERR_STR_WIDTH_FMT_LEN 6 -#define PAGE_USAGE_FMT (ao_strs_strtable+487) -#define PAGE_USAGE_FMT_LEN 42 -#define START_MARK (ao_strs_strtable+530) -#define START_MARK_LEN 82 -#define PREAMBLE_FMT (ao_strs_strtable+613) -#define PREAMBLE_FMT_LEN 105 -#define END_PRE_FMT (ao_strs_strtable+719) -#define END_PRE_FMT_LEN 36 -#define MULTI_DEF_FMT (ao_strs_strtable+756) -#define MULTI_DEF_FMT_LEN 120 -#define SGL_DEF_FMT (ao_strs_strtable+877) -#define SGL_DEF_FMT_LEN 67 -#define SGL_NO_DEF_FMT (ao_strs_strtable+945) -#define SGL_NO_DEF_FMT_LEN 61 -#define LOOP_STR (ao_strs_strtable+1007) -#define LOOP_STR_LEN 193 -#define ONLY_OPTS_LOOP (ao_strs_strtable+1201) -#define ONLY_OPTS_LOOP_LEN 89 -#define zLoopEnd (ao_strs_strtable+1291) -#define zLoopEnd_LEN 329 -#define END_MARK (ao_strs_strtable+1621) -#define END_MARK_LEN 115 -#define zOptionCase (ao_strs_strtable+1737) -#define zOptionCase_LEN 30 -#define zOptionPartName (ao_strs_strtable+1768) -#define zOptionPartName_LEN 17 -#define zOptionFullName (ao_strs_strtable+1786) -#define zOptionFullName_LEN 15 -#define zOptionFlag (ao_strs_strtable+1802) -#define zOptionFlag_LEN 15 -#define zOptionEndSelect (ao_strs_strtable+1818) -#define zOptionEndSelect_LEN 16 -#define UNK_OPT_FMT (ao_strs_strtable+1835) -#define UNK_OPT_FMT_LEN 141 -#define zTextExit (ao_strs_strtable+1977) -#define zTextExit_LEN 50 -#define zPagedUsageExit (ao_strs_strtable+2028) -#define zPagedUsageExit_LEN 73 -#define zCmdFmt (ao_strs_strtable+2102) -#define zCmdFmt_LEN 15 -#define zCountTest (ao_strs_strtable+2118) -#define zCountTest_LEN 178 -#define MULTI_ARG_FMT (ao_strs_strtable+2297) -#define MULTI_ARG_FMT_LEN 123 -#define SGL_ARG_FMT (ao_strs_strtable+2421) -#define SGL_ARG_FMT_LEN 246 -#define NO_MULTI_ARG_FMT (ao_strs_strtable+2668) -#define NO_MULTI_ARG_FMT_LEN 140 -#define NO_SGL_ARG_FMT (ao_strs_strtable+2809) -#define NO_SGL_ARG_FMT_LEN 306 -#define zMayArg (ao_strs_strtable+3116) -#define zMayArg_LEN 119 -#define zMustArg (ao_strs_strtable+3236) -#define zMustArg_LEN 31 -#define zCantArg (ao_strs_strtable+3268) -#define zCantArg_LEN 119 -#define INIT_LOPT_STR (ao_strs_strtable+3388) -#define INIT_LOPT_STR_LEN 250 -#define LOPT_ARG_FMT (ao_strs_strtable+3639) -#define LOPT_ARG_FMT_LEN 778 -#define INIT_OPT_STR (ao_strs_strtable+4418) -#define INIT_OPT_STR_LEN 116 -#define OPT_ARG_FMT (ao_strs_strtable+4535) -#define OPT_ARG_FMT_LEN 1153 -#define zOptNumFmt (ao_strs_strtable+5689) -#define zOptNumFmt_LEN 41 -#define zOptCookieCt (ao_strs_strtable+5731) -#define zOptCookieCt_LEN 38 -#define zOptCtFmt (ao_strs_strtable+5770) -#define zOptCtFmt_LEN 30 -#define zOptDisabl (ao_strs_strtable+5801) -#define zOptDisabl_LEN 32 -#define zFullOptFmt (ao_strs_strtable+5834) -#define zFullOptFmt_LEN 34 -#define zEquivMode (ao_strs_strtable+5869) -#define zEquivMode_LEN 44 -#define NO_LOAD_WARN (ao_strs_strtable+5914) -#define NO_LOAD_WARN_LEN 46 -#define NO_SAVE_OPTS (ao_strs_strtable+5961) -#define NO_SAVE_OPTS_LEN 46 -#define NO_SUPPRESS_LOAD (ao_strs_strtable+6008) -#define NO_SUPPRESS_LOAD_LEN 65 -#define SET_NO_TEXT_FMT (ao_strs_strtable+6074) -#define SET_NO_TEXT_FMT_LEN 30 -#define SAVE_WARN (ao_strs_strtable+6105) -#define SAVE_WARN_LEN 35 -#define OPEN_CLOSE_FMT (ao_strs_strtable+6141) -#define OPEN_CLOSE_FMT_LEN 6 -#define OPEN_XML_FMT (ao_strs_strtable+6148) -#define OPEN_XML_FMT_LEN 4 -#define END_XML_FMT (ao_strs_strtable+6153) -#define END_XML_FMT_LEN 6 -#define TYPE_ATR_FMT (ao_strs_strtable+6160) -#define TYPE_ATR_FMT_LEN 12 -#define NULL_ATR_FMT (ao_strs_strtable+6141) -#define NULL_ATR_FMT_LEN 6 -#define NESTED_OPT_FMT (ao_strs_strtable+6173) -#define NESTED_OPT_FMT_LEN 17 -#define XML_HEX_BYTE_FMT (ao_strs_strtable+6191) -#define XML_HEX_BYTE_FMT_LEN 7 -#define BOOL_ATR_FMT (ao_strs_strtable+6199) -#define BOOL_ATR_FMT_LEN 31 -#define NUMB_ATR_FMT (ao_strs_strtable+6231) -#define NUMB_ATR_FMT_LEN 34 - -extern char const ao_strs_strtable[6266]; +#define ARG_BREAK_STR (ao_strs_strtable+0) +#define ARG_BREAK_STR_LEN 5 +#define ARG_BY_NUM_FMT (ao_strs_strtable+180) +#define ARG_BY_NUM_FMT_LEN 9 +#define BOOL_ATR_FMT (ao_strs_strtable+6198) +#define BOOL_ATR_FMT_LEN 31 +#define BULLET_STR (ao_strs_strtable+401) +#define BULLET_STR_LEN 6 +#define DEEP_INDENT_STR (ao_strs_strtable+408) +#define DEEP_INDENT_STR_LEN 6 +#define EMPTY_ARG (ao_strs_strtable+169) +#define EMPTY_ARG_LEN 2 +#define END_MARK (ao_strs_strtable+1620) +#define END_MARK_LEN 115 +#define END_OPT_SEL_STR (ao_strs_strtable+98) +#define END_OPT_SEL_STR_LEN 12 +#define END_PRE_FMT (ao_strs_strtable+718) +#define END_PRE_FMT_LEN 36 +#define END_SET_TEXT (ao_strs_strtable+360) +#define END_SET_TEXT_LEN 3 +#define END_XML_FMT (ao_strs_strtable+6152) +#define END_XML_FMT_LEN 6 +#define ENUM_ERR_SEP_LINE_FMT (ao_strs_strtable+474) +#define ENUM_ERR_SEP_LINE_FMT_LEN 5 +#define ENUM_ERR_STR_WIDTH_FMT (ao_strs_strtable+480) +#define ENUM_ERR_STR_WIDTH_FMT_LEN 6 +#define EXPORT_ARG_FMT (ao_strs_strtable+190) +#define EXPORT_ARG_FMT_LEN 17 +#define FALSE_STR (ao_strs_strtable+263) +#define FALSE_STR_LEN 5 +#define FLAG_OPT_MARK (ao_strs_strtable+88) +#define FLAG_OPT_MARK_LEN 9 +#define FLAG_STR (ao_strs_strtable+342) +#define FLAG_STR_LEN 4 +#define INIT_LOPT_STR (ao_strs_strtable+3387) +#define INIT_LOPT_STR_LEN 250 +#define INIT_OPT_STR (ao_strs_strtable+4417) +#define INIT_OPT_STR_LEN 116 +#define INVALID_FMT (ao_strs_strtable+6) +#define INVALID_FMT_LEN 10 +#define INVALID_STR (ao_strs_strtable+17) +#define INVALID_STR_LEN 9 +#define LONG_OPT_MARK (ao_strs_strtable+68) +#define LONG_OPT_MARKER (ao_strs_strtable+398) +#define LONG_OPT_MARKER_LEN 2 +#define LONG_OPT_MARK_LEN 10 +#define LONG_USE_STR (ao_strs_strtable+332) +#define LONG_USE_STR_LEN 9 +#define LOOP_STR (ao_strs_strtable+1006) +#define LOOP_STR_LEN 193 +#define LOPT_ARG_FMT (ao_strs_strtable+3638) +#define LOPT_ARG_FMT_LEN 778 +#define MORE_STR (ao_strs_strtable+63) +#define MORE_STR_LEN 4 +#define MULTI_ARG_FMT (ao_strs_strtable+2296) +#define MULTI_ARG_FMT_LEN 123 +#define MULTI_DEF_FMT (ao_strs_strtable+755) +#define MULTI_DEF_FMT_LEN 120 +#define NESTED_OPT_FMT (ao_strs_strtable+6172) +#define NESTED_OPT_FMT_LEN 17 +#define NLSTR_FMT (ao_strs_strtable+40) +#define NLSTR_FMT_LEN 3 +#define NLSTR_SPACE_FMT (ao_strs_strtable+79) +#define NLSTR_SPACE_FMT_LEN 5 +#define NONE_STR (ao_strs_strtable+27) +#define NONE_STR_LEN 4 +#define NOT_FOUND_STR (ao_strs_strtable+417) +#define NOT_FOUND_STR_LEN 56 +#define NO_ARG_NEEDED (ao_strs_strtable+295) +#define NO_ARG_NEEDED_LEN 17 +#define NO_LOAD_WARN (ao_strs_strtable+5913) +#define NO_LOAD_WARN_LEN 46 +#define NO_MULTI_ARG_FMT (ao_strs_strtable+2667) +#define NO_MULTI_ARG_FMT_LEN 140 +#define NO_SAVE_OPTS (ao_strs_strtable+5960) +#define NO_SAVE_OPTS_LEN 46 +#define NO_SGL_ARG_FMT (ao_strs_strtable+2808) +#define NO_SGL_ARG_FMT_LEN 306 +#define NO_SUPPRESS_LOAD (ao_strs_strtable+6007) +#define NO_SUPPRESS_LOAD_LEN 65 +#define NULL_ATR_FMT (ao_strs_strtable+6140) +#define NULL_ATR_FMT_LEN 6 +#define NUMB_ATR_FMT (ao_strs_strtable+6230) +#define NUMB_ATR_FMT_LEN 34 +#define OK_NEED_OPT_ARG (ao_strs_strtable+277) +#define OK_NEED_OPT_ARG_LEN 17 +#define ONE_TAB_STR (ao_strs_strtable+415) +#define ONE_TAB_STR_LEN 1 +#define ONLY_OPTS_LOOP (ao_strs_strtable+1200) +#define ONLY_OPTS_LOOP_LEN 89 +#define OPEN_CLOSE_FMT (ao_strs_strtable+6140) +#define OPEN_CLOSE_FMT_LEN 6 +#define OPEN_XML_FMT (ao_strs_strtable+6147) +#define OPEN_XML_FMT_LEN 4 +#define OPTION_STR (ao_strs_strtable+364) +#define OPTION_STR_LEN 6 +#define OPT_ARG_FMT (ao_strs_strtable+4534) +#define OPT_ARG_FMT_LEN 1153 +#define OPT_END_FMT (ao_strs_strtable+154) +#define OPT_END_FMT_LEN 14 +#define OPT_VAL_FMT (ao_strs_strtable+147) +#define OPT_VAL_FMT_LEN 6 +#define OR_STR (ao_strs_strtable+36) +#define OR_STR_LEN 3 +#define PAGER_NAME (ao_strs_strtable+44) +#define PAGER_NAME_LEN 5 +#define PAGE_USAGE_FMT (ao_strs_strtable+487) +#define PAGE_USAGE_FMT_LEN 42 +#define PLUS_STR (ao_strs_strtable+32) +#define PLUS_STR_LEN 3 +#define PREAMBLE_FMT (ao_strs_strtable+612) +#define PREAMBLE_FMT_LEN 105 +#define QUOT_APOS (ao_strs_strtable+172) +#define QUOT_APOS_LEN 2 +#define QUOT_ARG_FMT (ao_strs_strtable+175) +#define QUOT_ARG_FMT_LEN 4 +#define SAVE_WARN (ao_strs_strtable+6104) +#define SAVE_WARN_LEN 35 +#define SET_NO_TEXT_FMT (ao_strs_strtable+6073) +#define SET_NO_TEXT_FMT_LEN 30 +#define SET_OFF_FMT (ao_strs_strtable+391) +#define SET_OFF_FMT_LEN 6 +#define SET_TEXT_FMT (ao_strs_strtable+347) +#define SET_TEXT_FMT_LEN 12 +#define SGL_ARG_FMT (ao_strs_strtable+2420) +#define SGL_ARG_FMT_LEN 246 +#define SGL_DEF_FMT (ao_strs_strtable+876) +#define SGL_DEF_FMT_LEN 67 +#define SGL_NO_DEF_FMT (ao_strs_strtable+944) +#define SGL_NO_DEF_FMT_LEN 61 +#define SHELL_MAGIC (ao_strs_strtable+140) +#define SHELL_MAGIC_LEN 6 +#define SHOW_PROG_ENV (ao_strs_strtable+371) +#define SHOW_PROG_ENV_LEN 19 +#define SHOW_VAL_FMT (ao_strs_strtable+240) +#define SHOW_VAL_FMT_LEN 17 +#define START_MARK (ao_strs_strtable+530) +#define START_MARK_LEN 81 +#define STDOUT (ao_strs_strtable+111) +#define STDOUT_LEN 6 +#define TIME_FMT (ao_strs_strtable+118) +#define TIME_FMT_LEN 21 +#define TMP_USAGE_FMT (ao_strs_strtable+50) +#define TMP_USAGE_FMT_LEN 12 +#define TRUE_STR (ao_strs_strtable+258) +#define TRUE_STR_LEN 4 +#define TWO_SPACES_STR (ao_strs_strtable+85) +#define TWO_SPACES_STR_LEN 2 +#define TYPE_ATR_FMT (ao_strs_strtable+6159) +#define TYPE_ATR_FMT_LEN 12 +#define UNK_OPT_FMT (ao_strs_strtable+1834) +#define UNK_OPT_FMT_LEN 141 +#define VER_STR (ao_strs_strtable+269) +#define VER_STR_LEN 7 +#define XML_HEX_BYTE_FMT (ao_strs_strtable+6190) +#define XML_HEX_BYTE_FMT_LEN 7 +#define YES_NEED_OPT_ARG (ao_strs_strtable+313) +#define YES_NEED_OPT_ARG_LEN 18 +#define apostrophy (ao_strs_strtable+221) +#define apostrophy_LEN 4 +#define arg_fmt (ao_strs_strtable+215) +#define arg_fmt_LEN 5 +#define init_optct (ao_strs_strtable+226) +#define init_optct_LEN 13 +#define set_dash (ao_strs_strtable+208) +#define set_dash_LEN 6 +#define zCantArg (ao_strs_strtable+3267) +#define zCantArg_LEN 119 +#define zCmdFmt (ao_strs_strtable+2101) +#define zCmdFmt_LEN 15 +#define zCountTest (ao_strs_strtable+2117) +#define zCountTest_LEN 178 +#define zEquivMode (ao_strs_strtable+5868) +#define zEquivMode_LEN 44 +#define zFullOptFmt (ao_strs_strtable+5833) +#define zFullOptFmt_LEN 34 +#define zLoopEnd (ao_strs_strtable+1290) +#define zLoopEnd_LEN 329 +#define zMayArg (ao_strs_strtable+3115) +#define zMayArg_LEN 119 +#define zMustArg (ao_strs_strtable+3235) +#define zMustArg_LEN 31 +#define zOptCookieCt (ao_strs_strtable+5730) +#define zOptCookieCt_LEN 38 +#define zOptCtFmt (ao_strs_strtable+5769) +#define zOptCtFmt_LEN 30 +#define zOptDisabl (ao_strs_strtable+5800) +#define zOptDisabl_LEN 32 +#define zOptNumFmt (ao_strs_strtable+5688) +#define zOptNumFmt_LEN 41 +#define zOptionCase (ao_strs_strtable+1736) +#define zOptionCase_LEN 30 +#define zOptionEndSelect (ao_strs_strtable+1817) +#define zOptionEndSelect_LEN 16 +#define zOptionFlag (ao_strs_strtable+1801) +#define zOptionFlag_LEN 15 +#define zOptionFullName (ao_strs_strtable+1785) +#define zOptionFullName_LEN 15 +#define zOptionPartName (ao_strs_strtable+1767) +#define zOptionPartName_LEN 17 +#define zPagedUsageExit (ao_strs_strtable+2027) +#define zPagedUsageExit_LEN 73 +#define zTextExit (ao_strs_strtable+1976) +#define zTextExit_LEN 50 +extern char const ao_strs_strtable[6265]; #endif /* STRINGS_AO_STRS_H_GUARD */ diff --git a/sntp/libopts/autoopts/options.h b/sntp/libopts/autoopts/options.h index 649ff3dbf9..c16d91b3be 100644 --- a/sntp/libopts/autoopts/options.h +++ b/sntp/libopts/autoopts/options.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (options.h) * - * It has been AutoGen-ed June 17, 2012 at 03:47:39 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:18 AM by AutoGen 5.16.2pre7 * From the definitions funcs.def * and the template file options_h * @@ -86,8 +86,8 @@ * See the relevant generated header file to determine which and what * values for "opt_name" are available. */ -#define OPTIONS_STRUCT_VERSION 147460 -#define OPTIONS_VERSION_STRING "36:4:11" +#define OPTIONS_STRUCT_VERSION 147461 +#define OPTIONS_VERSION_STRING "36:5:11" #define OPTIONS_MINIMUM_VERSION 102400 #define OPTIONS_MIN_VER_STRING "25:0:0" #define OPTIONS_VER_TO_NUM(_v, _r) (((_v) * 4096) + (_r)) @@ -718,13 +718,13 @@ extern void optionFree(tOptions*); extern const tOptionValue* optionGetValue(const tOptionValue*, char const*); -/* From: load.c line 475 +/* From: load.c line 478 * * optionLoadLine - process a string for an option name and value * * Arguments: - * pOpts program options descriptor - * pzLine NUL-terminated text + * opts program options descriptor + * line NUL-terminated text * * This is a client program callable routine for setting options from, for * example, the contents of a file that they read in. Only one option may @@ -733,7 +733,8 @@ extern const tOptionValue* optionGetValue(const tOptionValue*, char const*); * When passed a pointer to the option struct and a string, it will find * the option named by the first token on the string and set the option * argument to the remainder of the string. The caller must NUL terminate - * the string. Any embedded new lines will be included in the option + * the string. The caller need not skip over any introductory hyphens. + * Any embedded new lines will be included in the option * argument. If the input looks like one or more quoted strings, then the * input will be "cooked". The "cooking" is identical to the string * formation used in AutoGen definition files (@pxref{basic expression}), diff --git a/sntp/libopts/autoopts/usage-txt.h b/sntp/libopts/autoopts/usage-txt.h index 8ea302fce6..0200b8401d 100644 --- a/sntp/libopts/autoopts/usage-txt.h +++ b/sntp/libopts/autoopts/usage-txt.h @@ -2,12 +2,12 @@ * * DO NOT EDIT THIS FILE (usage-txt.h) * - * It has been AutoGen-ed June 17, 2012 at 03:47:37 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:15 AM by AutoGen 5.16.2pre7 * From the definitions usage-txt.def * and the template file usage-txt.tpl * * This file handles all the bookkeeping required for tracking all the little - * tiny strings used by the AutoOpts library. There are 145 + * tiny strings used by the AutoOpts library. There are 146 * of them. This is not versioned because it is entirely internal to the * library and accessed by client code only in a very well-controlled way: * they may substitute translated strings using a procedure that steps through @@ -50,7 +50,7 @@ typedef struct { char* utpz_GnuTimeArg; char* utpz_GnuNumArg; char* utpz_GnuStrArg; - cch_t* apz_str[ 138 ]; + cch_t* apz_str[ 139 ]; } usage_text_t; /* @@ -129,85 +129,86 @@ extern usage_text_t option_usage_text; #define zIllVendOptStr (option_usage_text.apz_str[ 56]) #define zIntRange (option_usage_text.apz_str[ 57]) #define zInvalOptDesc (option_usage_text.apz_str[ 58]) -#define zLowerBits (option_usage_text.apz_str[ 59]) -#define zMembers (option_usage_text.apz_str[ 60]) -#define zMisArg (option_usage_text.apz_str[ 61]) -#define zMultiEquiv (option_usage_text.apz_str[ 62]) -#define zMust (option_usage_text.apz_str[ 63]) -#define zNeedOne (option_usage_text.apz_str[ 64]) -#define zNoArg (option_usage_text.apz_str[ 65]) -#define zNoArgs (option_usage_text.apz_str[ 66]) -#define zNoCreat (option_usage_text.apz_str[ 67]) -#define zNoFlags (option_usage_text.apz_str[ 68]) -#define zNoKey (option_usage_text.apz_str[ 69]) -#define zNoLim (option_usage_text.apz_str[ 70]) -#define zNoPreset (option_usage_text.apz_str[ 71]) -#define zNoResetArg (option_usage_text.apz_str[ 72]) -#define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 73]) -#define zNoRq_ShrtTtl (option_usage_text.apz_str[ 74]) -#define zNoStat (option_usage_text.apz_str[ 75]) -#define zNoState (option_usage_text.apz_str[ 76]) -#define zNone (option_usage_text.apz_str[ 77]) -#define zNotDef (option_usage_text.apz_str[ 78]) -#define zNotCmdOpt (option_usage_text.apz_str[ 79]) -#define zNotEnough (option_usage_text.apz_str[ 80]) -#define zNotFile (option_usage_text.apz_str[ 81]) -#define zNotNumber (option_usage_text.apz_str[ 82]) -#define zNotDate (option_usage_text.apz_str[ 83]) -#define zNotDuration (option_usage_text.apz_str[ 84]) -#define zNrmOptFmt (option_usage_text.apz_str[ 85]) -#define zNumberOpt (option_usage_text.apz_str[ 86]) -#define zOnlyOne (option_usage_text.apz_str[ 87]) -#define zOptsOnly (option_usage_text.apz_str[ 88]) -#define zOutputFail (option_usage_text.apz_str[ 89]) -#define zPathFmt (option_usage_text.apz_str[ 90]) -#define zPlsSendBugs (option_usage_text.apz_str[ 91]) -#define zPreset (option_usage_text.apz_str[ 92]) -#define zPresetFile (option_usage_text.apz_str[ 93]) -#define zPresetIntro (option_usage_text.apz_str[ 94]) -#define zProhib (option_usage_text.apz_str[ 95]) -#define zReorder (option_usage_text.apz_str[ 96]) -#define zRange (option_usage_text.apz_str[ 97]) -#define zRangeAbove (option_usage_text.apz_str[ 98]) -#define zRangeLie (option_usage_text.apz_str[ 99]) -#define zRangeOnly (option_usage_text.apz_str[100]) -#define zRangeOr (option_usage_text.apz_str[101]) -#define zRangeErr (option_usage_text.apz_str[102]) -#define zRangeExact (option_usage_text.apz_str[103]) -#define zRangeScaled (option_usage_text.apz_str[104]) -#define zRangeUpto (option_usage_text.apz_str[105]) -#define zResetNotConfig (option_usage_text.apz_str[106]) -#define zReqFmt (option_usage_text.apz_str[107]) -#define zReqOptFmt (option_usage_text.apz_str[108]) -#define zReqThese (option_usage_text.apz_str[109]) -#define zReq_NoShrtTtl (option_usage_text.apz_str[110]) -#define zReq_ShrtTtl (option_usage_text.apz_str[111]) -#define zSepChars (option_usage_text.apz_str[112]) -#define zSetMemberSettings (option_usage_text.apz_str[113]) -#define zShrtGnuOptFmt (option_usage_text.apz_str[114]) -#define zSixSpaces (option_usage_text.apz_str[115]) -#define zStdBoolArg (option_usage_text.apz_str[116]) -#define zStdBreak (option_usage_text.apz_str[117]) -#define zStdFileArg (option_usage_text.apz_str[118]) -#define zStdKeyArg (option_usage_text.apz_str[119]) -#define zStdKeyLArg (option_usage_text.apz_str[120]) -#define zStdTimeArg (option_usage_text.apz_str[121]) -#define zStdNestArg (option_usage_text.apz_str[122]) -#define zStdNoArg (option_usage_text.apz_str[123]) -#define zStdNumArg (option_usage_text.apz_str[124]) -#define zStdOptArg (option_usage_text.apz_str[125]) -#define zStdReqArg (option_usage_text.apz_str[126]) -#define zStdStrArg (option_usage_text.apz_str[127]) -#define zTabHyp (option_usage_text.apz_str[128]) -#define zTabHypAnd (option_usage_text.apz_str[129]) -#define zTabout (option_usage_text.apz_str[130]) -#define zThreeSpaces (option_usage_text.apz_str[131]) -#define zTooLarge (option_usage_text.apz_str[132]) -#define zTwoSpaces (option_usage_text.apz_str[133]) -#define zUpTo (option_usage_text.apz_str[134]) -#define zValidKeys (option_usage_text.apz_str[135]) -#define zVendOptsAre (option_usage_text.apz_str[136]) -#define zVendIntro (option_usage_text.apz_str[137]) +#define zInvalOptName (option_usage_text.apz_str[ 59]) +#define zLowerBits (option_usage_text.apz_str[ 60]) +#define zMembers (option_usage_text.apz_str[ 61]) +#define zMisArg (option_usage_text.apz_str[ 62]) +#define zMultiEquiv (option_usage_text.apz_str[ 63]) +#define zMust (option_usage_text.apz_str[ 64]) +#define zNeedOne (option_usage_text.apz_str[ 65]) +#define zNoArg (option_usage_text.apz_str[ 66]) +#define zNoArgs (option_usage_text.apz_str[ 67]) +#define zNoCreat (option_usage_text.apz_str[ 68]) +#define zNoFlags (option_usage_text.apz_str[ 69]) +#define zNoKey (option_usage_text.apz_str[ 70]) +#define zNoLim (option_usage_text.apz_str[ 71]) +#define zNoPreset (option_usage_text.apz_str[ 72]) +#define zNoResetArg (option_usage_text.apz_str[ 73]) +#define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 74]) +#define zNoRq_ShrtTtl (option_usage_text.apz_str[ 75]) +#define zNoStat (option_usage_text.apz_str[ 76]) +#define zNoState (option_usage_text.apz_str[ 77]) +#define zNone (option_usage_text.apz_str[ 78]) +#define zNotDef (option_usage_text.apz_str[ 79]) +#define zNotCmdOpt (option_usage_text.apz_str[ 80]) +#define zNotEnough (option_usage_text.apz_str[ 81]) +#define zNotFile (option_usage_text.apz_str[ 82]) +#define zNotNumber (option_usage_text.apz_str[ 83]) +#define zNotDate (option_usage_text.apz_str[ 84]) +#define zNotDuration (option_usage_text.apz_str[ 85]) +#define zNrmOptFmt (option_usage_text.apz_str[ 86]) +#define zNumberOpt (option_usage_text.apz_str[ 87]) +#define zOnlyOne (option_usage_text.apz_str[ 88]) +#define zOptsOnly (option_usage_text.apz_str[ 89]) +#define zOutputFail (option_usage_text.apz_str[ 90]) +#define zPathFmt (option_usage_text.apz_str[ 91]) +#define zPlsSendBugs (option_usage_text.apz_str[ 92]) +#define zPreset (option_usage_text.apz_str[ 93]) +#define zPresetFile (option_usage_text.apz_str[ 94]) +#define zPresetIntro (option_usage_text.apz_str[ 95]) +#define zProhib (option_usage_text.apz_str[ 96]) +#define zReorder (option_usage_text.apz_str[ 97]) +#define zRange (option_usage_text.apz_str[ 98]) +#define zRangeAbove (option_usage_text.apz_str[ 99]) +#define zRangeLie (option_usage_text.apz_str[100]) +#define zRangeOnly (option_usage_text.apz_str[101]) +#define zRangeOr (option_usage_text.apz_str[102]) +#define zRangeErr (option_usage_text.apz_str[103]) +#define zRangeExact (option_usage_text.apz_str[104]) +#define zRangeScaled (option_usage_text.apz_str[105]) +#define zRangeUpto (option_usage_text.apz_str[106]) +#define zResetNotConfig (option_usage_text.apz_str[107]) +#define zReqFmt (option_usage_text.apz_str[108]) +#define zReqOptFmt (option_usage_text.apz_str[109]) +#define zReqThese (option_usage_text.apz_str[110]) +#define zReq_NoShrtTtl (option_usage_text.apz_str[111]) +#define zReq_ShrtTtl (option_usage_text.apz_str[112]) +#define zSepChars (option_usage_text.apz_str[113]) +#define zSetMemberSettings (option_usage_text.apz_str[114]) +#define zShrtGnuOptFmt (option_usage_text.apz_str[115]) +#define zSixSpaces (option_usage_text.apz_str[116]) +#define zStdBoolArg (option_usage_text.apz_str[117]) +#define zStdBreak (option_usage_text.apz_str[118]) +#define zStdFileArg (option_usage_text.apz_str[119]) +#define zStdKeyArg (option_usage_text.apz_str[120]) +#define zStdKeyLArg (option_usage_text.apz_str[121]) +#define zStdTimeArg (option_usage_text.apz_str[122]) +#define zStdNestArg (option_usage_text.apz_str[123]) +#define zStdNoArg (option_usage_text.apz_str[124]) +#define zStdNumArg (option_usage_text.apz_str[125]) +#define zStdOptArg (option_usage_text.apz_str[126]) +#define zStdReqArg (option_usage_text.apz_str[127]) +#define zStdStrArg (option_usage_text.apz_str[128]) +#define zTabHyp (option_usage_text.apz_str[129]) +#define zTabHypAnd (option_usage_text.apz_str[130]) +#define zTabout (option_usage_text.apz_str[131]) +#define zThreeSpaces (option_usage_text.apz_str[132]) +#define zTooLarge (option_usage_text.apz_str[133]) +#define zTwoSpaces (option_usage_text.apz_str[134]) +#define zUpTo (option_usage_text.apz_str[135]) +#define zValidKeys (option_usage_text.apz_str[136]) +#define zVendOptsAre (option_usage_text.apz_str[137]) +#define zVendIntro (option_usage_text.apz_str[138]) /* * First, set up the strings. Some of these are writable. These are all in @@ -222,7 +223,7 @@ extern usage_text_t option_usage_text; static char eng_zGnuTimeArg[] = "=Tim"; static char eng_zGnuNumArg[] = "=num"; static char eng_zGnuStrArg[] = "=str"; -static char const usage_txt[4631] = +static char const usage_txt[4660] = /* 0 */ "malloc of %d bytes failed\n\0" /* 27 */ "AutoOpts function called without option descriptor\n\0" /* 79 */ "\tThis exceeds the compiled library version: \0" @@ -292,93 +293,94 @@ static char const usage_txt[4631] = /* 2052 */ "%s: unknown vendor extension option -- %s\n\0" /* 2095 */ " or an integer from %d through %d\n\0" /* 2131 */ "AutoOpts ERROR: invalid option descriptor for %s\n\0" -/* 2182 */ " or an integer mask with any of the lower %d bits set\n\0" -/* 2238 */ "\t\t\t\t- is a set membership option\n\0" -/* 2272 */ "%s: option `%s' requires an argument\n\0" -/* 2310 */ "Equivalenced option '%s' was equivalenced to both\n" +/* 2182 */ "%s: invalid option name: %s\n\0" +/* 2211 */ " or an integer mask with any of the lower %d bits set\n\0" +/* 2267 */ "\t\t\t\t- is a set membership option\n\0" +/* 2301 */ "%s: option `%s' requires an argument\n\0" +/* 2339 */ "Equivalenced option '%s' was equivalenced to both\n" "\t'%s' and '%s'\0" -/* 2375 */ "\t\t\t\t- must appear between %d and %d times\n\0" -/* 2418 */ "ERROR: The %s option is required\n\0" -/* 2453 */ "%s: option `%s' cannot have an argument\n\0" -/* 2494 */ "%s: Command line arguments not allowed\n\0" -/* 2534 */ "error %d (%s) creating %s\n\0" -/* 2561 */ "Options are specified by single or double hyphens and their name.\n\0" -/* 2628 */ "%s error: `%s' does not match any %s keywords\n\0" -/* 2676 */ "\t\t\t\t- may appear multiple times\n\0" -/* 2709 */ "\t\t\t\t- may not be preset\n\0" -/* 2734 */ "The 'reset-option' option requires an argument\n\0" -/* 2782 */ " Arg Option-Name Description\n\0" -/* 2817 */ " Flg Arg Option-Name Description\n\0" -/* 2855 */ "error %d (%s) stat-ing %s\n\0" -/* 2882 */ "%s(optionRestore): error: no saved option state\n\0" -/* 2931 */ "none\0" -/* 2936 */ "'%s' not defined\n\0" -/* 2954 */ "'%s' is not a command line option\n\0" -/* 2989 */ "ERROR: The %s option must appear %d times\n\0" -/* 3033 */ "error: cannot load options from non-regular file %s\n\0" -/* 3087 */ "%s error: `%s' is not a recognizable number\n\0" -/* 3133 */ "%s error: `%s' is not a recognizable date/time\n\0" -/* 3182 */ "%s error: `%s' is not a recognizable time duration\n\0" -/* 3235 */ " %3s %s\0" -/* 3243 */ "The '-#' option may omit the hash char\n\0" -/* 3291 */ "one %s%s option allowed\n\0" -/* 3316 */ "All arguments are named options.\n\0" -/* 3350 */ "Write failure to output file\0" -/* 3379 */ " - reading file %s\0" -/* 3398 */ "\n" +/* 2404 */ "\t\t\t\t- must appear between %d and %d times\n\0" +/* 2447 */ "ERROR: The %s option is required\n\0" +/* 2482 */ "%s: option `%s' cannot have an argument\n\0" +/* 2523 */ "%s: Command line arguments not allowed\n\0" +/* 2563 */ "error %d (%s) creating %s\n\0" +/* 2590 */ "Options are specified by single or double hyphens and their name.\n\0" +/* 2657 */ "%s error: `%s' does not match any %s keywords\n\0" +/* 2705 */ "\t\t\t\t- may appear multiple times\n\0" +/* 2738 */ "\t\t\t\t- may not be preset\n\0" +/* 2763 */ "The 'reset-option' option requires an argument\n\0" +/* 2811 */ " Arg Option-Name Description\n\0" +/* 2846 */ " Flg Arg Option-Name Description\n\0" +/* 2884 */ "error %d (%s) stat-ing %s\n\0" +/* 2911 */ "%s(optionRestore): error: no saved option state\n\0" +/* 2960 */ "none\0" +/* 2965 */ "'%s' not defined\n\0" +/* 2983 */ "'%s' is not a command line option\n\0" +/* 3018 */ "ERROR: The %s option must appear %d times\n\0" +/* 3062 */ "error: cannot load options from non-regular file %s\n\0" +/* 3116 */ "%s error: `%s' is not a recognizable number\n\0" +/* 3162 */ "%s error: `%s' is not a recognizable date/time\n\0" +/* 3211 */ "%s error: `%s' is not a recognizable time duration\n\0" +/* 3264 */ " %3s %s\0" +/* 3272 */ "The '-#' option may omit the hash char\n\0" +/* 3320 */ "one %s%s option allowed\n\0" +/* 3345 */ "All arguments are named options.\n\0" +/* 3379 */ "Write failure to output file\0" +/* 3408 */ " - reading file %s\0" +/* 3427 */ "\n" "please send bug reports to: %s\n\0" -/* 3432 */ "\t\t\t\t- may NOT appear - preset only\n\0" -/* 3468 */ "# preset/initialization file\n" +/* 3461 */ "\t\t\t\t- may NOT appear - preset only\n\0" +/* 3497 */ "# preset/initialization file\n" "# %s#\n\0" -/* 3506 */ "\n" +/* 3535 */ "\n" "The following option preset mechanisms are supported:\n\0" -/* 3562 */ "prohibits these options:\n\0" -/* 3588 */ "Operands and options may be intermixed. They will be reordered.\n\0" -/* 3654 */ "%s%ld to %ld\0" -/* 3667 */ "%sgreater than or equal to %ld\0" -/* 3698 */ "%sIt must lie in one of the ranges:\n\0" -/* 3735 */ "%sIt must be in the range:\n\0" -/* 3763 */ ", or\n\0" -/* 3769 */ "%s error: %s option value %ld is out of range.\n\0" -/* 3818 */ "%s%ld exactly\0" -/* 3832 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0" -/* 3878 */ "%sless than or equal to %ld\0" -/* 3906 */ "The --reset-option has not been configured.\n\0" -/* 3951 */ "ERROR: %s option requires the %s option\n\0" -/* 3993 */ " %3s %-14s %s\0" -/* 4007 */ "requires these options:\n\0" -/* 4032 */ " Arg Option-Name Req? Description\n\0" -/* 4072 */ " Flg Arg Option-Name Req? Description\n\0" -/* 4115 */ "-_^\0" -/* 4119 */ "or you may use a numeric representation. Preceding these with a '!' will\n" +/* 3591 */ "prohibits these options:\n\0" +/* 3617 */ "Operands and options may be intermixed. They will be reordered.\n\0" +/* 3683 */ "%s%ld to %ld\0" +/* 3696 */ "%sgreater than or equal to %ld\0" +/* 3727 */ "%sIt must lie in one of the ranges:\n\0" +/* 3764 */ "%sIt must be in the range:\n\0" +/* 3792 */ ", or\n\0" +/* 3798 */ "%s error: %s option value %ld is out of range.\n\0" +/* 3847 */ "%s%ld exactly\0" +/* 3861 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0" +/* 3907 */ "%sless than or equal to %ld\0" +/* 3935 */ "The --reset-option has not been configured.\n\0" +/* 3980 */ "ERROR: %s option requires the %s option\n\0" +/* 4022 */ " %3s %-14s %s\0" +/* 4036 */ "requires these options:\n\0" +/* 4061 */ " Arg Option-Name Req? Description\n\0" +/* 4101 */ " Flg Arg Option-Name Req? Description\n\0" +/* 4144 */ "-_^\0" +/* 4148 */ "or you may use a numeric representation. Preceding these with a '!' will\n" "clear the bits, specifying 'none' will clear all bits, and 'all' will set them\n" "all. Multiple entries may be passed as an option argument list.\n\0" -/* 4338 */ "%s\0" -/* 4341 */ " \0" -/* 4348 */ "T/F\0" -/* 4352 */ "\n" +/* 4367 */ "%s\0" +/* 4370 */ " \0" +/* 4377 */ "T/F\0" +/* 4381 */ "\n" "%s\n\n" "%s\0" -/* 4360 */ "Fil\0" -/* 4364 */ "KWd\0" -/* 4368 */ "Mbr\0" -/* 4372 */ "Tim\0" -/* 4376 */ "Cpx\0" -/* 4380 */ "no \0" -/* 4384 */ "Num\0" -/* 4388 */ "opt\0" -/* 4392 */ "YES\0" -/* 4396 */ "Str\0" -/* 4400 */ "\t\t\t\t- \0" -/* 4407 */ "\t\t\t\t-- and \0" -/* 4419 */ "\t\t\t\t%s\n\0" -/* 4427 */ " \0" -/* 4431 */ "%s error: %s exceeds %s keyword count\n\0" -/* 4471 */ " \0" -/* 4474 */ "\t\t\t\t- may appear up to %d times\n\0" -/* 4507 */ "The valid \"%s\" option keywords are:\n\0" -/* 4544 */ "These additional options are:\0" -/* 4574 */ "The next option supports vendor supported extra options:"; +/* 4389 */ "Fil\0" +/* 4393 */ "KWd\0" +/* 4397 */ "Mbr\0" +/* 4401 */ "Tim\0" +/* 4405 */ "Cpx\0" +/* 4409 */ "no \0" +/* 4413 */ "Num\0" +/* 4417 */ "opt\0" +/* 4421 */ "YES\0" +/* 4425 */ "Str\0" +/* 4429 */ "\t\t\t\t- \0" +/* 4436 */ "\t\t\t\t-- and \0" +/* 4448 */ "\t\t\t\t%s\n\0" +/* 4456 */ " \0" +/* 4460 */ "%s error: %s exceeds %s keyword count\n\0" +/* 4500 */ " \0" +/* 4503 */ "\t\t\t\t- may appear up to %d times\n\0" +/* 4536 */ "The valid \"%s\" option keywords are:\n\0" +/* 4573 */ "These additional options are:\0" +/* 4603 */ "The next option supports vendor supported extra options:"; /* @@ -387,7 +389,7 @@ static char const usage_txt[4631] = * Aren't you glad you don't maintain this by hand? */ usage_text_t option_usage_text = { - 145, + 146, eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuFileArg, eng_zGnuKeyLArg, eng_zGnuTimeArg, eng_zGnuNumArg, eng_zGnuStrArg, { @@ -406,26 +408,26 @@ static char const usage_txt[4631] = usage_txt +1837, usage_txt +1864, usage_txt +1970, usage_txt +1976, usage_txt +1982, usage_txt +1989, usage_txt +2000, usage_txt +2026, usage_txt +2052, usage_txt +2095, usage_txt +2131, usage_txt +2182, - usage_txt +2238, usage_txt +2272, usage_txt +2310, usage_txt +2375, - usage_txt +2418, usage_txt +2453, usage_txt +2494, usage_txt +2534, - usage_txt +2561, usage_txt +2628, usage_txt +2676, usage_txt +2709, - usage_txt +2734, usage_txt +2782, usage_txt +2817, usage_txt +2855, - usage_txt +2882, usage_txt +2931, usage_txt +2936, usage_txt +2954, - usage_txt +2989, usage_txt +3033, usage_txt +3087, usage_txt +3133, - usage_txt +3182, usage_txt +3235, usage_txt +3243, usage_txt +3291, - usage_txt +3316, usage_txt +3350, usage_txt +3379, usage_txt +3398, - usage_txt +3432, usage_txt +3468, usage_txt +3506, usage_txt +3562, - usage_txt +3588, usage_txt +3654, usage_txt +3667, usage_txt +3698, - usage_txt +3735, usage_txt +3763, usage_txt +3769, usage_txt +3818, - usage_txt +3832, usage_txt +3878, usage_txt +3906, usage_txt +3951, - usage_txt +3993, usage_txt +4007, usage_txt +4032, usage_txt +4072, - usage_txt +4115, usage_txt +4119, usage_txt +4338, usage_txt +4341, - usage_txt +4348, usage_txt +4352, usage_txt +4360, usage_txt +4364, - usage_txt +4368, usage_txt +4372, usage_txt +4376, usage_txt +4380, - usage_txt +4384, usage_txt +4388, usage_txt +4392, usage_txt +4396, - usage_txt +4400, usage_txt +4407, usage_txt +4419, usage_txt +4427, - usage_txt +4431, usage_txt +4471, usage_txt +4474, usage_txt +4507, - usage_txt +4544, usage_txt +4574 + usage_txt +2211, usage_txt +2267, usage_txt +2301, usage_txt +2339, + usage_txt +2404, usage_txt +2447, usage_txt +2482, usage_txt +2523, + usage_txt +2563, usage_txt +2590, usage_txt +2657, usage_txt +2705, + usage_txt +2738, usage_txt +2763, usage_txt +2811, usage_txt +2846, + usage_txt +2884, usage_txt +2911, usage_txt +2960, usage_txt +2965, + usage_txt +2983, usage_txt +3018, usage_txt +3062, usage_txt +3116, + usage_txt +3162, usage_txt +3211, usage_txt +3264, usage_txt +3272, + usage_txt +3320, usage_txt +3345, usage_txt +3379, usage_txt +3408, + usage_txt +3427, usage_txt +3461, usage_txt +3497, usage_txt +3535, + usage_txt +3591, usage_txt +3617, usage_txt +3683, usage_txt +3696, + usage_txt +3727, usage_txt +3764, usage_txt +3792, usage_txt +3798, + usage_txt +3847, usage_txt +3861, usage_txt +3907, usage_txt +3935, + usage_txt +3980, usage_txt +4022, usage_txt +4036, usage_txt +4061, + usage_txt +4101, usage_txt +4144, usage_txt +4148, usage_txt +4367, + usage_txt +4370, usage_txt +4377, usage_txt +4381, usage_txt +4389, + usage_txt +4393, usage_txt +4397, usage_txt +4401, usage_txt +4405, + usage_txt +4409, usage_txt +4413, usage_txt +4417, usage_txt +4421, + usage_txt +4425, usage_txt +4429, usage_txt +4436, usage_txt +4448, + usage_txt +4456, usage_txt +4460, usage_txt +4500, usage_txt +4503, + usage_txt +4536, usage_txt +4573, usage_txt +4603 } }; diff --git a/sntp/libopts/boolean.c b/sntp/libopts/boolean.c index f0e5498a88..c463778e9a 100644 --- a/sntp/libopts/boolean.c +++ b/sntp/libopts/boolean.c @@ -2,7 +2,7 @@ /** * \file boolean.c * - * Time-stamp: "2012-03-31 13:46:19 bkorb" + * Time-stamp: "2012-08-11 08:34:39 bkorb" * * Automated Options Paged Usage module. * @@ -50,6 +50,9 @@ optionBooleanVal(tOptions * pOpts, tOptDesc * pOD ) (void)pOpts; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + if ((pOD->fOptState & OPTST_RESET) != 0) return; diff --git a/sntp/libopts/compat/compat.h b/sntp/libopts/compat/compat.h index 9d1c02ac4a..d3d1eab5fa 100644 --- a/sntp/libopts/compat/compat.h +++ b/sntp/libopts/compat/compat.h @@ -3,7 +3,7 @@ /** * \file compat.h --- fake the preprocessor into handlng portability * - * Time-stamp: "2012-02-28 19:40:44 bkorb" + * Time-stamp: "2012-08-11 08:17:36 bkorb" * * compat.h is free software. * This file is part of AutoGen. @@ -62,7 +62,9 @@ #ifndef HAVE_STRSIGNAL - char * strsignal( int signo ); +# ifndef HAVE_RAW_DECL_STRSIGNAL + char * strsignal(int signo); +# endif #endif #define _GNU_SOURCE 1 /* for strsignal in GNU's libc */ diff --git a/sntp/libopts/compat/pathfind.c b/sntp/libopts/compat/pathfind.c index 2e6f881ec9..3f668129d1 100644 --- a/sntp/libopts/compat/pathfind.c +++ b/sntp/libopts/compat/pathfind.c @@ -4,7 +4,7 @@ /* * Author: Gary V Vaughan - * Time-stamp: "2012-03-31 13:44:42 bkorb" + * Time-stamp: "2012-08-11 08:19:39 bkorb" */ /* Code: */ @@ -305,6 +305,7 @@ extract_colon_unit( char* pzDir, char const *string, int *p_index ) switch (ch) { case ':': pzDest[-1] = NUL; + /* FALLTHROUGH */ case NUL: goto copy_done; } diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c index 56e22b5db7..3f98e31f8b 100644 --- a/sntp/libopts/configfile.c +++ b/sntp/libopts/configfile.c @@ -1,7 +1,7 @@ /** * \file configfile.c * - * Time-stamp: "2012-03-31 13:56:11 bkorb" + * Time-stamp: "2012-08-11 08:34:55 bkorb" * * configuration/rc/ini file handling. * @@ -542,6 +542,7 @@ handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir) switch (ch) { case NUL: pcS = NULL; + /* FALLTHROUGH */ case NL: *pcD = NUL; @@ -549,9 +550,8 @@ handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir) goto copy_done; case '\\': - if (*pcS == NL) { + if (*pcS == NL) ch = *(pcS++); - } /* FALLTHROUGH */ default: *(pcD++) = ch; @@ -1129,6 +1129,9 @@ optionLoadOpt(tOptions * pOpts, tOptDesc * pOptDesc) { struct stat sb; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + /* * IF the option is not being disabled, THEN load the file. There must * be a file. (If it is being disabled, then the disablement processing @@ -1175,6 +1178,7 @@ parse_attrs(tOptions * pOpts, char * pzText, tOptionLoadMode * pMode, if (! IS_WHITESPACE_CHAR(*pzText)) switch (*pzText) { case '/': pType->valType = OPARG_TYPE_NONE; + /* FALLTHROUGH */ case '>': return pzText; default: diff --git a/sntp/libopts/enum.c b/sntp/libopts/enum.c index 2a9f9bc2b5..dff5df808c 100644 --- a/sntp/libopts/enum.c +++ b/sntp/libopts/enum.c @@ -2,7 +2,7 @@ /** * \file enumeration.c * - * Time-stamp: "2012-03-31 13:22:33 bkorb" + * Time-stamp: "2012-08-11 08:12:58 bkorb" * * Automated Options Paged Usage module. * @@ -321,6 +321,9 @@ optionEnumerationVal(tOptions * pOpts, tOptDesc * pOD, } default: + if ((pOD->fOptState & OPTST_RESET) != 0) + break; + res = find_name(pOD->optArg.argString, pOpts, pOD, paz_names, name_ct); if (pOD->fOptState & OPTST_ALLOC_ARG) { diff --git a/sntp/libopts/env.c b/sntp/libopts/env.c index 4dd18faaba..2b55137c74 100644 --- a/sntp/libopts/env.c +++ b/sntp/libopts/env.c @@ -2,7 +2,7 @@ /** * \file environment.c * - * Time-stamp: "2012-04-01 05:59:15 bkorb" + * Time-stamp: "2012-08-11 08:18:25 bkorb" * * This file contains all of the routines that must be linked into * an executable to use the generated option processing. The optional @@ -127,6 +127,8 @@ do_env_opt(tOptState * os, char * env_name, && (streqvcmp(os->pzOptArg, os->pOD->pz_DisablePfx) == 0)) { os->flags |= OPTST_DISABLED; os->pzOptArg = NULL; + handle_opt(pOpts, os); + return; } switch (type) { diff --git a/sntp/libopts/find.c b/sntp/libopts/find.c index f6510ee745..b9e88d5913 100644 --- a/sntp/libopts/find.c +++ b/sntp/libopts/find.c @@ -3,7 +3,7 @@ * * @brief Hunt for options in the option descriptor list * - * Time-stamp: "2012-01-29 19:07:30 bkorb" + * Time-stamp: "2012-08-11 08:36:11 bkorb" * * This file contains the routines that deal with processing quoted strings * into an internal format. @@ -44,9 +44,6 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz) case NUL: return res; case '=': - if (res >= (int)bufsz) - return -1; - memcpy(buf, *nm_pp, res); buf[res] = NUL; @@ -55,7 +52,8 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz) return res; default: - res++; + if (++res >= (int)bufsz) + return -1; } } } @@ -286,6 +284,12 @@ optionVendorOption(tOptions * pOpts, tOptDesc * pOD) tOptState opt_st = OPTSTATE_INITIALIZER(PRESET); char const * vopt_str = pOD->optArg.argString; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + + if ((pOD->fOptState & OPTST_RESET) != 0) + return; + if ((pOD->fOptState & OPTPROC_IMMEDIATE) == 0) opt_st.flags = OPTST_DEFINED; @@ -293,9 +297,10 @@ optionVendorOption(tOptions * pOpts, tOptDesc * pOD) || ! SUCCESSFUL(opt_find_long(pOpts, vopt_str, &opt_st)) || ! SUCCESSFUL(get_opt_arg(pOpts, &opt_st)) ) { - fprintf(stderr, zIllVendOptStr, vopt_str); + fprintf(stderr, zIllVendOptStr, pOpts->pzProgName, vopt_str); (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); /* NOTREACHED */ + _exit(EXIT_FAILURE); /* to be certain */ } /* @@ -321,31 +326,39 @@ optionVendorOption(tOptions * pOpts, tOptDesc * pOD) /** * Find the option descriptor by full name. * - * @param pOpts option data - * @param opt_name name of option to look for - * @param pOptState state about current option + * @param opts option data + * @param opt_name name of option to look for + * @param state state about current option * * @return success status */ LOCAL tSuccess -opt_find_long(tOptions * pOpts, char const * opt_name, tOptState * pOptState) +opt_find_long(tOptions * opts, char const * opt_name, tOptState * state) { char name_buf[128]; char * opt_arg; int nm_len = parse_opt(&opt_name, &opt_arg, name_buf, sizeof(name_buf)); - int matchIdx = 0; - bool disable = false; - int match_ct = - opt_match_ct(pOpts, opt_name, nm_len, &matchIdx, &disable); + int idx = 0; + bool disable = false; + int ct; + + if (nm_len <= 0) { + fprintf(stderr, zInvalOptName, opts->pzProgName, opt_name); + (*opts->pUsageProc)(opts, EXIT_FAILURE); + /* NOTREACHED */ + _exit(EXIT_FAILURE); /* to be certain */ + } + + ct = opt_match_ct(opts, opt_name, nm_len, &idx, &disable); /* * See if we found one match, no matches or multiple matches. */ - switch (match_ct) { - case 1: return opt_set(pOpts, opt_arg, matchIdx, disable, pOptState); - case 0: return opt_unknown(pOpts, opt_name, opt_arg, pOptState); - default: return opt_ambiguous(pOpts, opt_name, match_ct); + switch (ct) { + case 1: return opt_set(opts, opt_arg, idx, disable, state); + case 0: return opt_unknown(opts, opt_name, opt_arg, state); + default: return opt_ambiguous(opts, opt_name, ct); } } diff --git a/sntp/libopts/genshell.c b/sntp/libopts/genshell.c index 25f71087d2..2762088ef4 100644 --- a/sntp/libopts/genshell.c +++ b/sntp/libopts/genshell.c @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (genshell.c) * - * It has been AutoGen-ed June 17, 2012 at 03:47:35 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:14 AM by AutoGen 5.16.2pre7 * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 36:4:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -283,7 +283,7 @@ doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) (void)pOptDesc; (void)pOptions; } -/* extracted from optmain.tlib near line 1114 */ +/* extracted from optmain.tlib near line 1146 */ /** * The directory containing the data associated with genshellopt. diff --git a/sntp/libopts/genshell.h b/sntp/libopts/genshell.h index 74f7e0e4cb..2b28efb8b1 100644 --- a/sntp/libopts/genshell.h +++ b/sntp/libopts/genshell.h @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (genshell.h) * - * It has been AutoGen-ed June 17, 2012 at 03:47:35 PM by AutoGen 5.16.1pre8 + * It has been AutoGen-ed August 11, 2012 at 09:41:14 AM by AutoGen 5.16.2pre7 * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 36:4:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -55,7 +55,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147460 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -142,6 +142,12 @@ extern tOptions genshelloptOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c index 1ea7808061..06b0079ae5 100644 --- a/sntp/libopts/load.c +++ b/sntp/libopts/load.c @@ -1,7 +1,7 @@ /** * \file load.c - * Time-stamp: "2012-03-31 13:13:34 bkorb" + * Time-stamp: "2012-08-11 08:20:09 bkorb" * * This file contains the routines that deal with processing text strings * for options, either from a NUL-terminated string passed in or from an @@ -34,10 +34,10 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath); static bool -add_env_val(char * pzBuf, int bufSize, char const * pzName); +add_env_val(char * buf, int buf_sz, char const * name); static char * -assemble_arg_val(char * pzTxt, tOptionLoadMode mode); +assemble_arg_val(char * txt, tOptionLoadMode mode); /* = = = END-STATIC-FORWARD = = = */ /*=export_func optionMakePath @@ -239,64 +239,62 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName, return true; } - static bool -add_env_val(char * pzBuf, int bufSize, char const * pzName) +add_env_val(char * buf, int buf_sz, char const * name) { - char * pzDir = pzBuf; + char * dir_part = buf; for (;;) { - int ch = (int)*++pzName; + int ch = (int)*++name; if (! IS_VALUE_NAME_CHAR(ch)) break; - *(pzDir++) = (char)ch; + *(dir_part++) = (char)ch; } - if (pzDir == pzBuf) + if (dir_part == buf) return false; - *pzDir = NUL; + *dir_part = NUL; - pzDir = getenv(pzBuf); + dir_part = getenv(buf); /* * Environment value not found -- skip the home list entry */ - if (pzDir == NULL) + if (dir_part == NULL) return false; - if (strlen(pzDir) + 1 + strlen(pzName) >= (unsigned)bufSize) + if (strlen(dir_part) + 1 + strlen(name) >= (unsigned)buf_sz) return false; - sprintf(pzBuf, "%s%s", pzDir, pzName); + sprintf(buf, "%s%s", dir_part, name); return true; } - LOCAL void -mungeString(char* pzTxt, tOptionLoadMode mode) +mungeString(char * txt, tOptionLoadMode mode) { char * pzE; if (mode == OPTION_LOAD_KEEP) return; - if (IS_WHITESPACE_CHAR(*pzTxt)) { - char * pzS = SPN_WHITESPACE_CHARS(pzTxt+1); + if (IS_WHITESPACE_CHAR(*txt)) { + char * pzS = SPN_WHITESPACE_CHARS(txt+1); size_t l = strlen(pzS) + 1; - memmove(pzTxt, pzS, l); - pzE = pzTxt + l - 1; + memmove(txt, pzS, l); + pzE = txt + l - 1; } else - pzE = pzTxt + strlen(pzTxt); + pzE = txt + strlen(txt); - pzE = SPN_WHITESPACE_BACK(pzTxt, pzE); + pzE = SPN_WHITESPACE_BACK(txt, pzE); *pzE = NUL; if (mode == OPTION_LOAD_UNCOOKED) return; - switch (*pzTxt) { + switch (*txt) { default: return; case '"': case '\'': break; @@ -308,21 +306,20 @@ mungeString(char* pzTxt, tOptionLoadMode mode) case '\'': break; } - (void)ao_string_cook(pzTxt, NULL); + (void)ao_string_cook(txt, NULL); } - static char * -assemble_arg_val(char * pzTxt, tOptionLoadMode mode) +assemble_arg_val(char * txt, tOptionLoadMode mode) { - char* pzEnd = strpbrk(pzTxt, ARG_BREAK_STR); + char* pzEnd = strpbrk(txt, ARG_BREAK_STR); int space_break; /* * Not having an argument to a configurable name is okay. */ if (pzEnd == NULL) - return pzTxt + strlen(pzTxt); + return txt + strlen(txt); /* * If we are keeping all whitespace, then the modevalue starts with the @@ -349,34 +346,41 @@ assemble_arg_val(char * pzTxt, tOptionLoadMode mode) return pzEnd; } - -/* +/** * Load an option from a block of text. The text must start with the * configurable/option name and be followed by its associated value. * That value may be processed in any of several ways. See "tOptionLoadMode" * in autoopts.h. + * + * @param[in,out] opts program options descriptor + * @param[in,out] opt_state option processing state + * @param[in,out] line source line with long option name in it + * @param[in] direction current processing direction (preset or not) + * @param[in] load_mode option loading mode (OPTION_LOAD_*) */ LOCAL void loadOptionLine( - tOptions* pOpts, - tOptState* pOS, - char* pzLine, + tOptions * opts, + tOptState * opt_state, + char * line, tDirection direction, tOptionLoadMode load_mode ) { - pzLine = SPN_WHITESPACE_CHARS(pzLine); + line = SPN_LOAD_LINE_SKIP_CHARS(line); { - char* pzArg = assemble_arg_val(pzLine, load_mode); + char * arg = assemble_arg_val(line, load_mode); - if (! SUCCESSFUL(opt_find_long(pOpts, pzLine, pOS))) + if (! SUCCESSFUL(opt_find_long(opts, line, opt_state))) return; - if (pOS->flags & OPTST_NO_INIT) + + if (opt_state->flags & OPTST_NO_INIT) return; - pOS->pzOptArg = pzArg; + + opt_state->pzOptArg = arg; } - switch (pOS->flags & (OPTST_IMM|OPTST_DISABLE_IMM)) { + switch (opt_state->flags & (OPTST_IMM|OPTST_DISABLE_IMM)) { case 0: /* * The selected option has no immediate action. @@ -394,7 +398,7 @@ loadOptionLine( * immediately for enablement, but normally for disablement. * Therefore, skip if disabled. */ - if ((pOS->flags & OPTST_DISABLED) == 0) + if ((opt_state->flags & OPTST_DISABLED) == 0) return; } else { /* @@ -402,7 +406,7 @@ loadOptionLine( * immediately for enablement, but normally for disablement. * Therefore, skip if NOT disabled. */ - if ((pOS->flags & OPTST_DISABLED) != 0) + if ((opt_state->flags & OPTST_DISABLED) != 0) return; } break; @@ -414,7 +418,7 @@ loadOptionLine( * immediately for disablement, but normally for disablement. * Therefore, skip if NOT disabled. */ - if ((pOS->flags & OPTST_DISABLED) != 0) + if ((opt_state->flags & OPTST_DISABLED) != 0) return; } else { /* @@ -422,7 +426,7 @@ loadOptionLine( * immediately for disablement, but normally for disablement. * Therefore, skip if disabled. */ - if ((pOS->flags & OPTST_DISABLED) == 0) + if ((opt_state->flags & OPTST_DISABLED) == 0) return; } break; @@ -441,43 +445,42 @@ loadOptionLine( /* * Fix up the args. */ - if (OPTST_GET_ARGTYPE(pOS->pOD->fOptState) == OPARG_TYPE_NONE) { - if (*pOS->pzOptArg != NUL) + if (OPTST_GET_ARGTYPE(opt_state->pOD->fOptState) == OPARG_TYPE_NONE) { + if (*opt_state->pzOptArg != NUL) return; - pOS->pzOptArg = NULL; + opt_state->pzOptArg = NULL; - } else if (pOS->pOD->fOptState & OPTST_ARG_OPTIONAL) { - if (*pOS->pzOptArg == NUL) - pOS->pzOptArg = NULL; + } else if (opt_state->pOD->fOptState & OPTST_ARG_OPTIONAL) { + if (*opt_state->pzOptArg == NUL) + opt_state->pzOptArg = NULL; else { - AGDUPSTR(pOS->pzOptArg, pOS->pzOptArg, "option argument"); - pOS->flags |= OPTST_ALLOC_ARG; + AGDUPSTR(opt_state->pzOptArg, opt_state->pzOptArg, "opt arg"); + opt_state->flags |= OPTST_ALLOC_ARG; } } else { - if (*pOS->pzOptArg == NUL) - pOS->pzOptArg = zNil; + if (*opt_state->pzOptArg == NUL) + opt_state->pzOptArg = zNil; else { - AGDUPSTR(pOS->pzOptArg, pOS->pzOptArg, "option argument"); - pOS->flags |= OPTST_ALLOC_ARG; + AGDUPSTR(opt_state->pzOptArg, opt_state->pzOptArg, "opt arg"); + opt_state->flags |= OPTST_ALLOC_ARG; } } { tOptionLoadMode sv = option_load_mode; option_load_mode = load_mode; - handle_opt(pOpts, pOS); + handle_opt(opts, opt_state); option_load_mode = sv; } } - /*=export_func optionLoadLine * * what: process a string for an option name and value * - * arg: tOptions*, pOpts, program options descriptor - * arg: char const*, pzLine, NUL-terminated text + * arg: tOptions*, opts, program options descriptor + * arg: char const*, line, NUL-terminated text * * doc: * @@ -488,7 +491,8 @@ loadOptionLine( * When passed a pointer to the option struct and a string, it will find * the option named by the first token on the string and set the option * argument to the remainder of the string. The caller must NUL terminate - * the string. Any embedded new lines will be included in the option + * the string. The caller need not skip over any introductory hyphens. + * Any embedded new lines will be included in the option * argument. If the input looks like one or more quoted strings, then the * input will be "cooked". The "cooking" is identical to the string * formation used in AutoGen definition files (@pxref{basic expression}), @@ -498,12 +502,12 @@ loadOptionLine( * will cause a warning to print, but the function should return. =*/ void -optionLoadLine(tOptions * pOpts, char const * pzLine) +optionLoadLine(tOptions * opts, char const * line) { tOptState st = OPTSTATE_INITIALIZER(SET); char* pz; - AGDUPSTR(pz, pzLine, "user option line"); - loadOptionLine(pOpts, &st, pz, DIRECTION_PROCESS, OPTION_LOAD_COOKED); + AGDUPSTR(pz, line, "user option line"); + loadOptionLine(opts, &st, pz, DIRECTION_PROCESS, OPTION_LOAD_COOKED); AGFREE(pz); } /* diff --git a/sntp/libopts/m4/libopts.m4 b/sntp/libopts/m4/libopts.m4 index 6c8c1cc488..6f652fb6ab 100644 --- a/sntp/libopts/m4/libopts.m4 +++ b/sntp/libopts/m4/libopts.m4 @@ -2,7 +2,7 @@ dnl -*- buffer-read-only: t -*- vi: set ro: dnl dnl DO NOT EDIT THIS FILE (libopts.m4) dnl -dnl It has been AutoGen-ed June 17, 2012 at 03:47:31 PM by AutoGen 5.16.1pre8 +dnl It has been AutoGen-ed August 11, 2012 at 09:41:10 AM by AutoGen 5.16.2pre7 dnl From the definitions libopts.def dnl and the template file conftest.tpl dnl @@ -57,22 +57,22 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ string errno stdlib memory setjmp do eval as_ac_var=\${ac_cv_header_${f}_h+set} test "${as_ac_var}" = set || { - ]AC_MSG_ERROR([You must have ${f}.h on your system])[ + ]AC_MSG_ERROR([you must have ${f}.h on your system])[ } done ${lo_have_arg_hdr} || \ - ]AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])[ + ]AC_MSG_ERROR([you must have stdarg.h or varargs.h on your system])[ ${lo_have_str_hdr} || \ - ]AC_MSG_ERROR([You must have string.h or strings.h on your system])[ + ]AC_MSG_ERROR([you must have string.h or strings.h on your system])[ ${lo_have_lim_hdr} || \ ]AC_MSG_ERROR( - [You must have one of limits.h, sys/limits.h or values.h])[ + [you must have one of limits.h, sys/limits.h or values.h])[ ${lo_have_typ_hdr} || \ - ]AC_MSG_ERROR([You must have inttypes.h or stdint.h on your system]) + ]AC_MSG_ERROR([you must have inttypes.h or stdint.h on your system]) # ---------------------------------------------------------------------- # Checks for typedefs @@ -116,7 +116,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ if ! true ; then exit 1 ; fi echo /bin/sh'` test -x "$POSIX_SHELL" && break - ]AC_ERROR([Cannot locate a working POSIX shell])[ + ]AC_MSG_ERROR([cannot locate a working POSIX shell])[ done] AC_DEFINE_UNQUOTED([POSIX_SHELL], ["${POSIX_SHELL}"], [define to a working POSIX compliant shell]) @@ -209,7 +209,7 @@ AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[ LIBREGEX_LIBS="" AC_MSG_CHECKING([whether libregex functions properly]) AC_CACHE_VAL([libopts_cv_with_libregex],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include @%:@include @%:@include @%:@include REGEX_HEADER @@ -230,7 +230,7 @@ int main() { } return 0; }], [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no], - [libopts_cv_with_libregex=no]) # end of AC_TRY_RUN + [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex AC_MSG_RESULT([${libopts_cv_with_libregex}]) if test "X${libopts_cv_with_libregex}" != Xno @@ -248,14 +248,14 @@ int main() { AC_DEFUN([LIBOPTS_RUN_PATHFIND],[ AC_MSG_CHECKING([whether pathfind(3) works]) AC_CACHE_VAL([libopts_cv_run_pathfind],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include @%:@include int main (int argc, char** argv) { char* pz = pathfind( getenv( "PATH" ), "sh", "x" ); return (pz == 0) ? 1 : 0; }], [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no] - ) # end of TRY_RUN + ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind AC_MSG_RESULT([${libopts_cv_run_pathfind}]) if test "X${libopts_cv_run_pathfind}" != Xno @@ -291,7 +291,7 @@ echo ${dzero}` AC_DEFUN([LIBOPTS_RUN_REALPATH],[ AC_MSG_CHECKING([whether we have a functional realpath(3C)]) AC_CACHE_VAL([libopts_cv_run_realpath],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include @%:@include int main (int argc, char** argv) { @%:@ifndef PATH_MAX @@ -303,7 +303,7 @@ choke me!! return (pz == zPath) ? 0 : 1; }], [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no] - ) # end of TRY_RUN + ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath AC_MSG_RESULT([${libopts_cv_run_realpath}]) if test "X${libopts_cv_run_realpath}" != Xno @@ -318,7 +318,7 @@ choke me!! AC_DEFUN([LIBOPTS_RUN_STRFTIME],[ AC_MSG_CHECKING([whether strftime() works]) AC_CACHE_VAL([libopts_cv_run_strftime],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include @%:@include char t_buf@<:@ 64 @:>@; int main() { @@ -336,7 +336,7 @@ int main() { strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm ); return (strcmp( t_buf, z ) != 0); }], [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no] - ) # end of TRY_RUN + ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime AC_MSG_RESULT([${libopts_cv_run_strftime}]) if test "X${libopts_cv_run_strftime}" != Xno @@ -351,12 +351,12 @@ int main() { AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[ AC_MSG_CHECKING([whether fopen accepts "b" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_binary],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rb"); return (fp == NULL) ? 1 : fclose(fp); }], [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no] - ) # end of TRY_RUN + ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary AC_MSG_RESULT([${libopts_cv_run_fopen_binary}]) if test "X${libopts_cv_run_fopen_binary}" != Xno @@ -374,12 +374,12 @@ return (fp == NULL) ? 1 : fclose(fp); }], AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[ AC_MSG_CHECKING([whether fopen accepts "t" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_text],[ - AC_TRY_RUN([@%:@include + AC_RUN_IFELSE([@%:@include int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rt"); return (fp == NULL) ? 1 : fclose(fp); }], [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no] - ) # end of TRY_RUN + ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text AC_MSG_RESULT([${libopts_cv_run_fopen_text}]) if test "X${libopts_cv_run_fopen_text}" != Xno diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c index 79edb7022b..5ba949d1b8 100644 --- a/sntp/libopts/makeshell.c +++ b/sntp/libopts/makeshell.c @@ -2,7 +2,7 @@ /** * \file makeshell.c * - * Time-stamp: "2012-04-07 09:03:16 bkorb" + * Time-stamp: "2012-08-11 08:51:32 bkorb" * * This module will interpret the options set in the tOptions * structure and create a Bourne shell script capable of parsing them. @@ -33,6 +33,7 @@ tOptions * optionParseShellOptions = NULL; static char const * shell_prog = NULL; static char * script_leader = NULL; static char * script_trailer = NULL; +static char * script_text = NULL; /* = = = START-STATIC-FORWARD = = = */ static void @@ -60,10 +61,13 @@ static void emit_match_expr(char const * pzMatchName, tOptDesc* pCurOpt, tOptions* pOpts); static void -emitLong(tOptions * pOpts); +emit_long(tOptions * pOpts); + +static char * +load_old_output(char const * fname); static void -open_out(char const * pzFile); +open_out(char const * fname); /* = = = END-STATIC-FORWARD = = = */ /*=export_func optionParseShell @@ -112,7 +116,7 @@ optionParseShell(tOptions * pOpts) fputs(LONG_OPT_MARK, stdout); fputs(INIT_LOPT_STR, stdout); - emitLong(pOpts); + emit_long(pOpts); printf(LOPT_ARG_FMT, pOpts->pzPROGNAME); fputs(END_OPT_SEL_STR, stdout); @@ -122,7 +126,7 @@ optionParseShell(tOptions * pOpts) case 0: fputs(ONLY_OPTS_LOOP, stdout); fputs(INIT_LOPT_STR, stdout); - emitLong(pOpts); + emit_long(pOpts); printf(LOPT_ARG_FMT, pOpts->pzPROGNAME); break; @@ -143,7 +147,7 @@ optionParseShell(tOptions * pOpts) fputs(LONG_OPT_MARK, stdout); fputs(INIT_LOPT_STR, stdout); - emitLong(pOpts); + emit_long(pOpts); printf(LOPT_ARG_FMT, pOpts->pzPROGNAME); fputs(END_OPT_SEL_STR, stdout); @@ -172,6 +176,11 @@ optionParseShell(tOptions * pOpts) fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } + + AGFREE(script_text); + script_leader = NULL; + script_trailer = NULL; + script_text = NULL; } #ifdef HAVE_WORKING_FORK @@ -609,11 +618,11 @@ emit_match_expr(char const * pzMatchName, tOptDesc* pCurOpt, tOptions* pOpts) } -/* - * Emit GNU-standard long option handling code +/** + * Emit GNU-standard long option handling code. */ static void -emitLong(tOptions * pOpts) +emit_long(tOptions * pOpts) { tOptDesc* pOD = pOpts->pOptDesc; int ct = pOpts->optCt; @@ -645,70 +654,96 @@ emitLong(tOptions * pOpts) printf(UNK_OPT_FMT, OPTION_STR, pOpts->pzPROGNAME); } - -static void -open_out(char const * pzFile) +/** + * Load the previous shell script output file. We need to preserve any + * hand-edited additions outside of the START_MARK and END_MARKs. + * + * @param[in] fname the output file name + */ +static char * +load_old_output(char const * fname) { - FILE* fp; - char* pzData = NULL; + /* + * IF we cannot stat the file, + * THEN assume we are creating a new file. + * Skip the loading of the old data. + */ + FILE * fp = fopen(fname, "r" FOPEN_BINARY_FLAG); struct stat stbf; + char * text; + char * scan; - do { - char* pzScan; - size_t sizeLeft; + if (fp == NULL) + return NULL; - /* - * IF we cannot stat the file, - * THEN assume we are creating a new file. - * Skip the loading of the old data. - */ - if (stat(pzFile, &stbf) != 0) + /* + * If we opened it, we should be able to stat it and it needs + * to be a regular file + */ + if ((fstat(fileno(fp), &stbf) != 0) || (! S_ISREG(stbf.st_mode))) { + fprintf(stderr, zNotFile, fname); + exit(EXIT_FAILURE); + } + + scan = text = AGALOC(stbf.st_size + 1, "f data"); + + /* + * Read in all the data as fast as our OS will let us. + */ + for (;;) { + int inct = fread((void*)scan, (size_t)1, stbf.st_size, fp); + if (inct == 0) break; - /* - * The file must be a regular file - */ - if (! S_ISREG(stbf.st_mode)) { - fprintf(stderr, zNotFile, pzFile); - exit(EXIT_FAILURE); - } + stbf.st_size -= inct; - pzData = AGALOC(stbf.st_size + 1, "f data"); - fp = fopen(pzFile, "r" FOPEN_BINARY_FLAG); + if (stbf.st_size == 0) + break; - sizeLeft = (unsigned)stbf.st_size; - pzScan = pzData; + scan += inct; + } - /* - * Read in all the data as fast as our OS will let us. - */ - for (;;) { - int inct = fread((void*)pzScan, (size_t)1, sizeLeft, fp); - if (inct == 0) - break; + *scan = NUL; + fclose(fp); - pzScan += inct; - sizeLeft -= inct; + return text; +} - if (sizeLeft == 0) - break; - } +/** + * Open the specified output file. If it already exists, load its + * contents and save the non-generated (hand edited) portions. + * If a "start mark" is found, everything before it is preserved leader. + * If not, the entire thing is a trailer. Assuming the start is found, + * then everything after the end marker is the trailer. If the end + * mark is not found, the file is actually corrupt, but we take the + * remainder to be the trailer. + * + * @param[in] fname the output file name + */ +static void +open_out(char const * fname) +{ - /* - * NUL-terminate the leader and look for the trailer - */ - *pzScan = NUL; - fclose(fp); - pzScan = strstr(pzData, START_MARK); - if (pzScan == NULL) { - script_trailer = pzData; + do { + char * txt = script_text = load_old_output(fname); + char * scn; + + if (txt == NULL) + break; + + scn = strstr(txt, START_MARK); + if (scn == NULL) { + script_trailer = txt; break; } - *(pzScan++) = NUL; - pzScan = strstr(pzScan, END_MARK); - if (pzScan == NULL) { - script_trailer = pzData; + *(scn++) = NUL; + scn = strstr(scn, END_MARK); + if (scn == NULL) { + /* + * The file is corrupt. + */ + script_trailer = txt + strlen(txt) + START_MARK_LEN + 1; break; } @@ -716,11 +751,11 @@ open_out(char const * pzFile) * Check to see if the data contains our marker. * If it does, then we will skip over it */ - script_trailer = pzScan + END_MARK_LEN; - script_leader = pzData; + script_trailer = scn + END_MARK_LEN; + script_leader = txt; } while (false); - if (freopen(pzFile, "w" FOPEN_BINARY_FLAG, stdout) != stdout) { + if (freopen(fname, "w" FOPEN_BINARY_FLAG, stdout) != stdout) { fprintf(stderr, zFreopenFail, errno, strerror(errno)); exit(EXIT_FAILURE); } diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h index 3922f0b983..f52c74afb8 100644 --- a/sntp/libopts/proto.h +++ b/sntp/libopts/proto.h @@ -1,7 +1,7 @@ /* -*- buffer-read-only: t -*- vi: set ro: * * Prototypes for autoopts - * Generated Sun Jun 17 15:47:44 PDT 2012 + * Generated Sat Aug 11 09:41:23 PDT 2012 */ #ifndef AUTOOPTS_PROTO_H_GUARD #define AUTOOPTS_PROTO_H_GUARD 1 @@ -65,7 +65,7 @@ env_presets(tOptions * pOpts, teEnvPresetType type); * Extracted from find.c */ LOCAL tSuccess -opt_find_long(tOptions * pOpts, char const * opt_name, tOptState * pOptState); +opt_find_long(tOptions * opts, char const * opt_name, tOptState * state); LOCAL tSuccess opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState); @@ -80,13 +80,13 @@ find_opt(tOptions * pOpts, tOptState * pOptState); * Extracted from load.c */ LOCAL void -mungeString(char* pzTxt, tOptionLoadMode mode); +mungeString(char * txt, tOptionLoadMode mode); LOCAL void loadOptionLine( - tOptions* pOpts, - tOptState* pOS, - char* pzLine, + tOptions * opts, + tOptState * opt_state, + char * line, tDirection direction, tOptionLoadMode load_mode ); diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c index b8c5b9e274..ba61d12311 100644 --- a/sntp/libopts/reset.c +++ b/sntp/libopts/reset.c @@ -2,7 +2,7 @@ /** * \file reset.c * - * Time-stamp: "2011-05-24 18:07:16 bkorb" + * Time-stamp: "2012-08-11 08:35:11 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. @@ -75,6 +75,9 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) char const * pzArg = pOD->optArg.argString; tSuccess succ; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + if (reset_active) return; diff --git a/sntp/libopts/stack.c b/sntp/libopts/stack.c index 094b2a1de3..ecf52ab177 100644 --- a/sntp/libopts/stack.c +++ b/sntp/libopts/stack.c @@ -2,7 +2,7 @@ /** * \file stack.c * - * Time-stamp: "2012-03-31 13:16:41 bkorb" + * Time-stamp: "2012-08-11 08:35:28 bkorb" * * This is a special option processing routine that will save the * argument to an option in a FIFO queue. @@ -49,8 +49,12 @@ optionUnstackArg(tOptions * pOpts, tOptDesc * pOptDesc) (void)pOpts; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + if ((pOptDesc->fOptState & OPTST_RESET) != 0) return; + pAL = (tArgList*)pOptDesc->optCookie; /* @@ -234,7 +238,8 @@ optionStackArg(tOptions * pOpts, tOptDesc * pOD) { char * pz; - (void)pOpts; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; if ((pOD->fOptState & OPTST_RESET) != 0) { tArgList* pAL = (void*)pOD->optCookie; diff --git a/sntp/libopts/time.c b/sntp/libopts/time.c index 7348bdb406..e8e4f052c8 100644 --- a/sntp/libopts/time.c +++ b/sntp/libopts/time.c @@ -2,7 +2,7 @@ /** * \file time.c * - * Time-stamp: "2012-01-29 12:52:31 bkorb" + * Time-stamp: "2012-08-11 08:34:17 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. @@ -40,6 +40,9 @@ optionTimeVal(tOptions * pOpts, tOptDesc * pOD) { time_t val; + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + if ((pOD->fOptState & OPTST_RESET) != 0) return; @@ -72,6 +75,9 @@ void optionTimeDate(tOptions * pOpts, tOptDesc * pOD) { #if defined(HAVE_GETDATE_R) && defined(HAVE_PUTENV) + if (pOpts <= OPTPROC_EMIT_LIMIT) + return; + if ((! HAS_pzPkgDataDir(pOpts)) || (pOpts->pzPkgDataDir == NULL)) goto default_action; diff --git a/sntp/libopts/value-type.h b/sntp/libopts/value-type.h index fe0edc98e7..70ff91a58b 100644 --- a/sntp/libopts/value-type.h +++ b/sntp/libopts/value-type.h @@ -1,5 +1,5 @@ /* - * Generated header for gperf generated source Sun Jun 17 15:47:35 PDT 2012 + * Generated header for gperf generated source Sat Aug 11 09:41:14 PDT 2012 * This file enumerates the list of names and declares the * procedure for mapping string names to the enum value. */ diff --git a/sntp/libopts/version.c b/sntp/libopts/version.c index 24041b2013..e91d4ec8c9 100644 --- a/sntp/libopts/version.c +++ b/sntp/libopts/version.c @@ -1,6 +1,6 @@ /* - * Time-stamp: "2012-01-29 19:44:24 bkorb" + * Time-stamp: "2012-08-11 08:41:53 bkorb" * * This module implements the default usage procedure for * Automated Options. It may be overridden, of course. @@ -49,113 +49,116 @@ optionVersion(void) /** * Select among various ways to emit version information. * - * @param pOpts the option descriptor + * @param opts the option descriptor * @param fp the output stream */ static void -emit_simple_ver(tOptions * pOpts, FILE * fp) +emit_simple_ver(tOptions * opts, FILE * fp) { /* * Use the supplied string */ - if (pOpts->pzFullVersion != NULL) - fputs(pOpts->pzFullVersion, fp); + if (opts->pzFullVersion != NULL) + fputs(opts->pzFullVersion, fp); /* * Extract the interesting part of the copyright string */ - else if (pOpts->pzCopyright != NULL) { - char const * pe = strchr(pOpts->pzCopyright, NL); + else if (opts->pzCopyright != NULL) { + char const * pe = strchr(opts->pzCopyright, NL); if (pe == NULL) - pe = pOpts->pzCopyright + strlen(pOpts->pzCopyright); - fwrite(pOpts->pzCopyright, 1, pe - pOpts->pzCopyright, fp); + pe = opts->pzCopyright + strlen(opts->pzCopyright); + fwrite(opts->pzCopyright, 1, pe - opts->pzCopyright, fp); } /* * Extract the interesting part of the usage title string */ else { - char const * pe = strchr(pOpts->pzUsageTitle, NL); + char const * pe = strchr(opts->pzUsageTitle, NL); if (pe == NULL) - pe = pOpts->pzUsageTitle + strlen(pOpts->pzUsageTitle); - fwrite(pOpts->pzUsageTitle, 1, pe - pOpts->pzUsageTitle, fp); + pe = opts->pzUsageTitle + strlen(opts->pzUsageTitle); + fwrite(opts->pzUsageTitle, 1, pe - opts->pzUsageTitle, fp); } fputc(NL, fp); } static void -emit_copy_ver(tOptions * pOpts, FILE * fp) +emit_copy_ver(tOptions * opts, FILE * fp) { - if (pOpts->pzCopyright != NULL) - fputs(pOpts->pzCopyright, fp); + if (opts->pzCopyright != NULL) + fputs(opts->pzCopyright, fp); - else if (pOpts->pzFullVersion != NULL) - fputs(pOpts->pzFullVersion, fp); + else if (opts->pzFullVersion != NULL) + fputs(opts->pzFullVersion, fp); else { - char const * pe = strchr(pOpts->pzUsageTitle, NL); + char const * pe = strchr(opts->pzUsageTitle, NL); if (pe == NULL) - pe = pOpts->pzUsageTitle + strlen(pOpts->pzUsageTitle); - fwrite(pOpts->pzUsageTitle, 1, pe - pOpts->pzCopyright, fp); + pe = opts->pzUsageTitle + strlen(opts->pzUsageTitle); + fwrite(opts->pzUsageTitle, 1, pe - opts->pzCopyright, fp); } fputc(NL, fp); - if (HAS_pzPkgDataDir(pOpts) && (pOpts->pzPackager != NULL)) - fputs(pOpts->pzPackager, fp); + if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) + fputs(opts->pzPackager, fp); - else if (pOpts->pzBugAddr != NULL) - fprintf(fp, zPlsSendBugs, pOpts->pzBugAddr); + else if (opts->pzBugAddr != NULL) + fprintf(fp, zPlsSendBugs, opts->pzBugAddr); } static void -emit_copy_note(tOptions * pOpts, FILE * fp) +emit_copy_note(tOptions * opts, FILE * fp) { - if (pOpts->pzCopyright != NULL) { - fputs(pOpts->pzCopyright, fp); + if (opts->pzCopyright != NULL) { + fputs(opts->pzCopyright, fp); fputc(NL, fp); } - if (pOpts->pzCopyNotice != NULL) { - fputs(pOpts->pzCopyNotice, fp); + if (opts->pzCopyNotice != NULL) { + fputs(opts->pzCopyNotice, fp); fputc(NL, fp); } fprintf(fp, zAO_Ver, optionVersion()); - if (HAS_pzPkgDataDir(pOpts) && (pOpts->pzPackager != NULL)) - fputs(pOpts->pzPackager, fp); + if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) + fputs(opts->pzPackager, fp); - else if (pOpts->pzBugAddr != NULL) - fprintf(fp, zPlsSendBugs, pOpts->pzBugAddr); + else if (opts->pzBugAddr != NULL) + fprintf(fp, zPlsSendBugs, opts->pzBugAddr); } static void -print_ver(tOptions * pOpts, tOptDesc * pOD, FILE * fp) +print_ver(tOptions * opts, tOptDesc * od, FILE * fp) { char ch; + if (opts <= OPTPROC_EMIT_LIMIT) + return; + /* * IF we have an argument for this option, use it * Otherwise, default to version only or copyright note, * depending on whether the layout is GNU standard form or not. */ - if ( (pOD->fOptState & OPTST_ARG_OPTIONAL) - && (pOD->optArg.argString != NULL) - && (pOD->optArg.argString[0] != NUL)) + if ( (od->fOptState & OPTST_ARG_OPTIONAL) + && (od->optArg.argString != NULL) + && (od->optArg.argString[0] != NUL)) - ch = pOD->optArg.argString[0]; + ch = od->optArg.argString[0]; else { - set_usage_flags(pOpts, NULL); - ch = (pOpts->fOptSet & OPTPROC_GNUUSAGE) ? 'c' : 'v'; + set_usage_flags(opts, NULL); + ch = (opts->fOptSet & OPTPROC_GNUUSAGE) ? 'c' : 'v'; } switch (ch) { case NUL: /* arg provided, but empty */ - case 'v': case 'V': emit_simple_ver(pOpts, fp); break; - case 'c': case 'C': emit_copy_ver(pOpts, fp); break; - case 'n': case 'N': emit_copy_note(pOpts, fp); break; + case 'v': case 'V': emit_simple_ver(opts, fp); break; + case 'c': case 'C': emit_copy_ver( opts, fp); break; + case 'n': case 'N': emit_copy_note( opts, fp); break; default: fprintf(stderr, zBadVerArg, ch); @@ -174,32 +177,32 @@ print_ver(tOptions * pOpts, tOptDesc * pOD, FILE * fp) * private: * * what: Print the program version - * arg: + tOptions* + pOpts + program options descriptor + - * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + + * arg: + tOptions* + opts + program options descriptor + + * arg: + tOptDesc* + od + the descriptor for this arg + * * doc: * This routine will print the version to stdout. =*/ void -optionPrintVersion(tOptions * pOpts, tOptDesc * pOD) +optionPrintVersion(tOptions * opts, tOptDesc * od) { - print_ver(pOpts, pOD, stdout); + print_ver(opts, od, stdout); } /*=export_func optionVersionStderr * private: * * what: Print the program version to stderr - * arg: + tOptions* + pOpts + program options descriptor + - * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + + * arg: + tOptions* + opts + program options descriptor + + * arg: + tOptDesc* + od + the descriptor for this arg + * * doc: * This routine will print the version to stderr. =*/ void -optionVersionStderr(tOptions * pOpts, tOptDesc * pOD) +optionVersionStderr(tOptions * opts, tOptDesc * od) { - print_ver(pOpts, pOD, stderr); + print_ver(opts, od, stderr); } /* diff --git a/sntp/libopts/xat-attribute.h b/sntp/libopts/xat-attribute.h index 9fb5eb80df..ac9b5954de 100644 --- a/sntp/libopts/xat-attribute.h +++ b/sntp/libopts/xat-attribute.h @@ -1,5 +1,5 @@ /* - * Generated header for gperf generated source Sun Jun 17 15:47:35 PDT 2012 + * Generated header for gperf generated source Sat Aug 11 09:41:14 PDT 2012 * This file enumerates the list of names and declares the * procedure for mapping string names to the enum value. */ diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c index 723a43a073..20790ec418 100644 --- a/sntp/sntp-opts.c +++ b/sntp/sntp-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:22:25 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:32 PM by AutoGen 5.16.2 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,15 +36,16 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "sntp-opts.h" #include #include #include #include - -#define OPTION_CODE_COMPILE 1 -#include "sntp-opts.h" #include + #ifdef __cplusplus extern "C" { #endif @@ -55,10 +56,10 @@ extern FILE * option_usage_fp; #define zCopyright (sntp_opt_strs+0) #define zLicenseDescrip (sntp_opt_strs+314) -extern tUsageProc optionUsage; /* * global included definitions - */#ifdef __windows + */ +#ifdef __windows extern int atoi(const char*); #else # include @@ -71,7 +72,7 @@ extern tUsageProc optionUsage; /* * sntp option static const strings */ -static char const sntp_opt_strs[2613] = +static char const sntp_opt_strs[2568] = /* 0 */ "sntp 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -84,98 +85,98 @@ static char const sntp_opt_strs[2613] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 952 */ "Force IPv4 DNS name resolution\0" -/* 983 */ "IPV4\0" -/* 988 */ "ipv4\0" -/* 993 */ "Force IPv6 DNS name resolution\0" -/* 1024 */ "IPV6\0" -/* 1029 */ "ipv6\0" -/* 1034 */ "Enable authentication with the key @var{auth-keynumber}\0" -/* 1090 */ "AUTHENTICATION\0" -/* 1105 */ "authentication\0" -/* 1120 */ "The number of seconds to wait for broadcasts\0" -/* 1165 */ "BCTIMEOUT\0" -/* 1175 */ "bctimeout\0" -/* 1185 */ "Listen to the address specified for broadcast time sync\0" -/* 1241 */ "BROADCAST\0" -/* 1251 */ "broadcast\0" -/* 1261 */ "Concurrently query all IPs returned for host-name\0" -/* 1311 */ "CONCURRENT\0" -/* 1322 */ "concurrent\0" -/* 1333 */ "Increase debug verbosity level\0" -/* 1364 */ "DEBUG_LEVEL\0" -/* 1376 */ "debug-level\0" -/* 1388 */ "Set the debug verbosity level\0" -/* 1418 */ "SET_DEBUG_LEVEL\0" -/* 1434 */ "set-debug-level\0" -/* 1450 */ "The gap (in milliseconds) between time requests\0" -/* 1498 */ "GAP\0" -/* 1502 */ "gap\0" -/* 1506 */ "KoD history filename\0" -/* 1527 */ "KOD\0" -/* 1531 */ "kod\0" -/* 1535 */ "/var/db/ntp-kod\0" -/* 1551 */ "Look in this file for the key specified with @option{-a}\0" -/* 1608 */ "KEYFILE\0" -/* 1616 */ "keyfile\0" -/* 1624 */ "Log to specified logfile\0" -/* 1649 */ "LOGFILE\0" -/* 1657 */ "logfile\0" -/* 1665 */ "Adjustments less than @var{steplimit} msec will be slewed\0" -/* 1723 */ "STEPLIMIT\0" -/* 1733 */ "steplimit\0" -/* 1743 */ "Send @var{int} as our NTP version\0" -/* 1777 */ "NTPVERSION\0" -/* 1788 */ "ntpversion\0" -/* 1799 */ "Use the NTP Reserved Port (port 123)\0" -/* 1836 */ "USERESERVEDPORT\0" -/* 1852 */ "usereservedport\0" -/* 1868 */ "OK to 'step' the time with @command{settimeofday(2)}\0" -/* 1921 */ "STEP\0" -/* 1926 */ "step\0" -/* 1931 */ "OK to 'slew' the time with @command{adjtime(2)}\0" -/* 1979 */ "SLEW\0" -/* 1984 */ "slew\0" -/* 1989 */ "The number of seconds to wait for unicast responses\0" -/* 2041 */ "UCTIMEOUT\0" -/* 2051 */ "uctimeout\0" -/* 2061 */ "Wait for pending replies (if not setting the time)\0" -/* 2112 */ "WAIT\0" -/* 2117 */ "no-wait\0" -/* 2125 */ "no\0" -/* 2128 */ "Display extended usage information and exit\0" -/* 2172 */ "help\0" -/* 2177 */ "Extended usage information passed thru pager\0" -/* 2222 */ "more-help\0" -/* 2232 */ "Output version information and exit\0" -/* 2268 */ "version\0" -/* 2276 */ "Save the option state to a config file\0" -/* 2315 */ "save-opts\0" -/* 2325 */ "Load options from a config file\0" -/* 2357 */ "LOAD_OPTS\0" -/* 2367 */ "no-load-opts\0" -/* 2380 */ "SNTP\0" -/* 2385 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 954 */ "Force IPv4 DNS name resolution\0" +/* 985 */ "IPV4\0" +/* 990 */ "ipv4\0" +/* 995 */ "Force IPv6 DNS name resolution\0" +/* 1026 */ "IPV6\0" +/* 1031 */ "ipv6\0" +/* 1036 */ "Enable authentication with the key auth-keynumber\0" +/* 1086 */ "AUTHENTICATION\0" +/* 1101 */ "authentication\0" +/* 1116 */ "The number of seconds to wait for broadcasts\0" +/* 1161 */ "BCTIMEOUT\0" +/* 1171 */ "bctimeout\0" +/* 1181 */ "Listen to the address specified for broadcast time sync\0" +/* 1237 */ "BROADCAST\0" +/* 1247 */ "broadcast\0" +/* 1257 */ "Concurrently query all IPs returned for host-name\0" +/* 1307 */ "CONCURRENT\0" +/* 1318 */ "concurrent\0" +/* 1329 */ "Increase debug verbosity level\0" +/* 1360 */ "DEBUG_LEVEL\0" +/* 1372 */ "debug-level\0" +/* 1384 */ "Set the debug verbosity level\0" +/* 1414 */ "SET_DEBUG_LEVEL\0" +/* 1430 */ "set-debug-level\0" +/* 1446 */ "The gap (in milliseconds) between time requests\0" +/* 1494 */ "GAP\0" +/* 1498 */ "gap\0" +/* 1502 */ "KoD history filename\0" +/* 1523 */ "KOD\0" +/* 1527 */ "kod\0" +/* 1531 */ "/var/db/ntp-kod\0" +/* 1547 */ "Look in this file for the key specified with -a\0" +/* 1595 */ "KEYFILE\0" +/* 1603 */ "keyfile\0" +/* 1611 */ "Log to specified logfile\0" +/* 1636 */ "LOGFILE\0" +/* 1644 */ "logfile\0" +/* 1652 */ "Adjustments less than steplimit msec will be slewed\0" +/* 1704 */ "STEPLIMIT\0" +/* 1714 */ "steplimit\0" +/* 1724 */ "Send int as our NTP version\0" +/* 1752 */ "NTPVERSION\0" +/* 1763 */ "ntpversion\0" +/* 1774 */ "Use the NTP Reserved Port (port 123)\0" +/* 1811 */ "USERESERVEDPORT\0" +/* 1827 */ "usereservedport\0" +/* 1843 */ "OK to 'step' the time with settimeofday(2)\0" +/* 1886 */ "STEP\0" +/* 1891 */ "step\0" +/* 1896 */ "OK to 'slew' the time with adjtime(2)\0" +/* 1934 */ "SLEW\0" +/* 1939 */ "slew\0" +/* 1944 */ "The number of seconds to wait for unicast responses\0" +/* 1996 */ "UCTIMEOUT\0" +/* 2006 */ "uctimeout\0" +/* 2016 */ "Wait for pending replies (if not setting the time)\0" +/* 2067 */ "WAIT\0" +/* 2072 */ "no-wait\0" +/* 2080 */ "no\0" +/* 2083 */ "Display extended usage information and exit\0" +/* 2127 */ "help\0" +/* 2132 */ "Extended usage information passed thru pager\0" +/* 2177 */ "more-help\0" +/* 2187 */ "Output version information and exit\0" +/* 2223 */ "version\0" +/* 2231 */ "Save the option state to a config file\0" +/* 2270 */ "save-opts\0" +/* 2280 */ "Load options from a config file\0" +/* 2312 */ "LOAD_OPTS\0" +/* 2322 */ "no-load-opts\0" +/* 2335 */ "SNTP\0" +/* 2340 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]... \\\n" "\t\t[ hostname-or-IP ...]\n\0" -/* 2546 */ ".ntprc\0" -/* 2553 */ "$HOME\0" -/* 2559 */ ".\0" -/* 2561 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 2595 */ "\n\n\0" -/* 2598 */ "sntp 4.2.7p295"; +/* 2501 */ "$HOME\0" +/* 2507 */ ".\0" +/* 2509 */ ".ntprc\0" +/* 2516 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 2550 */ "\n\n\0" +/* 2553 */ "sntp 4.2.7p295"; /* * ipv4 option description with * "Must also have options" and "Incompatible options": */ -#define IPV4_DESC (sntp_opt_strs+952) -#define IPV4_NAME (sntp_opt_strs+983) -#define IPV4_name (sntp_opt_strs+988) +#define IPV4_DESC (sntp_opt_strs+954) +#define IPV4_NAME (sntp_opt_strs+985) +#define IPV4_name (sntp_opt_strs+990) static int const aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) @@ -184,9 +185,9 @@ static int const aIpv4CantList[] = { * ipv6 option description with * "Must also have options" and "Incompatible options": */ -#define IPV6_DESC (sntp_opt_strs+993) -#define IPV6_NAME (sntp_opt_strs+1024) -#define IPV6_name (sntp_opt_strs+1029) +#define IPV6_DESC (sntp_opt_strs+995) +#define IPV6_NAME (sntp_opt_strs+1026) +#define IPV6_name (sntp_opt_strs+1031) static int const aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) @@ -194,18 +195,18 @@ static int const aIpv6CantList[] = { /* * authentication option description: */ -#define AUTHENTICATION_DESC (sntp_opt_strs+1034) -#define AUTHENTICATION_NAME (sntp_opt_strs+1090) -#define AUTHENTICATION_name (sntp_opt_strs+1105) +#define AUTHENTICATION_DESC (sntp_opt_strs+1036) +#define AUTHENTICATION_NAME (sntp_opt_strs+1086) +#define AUTHENTICATION_name (sntp_opt_strs+1101) #define AUTHENTICATION_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * bctimeout option description: */ -#define BCTIMEOUT_DESC (sntp_opt_strs+1120) -#define BCTIMEOUT_NAME (sntp_opt_strs+1165) -#define BCTIMEOUT_name (sntp_opt_strs+1175) +#define BCTIMEOUT_DESC (sntp_opt_strs+1116) +#define BCTIMEOUT_NAME (sntp_opt_strs+1161) +#define BCTIMEOUT_name (sntp_opt_strs+1171) #define BCTIMEOUT_DFT_ARG ((char const*)68) #define BCTIMEOUT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -213,44 +214,44 @@ static int const aIpv6CantList[] = { /* * broadcast option description: */ -#define BROADCAST_DESC (sntp_opt_strs+1185) -#define BROADCAST_NAME (sntp_opt_strs+1241) -#define BROADCAST_name (sntp_opt_strs+1251) +#define BROADCAST_DESC (sntp_opt_strs+1181) +#define BROADCAST_NAME (sntp_opt_strs+1237) +#define BROADCAST_name (sntp_opt_strs+1247) #define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * concurrent option description: */ -#define CONCURRENT_DESC (sntp_opt_strs+1261) -#define CONCURRENT_NAME (sntp_opt_strs+1311) -#define CONCURRENT_name (sntp_opt_strs+1322) +#define CONCURRENT_DESC (sntp_opt_strs+1257) +#define CONCURRENT_NAME (sntp_opt_strs+1307) +#define CONCURRENT_name (sntp_opt_strs+1318) #define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * debug-level option description: */ -#define DEBUG_LEVEL_DESC (sntp_opt_strs+1333) -#define DEBUG_LEVEL_NAME (sntp_opt_strs+1364) -#define DEBUG_LEVEL_name (sntp_opt_strs+1376) +#define DEBUG_LEVEL_DESC (sntp_opt_strs+1329) +#define DEBUG_LEVEL_NAME (sntp_opt_strs+1360) +#define DEBUG_LEVEL_name (sntp_opt_strs+1372) #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * set-debug-level option description: */ -#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1388) -#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1418) -#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1434) +#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1384) +#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1414) +#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1430) #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * gap option description: */ -#define GAP_DESC (sntp_opt_strs+1450) -#define GAP_NAME (sntp_opt_strs+1498) -#define GAP_name (sntp_opt_strs+1502) +#define GAP_DESC (sntp_opt_strs+1446) +#define GAP_NAME (sntp_opt_strs+1494) +#define GAP_name (sntp_opt_strs+1498) #define GAP_DFT_ARG ((char const*)50) #define GAP_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -258,46 +259,46 @@ static int const aIpv6CantList[] = { /* * kod option description: */ -#define KOD_DESC (sntp_opt_strs+1506) -#define KOD_NAME (sntp_opt_strs+1527) -#define KOD_name (sntp_opt_strs+1531) -#define KOD_DFT_ARG (sntp_opt_strs+1535) +#define KOD_DESC (sntp_opt_strs+1502) +#define KOD_NAME (sntp_opt_strs+1523) +#define KOD_name (sntp_opt_strs+1527) +#define KOD_DFT_ARG (sntp_opt_strs+1531) #define KOD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * keyfile option description: */ -#define KEYFILE_DESC (sntp_opt_strs+1551) -#define KEYFILE_NAME (sntp_opt_strs+1608) -#define KEYFILE_name (sntp_opt_strs+1616) +#define KEYFILE_DESC (sntp_opt_strs+1547) +#define KEYFILE_NAME (sntp_opt_strs+1595) +#define KEYFILE_name (sntp_opt_strs+1603) #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * logfile option description: */ -#define LOGFILE_DESC (sntp_opt_strs+1624) -#define LOGFILE_NAME (sntp_opt_strs+1649) -#define LOGFILE_name (sntp_opt_strs+1657) +#define LOGFILE_DESC (sntp_opt_strs+1611) +#define LOGFILE_NAME (sntp_opt_strs+1636) +#define LOGFILE_name (sntp_opt_strs+1644) #define LOGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * steplimit option description: */ -#define STEPLIMIT_DESC (sntp_opt_strs+1665) -#define STEPLIMIT_NAME (sntp_opt_strs+1723) -#define STEPLIMIT_name (sntp_opt_strs+1733) +#define STEPLIMIT_DESC (sntp_opt_strs+1652) +#define STEPLIMIT_NAME (sntp_opt_strs+1704) +#define STEPLIMIT_name (sntp_opt_strs+1714) #define STEPLIMIT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * ntpversion option description: */ -#define NTPVERSION_DESC (sntp_opt_strs+1743) -#define NTPVERSION_NAME (sntp_opt_strs+1777) -#define NTPVERSION_name (sntp_opt_strs+1788) +#define NTPVERSION_DESC (sntp_opt_strs+1724) +#define NTPVERSION_NAME (sntp_opt_strs+1752) +#define NTPVERSION_name (sntp_opt_strs+1763) #define NTPVERSION_DFT_ARG ((char const*)4) #define NTPVERSION_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -305,33 +306,33 @@ static int const aIpv6CantList[] = { /* * usereservedport option description: */ -#define USERESERVEDPORT_DESC (sntp_opt_strs+1799) -#define USERESERVEDPORT_NAME (sntp_opt_strs+1836) -#define USERESERVEDPORT_name (sntp_opt_strs+1852) +#define USERESERVEDPORT_DESC (sntp_opt_strs+1774) +#define USERESERVEDPORT_NAME (sntp_opt_strs+1811) +#define USERESERVEDPORT_name (sntp_opt_strs+1827) #define USERESERVEDPORT_FLAGS (OPTST_DISABLED) /* * step option description: */ -#define STEP_DESC (sntp_opt_strs+1868) -#define STEP_NAME (sntp_opt_strs+1921) -#define STEP_name (sntp_opt_strs+1926) +#define STEP_DESC (sntp_opt_strs+1843) +#define STEP_NAME (sntp_opt_strs+1886) +#define STEP_name (sntp_opt_strs+1891) #define STEP_FLAGS (OPTST_DISABLED) /* * slew option description: */ -#define SLEW_DESC (sntp_opt_strs+1931) -#define SLEW_NAME (sntp_opt_strs+1979) -#define SLEW_name (sntp_opt_strs+1984) +#define SLEW_DESC (sntp_opt_strs+1896) +#define SLEW_NAME (sntp_opt_strs+1934) +#define SLEW_name (sntp_opt_strs+1939) #define SLEW_FLAGS (OPTST_DISABLED) /* * uctimeout option description: */ -#define UCTIMEOUT_DESC (sntp_opt_strs+1989) -#define UCTIMEOUT_NAME (sntp_opt_strs+2041) -#define UCTIMEOUT_name (sntp_opt_strs+2051) +#define UCTIMEOUT_DESC (sntp_opt_strs+1944) +#define UCTIMEOUT_NAME (sntp_opt_strs+1996) +#define UCTIMEOUT_name (sntp_opt_strs+2006) #define UCTIMEOUT_DFT_ARG ((char const*)5) #define UCTIMEOUT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -339,21 +340,21 @@ static int const aIpv6CantList[] = { /* * wait option description: */ -#define WAIT_DESC (sntp_opt_strs+2061) -#define WAIT_NAME (sntp_opt_strs+2112) -#define NOT_WAIT_name (sntp_opt_strs+2117) -#define NOT_WAIT_PFX (sntp_opt_strs+2125) +#define WAIT_DESC (sntp_opt_strs+2016) +#define WAIT_NAME (sntp_opt_strs+2067) +#define NOT_WAIT_name (sntp_opt_strs+2072) +#define NOT_WAIT_PFX (sntp_opt_strs+2080) #define WAIT_name (NOT_WAIT_name + 3) #define WAIT_FLAGS (OPTST_INITENABLED) /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (sntp_opt_strs+2128) -#define HELP_name (sntp_opt_strs+2172) +#define HELP_DESC (sntp_opt_strs+2083) +#define HELP_name (sntp_opt_strs+2127) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (sntp_opt_strs+2177) -#define MORE_HELP_name (sntp_opt_strs+2222) +#define MORE_HELP_DESC (sntp_opt_strs+2132) +#define MORE_HELP_name (sntp_opt_strs+2177) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -366,14 +367,14 @@ static int const aIpv6CantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (sntp_opt_strs+2232) -#define VER_name (sntp_opt_strs+2268) -#define SAVE_OPTS_DESC (sntp_opt_strs+2276) -#define SAVE_OPTS_name (sntp_opt_strs+2315) -#define LOAD_OPTS_DESC (sntp_opt_strs+2325) -#define LOAD_OPTS_NAME (sntp_opt_strs+2357) -#define NO_LOAD_OPTS_name (sntp_opt_strs+2367) -#define LOAD_OPTS_pfx (sntp_opt_strs+2125) +#define VER_DESC (sntp_opt_strs+2187) +#define VER_name (sntp_opt_strs+2223) +#define SAVE_OPTS_DESC (sntp_opt_strs+2231) +#define SAVE_OPTS_name (sntp_opt_strs+2270) +#define LOAD_OPTS_DESC (sntp_opt_strs+2280) +#define LOAD_OPTS_NAME (sntp_opt_strs+2312) +#define NO_LOAD_OPTS_name (sntp_opt_strs+2322) +#define LOAD_OPTS_pfx (sntp_opt_strs+2080) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -412,13 +413,14 @@ static tOptProc */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_SNTP_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Sntp Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the sntp Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the sntp program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, @@ -717,20 +719,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Sntp Option Environment + * Define the sntp Option Environment */ -#define zPROGNAME (sntp_opt_strs+2380) -#define zUsageTitle (sntp_opt_strs+2385) -#define zRcName (sntp_opt_strs+2546) +#define zPROGNAME (sntp_opt_strs+2335) +#define zUsageTitle (sntp_opt_strs+2340) +#define zRcName (sntp_opt_strs+2509) static char const * const apzHomeList[3] = { - sntp_opt_strs+2553, - sntp_opt_strs+2559, + sntp_opt_strs+2501, + sntp_opt_strs+2507, NULL }; -#define zBugsAddr (sntp_opt_strs+2561) -#define zExplain (sntp_opt_strs+2595) +#define zBugsAddr (sntp_opt_strs+2516) +#define zExplain (sntp_opt_strs+2550) #define zDetail (NULL) -#define zFullVersion (sntp_opt_strs+2598) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (sntp_opt_strs+2553) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -745,33 +747,51 @@ static char const * const apzHomeList[3] = { #define sntp_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&sntpOptions, SNTP_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(SNTP_EXIT_SUCCESS); } #if ! defined(TEST_SNTP_OPTS) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the set-debug-level option. * - * For the set-debug-level option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 26 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); + (void)pOptions; } #endif /* defined(TEST_SNTP_OPTS) */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the kod option. * - * For the kod option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptKod(tOptions* pOptions, tOptDesc* pOptDesc) @@ -784,12 +804,18 @@ doOptKod(tOptions* pOptions, tOptDesc* pOptDesc) #endif mode.file_flags = O_CLOEXEC; + /* + * This function handles special invalid values for "pOptions" + */ optionFileCheck(pOptions, pOptDesc, type, mode); } -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the keyfile option. * - * For the keyfile option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc) @@ -802,12 +828,18 @@ doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc) #endif mode.file_flags = O_CLOEXEC; + /* + * This function handles special invalid values for "pOptions" + */ optionFileCheck(pOptions, pOptDesc, type, mode); } -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the logfile option. * - * For the logfile option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc) @@ -820,12 +852,18 @@ doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc) #endif mode.file_flags = O_CLOEXEC; + /* + * This function handles special invalid values for "pOptions" + */ optionFileCheck(pOptions, pOptDesc, type, mode); } -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the steplimit option. * - * For the steplimit option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc) @@ -852,13 +890,15 @@ doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc) option_usage_fp = stderr; emit_ranges: - optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the ntpversion option. * - * For the ntpversion option. + * @param pOptions the sntp options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc) @@ -885,15 +925,22 @@ doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc) option_usage_fp = stderr; emit_ranges: - optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -906,12 +953,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_SNTP_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with sntp. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged sntp + * for the current distribution. + */ #ifndef WITH_PACKAGER # define sntp_packager_info NULL #else @@ -927,7 +981,13 @@ static char const sntp_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for sntp. The one structure that + * binds them all. + */ tOptions sntpOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -972,7 +1032,16 @@ tOptions sntpOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -992,8 +1061,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the sntpOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h index 5fe225c6b3..ea618bb943 100644 --- a/sntp/sntp-opts.h +++ b/sntp/sntp-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:22:24 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:32 PM by AutoGen 5.16.2 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -121,7 +121,9 @@ typedef enum { */ typedef enum { SNTP_EXIT_SUCCESS = 0, - SNTP_EXIT_FAILURE = 1 + SNTP_EXIT_FAILURE = 1, + SNTP_EXIT_NO_CONFIG_INPUT = 66, + SNTP_EXIT_LIBOPTS_FAILURE = 70 } sntp_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -289,7 +291,7 @@ typedef enum { sntpOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -305,6 +307,12 @@ extern tOptions sntpOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/sntp/sntp.1sntpman b/sntp/sntp.1sntpman index 887b9dd53f..115bc1981f 100644 --- a/sntp/sntp.1sntpman +++ b/sntp/sntp.1sntpman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (sntp-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:33:01 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:59:09 PM by AutoGen 5.16.2 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ sntp \- standard Simple Network Time Protocol client program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ hostname-or-IP ...] .PP .SH DESCRIPTION -.B +.B XXX Program Name can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or from a @@ -73,13 +73,13 @@ Force DNS resolution of the following host names on the command line to the IPv6 namespace. .TP .BR \-a " \fIauth\-keynumber\fP, " \-\-authentication "=" \fIauth\-keynumber\fP -Enable authentication with the key @var{auth-keynumber}. +Enable authentication with the key \fBauth-keynumber\fP. This option takes an integer number as its argument. .sp This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the -keyfile option (@option{-k}) for more details. +keyfile option (\fB-k\fP) for more details. .TP .BR \-B " \fIseconds\fP, " \-\-bctimeout "=" \fIseconds\fP The number of seconds to wait for broadcasts. @@ -88,16 +88,16 @@ The default \fIseconds\fP for this option is: .ti +4 68 .sp -When waiting for a broadcast packet @code{sntp} will wait the number +When waiting for a broadcast packet \fBsntp\fP will wait the number of seconds specified before giving up. .TP .BR \-b " \fIbroadcast\-address\fP, " \-\-broadcast "=" \fIbroadcast\-address\fP Listen to the address specified for broadcast time sync. This option may appear an unlimited number of times. .sp -If specified @code{sntp} will listen to the specified address +If specified \fBsntp\fP will listen to the specified address for NTP broadcasts. The default maximum wait time -can be modified with @option{-B}. +can be modified with \fB-B\fP. .TP .BR \-c " \fIhost\-name\fP, " \-\-concurrent "=" \fIhost\-name\fP Concurrently query all IPs returned for host-name. @@ -106,9 +106,9 @@ This option may appear an unlimited number of times. Requests from an NTP "client" to a "server" should never be sent more rapidly than one every 2 seconds. By default, any IPs returned as part of a DNS lookup are assumed to be for a single instance of -ntpd, and therefore @code{sntp} will send queries to these IPs one +ntpd, and therefore \fBsntp\fP will send queries to these IPs one after another, with a 2-second gap in between each query. -The @option{-c} or @option{--concurrent} flag says that any IPs +The \fB-c\fP or \fB--concurrent\fP flag says that any IPs returned for the DNS lookup of the supplied host-name are on different machines, so we can send concurrent queries. .TP @@ -144,28 +144,28 @@ Specifies the filename to be used for the persistent history of KoD responses received from servers. .TP .BR \-k " \fIfile\-name\fP, " \-\-keyfile "=" \fIfile\-name\fP -Look in this file for the key specified with @option{-a}. +Look in this file for the key specified with \fB-a\fP. .sp This option specifies the keyfile. -@code{sntp} will search for the key specified with @option{-a} -@file{keyno} in this file. Key files follow the following format: -@file{keyid keytype key} -Where @file{keyid} is a number identifying this key -@file{keytype} is one of the following: -@code{S} Key is a 64 Bit hexadecimal number as specified in in the DES specification. -@code{N} Key is a 64 Bit hexadecimal number as specified in the NTP standard. -@code{A} Key is a 1-to-8 character ASCII string. -@code{M} Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. -For more information see @command{ntp.keys(5)}. +\fBsntp\fP will search for the key specified with \fB-a\fP +\fIkeyno\fP in this file. Key files follow the following format: +\fIkeyid keytype key\fP +Where \fIkeyid\fP is a number identifying this key +\fIkeytype\fP is one of the following: +\fBS\fP Key is a 64 Bit hexadecimal number as specified in in the DES specification. +\fBN\fP Key is a 64 Bit hexadecimal number as specified in the NTP standard. +\fBA\fP Key is a 1-to-8 character ASCII string. +\fBM\fP Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. +For more information see \fBntp.keys(5)\fP. .TP .BR \-l " \fIfile\-name\fP, " \-\-logfile "=" \fIfile\-name\fP Log to specified logfile. .sp This option causes the client to write log messages to the specified -@file{logfile}. +\fIlogfile\fP. .TP .BR \-M " \fInumber\fP, " \-\-steplimit "=" \fInumber\fP -Adjustments less than @var{steplimit} msec will be slewed. +Adjustments less than \fBsteplimit\fP msec will be slewed. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -175,12 +175,12 @@ greater than or equal to 0 .fi .in -4 .sp -If the time adjustment is less than @file{steplimit} milliseconds, -slew the amount using @command{adjtime(2)}. Otherwise, step the -correction using @command{settimeofday(2)}. +If the time adjustment is less than \fIsteplimit\fP milliseconds, +slew the amount using \fBadjtime(2)\fP. Otherwise, step the +correction using \fBsettimeofday(2)\fP. .TP .BR \-o " \fInumber\fP, " \-\-ntpversion "=" \fInumber\fP -Send @var{int} as our NTP version. +Send \fBint\fP as our NTP version. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -194,7 +194,7 @@ The default \fInumber\fP for this option is: 4 .sp When sending requests to a remote server, tell them we are running -NTP protocol version @file{ntpversion} . +NTP protocol version \fIntpversion\fP . .TP .BR \-r ", " -\-usereservedport Use the NTP Reserved Port (port 123). @@ -203,11 +203,11 @@ Use port 123, which is reserved for NTP, for our network communications. .TP .BR \-S ", " -\-step -OK to 'step' the time with @command{settimeofday(2)}. +OK to 'step' the time with \fBsettimeofday(2)\fP. .sp .TP .BR \-s ", " -\-slew -OK to 'slew' the time with @command{adjtime(2)}. +OK to 'slew' the time with \fBadjtime(2)\fP. .sp .TP .BR \-u " \fIseconds\fP, " \-\-uctimeout "=" \fIseconds\fP @@ -217,7 +217,7 @@ The default \fIseconds\fP for this option is: .ti +4 5 .sp -When waiting for a unicast reply, @code{sntp} will wait the number +When waiting for a unicast reply, \fBsntp\fP will wait the number of seconds specified before giving up. .TP .BR \-\-wait, " \fB\-\-no\-wait\fP" @@ -287,11 +287,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH AUTHORS .An "Johannes Maximilian Kuehn" .An "Harlan Stenn" diff --git a/sntp/sntp.1sntpmdoc b/sntp/sntp.1sntpmdoc index fc3444aa1c..441a0b88d0 100644 --- a/sntp/sntp.1sntpmdoc +++ b/sntp/sntp.1sntpmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt SNTP 1sntpmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:33:04 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:59:04 PM by AutoGen 5.16.2 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -75,13 +75,13 @@ ipv4. Force DNS resolution of the following host names on the command line to the IPv6 namespace. .It \-a " \fIauth\-keynumber\fP, " \-\-authentication "=" \fIauth\-keynumber\fP -Enable authentication with the key @var{auth-keynumber}. +Enable authentication with the key \fBauth\-keynumber\fP. This option takes an integer number as its argument. .sp This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the -keyfile option (@option{-k}) for more details. +keyfile option (\fB\-k\fP) for more details. .It \-B " \fIseconds\fP, " \-\-bctimeout "=" \fIseconds\fP The number of seconds to wait for broadcasts. This option takes an integer number as its argument. @@ -89,35 +89,38 @@ The default \fIseconds\fP for this option is: .ti +4 68 .sp -When waiting for a broadcast packet @code{sntp} will wait the number +When waiting for a broadcast packet \fBsntp\fP will wait the number of seconds specified before giving up. .It \-b " \fIbroadcast\-address\fP, " \-\-broadcast "=" \fIbroadcast\-address\fP Listen to the address specified for broadcast time sync. This option may appear an unlimited number of times. .sp -If specified @code{sntp} will listen to the specified address +If specified \fBsntp\fP will listen to the specified address for NTP broadcasts. The default maximum wait time -can be modified with @option{-B}. +can be modified with \fB\-B\fP. .It \-c " \fIhost\-name\fP, " \-\-concurrent "=" \fIhost\-name\fP -Concurrently query all IPs returned for host-name. +Concurrently query all IPs returned for host\-name. This option may appear an unlimited number of times. .sp Requests from an NTP "client" to a "server" should never be sent more rapidly than one every 2 seconds. By default, any IPs returned as part of a DNS lookup are assumed to be for a single instance of -ntpd, and therefore @code{sntp} will send queries to these IPs one -after another, with a 2-second gap in between each query. -The @option{-c} or @option{--concurrent} flag says that any IPs -returned for the DNS lookup of the supplied host-name are on +ntpd, and therefore \fBsntp\fP will send queries to these IPs one +after another, with a 2\-second gap in between each query. +.sp +The \fB\-c\fP or \fB\-\-concurrent\fP flag says that any IPs +returned for the DNS lookup of the supplied host\-name are on different machines, so we can send concurrent queries. .It \-d ", " -\-debug\-level Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-g " \fImilliseconds\fP, " \-\-gap "=" \fImilliseconds\fP The gap (in milliseconds) between time requests. This option takes an integer number as its argument. @@ -138,26 +141,29 @@ The default \fIfile\-name\fP for this option is: Specifies the filename to be used for the persistent history of KoD responses received from servers. .It \-k " \fIfile\-name\fP, " \-\-keyfile "=" \fIfile\-name\fP -Look in this file for the key specified with @option{-a}. +Look in this file for the key specified with \fB\-a\fP. .sp This option specifies the keyfile. -@code{sntp} will search for the key specified with @option{-a} -@file{keyno} in this file. Key files follow the following format: -@file{keyid keytype key} -Where @file{keyid} is a number identifying this key -@file{keytype} is one of the following: -@code{S} Key is a 64 Bit hexadecimal number as specified in in the DES specification. -@code{N} Key is a 64 Bit hexadecimal number as specified in the NTP standard. -@code{A} Key is a 1-to-8 character ASCII string. -@code{M} Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. -For more information see @command{ntp.keys(5)}. +\fBsntp\fP will search for the key specified with \fB\-a\fP +\fIkeyno\fP in this file. Key files follow the following format: +.sp +\fIkeyid keytype key\fP +.sp +Where \fIkeyid\fP is a number identifying this key +\fIkeytype\fP is one of the following: +\fBS\fP Key is a 64 Bit hexadecimal number as specified in in the DES specification. +\fBN\fP Key is a 64 Bit hexadecimal number as specified in the NTP standard. +\fBA\fP Key is a 1\-to\-8 character ASCII string. +\fBM\fP Key is a 1\-to\-8 character ASCII string using the MD5 authentication scheme. +.sp +For more information see \fBntp.keys(5)\fP. .It \-l " \fIfile\-name\fP, " \-\-logfile "=" \fIfile\-name\fP Log to specified logfile. .sp This option causes the client to write log messages to the specified -@file{logfile}. +\fIlogfile\fP. .It \-M " \fInumber\fP, " \-\-steplimit "=" \fInumber\fP -Adjustments less than @var{steplimit} msec will be slewed. +Adjustments less than \fBsteplimit\fP msec will be slewed. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -167,11 +173,11 @@ greater than or equal to 0 .fi .in -4 .sp -If the time adjustment is less than @file{steplimit} milliseconds, -slew the amount using @command{adjtime(2)}. Otherwise, step the -correction using @command{settimeofday(2)}. +If the time adjustment is less than \fIsteplimit\fP milliseconds, +slew the amount using \fBadjtime(2)\fP. Otherwise, step the +correction using \fBsettimeofday(2)\fP. .It \-o " \fInumber\fP, " \-\-ntpversion "=" \fInumber\fP -Send @var{int} as our NTP version. +Send \fBint\fP as our NTP version. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -185,17 +191,19 @@ The default \fInumber\fP for this option is: 4 .sp When sending requests to a remote server, tell them we are running -NTP protocol version @file{ntpversion} . +NTP protocol version \fIntpversion\fP . .It \-r ", " -\-usereservedport Use the NTP Reserved Port (port 123). .sp Use port 123, which is reserved for NTP, for our network communications. .It \-S ", " -\-step -OK to 'step' the time with @command{settimeofday(2)}. +OK to 'step' the time with \fBsettimeofday(2)\fP. +.sp .sp .It \-s ", " -\-slew -OK to 'slew' the time with @command{adjtime(2)}. +OK to 'slew' the time with \fBadjtime(2)\fP. +.sp .sp .It \-u " \fIseconds\fP, " \-\-uctimeout "=" \fIseconds\fP The number of seconds to wait for unicast responses. @@ -204,7 +212,7 @@ The default \fIseconds\fP for this option is: .ti +4 5 .sp -When waiting for a unicast reply, @code{sntp} will wait the number +When waiting for a unicast reply, \fBsntp\fP will wait the number of seconds specified before giving up. .It \-\-wait, " \fB\-\-no\-wait\fP" Wait for pending replies (if not setting the time). @@ -269,10 +277,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh AUTHORS .An "Johannes Maximilian Kuehn" diff --git a/sntp/sntp.html b/sntp/sntp.html index 66cb53ecae..6adb016a03 100644 --- a/sntp/sntp.html +++ b/sntp/sntp.html @@ -3,7 +3,7 @@ Sntp User's Manual - + @@ -14,18 +14,20 @@ pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } - span.sc { font-variant:small-caps } - span.roman { font-family: serif; font-weight: normal; } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } -->

Sntp User's Manual

+


-Next: , +Next: , Previous: (dir), Up: (dir) -
+

Simple Network Time Protocol User Manual

@@ -41,7 +43,7 @@ well. It can be run as an interactive command or from a cron job.

The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. -

+

Short Contents

-


-
+


+ +
@@ -76,91 +79,131 @@ the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.
-


-
+


+ +

Invoking sntp

-sntp + +

sntp can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be -run as an interactive command or in a -cron +run as an interactive command or from a +.Ic +cron job.

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. -

The default is to write the estimated correct local date and time (i.e. not -UTC) to the standard output in a format like -

     1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN
-
+

.PP +The default is to write the estimated correct local date and time (i.e. not +UTC) to the standard output in a format like: + +

.Ic +"'1996-10-15 +20:17:25.123 +(+0800) ++4.567 ++/- +0.089 +[host] +IP +sN'" +

where the -

     (+0800)
-
-

means that to get to UTC from the reported local time one must +.Ic +"'(+0800)'" +means that to get to UTC from the reported local time one must add 8 hours and 0 minutes, the -

     +4.567
-
-

indicates the local clock is 4.567 seconds behind the correct time +.Ic +"'+4.567'" +indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct). Note that the number of decimals printed for this value will change -based on the reported precision of the server. -

     +/- 0.089
-
-

is the reported synchronization distance (in seconds), -which represents the maximum error due to all causes. +based on the reported precision of the server. +.Ic +"'+/- +0.089'" +is the reported +.Em +synchronization +distance +(in seconds), which represents the maximum error due to all causes. If the server does not report valid data needed to calculate the synchronization distance, this will be reported as -

     +/- ?
-
-

If the host is different from the IP, both will be displayed. -Otherwise, only the IP is displayed. -Finally, the stratum is reported. +.Ic +"'+/- +?'" +. +If the +.Em +host +is different from the +.Em +IP +, +both will be displayed. +Otherwise, only the +.Em +IP +is displayed. +Finally, the +.Em +stratum +of the host is reported.

This section was generated by AutoGen, -the aginfo template and the option descriptions for the sntp program. It documents the sntp usage text and option meanings. - -

This software is released under a specialized copyright license. +using the agtexi-cmd template and the option descriptions for the sntp program. +This software is released under the NTP license, <http://ntp.org/license>.

+


-Next: , +Next: , Up: sntp Invocation -
+
-

sntp usage help (-?)

+

sntp help/usage (-?)

-

-This is the automatically generated usage text for sntp: +

+This is the automatically generated usage text for sntp. +The text printed is the same whether for the help option (-?) or the more-help option (-!). more-help will print +the usage text by passing it through a pager program. +more-help is disabled on platforms without a working +fork(2) function. The PAGER environment variable is +used to select the program, defaulting to more. Both will exit +with a status code of 0.

sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p295
 USAGE:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
@@ -172,7 +215,7 @@ USAGE:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ].
    -6 no  ipv6           Force IPv6 DNS name resolution
                                 - prohibits these options:
                                 ipv4
-   -a Num authentication Enable authentication with the key @var{auth-keynumber}
+   -a Num authentication Enable authentication with the key auth-keynumber
    -B Num bctimeout      The number of seconds to wait for broadcasts
    -b Str broadcast      Listen to the address specified for broadcast time sync
                                 - may appear multiple times
@@ -184,17 +227,17 @@ USAGE:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ].
                                 - may appear multiple times
    -g Num gap            The gap (in milliseconds) between time requests
    -K Fil kod            KoD history filename
-   -k Fil keyfile        Look in this file for the key specified with @option{-a}
+   -k Fil keyfile        Look in this file for the key specified with -a
    -l Fil logfile        Log to specified logfile
-   -M Num steplimit      Adjustments less than @var{steplimit} msec will be slewed
+   -M Num steplimit      Adjustments less than steplimit msec will be slewed
                                 - It must be in the range:
                                   greater than or equal to 0
-   -o Num ntpversion     Send @var{int} as our NTP version
+   -o Num ntpversion     Send int as our NTP version
                                 - It must be in the range:
                                   0 to 7
    -r no  usereservedport Use the NTP Reserved Port (port 123)
-   -S no  step           OK to 'step' the time with @command{settimeofday(2)}
-   -s no  slew           OK to 'slew' the time with @command{adjtime(2)}
+   -S no  step           OK to 'step' the time with settimeofday(2)
+   -s no  slew           OK to 'slew' the time with adjtime(2)
    -u Num uctimeout      The number of seconds to wait for unicast responses
       no  wait           Wait for pending replies (if not setting the time)
                                 - disabled as --no-wait
@@ -220,73 +263,122 @@ The following option preset mechanisms are supported:
 please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
 
+


-Next: , +Next: , Previous: sntp usage, Up: sntp Invocation -
+ +
+ +

ipv4 option (-4)

+ +

+This is the “force ipv4 dns name resolution” option. + +

This option has some usage constraints. It: +

    +
  • must not appear in combination with any of the following options: +ipv6. +
+ +

Force DNS resolution of the following host names on the command line +to the IPv4 namespace. +

+ +


+Next: , +Previous: sntp ipv4, +Up: sntp Invocation + +
+ +

ipv6 option (-6)

+ +

+This is the “force ipv6 dns name resolution” option. + +

This option has some usage constraints. It: +

    +
  • must not appear in combination with any of the following options: +ipv4. +
+ +

Force DNS resolution of the following host names on the command line +to the IPv6 namespace. +

+ +


+Next: , +Previous: sntp ipv6, +Up: sntp Invocation +

authentication option (-a)

-

+

This is the “enable authentication with the key auth-keynumber” option. +This option takes an argument number auth-keynumber. This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the -keyfile option (-k) for more details. - +keyfile option (-k) for more details.

+


-Next: , +Next: , Previous: sntp authentication, Up: sntp Invocation -
+

bctimeout option (-B)

-

+

This is the “the number of seconds to wait for broadcasts” option. +This option takes an argument number seconds. When waiting for a broadcast packet sntp will wait the number -of seconds specified before giving up. - +of seconds specified before giving up.

+


-Next: , +Next: , Previous: sntp bctimeout, Up: sntp Invocation -
+

broadcast option (-b)

-

-This is the “listen to the address specified for broadcast time sync” option. +

+This is the “listen to the address specified for broadcast time sync” option. +This option takes an argument string broadcast-address. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • may appear an unlimited number of times.

If specified sntp will listen to the specified address for NTP broadcasts. The default maximum wait time -can be modified with -B. - +can be modified with -B.

+


-Next: , +Next: , Previous: sntp broadcast, Up: sntp Invocation -
+

concurrent option (-c)

-

-This is the “concurrently query all ips returned for host-name” option. +

+This is the “concurrently query all ips returned for host-name” option. +This option takes an argument string host-name. -

This option has some usage constraints. It: +

This option has some usage constraints. It:

  • may appear an unlimited number of times.
@@ -297,291 +389,349 @@ as part of a DNS lookup are assumed to be for a single instance of ntpd, and therefore sntp will send queries to these IPs one after another, with a 2-second gap in between each query. -

The -c or --concurrent flag says that any IPs +

The -c or --concurrent flag says that any IPs returned for the DNS lookup of the supplied host-name are on -different machines, so we can send concurrent queries. - +different machines, so we can send concurrent queries.

+


-Next: , +Next: , Previous: sntp concurrent, Up: sntp Invocation -
-
-

debug-level option (-d)

- -

-This is the “increase debug verbosity level” option. - -

This option has some usage constraints. It: -

    -
  • may appear an unlimited number of times. -
- -
-


-Next: , -Previous: sntp debug-level, -Up: sntp Invocation -

gap option (-g)

-

+

This is the “the gap (in milliseconds) between time requests” option. +This option takes an argument number milliseconds. Since we're only going to use the first valid response we get and there is benefit to specifying a good number of servers to query, separate the queries we send out by the specified number of -milliseconds. - +milliseconds.

+


-Next: , +Next: , Previous: sntp gap, Up: sntp Invocation -
-
- -

ipv4 option (-4)

- -

-This is the “force ipv4 dns name resolution” option. - -

This option has some usage constraints. It: -

    -
  • must not appear in combination with any of the following options: -ipv6. -
- -

Force DNS resolution of the following host names on the command line -to the IPv4 namespace. -

-


-Next: , -Previous: sntp ipv4, -Up: sntp Invocation -
-

ipv6 option (-6)

- -

-This is the “force ipv6 dns name resolution” option. - -

This option has some usage constraints. It: -

    -
  • must not appear in combination with any of the following options: -ipv4. -
- -

Force DNS resolution of the following host names on the command line -to the IPv6 namespace. +

kod option (-K)

+

+This is the “kod history filename” option. +This option takes an argument file file-name. +Specifies the filename to be used for the persistent history of KoD +responses received from servers.

+


-Next: , -Previous: sntp ipv6, +Next: , +Previous: sntp kod, Up: sntp Invocation -
+

keyfile option (-k)

-This is the “look in this file for the key specified with -a” option. +This is the “look in this file for the key specified with -a” option. +This option takes an argument file file-name. This option specifies the keyfile. -sntp will search for the key specified with -a -keyno in this file. Key files follow the following format: +sntp will search for the key specified with -a +keyno in this file. Key files follow the following format: -

keyid keytype key +

keyid keytype key -

Where keyid is a number identifying this key -keytype is one of the following: +

Where keyid is a number identifying this key +keytype is one of the following: S Key is a 64 Bit hexadecimal number as specified in in the DES specification. N Key is a 64 Bit hexadecimal number as specified in the NTP standard. A Key is a 1-to-8 character ASCII string. M Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. -

For more information see ntp.keys(5). - +

For more information see ntp.keys(5).

+


-Next: , +Next: , Previous: sntp keyfile, Up: sntp Invocation -
-
-

kod option (-K)

+
-

-This is the “kod history filename” option. -Specifies the filename to be used for the persistent history of KoD -responses received from servers. +

logfile option (-l)

+

+This is the “log to specified logfile” option. +This option takes an argument file file-name. +This option causes the client to write log messages to the specified +logfile.

+


-Next: , -Previous: sntp kod, +Next: , +Previous: sntp logfile, Up: sntp Invocation -
-
-

logfile option (-l)

+
-

-This is the “log to specified logfile” option. -This option causes the client to write log messages to the specified -logfile. +

steplimit option (-M)

+

+This is the “adjustments less than steplimit msec will be slewed” option. +This option takes an argument number. +If the time adjustment is less than steplimit milliseconds, +slew the amount using adjtime(2). Otherwise, step the +correction using settimeofday(2).

+


-Next: , -Previous: sntp logfile, +Next: , +Previous: sntp steplimit, Up: sntp Invocation -
+

ntpversion option (-o)

This is the “send int as our ntp version” option. +This option takes an argument number. When sending requests to a remote server, tell them we are running -NTP protocol version ntpversion . - +NTP protocol version ntpversion .

+


-Next: , +Next: , Previous: sntp ntpversion, Up: sntp Invocation -
-
- -

set-debug-level option (-D)

-

-This is the “set the debug verbosity level” option. +

-

This option has some usage constraints. It: -

    -
  • may appear an unlimited number of times. -
+

usereservedport option (-r)

+

+This is the “use the ntp reserved port (port 123)” option. +Use port 123, which is reserved for NTP, for our network +communications.

+


-Next: , -Previous: sntp set-debug-level, +Next: , +Previous: sntp usereservedport, Up: sntp Invocation -
-
-

slew option (-s)

+
-

-This is the “ok to 'slew' the time with adjtime(2)” option. +

uctimeout option (-u)

+

+This is the “the number of seconds to wait for unicast responses” option. +This option takes an argument number seconds. +When waiting for a unicast reply, sntp will wait the number +of seconds specified before giving up.

+


-Next: , -Previous: sntp slew, +Next: , +Previous: sntp uctimeout, Up: sntp Invocation -
+
-

step option (-S)

+

wait option

-

-This is the “ok to 'step' the time with settimeofday(2)” option. +

+This is the “wait for pending replies (if not setting the time)” option. + +

This option has some usage constraints. It: +

    +
  • is enabled by default. +
+ +

If we are not setting the time, wait for all pending responses.

+


-Next: , -Previous: sntp step, +Next: , +Previous: sntp wait, Up: sntp Invocation -
+
-

steplimit option (-M)

+

presetting/configuring sntp

-

-This is the “adjustments less than steplimit msec will be slewed” option. -If the time adjustment is less than steplimit milliseconds, -slew the amount using adjtime(2). Otherwise, step the -correction using settimeofday(2). +

Any option that is not marked as not presettable may be preset by +loading values from configuration ("rc" or "ini") files, and values from environment variables named SNTP and SNTP_<OPTION_NAME>. <OPTION_NAME> must be one of +the options listed above in upper case and segmented with underscores. +The SNTP variable will be tokenized and parsed like +the command line. The remaining variables are tested for existence and their +values are treated like option arguments. + +

libopts will search in 2 places for configuration files: +

    +
  • $HOME +
  • $PWD +
+ The environment variables HOME, and PWD +are expanded and replaced when sntp runs. +For any of these that are plain files, they are simply processed. +For any that are directories, then a file named .ntprc is searched for +within that directory and processed. + +

Configuration files may be in a wide variety of formats. +The basic format is an option name followed by a value (argument) on the +same line. Values may be separated from the option name with a colon, +equal sign or simply white space. Values may be continued across multiple +lines by escaping the newline with a backslash. + +

Multiple programs may also share the same initialization file. +Common options are collected at the top, followed by program specific +segments. The segments are separated by lines like: +

    [SNTP]
+
+

or by +

    <?program sntp>
+
+

Do not mix these styles within one configuration file. + +

Compound values and carefully constructed string values may also be +specified using XML syntax: +

    <option-name>
+       <sub-opt>...&lt;...&gt;...</sub-opt>
+    </option-name>
+
+

yielding an option-name.sub-opt string value of +

    "...<...>..."
+
+

AutoOpts does not track suboptions. You simply note that it is a +hierarchicly valued option. AutoOpts does provide a means for searching +the associated name/value pair list (see: optionFindValue). + +

The command line options relating to configuration and/or usage help are: + +

version (-)
+ +

Print the program version to standard out, optionally with licensing +information, then exit 0. The optional argument specifies how much licensing +detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. Only the +first letter of the argument is examined: + +

+
version
Only print the version. This is the default. +
copyright
Name the copyright usage licensing terms. +
verbose
Print the full copyright usage licensing terms. +
+


-Next: , -Previous: sntp steplimit, +Next: , +Previous: sntp config, Up: sntp Invocation -
-
-

uctimeout option (-u)

+
-

-This is the “the number of seconds to wait for unicast responses” option. -When waiting for a unicast reply, sntp will wait the number -of seconds specified before giving up. +

sntp exit status

-
+

One of the following exit values will be returned: +

+
0 (EXIT_SUCCESS)
Successful program execution. +
1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid. +
66 (EX_NOINPUT)
A specified configuration file could not be loaded. +
70 (EX_SOFTWARE)
libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +
+
+


-Next: , -Previous: sntp uctimeout, +Next: , +Previous: sntp exit status, Up: sntp Invocation -
-
-

usereservedport option (-r)

+
-

-This is the “use the ntp reserved port (port 123)” option. -Use port 123, which is reserved for NTP, for our network -communications. +

sntp Usage

+ +
+
Li
is the simplest use of this program +and can be run as an unprivileged command +to check the current time and error in the local clock. +
Li
With suitable privilege, +run as a command +or from a +cron(8) +job, +.Ic +"sntp +-a" +will reset the local clock from a synchronized specified server, +like the (deprecated) +ntpdate(1ntpdatemdoc), +or +rdate(8) +commands.
+


-Previous: sntp usereservedport, +Next: , +Previous: sntp Usage, Up: sntp Invocation -
+
-

wait option

+

sntp Authors

+ +

.An +"Johannes +Maximilian +Kuehn" +.An +"Harlan +Stenn" +.An +"Dave +Hart" +

+ +


+Previous: sntp Authors, +Up: sntp Invocation -

-This is the “wait for pending replies (if not setting the time)” option. +

-

This option has some usage constraints. It: -

    -
  • is enabled by default. -
+

sntp Bugs

-

If we are not setting the time, wait for all pending responses. +

Please report bugs to http://bugs.ntp.org .

-


-
+


+ +
- +

Usage

-

The simplest use of this program is as an unprivileged command to +

The simplest use of this program is as an unprivileged command to check the current time, offset, and error in the local clock. For example: -

    sntp ntpserver.somewhere
+     
         sntp ntpserver.somewhere
 
-

With suitable privilege, it can be run as a command or in a +

With suitable privilege, it can be run as a command or in a crom job to reset the local clock from a reliable server, like the ntpdate and rdate commands. For example: -

    sntp -a ntpserver.somewhere
+     
         sntp -a ntpserver.somewhere
 
- + diff --git a/sntp/sntp.man.in b/sntp/sntp.man.in index 59ab36fd42..cd63efccc4 100644 --- a/sntp/sntp.man.in +++ b/sntp/sntp.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (sntp-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:33:01 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:59:09 PM by AutoGen 5.16.2 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .\" @@ -14,7 +14,7 @@ sntp \- standard Simple Network Time Protocol client program .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ hostname-or-IP ...] .PP .SH DESCRIPTION -.B +.B XXX Program Name can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or from a @@ -73,13 +73,13 @@ Force DNS resolution of the following host names on the command line to the IPv6 namespace. .TP .BR \-a " \fIauth\-keynumber\fP, " \-\-authentication "=" \fIauth\-keynumber\fP -Enable authentication with the key @var{auth-keynumber}. +Enable authentication with the key \fBauth-keynumber\fP. This option takes an integer number as its argument. .sp This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the -keyfile option (@option{-k}) for more details. +keyfile option (\fB-k\fP) for more details. .TP .BR \-B " \fIseconds\fP, " \-\-bctimeout "=" \fIseconds\fP The number of seconds to wait for broadcasts. @@ -88,16 +88,16 @@ The default \fIseconds\fP for this option is: .ti +4 68 .sp -When waiting for a broadcast packet @code{sntp} will wait the number +When waiting for a broadcast packet \fBsntp\fP will wait the number of seconds specified before giving up. .TP .BR \-b " \fIbroadcast\-address\fP, " \-\-broadcast "=" \fIbroadcast\-address\fP Listen to the address specified for broadcast time sync. This option may appear an unlimited number of times. .sp -If specified @code{sntp} will listen to the specified address +If specified \fBsntp\fP will listen to the specified address for NTP broadcasts. The default maximum wait time -can be modified with @option{-B}. +can be modified with \fB-B\fP. .TP .BR \-c " \fIhost\-name\fP, " \-\-concurrent "=" \fIhost\-name\fP Concurrently query all IPs returned for host-name. @@ -106,9 +106,9 @@ This option may appear an unlimited number of times. Requests from an NTP "client" to a "server" should never be sent more rapidly than one every 2 seconds. By default, any IPs returned as part of a DNS lookup are assumed to be for a single instance of -ntpd, and therefore @code{sntp} will send queries to these IPs one +ntpd, and therefore \fBsntp\fP will send queries to these IPs one after another, with a 2-second gap in between each query. -The @option{-c} or @option{--concurrent} flag says that any IPs +The \fB-c\fP or \fB--concurrent\fP flag says that any IPs returned for the DNS lookup of the supplied host-name are on different machines, so we can send concurrent queries. .TP @@ -144,28 +144,28 @@ Specifies the filename to be used for the persistent history of KoD responses received from servers. .TP .BR \-k " \fIfile\-name\fP, " \-\-keyfile "=" \fIfile\-name\fP -Look in this file for the key specified with @option{-a}. +Look in this file for the key specified with \fB-a\fP. .sp This option specifies the keyfile. -@code{sntp} will search for the key specified with @option{-a} -@file{keyno} in this file. Key files follow the following format: -@file{keyid keytype key} -Where @file{keyid} is a number identifying this key -@file{keytype} is one of the following: -@code{S} Key is a 64 Bit hexadecimal number as specified in in the DES specification. -@code{N} Key is a 64 Bit hexadecimal number as specified in the NTP standard. -@code{A} Key is a 1-to-8 character ASCII string. -@code{M} Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. -For more information see @command{ntp.keys(5)}. +\fBsntp\fP will search for the key specified with \fB-a\fP +\fIkeyno\fP in this file. Key files follow the following format: +\fIkeyid keytype key\fP +Where \fIkeyid\fP is a number identifying this key +\fIkeytype\fP is one of the following: +\fBS\fP Key is a 64 Bit hexadecimal number as specified in in the DES specification. +\fBN\fP Key is a 64 Bit hexadecimal number as specified in the NTP standard. +\fBA\fP Key is a 1-to-8 character ASCII string. +\fBM\fP Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. +For more information see \fBntp.keys(5)\fP. .TP .BR \-l " \fIfile\-name\fP, " \-\-logfile "=" \fIfile\-name\fP Log to specified logfile. .sp This option causes the client to write log messages to the specified -@file{logfile}. +\fIlogfile\fP. .TP .BR \-M " \fInumber\fP, " \-\-steplimit "=" \fInumber\fP -Adjustments less than @var{steplimit} msec will be slewed. +Adjustments less than \fBsteplimit\fP msec will be slewed. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -175,12 +175,12 @@ greater than or equal to 0 .fi .in -4 .sp -If the time adjustment is less than @file{steplimit} milliseconds, -slew the amount using @command{adjtime(2)}. Otherwise, step the -correction using @command{settimeofday(2)}. +If the time adjustment is less than \fIsteplimit\fP milliseconds, +slew the amount using \fBadjtime(2)\fP. Otherwise, step the +correction using \fBsettimeofday(2)\fP. .TP .BR \-o " \fInumber\fP, " \-\-ntpversion "=" \fInumber\fP -Send @var{int} as our NTP version. +Send \fBint\fP as our NTP version. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -194,7 +194,7 @@ The default \fInumber\fP for this option is: 4 .sp When sending requests to a remote server, tell them we are running -NTP protocol version @file{ntpversion} . +NTP protocol version \fIntpversion\fP . .TP .BR \-r ", " -\-usereservedport Use the NTP Reserved Port (port 123). @@ -203,11 +203,11 @@ Use port 123, which is reserved for NTP, for our network communications. .TP .BR \-S ", " -\-step -OK to 'step' the time with @command{settimeofday(2)}. +OK to 'step' the time with \fBsettimeofday(2)\fP. .sp .TP .BR \-s ", " -\-slew -OK to 'slew' the time with @command{adjtime(2)}. +OK to 'slew' the time with \fBadjtime(2)\fP. .sp .TP .BR \-u " \fIseconds\fP, " \-\-uctimeout "=" \fIseconds\fP @@ -217,7 +217,7 @@ The default \fIseconds\fP for this option is: .ti +4 5 .sp -When waiting for a unicast reply, @code{sntp} will wait the number +When waiting for a unicast reply, \fBsntp\fP will wait the number of seconds specified before giving up. .TP .BR \-\-wait, " \fB\-\-no\-wait\fP" @@ -287,11 +287,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH AUTHORS .An "Johannes Maximilian Kuehn" .An "Harlan Stenn" diff --git a/sntp/sntp.mdoc.in b/sntp/sntp.mdoc.in index 4cbabf7a88..88ce5afba2 100644 --- a/sntp/sntp.mdoc.in +++ b/sntp/sntp.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt SNTP @SNTP_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:33:04 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:59:04 PM by AutoGen 5.16.2 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -75,13 +75,13 @@ ipv4. Force DNS resolution of the following host names on the command line to the IPv6 namespace. .It \-a " \fIauth\-keynumber\fP, " \-\-authentication "=" \fIauth\-keynumber\fP -Enable authentication with the key @var{auth-keynumber}. +Enable authentication with the key \fBauth\-keynumber\fP. This option takes an integer number as its argument. .sp This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the -keyfile option (@option{-k}) for more details. +keyfile option (\fB\-k\fP) for more details. .It \-B " \fIseconds\fP, " \-\-bctimeout "=" \fIseconds\fP The number of seconds to wait for broadcasts. This option takes an integer number as its argument. @@ -89,35 +89,38 @@ The default \fIseconds\fP for this option is: .ti +4 68 .sp -When waiting for a broadcast packet @code{sntp} will wait the number +When waiting for a broadcast packet \fBsntp\fP will wait the number of seconds specified before giving up. .It \-b " \fIbroadcast\-address\fP, " \-\-broadcast "=" \fIbroadcast\-address\fP Listen to the address specified for broadcast time sync. This option may appear an unlimited number of times. .sp -If specified @code{sntp} will listen to the specified address +If specified \fBsntp\fP will listen to the specified address for NTP broadcasts. The default maximum wait time -can be modified with @option{-B}. +can be modified with \fB\-B\fP. .It \-c " \fIhost\-name\fP, " \-\-concurrent "=" \fIhost\-name\fP -Concurrently query all IPs returned for host-name. +Concurrently query all IPs returned for host\-name. This option may appear an unlimited number of times. .sp Requests from an NTP "client" to a "server" should never be sent more rapidly than one every 2 seconds. By default, any IPs returned as part of a DNS lookup are assumed to be for a single instance of -ntpd, and therefore @code{sntp} will send queries to these IPs one -after another, with a 2-second gap in between each query. -The @option{-c} or @option{--concurrent} flag says that any IPs -returned for the DNS lookup of the supplied host-name are on +ntpd, and therefore \fBsntp\fP will send queries to these IPs one +after another, with a 2\-second gap in between each query. +.sp +The \fB\-c\fP or \fB\-\-concurrent\fP flag says that any IPs +returned for the DNS lookup of the supplied host\-name are on different machines, so we can send concurrent queries. .It \-d ", " -\-debug\-level Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-g " \fImilliseconds\fP, " \-\-gap "=" \fImilliseconds\fP The gap (in milliseconds) between time requests. This option takes an integer number as its argument. @@ -138,26 +141,29 @@ The default \fIfile\-name\fP for this option is: Specifies the filename to be used for the persistent history of KoD responses received from servers. .It \-k " \fIfile\-name\fP, " \-\-keyfile "=" \fIfile\-name\fP -Look in this file for the key specified with @option{-a}. +Look in this file for the key specified with \fB\-a\fP. .sp This option specifies the keyfile. -@code{sntp} will search for the key specified with @option{-a} -@file{keyno} in this file. Key files follow the following format: -@file{keyid keytype key} -Where @file{keyid} is a number identifying this key -@file{keytype} is one of the following: -@code{S} Key is a 64 Bit hexadecimal number as specified in in the DES specification. -@code{N} Key is a 64 Bit hexadecimal number as specified in the NTP standard. -@code{A} Key is a 1-to-8 character ASCII string. -@code{M} Key is a 1-to-8 character ASCII string using the MD5 authentication scheme. -For more information see @command{ntp.keys(5)}. +\fBsntp\fP will search for the key specified with \fB\-a\fP +\fIkeyno\fP in this file. Key files follow the following format: +.sp +\fIkeyid keytype key\fP +.sp +Where \fIkeyid\fP is a number identifying this key +\fIkeytype\fP is one of the following: +\fBS\fP Key is a 64 Bit hexadecimal number as specified in in the DES specification. +\fBN\fP Key is a 64 Bit hexadecimal number as specified in the NTP standard. +\fBA\fP Key is a 1\-to\-8 character ASCII string. +\fBM\fP Key is a 1\-to\-8 character ASCII string using the MD5 authentication scheme. +.sp +For more information see \fBntp.keys(5)\fP. .It \-l " \fIfile\-name\fP, " \-\-logfile "=" \fIfile\-name\fP Log to specified logfile. .sp This option causes the client to write log messages to the specified -@file{logfile}. +\fIlogfile\fP. .It \-M " \fInumber\fP, " \-\-steplimit "=" \fInumber\fP -Adjustments less than @var{steplimit} msec will be slewed. +Adjustments less than \fBsteplimit\fP msec will be slewed. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -167,11 +173,11 @@ greater than or equal to 0 .fi .in -4 .sp -If the time adjustment is less than @file{steplimit} milliseconds, -slew the amount using @command{adjtime(2)}. Otherwise, step the -correction using @command{settimeofday(2)}. +If the time adjustment is less than \fIsteplimit\fP milliseconds, +slew the amount using \fBadjtime(2)\fP. Otherwise, step the +correction using \fBsettimeofday(2)\fP. .It \-o " \fInumber\fP, " \-\-ntpversion "=" \fInumber\fP -Send @var{int} as our NTP version. +Send \fBint\fP as our NTP version. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 @@ -185,17 +191,19 @@ The default \fInumber\fP for this option is: 4 .sp When sending requests to a remote server, tell them we are running -NTP protocol version @file{ntpversion} . +NTP protocol version \fIntpversion\fP . .It \-r ", " -\-usereservedport Use the NTP Reserved Port (port 123). .sp Use port 123, which is reserved for NTP, for our network communications. .It \-S ", " -\-step -OK to 'step' the time with @command{settimeofday(2)}. +OK to 'step' the time with \fBsettimeofday(2)\fP. +.sp .sp .It \-s ", " -\-slew -OK to 'slew' the time with @command{adjtime(2)}. +OK to 'slew' the time with \fBadjtime(2)\fP. +.sp .sp .It \-u " \fIseconds\fP, " \-\-uctimeout "=" \fIseconds\fP The number of seconds to wait for unicast responses. @@ -204,7 +212,7 @@ The default \fIseconds\fP for this option is: .ti +4 5 .sp -When waiting for a unicast reply, @code{sntp} will wait the number +When waiting for a unicast reply, \fBsntp\fP will wait the number of seconds specified before giving up. .It \-\-wait, " \fB\-\-no\-wait\fP" Wait for pending replies (if not setting the time). @@ -269,10 +277,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh AUTHORS .An "Johannes Maximilian Kuehn" diff --git a/util/invoke-ntp-keygen.texi b/util/invoke-ntp-keygen.texi index c1e53a121f..e5c7a1aaef 100644 --- a/util/invoke-ntp-keygen.texi +++ b/util/invoke-ntp-keygen.texi @@ -6,287 +6,930 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi) # -# It has been AutoGen-ed August 11, 2012 at 11:32:53 AM by AutoGen 5.14 +# It has been AutoGen-ed August 11, 2012 at 08:58:43 PM by AutoGen 5.16.2 # From the definitions ntp-keygen-opts.def # and the template file agtexi-cmd.tpl @end ignore +This program generates cryptographic data files used by the NTPv4 +authentication and identification schemes. +It generates MD5 key files used in symmetric key cryptography. +In addition, if the OpenSSL software library has been installed, +it generates keys, certificate and identity files used in public key +cryptography. +These files are used for cookie encryption, +digital signature and challenge/response identification algorithms +compatible with the Internet standard security infrastructure. -This section was generated by @strong{AutoGen}, -using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-keygen} program. -This software is released under the NTP license, . - -@menu -* ntp-keygen usage:: ntp-keygen help/usage (-?) -* ntp-keygen certificate:: certificate option (-c) -* ntp-keygen cipher:: cipher option (-C) -* ntp-keygen id-key:: id-key option (-e) -* ntp-keygen gq-params:: gq-params option (-G) -* ntp-keygen host-key:: host-key option (-H) -* ntp-keygen iffkey:: iffkey option (-I) -* ntp-keygen ident:: ident option (-i) -* ntp-keygen lifetime:: lifetime option (-l) -* ntp-keygen md5key:: md5key option (-M) -* ntp-keygen modulus:: modulus option (-m) -* ntp-keygen pvt-cert:: pvt-cert option (-P) -* ntp-keygen pvt-passwd:: pvt-passwd option (-p) -* ntp-keygen get-pvt-passwd:: get-pvt-passwd option (-q) -* ntp-keygen sign-key:: sign-key option (-S) -* ntp-keygen subject-name:: subject-name option (-s) -* ntp-keygen trusted-cert:: trusted-cert option (-T) -* ntp-keygen mv-params:: mv-params option (-V) -* ntp-keygen mv-keys:: mv-keys option (-v) -* ntp-keygen config:: presetting/configuring ntp-keygen -* ntp-keygen exit status:: exit status -* ntp-keygen Description:: Description -* ntp-keygen Usage:: Usage -* ntp-keygen Notes:: Notes -* ntp-keygen Bugs:: Bugs -@end menu - -@node ntp-keygen usage -@subsection ntp-keygen help/usage (-?) -@cindex ntp-keygen help - -This is the automatically generated usage text for ntp-keygen. -The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!). @code{more-help} will print -the usage text by passing it through a pager program. -@code{more-help} is disabled on platforms without a working -@code{fork(2)} function. The @code{PAGER} environment variable is -used to select the program, defaulting to @file{more}. Both will exit -with a status code of 0. +All files are in PEM-encoded printable ASCII format, +so they can be embedded as MIME attachments in mail to other sites +and certificate authorities. +By default, files are not encrypted. -@exampleindent 0 -@example -ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p295 -USAGE: ntp-keygen [ - [] | --[@{=| @}] ]... - Flg Arg Option-Name Description - -c Str certificate certificate scheme - -C Str cipher privatekey cipher - -d no debug-level Increase debug verbosity level - - may appear multiple times - -D Str set-debug-level Set the debug verbosity level - - may appear multiple times - -e no id-key Write IFF or GQ identity keys - -G no gq-params Generate GQ parameters and keys - -H no host-key generate RSA host key - -I no iffkey generate IFF parameters - -i Str ident set Autokey group name - -l Num lifetime set certificate lifetime - -M no md5key generate MD5 keys - -m Num modulus modulus - - It must be in the range: - 256 to 2048 - -P no pvt-cert generate PC private certificate - -p Str pvt-passwd output private password - -q Str get-pvt-passwd input private password - -S Str sign-key generate sign key (RSA or DSA) - -s Str subject-name set host and optionally group name - -T no trusted-cert trusted certificate (TC scheme) - -V Num mv-params generate MV parameters - -v Num mv-keys update MV keys - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name or by a single -hyphen and the flag character. - - - -The following option preset mechanisms are supported: - - reading file $HOME/.ntprc - - reading file ./.ntprc - - examining environment variables named NTP_KEYGEN_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 +The +@code{ntpd(8)} +configuration command +.Ic +crypto +pw +Ar +password +specifies the read password for previously encrypted files. +The daemon expires on the spot if the password is missing +or incorrect. +For convenience, if a file has been previously encrypted, +the default read password is the name of the host running +the program. +If the previous write password is specified as the host name, +these files can be read by that host with no explicit password. -@node ntp-keygen certificate -@subsection certificate option (-c) -@cindex ntp-keygen-certificate -This is the ``certificate scheme'' option. -This option takes an argument string @file{scheme}. +File names begin with the prefix +.Cm +ntpkey_ +and end with the postfix +.Ar +_hostname.filestamp +, +where +.Ar +hostname +is the owner name, usually the string returned +by the Unix gethostname() routine, and +.Ar +filestamp +is the NTP seconds when the file was generated, in decimal digits. +This both guarantees uniqueness and simplifies maintenance +procedures, since all files can be quickly removed +by a +.Ic +rm +ntpkey\&* +command or all files generated +at a specific time can be removed by a +.Ic +rm +.Ar +\&*filestamp +command. +To further reduce the risk of misconfiguration, +the first two lines of a file contain the file name +and generation date and time as comments. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +All files are installed by default in the keys directory +.Pa +/usr/local/etc +, +which is normally in a shared filesystem +in NFS-mounted networks. +The actual location of the keys directory +and each file can be overridden by configuration commands, +but this is not recommended. +Normally, the files for each host are generated by that host +and used only by that host, although exceptions exist +as noted later on this page. -scheme is one of -RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, -DSA-SHA, or DSA-SHA1. +Normally, files containing private values, +including the host key, sign key and identification parameters, +are permitted root read/write-only; +while others containing public values are permitted world readable. +Alternatively, files containing private values can be encrypted +and these files permitted world readable, +which simplifies maintenance in shared file systems. +Since uniqueness is insured by the hostname and +file name extensions, the files for a NFS server and +dependent clients can all be installed in the same shared directory. -Select the certificate message digest/signature encryption scheme. -Note that RSA schemes must be used with a RSA sign key and DSA -schemes must be used with a DSA sign key. The default without -this option is RSA-MD5. -@node ntp-keygen cipher -@subsection cipher option (-C) -@cindex ntp-keygen-cipher +The recommended practice is to keep the file name extensions +when installing a file and to install a soft link +from the generic names specified elsewhere on this page +to the generated files. +This allows new file generations to be activated simply +by changing the link. +If a link is present, ntpd follows it to the file name +to extract the filestamp. +If a link is not present, +@code{ntpd(8)} +extracts the filestamp from the file itself. +This allows clients to verify that the file and generation times +are always current. +The +@code{ntp-keygen} +program uses the same timestamp extension for all files generated +at one time, so each generation is distinct and can be readily +recognized in monitoring data. +.Ss +Running +the +program +The safest way to run the +@code{ntp-keygen} +program is logged in directly as root. +The recommended procedure is change to the keys directory, +usually +.Pa +/usr/local/etc +, +then run the program. +When run for the first time, +or if all +.Cm +ntpkey +files have been removed, +the program generates a RSA host key file and matching RSA-MD5 certificate file, +which is all that is necessary in many cases. +The program also generates soft links from the generic names +to the respective files. +If run again, the program uses the same host key file, +but generates a new certificate file and link. -This is the ``privatekey cipher'' option. -This option takes an argument string @file{cipher}. +The host key is used to encrypt the cookie when required and so must be RSA type. +By default, the host key is also the sign key used to encrypt signatures. +When necessary, a different sign key can be specified and this can be +either RSA or DSA type. +By default, the message digest type is MD5, but any combination +of sign key type and message digest type supported by the OpenSSL library +can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 +and RIPE160 message digest algorithms. +However, the scheme specified in the certificate must be compatible +with the sign key. +Certificates using any digest algorithm are compatible with RSA sign keys; +however, only SHA and SHA1 certificates are compatible with DSA sign keys. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +Private/public key files and certificates are compatible with +other OpenSSL applications and very likely other libraries as well. +Certificates or certificate requests derived from them should be compatible +with extant industry practice, although some users might find +the interpretation of X509v3 extension fields somewhat liberal. +However, the identification parameter files, although encoded +as the other files, are probably not compatible with anything other than Autokey. -Select the cipher which is used to encrypt the files containing -private keys. The default is three-key triple DES in CBC mode, -equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers -available in "openssl -h" output. -@node ntp-keygen id-key -@subsection id-key option (-e) -@cindex ntp-keygen-id-key +Running the program as other than root and using the Unix +.Ic +su +command +to assume root may not work properly, since by default the OpenSSL library +looks for the random seed file +.Cm +.rnd +in the user home directory. +However, there should be only one +.Cm +.rnd +, +most conveniently +in the root directory, so it is convenient to define the +.Cm +$RANDFILE +environment variable used by the OpenSSL library as the path to +.Cm +/.rnd +. -This is the ``write iff or gq identity keys'' option. +Installing the keys as root might not work in NFS-mounted +shared file systems, as NFS clients may not be able to write +to the shared keys directory, even as root. +In this case, NFS clients can specify the files in another +directory such as +.Pa +/etc +using the +.Ic +keysdir +command. +There is no need for one client to read the keys and certificates +of other clients or servers, as these data are obtained automatically +by the Autokey protocol. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +Ordinarily, cryptographic files are generated by the host that uses them, +but it is possible for a trusted agent (TA) to generate these files +for other hosts; however, in such cases files should always be encrypted. +The subject name and trusted name default to the hostname +of the host generating the files, but can be changed by command line options. +It is convenient to designate the owner name and trusted name +as the subject and issuer fields, respectively, of the certificate. +The owner name is also used for the host and sign key files, +while the trusted name is used for the identity files. -Write the IFF or GQ client keys to the standard output. This is -intended for automatic key distribution by mail. -@node ntp-keygen gq-params -@subsection gq-params option (-G) -@cindex ntp-keygen-gq-params -This is the ``generate gq parameters and keys'' option. +All files are installed by default in the keys directory +.Pa +/usr/local/etc +, +which is normally in a shared filesystem +in NFS-mounted networks. +The actual location of the keys directory +and each file can be overridden by configuration commands, +but this is not recommended. +Normally, the files for each host are generated by that host +and used only by that host, although exceptions exist +as noted later on this page. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +Normally, files containing private values, +including the host key, sign key and identification parameters, +are permitted root read/write-only; +while others containing public values are permitted world readable. +Alternatively, files containing private values can be encrypted +and these files permitted world readable, +which simplifies maintenance in shared file systems. +Since uniqueness is insured by the hostname and +file name extensions, the files for a NFS server and +dependent clients can all be installed in the same shared directory. -Generate parameters and keys for the GQ identification scheme, -obsoleting any that may exist. -@node ntp-keygen host-key -@subsection host-key option (-H) -@cindex ntp-keygen-host-key - -This is the ``generate rsa host key'' option. +The recommended practice is to keep the file name extensions +when installing a file and to install a soft link +from the generic names specified elsewhere on this page +to the generated files. +This allows new file generations to be activated simply +by changing the link. +If a link is present, ntpd follows it to the file name +to extract the filestamp. +If a link is not present, +@code{ntpd(8)} +extracts the filestamp from the file itself. +This allows clients to verify that the file and generation times +are always current. +The +@code{ntp-keygen} +program uses the same timestamp extension for all files generated +at one time, so each generation is distinct and can be readily +recognized in monitoring data. +.Ss +Running +the +program +The safest way to run the +@code{ntp-keygen} +program is logged in directly as root. +The recommended procedure is change to the keys directory, +usually +.Pa +/usr/local/etc +, +then run the program. +When run for the first time, +or if all +.Cm +ntpkey +files have been removed, +the program generates a RSA host key file and matching RSA-MD5 certificate file, +which is all that is necessary in many cases. +The program also generates soft links from the generic names +to the respective files. +If run again, the program uses the same host key file, +but generates a new certificate file and link. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +The host key is used to encrypt the cookie when required and so must be RSA type. +By default, the host key is also the sign key used to encrypt signatures. +When necessary, a different sign key can be specified and this can be +either RSA or DSA type. +By default, the message digest type is MD5, but any combination +of sign key type and message digest type supported by the OpenSSL library +can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 +and RIPE160 message digest algorithms. +However, the scheme specified in the certificate must be compatible +with the sign key. +Certificates using any digest algorithm are compatible with RSA sign keys; +however, only SHA and SHA1 certificates are compatible with DSA sign keys. -Generate new host keys, obsoleting any that may exist. -@node ntp-keygen iffkey -@subsection iffkey option (-I) -@cindex ntp-keygen-iffkey +Private/public key files and certificates are compatible with +other OpenSSL applications and very likely other libraries as well. +Certificates or certificate requests derived from them should be compatible +with extant industry practice, although some users might find +the interpretation of X509v3 extension fields somewhat liberal. +However, the identification parameter files, although encoded +as the other files, are probably not compatible with anything other than Autokey. -This is the ``generate iff parameters'' option. +Running the program as other than root and using the Unix +.Ic +su +command +to assume root may not work properly, since by default the OpenSSL library +looks for the random seed file +.Cm +.rnd +in the user home directory. +However, there should be only one +.Cm +.rnd +, +most conveniently +in the root directory, so it is convenient to define the +.Cm +$RANDFILE +environment variable used by the OpenSSL library as the path to +.Cm +/.rnd +. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +Installing the keys as root might not work in NFS-mounted +shared file systems, as NFS clients may not be able to write +to the shared keys directory, even as root. +In this case, NFS clients can specify the files in another +directory such as +.Pa +/etc +using the +.Ic +keysdir +command. +There is no need for one client to read the keys and certificates +of other clients or servers, as these data are obtained automatically +by the Autokey protocol. -Generate parameters for the IFF identification scheme, obsoleting -any that may exist. -@node ntp-keygen ident -@subsection ident option (-i) -@cindex ntp-keygen-ident +Ordinarily, cryptographic files are generated by the host that uses them, +but it is possible for a trusted agent (TA) to generate these files +for other hosts; however, in such cases files should always be encrypted. +The subject name and trusted name default to the hostname +of the host generating the files, but can be changed by command line options. +It is convenient to designate the owner name and trusted name +as the subject and issuer fields, respectively, of the certificate. +The owner name is also used for the host and sign key files, +while the trusted name is used for the identity files. +seconds. +seconds. -This is the ``set autokey group name'' option. -This option takes an argument string @file{group}. +s Trusted Hosts and Groups +Each cryptographic configuration involves selection of a signature scheme +and identification scheme, called a cryptotype, +as explained in the +.Sx +Authentication +Options +section of +@code{ntp.conf(5)}. +The default cryptotype uses RSA encryption, MD5 message digest +and TC identification. +First, configure a NTP subnet including one or more low-stratum +trusted hosts from which all other hosts derive synchronization +directly or indirectly. +Trusted hosts have trusted certificates; +all other hosts have nontrusted certificates. +These hosts will automatically and dynamically build authoritative +certificate trails to one or more trusted hosts. +A trusted group is the set of all hosts that have, directly or indirectly, +a certificate trail ending at a trusted host. +The trail is defined by static configuration file entries +or dynamic means described on the +.Sx +Automatic +NTP +Configuration +Options +section of +@code{ntp.conf(5)}. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +On each trusted host as root, change to the keys directory. +To insure a fresh fileset, remove all +.Cm +ntpkey +files. +Then run +@code{ntp-keygen} +@code{-T} to generate keys and a trusted certificate. +On all other hosts do the same, but leave off the +@code{-T} flag to generate keys and nontrusted certificates. +When complete, start the NTP daemons beginning at the lowest stratum +and working up the tree. +It may take some time for Autokey to instantiate the certificate trails +throughout the subnet, but setting up the environment is completely automatic. -Set the optional Autokey group name to name. This is used in -the file name of IFF, GQ, and MV client parameters files. In -that role, the default is the host name if this option is not -provided. The group name, if specified using -i/--ident or -using -s/--subject-name following an '@' character, is also a -part of the self-signed host certificate's subject and issuer -names in the form host@group and should match the 'crypto ident' -or 'server ident' configuration in ntpd's configuration file. -@node ntp-keygen lifetime -@subsection lifetime option (-l) -@cindex ntp-keygen-lifetime +If it is necessary to use a different sign key or different digest/signature +scheme than the default, run +@code{ntp-keygen} +with the +@code{-S} @code{-Ar} @code{-type} option, where +.Ar +type +is either +.Cm +RSA +or +.Cm +DSA +. +The most often need to do this is when a DSA-signed certificate is used. +If it is necessary to use a different certificate scheme than the default, +run +@code{ntp-keygen} +with the +@code{-c} @code{-Ar} @code{-scheme} option and selected +.Ar +scheme +as needed. +f +@code{ntp-keygen} +is run again without these options, it generates a new certificate +using the same scheme and sign key. -This is the ``set certificate lifetime'' option. -This option takes an argument number @file{lifetime}. +After setting up the environment it is advisable to update certificates +from time to time, if only to extend the validity interval. +Simply run +@code{ntp-keygen} +with the same flags as before to generate new certificates +using existing keys. +However, if the host or sign key is changed, +@code{ntpd(8)} +should be restarted. +When +@code{ntpd(8)} +is restarted, it loads any new files and restarts the protocol. +Other dependent hosts will continue as usual until signatures are refreshed, +at which time the protocol is restarted. +.Ss +Identity +Schemes +As mentioned on the Autonomous Authentication page, +the default TC identity scheme is vulnerable to a middleman attack. +However, there are more secure identity schemes available, +including PC, IFF, GQ and MV described on the +.Qq +Identification +Schemes +page +(maybe available at +.Li +http://www.eecis.udel.edu/%7emills/keygen.html +) +. +These schemes are based on a TA, one or more trusted hosts +and some number of nontrusted hosts. +Trusted hosts prove identity using values provided by the TA, +while the remaining hosts prove identity using values provided +by a trusted host and certificate trails that end on that host. +The name of a trusted host is also the name of its sugroup +and also the subject and issuer name on its trusted certificate. +The TA is not necessarily a trusted host in this sense, but often is. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +In some schemes there are separate keys for servers and clients. +A server can also be a client of another server, +but a client can never be a server for another client. +In general, trusted hosts and nontrusted hosts that operate +as both server and client have parameter files that contain +both server and client keys. +Hosts that operate +only as clients have key files that contain only client keys. -Set the certificate expiration to lifetime days from now. -@node ntp-keygen md5key -@subsection md5key option (-M) -@cindex ntp-keygen-md5key +The PC scheme supports only one trusted host in the group. +On trusted host alice run +@code{ntp-keygen} +@code{-P} @code{-p} @code{-Ar} @code{-password} to generate the host key file +.Pa +ntpkey_RSAkey_ +Ns +Ar +alice.filestamp +and trusted private certificate file +.Pa +ntpkey_RSA-MD5_cert_ +Ns +Ar +alice.filestamp +. +Copy both files to all group hosts; +they replace the files which would be generated in other schemes. +On each host bob install a soft link from the generic name +.Pa +ntpkey_host_ +Ns +Ar +bob +to the host key file and soft link +.Pa +ntpkey_cert_ +Ns +Ar +bob +to the private certificate file. +Note the generic links are on bob, but point to files generated +by trusted host alice. +In this scheme it is not possible to refresh +either the keys or certificates without copying them +to all other hosts in the group. -This is the ``generate md5 keys'' option. -Generate MD5 keys, obsoleting any that may exist. -@node ntp-keygen modulus -@subsection modulus option (-m) -@cindex ntp-keygen-modulus +For the IFF scheme proceed as in the TC scheme to generate keys +and certificates for all group hosts, then for every trusted host in the group, +generate the IFF parameter file. +On trusted host alice run +@code{ntp-keygen} +@code{-T} @code{-I} @code{-p} @code{-Ar} @code{-password} to produce her parameter file +.Pa +ntpkey_IFFpar_ +Ns +Ar +alice.filestamp +, +which includes both server and client keys. +Copy this file to all group hosts that operate as both servers +and clients and install a soft link from the generic +.Pa +ntpkey_iff_ +Ns +Ar +alice +to this file. +If there are no hosts restricted to operate only as clients, +there is nothing further to do. +As the IFF scheme is independent +of keys and certificates, these files can be refreshed as needed. -This is the ``modulus'' option. -This option takes an argument number @file{modulus}. +If a rogue client has the parameter file, it could masquerade +as a legitimate server and present a middleman threat. +To eliminate this threat, the client keys can be extracted +from the parameter file and distributed to all restricted clients. +After generating the parameter file, on alice run +@code{ntp-keygen} +@code{-e} and pipe the output to a file or mail program. +Copy or mail this file to all restricted clients. +On these clients install a soft link from the generic +.Pa +ntpkey_iff_ +Ns +Ar +alice +to this file. +To further protect the integrity of the keys, +each file can be encrypted with a secret password. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +For the GQ scheme proceed as in the TC scheme to generate keys +and certificates for all group hosts, then for every trusted host +in the group, generate the IFF parameter file. +On trusted host alice run +@code{ntp-keygen} +@code{-T} @code{-G} @code{-p} @code{-Ar} @code{-password} to produce her parameter file +.Pa +ntpkey_GQpar_ +Ns +Ar +alice.filestamp +, +which includes both server and client keys. +Copy this file to all group hosts and install a soft link +from the generic +.Pa +ntpkey_gq_ +Ns +Ar +alice +to this file. +In addition, on each host bob install a soft link +from generic +.Pa +ntpkey_gq_ +Ns +Ar +bob +to this file. +As the GQ scheme updates the GQ parameters file and certificate +at the same time, keys and certificates can be regenerated as needed. -The number of bits in the prime modulus. The default is 512. -@node ntp-keygen pvt-cert -@subsection pvt-cert option (-P) -@cindex ntp-keygen-pvt-cert +For the MV scheme, proceed as in the TC scheme to generate keys +and certificates for all group hosts. +For illustration assume trish is the TA, alice one of several trusted hosts +and bob one of her clients. +On TA trish run +@code{ntp-keygen} +@code{-V} @code{-Ar} @code{-n} @code{-p} @code{-Ar} @code{-password}, where +.Ar +n +is the number of revokable keys (typically 5) to produce +the parameter file +.Pa +ntpkeys_MVpar_ +Ns +Ar +trish.filestamp +and client key files +.Pa +ntpkeys_MVkeyd_ +Ns +Ar +trish.filestamp +where +.Ar +d +is the key number (0 \&< +.Ar +d +\&< +.Ar +n +) +. +Copy the parameter file to alice and install a soft link +from the generic +.Pa +ntpkey_mv_ +Ns +Ar +alice +to this file. +Copy one of the client key files to alice for later distribution +to her clients. +It doesn't matter which client key file goes to alice, +since they all work the same way. +Alice copies the client key file to all of her cliens. +On client bob install a soft link from generic +.Pa +ntpkey_mvkey_ +Ns +Ar +bob +to the client key file. +As the MV scheme is independent of keys and certificates, +these files can be refreshed as needed. +.Ss +Command +Line +Options +@table @samp +@item Fl +Select certificate message digest/signature encryption scheme. +The +.Ar +scheme +can be one of the following: +. +Cm +RSA-MD2 +, +RSA-MD5 +, +RSA-SHA +, +RSA-SHA1 +, +RSA-MDC2 +, +RSA-RIPEMD160 +, +DSA-SHA +, +or +.Cm +DSA-SHA1 +. +Note that RSA schemes must be used with a RSA sign key and DSA +schemes must be used with a DSA sign key. +The default without this option is +.Cm +RSA-MD5 +. +@item Fl +Enable debugging. +This option displays the cryptographic data produced in eye-friendly billboards. +@item Fl +Write the IFF client keys to the standard output. +This is intended for automatic key distribution by mail. +@item Fl +Generate parameters and keys for the GQ identification scheme, +obsoleting any that may exist. +@item Fl +Generate keys for the GQ identification scheme +using the existing GQ parameters. +If the GQ parameters do not yet exist, create them first. +@item Fl +Generate new host keys, obsoleting any that may exist. +@item Fl +Generate parameters for the IFF identification scheme, +obsoleting any that may exist. +@item Fl +Set the suject name to +.Ar +name +. +This is used as the subject field in certificates +and in the file name for host and sign keys. +@item Fl +Generate MD5 keys, obsoleting any that may exist. +@item Fl +Generate a private certificate. +By default, the program generates public certificates. +@item Fl +Encrypt generated files containing private data with +.Ar +password +and the DES-CBC algorithm. +@item Fl +Set the password for reading files to password. +@item Fl +Generate a new sign key of the designated type, +obsoleting any that may exist. +By default, the program uses the host key as the sign key. +@item Fl +Set the issuer name to +.Ar +name +. +This is used for the issuer field in certificates +and in the file name for identity files. +@item Fl +Generate a trusted certificate. +By default, the program generates a non-trusted certificate. +@item Fl +Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. -This is the ``generate pc private certificate'' option. +@end multitable +.Ss +Random +Seed +File +All cryptographically sound key generation schemes must have means +to randomize the entropy seed used to initialize +the internal pseudo-random number generator used +by the library routines. +The OpenSSL library uses a designated random seed file for this purpose. +The file must be available when starting the NTP daemon and +@code{ntp-keygen} +program. +If a site supports OpenSSL or its companion OpenSSH, +it is very likely that means to do this are already available. -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize +It is important to understand that entropy must be evolved +for each generation, for otherwise the random number sequence +would be predictable. +Various means dependent on external events, such as keystroke intervals, +can be used to do this and some systems have built-in entropy sources. +Suitable means are described in the OpenSSL software documentation, +but are outside the scope of this page. -Generate a private certificate. By default, the program generates -public certificates. -@node ntp-keygen pvt-passwd -@subsection pvt-passwd option (-p) -@cindex ntp-keygen-pvt-passwd +The entropy seed used by the OpenSSL library is contained in a file, +usually called +.Cm +.rnd +, +which must be available when starting the NTP daemon +or the +@code{ntp-keygen} +program. +The NTP daemon will first look for the file +using the path specified by the +.Ic +randfile +subcommand of the +.Ic +crypto +configuration command. +If not specified in this way, or when starting the +@code{ntp-keygen} +program, +the OpenSSL library will look for the file using the path specified +by the +.Ev +RANDFILE +environment variable in the user home directory, +whether root or some other user. +If the +.Ev +RANDFILE +environment variable is not present, +the library will look for the +.Cm +.rnd +file in the user home directory. +If the file is not available or cannot be written, +the daemon exits with a message to the system log and the program +exits with a suitable error message. +.Ss +Cryptographic +Data +Files +All other file formats begin with two lines. +The first contains the file name, including the generated host name +and filestamp. +The second contains the datestamp in conventional Unix date format. +Lines beginning with # are considered comments and ignored by the +@code{ntp-keygen} +program and +@code{ntpd(8)} +daemon. +Cryptographic values are encoded first using ASN.1 rules, +then encrypted if necessary, and finally written PEM-encoded +printable ASCII format preceded and followed by MIME content identifier lines. -This is the ``output private password'' option. -This option takes an argument string @file{passwd}. +The format of the symmetric keys file is somewhat different +than the other files in the interest of backward compatibility. +Since DES-CBC is deprecated in NTPv4, the only key format of interest +is MD5 alphanumeric strings. +Following hte heard the keys are +entered one per line in the format +.D1 +Ar +keyno +type +key +where +.Ar +keyno +is a positive integer in the range 1-65,535, +.Ar +type +is the string MD5 defining the key format and +.Ar +key +is the key itself, +which is a printable ASCII string 16 characters or less in length. +Each character is chosen from the 93 printable characters +in the range 0x21 through 0x7f excluding space and the +.Ql +# +character. + +Note that the keys used by the +@code{ntpq(8)} +and +@code{ntpdc(8)} +programs +are checked against passwords requested by the programs +and entered by hand, so it is generally appropriate to specify these keys +in human readable ASCII format. + +The +@code{ntp-keygen} +program generates a MD5 symmetric keys file +.Pa +ntpkey_MD5key_ +Ns +Ar +hostname.filestamp +. +Since the file contains private shared keys, +it should be visible only to root and distributed by secure means +to other subnet hosts. +The NTP daemon loads the file +.Pa +ntp.keys +, +so +@code{ntp-keygen} +installs a soft link from this name to the generated file. +Subsequently, similar soft links must be installed by manual +or automated means on the other subnet hosts. +While this file is not used with the Autokey Version 2 protocol, +it is needed to authenticate some remote configuration commands +used by the +@code{ntpq(8)} +and +@code{ntpdc(8)} +utilities. + +This section was generated by @strong{AutoGen}, +using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-keygen} program. +This software is released under the NTP license, . + +@menu +* ntp-keygen usage:: ntp-keygen help/usage (-?) +* ntp-keygen certificate:: certificate option (-c) +* ntp-keygen cipher:: cipher option (-C) +* ntp-keygen id-key:: id-key option (-e) +* ntp-keygen gq-params:: gq-params option (-G) +* ntp-keygen host-key:: host-key option (-H) +* ntp-keygen iffkey:: iffkey option (-I) +* ntp-keygen ident:: ident option (-i) +* ntp-keygen lifetime:: lifetime option (-l) +* ntp-keygen md5key:: md5key option (-M) +* ntp-keygen modulus:: modulus option (-m) +* ntp-keygen pvt-cert:: pvt-cert option (-P) +* ntp-keygen pvt-passwd:: pvt-passwd option (-p) +* ntp-keygen get-pvt-passwd:: get-pvt-passwd option (-q) +* ntp-keygen sign-key:: sign-key option (-S) +* ntp-keygen subject-name:: subject-name option (-s) +* ntp-keygen trusted-cert:: trusted-cert option (-T) +* ntp-keygen mv-params:: mv-params option (-V) +* ntp-keygen mv-keys:: mv-keys option (-v) +* ntp-keygen config:: presetting/configuring ntp-keygen +* ntp-keygen exit status:: exit status +* ntp-keygen Usage:: Usage +* ntp-keygen Notes:: Notes +* ntp-keygen Bugs:: Bugs +@end menu + +@node ntp-keygen usage +@subsection ntp-keygen help/usage (-?) +@cindex ntp-keygen help + +This is the automatically generated usage text for ntp-keygen. +The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!). @code{more-help} will print +the usage text by passing it through a pager program. +@code{more-help} is disabled on platforms without a working +@code{fork(2)} function. The @code{PAGER} environment variable is +used to select the program, defaulting to @file{more}. Both will exit +with a status code of 0. + +@exampleindent 0 +@example +ntp-keygen is unavailable - no -? +@end example +@exampleindent 4 + +@node ntp-keygen certificate +@subsection certificate option (-c) +@cindex ntp-keygen-certificate + +This is the ``certificate scheme'' option. +This option takes an argument string @file{scheme}. @noindent This option has some usage constraints. It: @@ -295,10 +938,182 @@ This option has some usage constraints. It: must be compiled in by defining @code{AUTOKEY} during the compilation. @end itemize -Encrypt generated files containing private data with the specified -password and the cipher selected with -C/--cipher. -@node ntp-keygen get-pvt-passwd -@subsection get-pvt-passwd option (-q) +scheme is one of +RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, +DSA-SHA, or DSA-SHA1. + +Select the certificate message digest/signature encryption scheme. +Note that RSA schemes must be used with a RSA sign key and DSA +schemes must be used with a DSA sign key. The default without +this option is RSA-MD5. +@node ntp-keygen cipher +@subsection cipher option (-C) +@cindex ntp-keygen-cipher + +This is the ``privatekey cipher'' option. +This option takes an argument string @file{cipher}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Select the cipher which is used to encrypt the files containing +private keys. The default is three-key triple DES in CBC mode, +equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers +available in "openssl -h" output. +@node ntp-keygen id-key +@subsection id-key option (-e) +@cindex ntp-keygen-id-key + +This is the ``write iff or gq identity keys'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Write the IFF or GQ client keys to the standard output. This is +intended for automatic key distribution by mail. +@node ntp-keygen gq-params +@subsection gq-params option (-G) +@cindex ntp-keygen-gq-params + +This is the ``generate gq parameters and keys'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Generate parameters and keys for the GQ identification scheme, +obsoleting any that may exist. +@node ntp-keygen host-key +@subsection host-key option (-H) +@cindex ntp-keygen-host-key + +This is the ``generate rsa host key'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Generate new host keys, obsoleting any that may exist. +@node ntp-keygen iffkey +@subsection iffkey option (-I) +@cindex ntp-keygen-iffkey + +This is the ``generate iff parameters'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Generate parameters for the IFF identification scheme, obsoleting +any that may exist. +@node ntp-keygen ident +@subsection ident option (-i) +@cindex ntp-keygen-ident + +This is the ``set autokey group name'' option. +This option takes an argument string @file{group}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Set the optional Autokey group name to name. This is used in +the file name of IFF, GQ, and MV client parameters files. In +that role, the default is the host name if this option is not +provided. The group name, if specified using -i/--ident or +using -s/--subject-name following an '@' character, is also a +part of the self-signed host certificate's subject and issuer +names in the form host@group and should match the 'crypto ident' +or 'server ident' configuration in ntpd's configuration file. +@node ntp-keygen lifetime +@subsection lifetime option (-l) +@cindex ntp-keygen-lifetime + +This is the ``set certificate lifetime'' option. +This option takes an argument number @file{lifetime}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Set the certificate expiration to lifetime days from now. +@node ntp-keygen md5key +@subsection md5key option (-M) +@cindex ntp-keygen-md5key + +This is the ``generate md5 keys'' option. +Generate MD5 keys, obsoleting any that may exist. +@node ntp-keygen modulus +@subsection modulus option (-m) +@cindex ntp-keygen-modulus + +This is the ``modulus'' option. +This option takes an argument number @file{modulus}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +The number of bits in the prime modulus. The default is 512. +@node ntp-keygen pvt-cert +@subsection pvt-cert option (-P) +@cindex ntp-keygen-pvt-cert + +This is the ``generate pc private certificate'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Generate a private certificate. By default, the program generates +public certificates. +@node ntp-keygen pvt-passwd +@subsection pvt-passwd option (-p) +@cindex ntp-keygen-pvt-passwd + +This is the ``output private password'' option. +This option takes an argument string @file{passwd}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Encrypt generated files containing private data with the specified +password and the cipher selected with -C/--cipher. +@node ntp-keygen get-pvt-passwd +@subsection get-pvt-passwd option (-q) @cindex ntp-keygen-get-pvt-passwd This is the ``input private password'' option. @@ -376,662 +1191,133 @@ This is the ``generate mv parameters'' option. This option takes an argument number @file{num}. @noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize - -Generate parameters and keys for the Mu-Varadharajan (MV) -identification scheme. -@node ntp-keygen mv-keys -@subsection mv-keys option (-v) -@cindex ntp-keygen-mv-keys - -This is the ``update mv keys'' option. -This option takes an argument number @file{num}. - -@noindent -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{AUTOKEY} during the compilation. -@end itemize - -This option has no @samp{doc} documentation. - - -@node ntp-keygen config -@subsection presetting/configuring ntp-keygen - -Any option that is not marked as @i{not presettable} may be preset by -loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTP-KEYGEN} and @code{NTP-KEYGEN_}. @code{} must be one of -the options listed above in upper case and segmented with underscores. -The @code{NTP-KEYGEN} variable will be tokenized and parsed like -the command line. The remaining variables are tested for existence and their -values are treated like option arguments. - - -@noindent -@code{libopts} will search in 2 places for configuration files: -@itemize @bullet -@item -$HOME -@item -$PWD -@end itemize -The environment variables @code{HOME}, and @code{PWD} -are expanded and replaced when @file{ntp-keygen} runs. -For any of these that are plain files, they are simply processed. -For any that are directories, then a file named @file{.ntprc} is searched for -within that directory and processed. - - -Configuration files may be in a wide variety of formats. -The basic format is an option name followed by a value (argument) on the -same line. Values may be separated from the option name with a colon, -equal sign or simply white space. Values may be continued across multiple -lines by escaping the newline with a backslash. - -Multiple programs may also share the same initialization file. -Common options are collected at the top, followed by program specific -segments. The segments are separated by lines like: -@example -[NTP-KEYGEN] -@end example -@noindent -or by -@example - -@end example -@noindent -Do not mix these styles within one configuration file. - -Compound values and carefully constructed string values may also be -specified using XML syntax: -@example - - ...<...>... - -@end example -@noindent -yielding an @code{option-name.sub-opt} string value of -@example -"...<...>..." -@end example -@code{AutoOpts} does not track suboptions. You simply note that it is a -hierarchicly valued option. @code{AutoOpts} does provide a means for searching -the associated name/value pair list (see: optionFindValue). - -The command line options relating to configuration and/or usage help are: - -@subsubheading version (-) - -Print the program version to standard out, optionally with licensing -information, then exit 0. The optional argument specifies how much licensing -detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. Only the -first letter of the argument is examined: - -@table @samp -@item version -Only print the version. This is the default. -@item copyright -Name the copyright usage licensing terms. -@item verbose -Print the full copyright usage licensing terms. -@end table - -@node ntp-keygen exit status -@subsection ntp-keygen exit status - -One of the following exit values will be returned: -@table @samp -@item 0 (EXIT_SUCCESS) -Successful program execution. -@item 1 (EXIT_FAILURE) -The operation failed or the command syntax was not valid. -@item 66 (EX_NOINPUT) -A specified configuration file could not be loaded. -@item 70 (EX_SOFTWARE) -libopts had an internal operational error. Please report -it to autogen-users@@lists.sourceforge.net. Thank you. -@end table -@node ntp-keygen Description -@subsection ntp-keygen Description -This program generates cryptographic data files used by the NTPv4 -authentication and identification schemes. -It generates MD5 key files used in symmetric key cryptography. -In addition, if the OpenSSL software library has been installed, -it generates keys, certificate and identity files used in public key -cryptography. -These files are used for cookie encryption, -digital signature and challenge/response identification algorithms -compatible with the Internet standard security infrastructure. -All files are in PEM-encoded printable ASCII format, -so they can be embedded as MIME attachments in mail to other sites -and certificate authorities. -By default, files are not encrypted. -The -configuration command -specifies the read password for previously encrypted files. -The daemon expires on the spot if the password is missing -or incorrect. -For convenience, if a file has been previously encrypted, -the default read password is the name of the host running -the program. -If the previous write password is specified as the host name, -these files can be read by that host with no explicit password. - -File names begin with the prefix -and end with the postfix -where -is the owner name, usually the string returned -by the Unix gethostname() routine, and -is the NTP seconds when the file was generated, in decimal digits. -This both guarantees uniqueness and simplifies maintenance -procedures, since all files can be quickly removed -by a -command or all files generated -at a specific time can be removed by a -command. -To further reduce the risk of misconfiguration, -the first two lines of a file contain the file name -and generation date and time as comments. -All files are installed by default in the keys directory -which is normally in a shared filesystem -in NFS-mounted networks. -The actual location of the keys directory -and each file can be overridden by configuration commands, -but this is not recommended. -Normally, the files for each host are generated by that host -and used only by that host, although exceptions exist -as noted later on this page. -Normally, files containing private values, -including the host key, sign key and identification parameters, -are permitted root read/write-only; -while others containing public values are permitted world readable. -Alternatively, files containing private values can be encrypted -and these files permitted world readable, -which simplifies maintenance in shared file systems. -Since uniqueness is insured by the hostname and -file name extensions, the files for a NFS server and -dependent clients can all be installed in the same shared directory. -The recommended practice is to keep the file name extensions -when installing a file and to install a soft link -from the generic names specified elsewhere on this page -to the generated files. -This allows new file generations to be activated simply -by changing the link. -If a link is present, ntpd follows it to the file name -to extract the filestamp. -If a link is not present, -extracts the filestamp from the file itself. -This allows clients to verify that the file and generation times -are always current. -The -program uses the same timestamp extension for all files generated -at one time, so each generation is distinct and can be readily -recognized in monitoring data. -The safest way to run the -program is logged in directly as root. -The recommended procedure is change to the keys directory, -usually -then run the program. -When run for the first time, -or if all -files have been removed, -the program generates a RSA host key file and matching RSA-MD5 certificate file, -which is all that is necessary in many cases. -The program also generates soft links from the generic names -to the respective files. -If run again, the program uses the same host key file, -but generates a new certificate file and link. -The host key is used to encrypt the cookie when required and so must be RSA type. -By default, the host key is also the sign key used to encrypt signatures. -When necessary, a different sign key can be specified and this can be -either RSA or DSA type. -By default, the message digest type is MD5, but any combination -of sign key type and message digest type supported by the OpenSSL library -can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 -and RIPE160 message digest algorithms. -However, the scheme specified in the certificate must be compatible -with the sign key. -Certificates using any digest algorithm are compatible with RSA sign keys; -however, only SHA and SHA1 certificates are compatible with DSA sign keys. -Private/public key files and certificates are compatible with -other OpenSSL applications and very likely other libraries as well. -Certificates or certificate requests derived from them should be compatible -with extant industry practice, although some users might find -the interpretation of X509v3 extension fields somewhat liberal. -However, the identification parameter files, although encoded -as the other files, are probably not compatible with anything other than Autokey. -Running the program as other than root and using the Unix -command -to assume root may not work properly, since by default the OpenSSL library -looks for the random seed file -in the user home directory. -However, there should be only one -most conveniently -in the root directory, so it is convenient to define the -environment variable used by the OpenSSL library as the path to -Installing the keys as root might not work in NFS-mounted -shared file systems, as NFS clients may not be able to write -to the shared keys directory, even as root. -In this case, NFS clients can specify the files in another -directory such as -using the -command. -There is no need for one client to read the keys and certificates -of other clients or servers, as these data are obtained automatically -by the Autokey protocol. -Ordinarily, cryptographic files are generated by the host that uses them, -but it is possible for a trusted agent (TA) to generate these files -for other hosts; however, in such cases files should always be encrypted. -The subject name and trusted name default to the hostname -of the host generating the files, but can be changed by command line options. -It is convenient to designate the owner name and trusted name -as the subject and issuer fields, respectively, of the certificate. -The owner name is also used for the host and sign key files, -while the trusted name is used for the identity files. - -All files are installed by default in the keys directory -which is normally in a shared filesystem -in NFS-mounted networks. -The actual location of the keys directory -and each file can be overridden by configuration commands, -but this is not recommended. -Normally, the files for each host are generated by that host -and used only by that host, although exceptions exist -as noted later on this page. -Normally, files containing private values, -including the host key, sign key and identification parameters, -are permitted root read/write-only; -while others containing public values are permitted world readable. -Alternatively, files containing private values can be encrypted -and these files permitted world readable, -which simplifies maintenance in shared file systems. -Since uniqueness is insured by the hostname and -file name extensions, the files for a NFS server and -dependent clients can all be installed in the same shared directory. -The recommended practice is to keep the file name extensions -when installing a file and to install a soft link -from the generic names specified elsewhere on this page -to the generated files. -This allows new file generations to be activated simply -by changing the link. -If a link is present, ntpd follows it to the file name -to extract the filestamp. -If a link is not present, -extracts the filestamp from the file itself. -This allows clients to verify that the file and generation times -are always current. -The -program uses the same timestamp extension for all files generated -at one time, so each generation is distinct and can be readily -recognized in monitoring data. -The safest way to run the -program is logged in directly as root. -The recommended procedure is change to the keys directory, -usually -then run the program. -When run for the first time, -or if all -files have been removed, -the program generates a RSA host key file and matching RSA-MD5 certificate file, -which is all that is necessary in many cases. -The program also generates soft links from the generic names -to the respective files. -If run again, the program uses the same host key file, -but generates a new certificate file and link. -The host key is used to encrypt the cookie when required and so must be RSA type. -By default, the host key is also the sign key used to encrypt signatures. -When necessary, a different sign key can be specified and this can be -either RSA or DSA type. -By default, the message digest type is MD5, but any combination -of sign key type and message digest type supported by the OpenSSL library -can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 -and RIPE160 message digest algorithms. -However, the scheme specified in the certificate must be compatible -with the sign key. -Certificates using any digest algorithm are compatible with RSA sign keys; -however, only SHA and SHA1 certificates are compatible with DSA sign keys. -Private/public key files and certificates are compatible with -other OpenSSL applications and very likely other libraries as well. -Certificates or certificate requests derived from them should be compatible -with extant industry practice, although some users might find -the interpretation of X509v3 extension fields somewhat liberal. -However, the identification parameter files, although encoded -as the other files, are probably not compatible with anything other than Autokey. -Running the program as other than root and using the Unix -command -to assume root may not work properly, since by default the OpenSSL library -looks for the random seed file -in the user home directory. -However, there should be only one -most conveniently -in the root directory, so it is convenient to define the -environment variable used by the OpenSSL library as the path to -Installing the keys as root might not work in NFS-mounted -shared file systems, as NFS clients may not be able to write -to the shared keys directory, even as root. -In this case, NFS clients can specify the files in another -directory such as -using the -command. -There is no need for one client to read the keys and certificates -of other clients or servers, as these data are obtained automatically -by the Autokey protocol. -Ordinarily, cryptographic files are generated by the host that uses them, -but it is possible for a trusted agent (TA) to generate these files -for other hosts; however, in such cases files should always be encrypted. -The subject name and trusted name default to the hostname -of the host generating the files, but can be changed by command line options. -It is convenient to designate the owner name and trusted name -as the subject and issuer fields, respectively, of the certificate. -The owner name is also used for the host and sign key files, -while the trusted name is used for the identity files. -seconds. -seconds. - -s Trusted Hosts and Groups -Each cryptographic configuration involves selection of a signature scheme -and identification scheme, called a cryptotype, -as explained in the -section of -The default cryptotype uses RSA encryption, MD5 message digest -and TC identification. -First, configure a NTP subnet including one or more low-stratum -trusted hosts from which all other hosts derive synchronization -directly or indirectly. -Trusted hosts have trusted certificates; -all other hosts have nontrusted certificates. -These hosts will automatically and dynamically build authoritative -certificate trails to one or more trusted hosts. -A trusted group is the set of all hosts that have, directly or indirectly, -a certificate trail ending at a trusted host. -The trail is defined by static configuration file entries -or dynamic means described on the -section of -On each trusted host as root, change to the keys directory. -To insure a fresh fileset, remove all -files. -Then run -to generate keys and a trusted certificate. -On all other hosts do the same, but leave off the -flag to generate keys and nontrusted certificates. -When complete, start the NTP daemons beginning at the lowest stratum -and working up the tree. -It may take some time for Autokey to instantiate the certificate trails -throughout the subnet, but setting up the environment is completely automatic. -If it is necessary to use a different sign key or different digest/signature -scheme than the default, run -with the -option, where -is either -or -The most often need to do this is when a DSA-signed certificate is used. -If it is necessary to use a different certificate scheme than the default, -run -with the -option and selected -as needed. -f -is run again without these options, it generates a new certificate -using the same scheme and sign key. -After setting up the environment it is advisable to update certificates -from time to time, if only to extend the validity interval. -Simply run -with the same flags as before to generate new certificates -using existing keys. -However, if the host or sign key is changed, -should be restarted. -When -is restarted, it loads any new files and restarts the protocol. -Other dependent hosts will continue as usual until signatures are refreshed, -at which time the protocol is restarted. -As mentioned on the Autonomous Authentication page, -the default TC identity scheme is vulnerable to a middleman attack. -However, there are more secure identity schemes available, -including PC, IFF, GQ and MV described on the -page -(maybe available at -These schemes are based on a TA, one or more trusted hosts -and some number of nontrusted hosts. -Trusted hosts prove identity using values provided by the TA, -while the remaining hosts prove identity using values provided -by a trusted host and certificate trails that end on that host. -The name of a trusted host is also the name of its sugroup -and also the subject and issuer name on its trusted certificate. -The TA is not necessarily a trusted host in this sense, but often is. -In some schemes there are separate keys for servers and clients. -A server can also be a client of another server, -but a client can never be a server for another client. -In general, trusted hosts and nontrusted hosts that operate -as both server and client have parameter files that contain -both server and client keys. -Hosts that operate -only as clients have key files that contain only client keys. -The PC scheme supports only one trusted host in the group. -On trusted host alice run -to generate the host key file -and trusted private certificate file -Copy both files to all group hosts; -they replace the files which would be generated in other schemes. -On each host bob install a soft link from the generic name -to the host key file and soft link -to the private certificate file. -Note the generic links are on bob, but point to files generated -by trusted host alice. -In this scheme it is not possible to refresh -either the keys or certificates without copying them -to all other hosts in the group. -For the IFF scheme proceed as in the TC scheme to generate keys -and certificates for all group hosts, then for every trusted host in the group, -generate the IFF parameter file. -On trusted host alice run -to produce her parameter file -which includes both server and client keys. -Copy this file to all group hosts that operate as both servers -and clients and install a soft link from the generic -to this file. -If there are no hosts restricted to operate only as clients, -there is nothing further to do. -As the IFF scheme is independent -of keys and certificates, these files can be refreshed as needed. -If a rogue client has the parameter file, it could masquerade -as a legitimate server and present a middleman threat. -To eliminate this threat, the client keys can be extracted -from the parameter file and distributed to all restricted clients. -After generating the parameter file, on alice run -and pipe the output to a file or mail program. -Copy or mail this file to all restricted clients. -On these clients install a soft link from the generic -to this file. -To further protect the integrity of the keys, -each file can be encrypted with a secret password. -For the GQ scheme proceed as in the TC scheme to generate keys -and certificates for all group hosts, then for every trusted host -in the group, generate the IFF parameter file. -On trusted host alice run -to produce her parameter file -which includes both server and client keys. -Copy this file to all group hosts and install a soft link -from the generic -to this file. -In addition, on each host bob install a soft link -from generic -to this file. -As the GQ scheme updates the GQ parameters file and certificate -at the same time, keys and certificates can be regenerated as needed. -For the MV scheme, proceed as in the TC scheme to generate keys -and certificates for all group hosts. -For illustration assume trish is the TA, alice one of several trusted hosts -and bob one of her clients. -On TA trish run -where -is the number of revokable keys (typically 5) to produce -the parameter file -and client key files -where -is the key number (0 \&< -\&< -Copy the parameter file to alice and install a soft link -from the generic -to this file. -Copy one of the client key files to alice for later distribution -to her clients. -It doesn't matter which client key file goes to alice, -since they all work the same way. -Alice copies the client key file to all of her cliens. -On client bob install a soft link from generic -to the client key file. -As the MV scheme is independent of keys and certificates, -these files can be refreshed as needed. +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +Generate parameters and keys for the Mu-Varadharajan (MV) +identification scheme. +@node ntp-keygen mv-keys +@subsection mv-keys option (-v) +@cindex ntp-keygen-mv-keys + +This is the ``update mv keys'' option. +This option takes an argument number @file{num}. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must be compiled in by defining @code{AUTOKEY} during the compilation. +@end itemize + +This option has no @samp{doc} documentation. + + +@node ntp-keygen config +@subsection presetting/configuring ntp-keygen + +Any option that is not marked as @i{not presettable} may be preset by +loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTP-KEYGEN} and @code{NTP-KEYGEN_}. @code{} must be one of +the options listed above in upper case and segmented with underscores. +The @code{NTP-KEYGEN} variable will be tokenized and parsed like +the command line. The remaining variables are tested for existence and their +values are treated like option arguments. + + +@noindent +@code{libopts} will search in 2 places for configuration files: +@itemize @bullet +@item +$HOME +@item +$PWD +@end itemize +The environment variables @code{HOME}, and @code{PWD} +are expanded and replaced when @file{ntp-keygen} runs. +For any of these that are plain files, they are simply processed. +For any that are directories, then a file named @file{.ntprc} is searched for +within that directory and processed. + + +Configuration files may be in a wide variety of formats. +The basic format is an option name followed by a value (argument) on the +same line. Values may be separated from the option name with a colon, +equal sign or simply white space. Values may be continued across multiple +lines by escaping the newline with a backslash. + +Multiple programs may also share the same initialization file. +Common options are collected at the top, followed by program specific +segments. The segments are separated by lines like: +@example +[NTP-KEYGEN] +@end example +@noindent +or by +@example + +@end example +@noindent +Do not mix these styles within one configuration file. + +Compound values and carefully constructed string values may also be +specified using XML syntax: +@example + + ...<...>... + +@end example +@noindent +yielding an @code{option-name.sub-opt} string value of +@example +"...<...>..." +@end example +@code{AutoOpts} does not track suboptions. You simply note that it is a +hierarchicly valued option. @code{AutoOpts} does provide a means for searching +the associated name/value pair list (see: optionFindValue). + +The command line options relating to configuration and/or usage help are: + +@subsubheading version (-) + +Print the program version to standard out, optionally with licensing +information, then exit 0. The optional argument specifies how much licensing +detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. Only the +first letter of the argument is examined: + @table @samp -@item Fl -Select certificate message digest/signature encryption scheme. -The -can be one of the following: -or -Note that RSA schemes must be used with a RSA sign key and DSA -schemes must be used with a DSA sign key. -The default without this option is -@item Fl -Enable debugging. -This option displays the cryptographic data produced in eye-friendly billboards. -@item Fl -Write the IFF client keys to the standard output. -This is intended for automatic key distribution by mail. -@item Fl -Generate parameters and keys for the GQ identification scheme, -obsoleting any that may exist. -@item Fl -Generate keys for the GQ identification scheme -using the existing GQ parameters. -If the GQ parameters do not yet exist, create them first. -@item Fl -Generate new host keys, obsoleting any that may exist. -@item Fl -Generate parameters for the IFF identification scheme, -obsoleting any that may exist. -@item Fl -Set the suject name to -This is used as the subject field in certificates -and in the file name for host and sign keys. -@item Fl -Generate MD5 keys, obsoleting any that may exist. -@item Fl -Generate a private certificate. -By default, the program generates public certificates. -@item Fl -Encrypt generated files containing private data with -and the DES-CBC algorithm. -@item Fl -Set the password for reading files to password. -@item Fl -Generate a new sign key of the designated type, -obsoleting any that may exist. -By default, the program uses the host key as the sign key. -@item Fl -Set the issuer name to -This is used for the issuer field in certificates -and in the file name for identity files. -@item Fl -Generate a trusted certificate. -By default, the program generates a non-trusted certificate. -@item Fl -Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. +@item version +Only print the version. This is the default. +@item copyright +Name the copyright usage licensing terms. +@item verbose +Print the full copyright usage licensing terms. +@end table -@end multitable -All cryptographically sound key generation schemes must have means -to randomize the entropy seed used to initialize -the internal pseudo-random number generator used -by the library routines. -The OpenSSL library uses a designated random seed file for this purpose. -The file must be available when starting the NTP daemon and -program. -If a site supports OpenSSL or its companion OpenSSH, -it is very likely that means to do this are already available. -It is important to understand that entropy must be evolved -for each generation, for otherwise the random number sequence -would be predictable. -Various means dependent on external events, such as keystroke intervals, -can be used to do this and some systems have built-in entropy sources. -Suitable means are described in the OpenSSL software documentation, -but are outside the scope of this page. -The entropy seed used by the OpenSSL library is contained in a file, -usually called -which must be available when starting the NTP daemon -or the -program. -The NTP daemon will first look for the file -using the path specified by the -subcommand of the -configuration command. -If not specified in this way, or when starting the -program, -the OpenSSL library will look for the file using the path specified -by the -environment variable in the user home directory, -whether root or some other user. -If the -environment variable is not present, -the library will look for the -file in the user home directory. -If the file is not available or cannot be written, -the daemon exits with a message to the system log and the program -exits with a suitable error message. -All other file formats begin with two lines. -The first contains the file name, including the generated host name -and filestamp. -The second contains the datestamp in conventional Unix date format. -Lines beginning with # are considered comments and ignored by the -program and -daemon. -Cryptographic values are encoded first using ASN.1 rules, -then encrypted if necessary, and finally written PEM-encoded -printable ASCII format preceded and followed by MIME content identifier lines. -The format of the symmetric keys file is somewhat different -than the other files in the interest of backward compatibility. -Since DES-CBC is deprecated in NTPv4, the only key format of interest -is MD5 alphanumeric strings. -Following hte heard the keys are -entered one per line in the format -where -is a positive integer in the range 1-65,535, -is the string MD5 defining the key format and -is the key itself, -which is a printable ASCII string 16 characters or less in length. -Each character is chosen from the 93 printable characters -in the range 0x21 through 0x7f excluding space and the -character. -Note that the keys used by the -and -programs -are checked against passwords requested by the programs -and entered by hand, so it is generally appropriate to specify these keys -in human readable ASCII format. -The -program generates a MD5 symmetric keys file -Since the file contains private shared keys, -it should be visible only to root and distributed by secure means -to other subnet hosts. -The NTP daemon loads the file -so -installs a soft link from this name to the generated file. -Subsequently, similar soft links must be installed by manual -or automated means on the other subnet hosts. -While this file is not used with the Autokey Version 2 protocol, -it is needed to authenticate some remote configuration commands -used by the -and -utilities. +@node ntp-keygen exit status +@subsection ntp-keygen exit status + +One of the following exit values will be returned: +@table @samp +@item 0 (EXIT_SUCCESS) +Successful program execution. +@item 1 (EXIT_FAILURE) +The operation failed or the command syntax was not valid. +@item 66 (EX_NOINPUT) +A specified configuration file could not be loaded. +@item 70 (EX_SOFTWARE) +libopts had an internal operational error. Please report +it to autogen-users@@lists.sourceforge.net. Thank you. +@end table @node ntp-keygen Usage @subsection ntp-keygen Usage The -option specifies the write password and -option the read password for previously encrypted files. +@code{-p} @code{-Ar} @code{-password} option specifies the write password and +@code{-q} @code{-Ar} @code{-password} option the read password for previously encrypted files. The +@code{ntp-keygen} program prompts for the password if it reads an encrypted file and the password is missing or incorrect. If an encrypted file is read successfully and @@ -1046,4 +1332,5 @@ It can take quite a while to generate some cryptographic values, from one to several minutes with modern architectures such as UltraSPARC and up to tens of minutes to an hour with older architectures such as SPARC IPC. + Please report bugs to http://bugs.ntp.org . diff --git a/util/ntp-keygen-opts.c b/util/ntp-keygen-opts.c index 02654f7045..2d1e263bdf 100644 --- a/util/ntp-keygen-opts.c +++ b/util/ntp-keygen-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) * - * It has been AutoGen-ed August 11, 2012 at 11:32:43 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:34 PM by AutoGen 5.16.2 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -36,15 +36,16 @@ * is provided "as is" without express or implied warranty. */ +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntp-keygen-opts.h" #include #include #include #include - -#define OPTION_CODE_COMPILE 1 -#include "ntp-keygen-opts.h" #include + #ifdef __cplusplus extern "C" { #endif @@ -55,10 +56,10 @@ extern FILE * option_usage_fp; #define zCopyright (ntp_keygen_opt_strs+0) #define zLicenseDescrip (ntp_keygen_opt_strs+326) -extern tUsageProc optionUsage; /* * global included definitions - */#include + */ +#include #ifdef __windows extern int atoi(const char*); @@ -73,7 +74,7 @@ extern tUsageProc optionUsage; /* * ntp-keygen option static const strings */ -static char const ntp_keygen_opt_strs[2320] = +static char const ntp_keygen_opt_strs[2322] = /* 0 */ "ntp-keygen (ntp) 4.2.7p295\n" "Copyright (C) 1970-2012 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -86,98 +87,98 @@ static char const ntp_keygen_opt_strs[2320] = "provided that the above copyright notice appears in all copies and that\n" "both the copyright notice and this permission notice appear in supporting\n" "documentation, and that the name The University of Delaware not be used in\n" - "advertising or publicity pertaining to distribution of the software\n" - "without specific, written prior permission. The University of Delaware\n" - "makes no representations about the suitability this software for any\n" - "purpose. It is provided \"as is\" without express or implied warranty.\n\0" -/* 964 */ "certificate scheme\0" -/* 983 */ "CERTIFICATE\0" -/* 995 */ "certificate\0" -/* 1007 */ "privatekey cipher\0" -/* 1025 */ "CIPHER\0" -/* 1032 */ "cipher\0" -/* 1039 */ "Increase debug verbosity level\0" -/* 1070 */ "DEBUG_LEVEL\0" -/* 1082 */ "debug-level\0" -/* 1094 */ "Set the debug verbosity level\0" -/* 1124 */ "SET_DEBUG_LEVEL\0" -/* 1140 */ "set-debug-level\0" -/* 1156 */ "Write IFF or GQ identity keys\0" -/* 1186 */ "ID_KEY\0" -/* 1193 */ "id-key\0" -/* 1200 */ "Generate GQ parameters and keys\0" -/* 1232 */ "GQ_PARAMS\0" -/* 1242 */ "gq-params\0" -/* 1252 */ "generate RSA host key\0" -/* 1274 */ "HOST_KEY\0" -/* 1283 */ "host-key\0" -/* 1292 */ "generate IFF parameters\0" -/* 1316 */ "IFFKEY\0" -/* 1323 */ "iffkey\0" -/* 1330 */ "set Autokey group name\0" -/* 1353 */ "IDENT\0" -/* 1359 */ "ident\0" -/* 1365 */ "set certificate lifetime\0" -/* 1390 */ "LIFETIME\0" -/* 1399 */ "lifetime\0" -/* 1408 */ "generate MD5 keys\0" -/* 1426 */ "MD5KEY\0" -/* 1433 */ "md5key\0" -/* 1440 */ "modulus\0" -/* 1448 */ "MODULUS\0" -/* 1456 */ "generate PC private certificate\0" -/* 1488 */ "PVT_CERT\0" -/* 1497 */ "pvt-cert\0" -/* 1506 */ "output private password\0" -/* 1530 */ "PVT_PASSWD\0" -/* 1541 */ "pvt-passwd\0" -/* 1552 */ "input private password\0" -/* 1575 */ "GET_PVT_PASSWD\0" -/* 1590 */ "get-pvt-passwd\0" -/* 1605 */ "generate sign key (RSA or DSA)\0" -/* 1636 */ "SIGN_KEY\0" -/* 1645 */ "sign-key\0" -/* 1654 */ "set host and optionally group name\0" -/* 1689 */ "SUBJECT_NAME\0" -/* 1702 */ "subject-name\0" -/* 1715 */ "trusted certificate (TC scheme)\0" -/* 1747 */ "TRUSTED_CERT\0" -/* 1760 */ "trusted-cert\0" -/* 1773 */ "generate MV parameters\0" -/* 1802 */ "MV_PARAMS\0" -/* 1812 */ "mv-params\0" -/* 1822 */ "update MV keys\0" -/* 1843 */ "MV_KEYS\0" -/* 1851 */ "mv-keys\0" -/* 1859 */ "Display extended usage information and exit\0" -/* 1903 */ "help\0" -/* 1908 */ "Extended usage information passed thru pager\0" -/* 1953 */ "more-help\0" -/* 1963 */ "Output version information and exit\0" -/* 1999 */ "version\0" -/* 2007 */ "Save the option state to a config file\0" -/* 2046 */ "save-opts\0" -/* 2056 */ "Load options from a config file\0" -/* 2088 */ "LOAD_OPTS\0" -/* 2098 */ "no-load-opts\0" -/* 2111 */ "no\0" -/* 2114 */ "NTP_KEYGEN\0" -/* 2125 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p295\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware makes no\n" + "representations about the suitability this software for any purpose. It is\n" + "provided \"as is\" without express or implied warranty.\n\0" +/* 966 */ "certificate scheme\0" +/* 985 */ "CERTIFICATE\0" +/* 997 */ "certificate\0" +/* 1009 */ "privatekey cipher\0" +/* 1027 */ "CIPHER\0" +/* 1034 */ "cipher\0" +/* 1041 */ "Increase debug verbosity level\0" +/* 1072 */ "DEBUG_LEVEL\0" +/* 1084 */ "debug-level\0" +/* 1096 */ "Set the debug verbosity level\0" +/* 1126 */ "SET_DEBUG_LEVEL\0" +/* 1142 */ "set-debug-level\0" +/* 1158 */ "Write IFF or GQ identity keys\0" +/* 1188 */ "ID_KEY\0" +/* 1195 */ "id-key\0" +/* 1202 */ "Generate GQ parameters and keys\0" +/* 1234 */ "GQ_PARAMS\0" +/* 1244 */ "gq-params\0" +/* 1254 */ "generate RSA host key\0" +/* 1276 */ "HOST_KEY\0" +/* 1285 */ "host-key\0" +/* 1294 */ "generate IFF parameters\0" +/* 1318 */ "IFFKEY\0" +/* 1325 */ "iffkey\0" +/* 1332 */ "set Autokey group name\0" +/* 1355 */ "IDENT\0" +/* 1361 */ "ident\0" +/* 1367 */ "set certificate lifetime\0" +/* 1392 */ "LIFETIME\0" +/* 1401 */ "lifetime\0" +/* 1410 */ "generate MD5 keys\0" +/* 1428 */ "MD5KEY\0" +/* 1435 */ "md5key\0" +/* 1442 */ "modulus\0" +/* 1450 */ "MODULUS\0" +/* 1458 */ "generate PC private certificate\0" +/* 1490 */ "PVT_CERT\0" +/* 1499 */ "pvt-cert\0" +/* 1508 */ "output private password\0" +/* 1532 */ "PVT_PASSWD\0" +/* 1543 */ "pvt-passwd\0" +/* 1554 */ "input private password\0" +/* 1577 */ "GET_PVT_PASSWD\0" +/* 1592 */ "get-pvt-passwd\0" +/* 1607 */ "generate sign key (RSA or DSA)\0" +/* 1638 */ "SIGN_KEY\0" +/* 1647 */ "sign-key\0" +/* 1656 */ "set host and optionally group name\0" +/* 1691 */ "SUBJECT_NAME\0" +/* 1704 */ "subject-name\0" +/* 1717 */ "trusted certificate (TC scheme)\0" +/* 1749 */ "TRUSTED_CERT\0" +/* 1762 */ "trusted-cert\0" +/* 1775 */ "generate MV parameters\0" +/* 1804 */ "MV_PARAMS\0" +/* 1814 */ "mv-params\0" +/* 1824 */ "update MV keys\0" +/* 1845 */ "MV_KEYS\0" +/* 1853 */ "mv-keys\0" +/* 1861 */ "Display extended usage information and exit\0" +/* 1905 */ "help\0" +/* 1910 */ "Extended usage information passed thru pager\0" +/* 1955 */ "more-help\0" +/* 1965 */ "Output version information and exit\0" +/* 2001 */ "version\0" +/* 2009 */ "Save the option state to a config file\0" +/* 2048 */ "save-opts\0" +/* 2058 */ "Load options from a config file\0" +/* 2090 */ "LOAD_OPTS\0" +/* 2100 */ "no-load-opts\0" +/* 2113 */ "no\0" +/* 2116 */ "NTP_KEYGEN\0" +/* 2127 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p295\n" "USAGE: %s [ - [] | --[{=| }] ]...\n\0" -/* 2241 */ ".ntprc\0" -/* 2248 */ "$HOME\0" -/* 2254 */ ".\0" -/* 2256 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 2290 */ "\n\n\0" -/* 2293 */ "ntp-keygen (ntp) 4.2.7p295"; +/* 2243 */ "$HOME\0" +/* 2249 */ ".\0" +/* 2251 */ ".ntprc\0" +/* 2258 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 2292 */ "\n\n\0" +/* 2295 */ "ntp-keygen (ntp) 4.2.7p295"; /* * certificate option description: */ #ifdef AUTOKEY -#define CERTIFICATE_DESC (ntp_keygen_opt_strs+964) -#define CERTIFICATE_NAME (ntp_keygen_opt_strs+983) -#define CERTIFICATE_name (ntp_keygen_opt_strs+995) +#define CERTIFICATE_DESC (ntp_keygen_opt_strs+966) +#define CERTIFICATE_NAME (ntp_keygen_opt_strs+985) +#define CERTIFICATE_name (ntp_keygen_opt_strs+997) #define CERTIFICATE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -192,9 +193,9 @@ static char const ntp_keygen_opt_strs[2320] = * cipher option description: */ #ifdef AUTOKEY -#define CIPHER_DESC (ntp_keygen_opt_strs+1007) -#define CIPHER_NAME (ntp_keygen_opt_strs+1025) -#define CIPHER_name (ntp_keygen_opt_strs+1032) +#define CIPHER_DESC (ntp_keygen_opt_strs+1009) +#define CIPHER_NAME (ntp_keygen_opt_strs+1027) +#define CIPHER_name (ntp_keygen_opt_strs+1034) #define CIPHER_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -208,17 +209,17 @@ static char const ntp_keygen_opt_strs[2320] = /* * debug-level option description: */ -#define DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1039) -#define DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1070) -#define DEBUG_LEVEL_name (ntp_keygen_opt_strs+1082) +#define DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1041) +#define DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1072) +#define DEBUG_LEVEL_name (ntp_keygen_opt_strs+1084) #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * set-debug-level option description: */ -#define SET_DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1094) -#define SET_DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1124) -#define SET_DEBUG_LEVEL_name (ntp_keygen_opt_strs+1140) +#define SET_DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1096) +#define SET_DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1126) +#define SET_DEBUG_LEVEL_name (ntp_keygen_opt_strs+1142) #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -226,9 +227,9 @@ static char const ntp_keygen_opt_strs[2320] = * id-key option description: */ #ifdef AUTOKEY -#define ID_KEY_DESC (ntp_keygen_opt_strs+1156) -#define ID_KEY_NAME (ntp_keygen_opt_strs+1186) -#define ID_KEY_name (ntp_keygen_opt_strs+1193) +#define ID_KEY_DESC (ntp_keygen_opt_strs+1158) +#define ID_KEY_NAME (ntp_keygen_opt_strs+1188) +#define ID_KEY_name (ntp_keygen_opt_strs+1195) #define ID_KEY_FLAGS (OPTST_DISABLED) #else /* disable id-key */ @@ -242,9 +243,9 @@ static char const ntp_keygen_opt_strs[2320] = * gq-params option description: */ #ifdef AUTOKEY -#define GQ_PARAMS_DESC (ntp_keygen_opt_strs+1200) -#define GQ_PARAMS_NAME (ntp_keygen_opt_strs+1232) -#define GQ_PARAMS_name (ntp_keygen_opt_strs+1242) +#define GQ_PARAMS_DESC (ntp_keygen_opt_strs+1202) +#define GQ_PARAMS_NAME (ntp_keygen_opt_strs+1234) +#define GQ_PARAMS_name (ntp_keygen_opt_strs+1244) #define GQ_PARAMS_FLAGS (OPTST_DISABLED) #else /* disable gq-params */ @@ -258,9 +259,9 @@ static char const ntp_keygen_opt_strs[2320] = * host-key option description: */ #ifdef AUTOKEY -#define HOST_KEY_DESC (ntp_keygen_opt_strs+1252) -#define HOST_KEY_NAME (ntp_keygen_opt_strs+1274) -#define HOST_KEY_name (ntp_keygen_opt_strs+1283) +#define HOST_KEY_DESC (ntp_keygen_opt_strs+1254) +#define HOST_KEY_NAME (ntp_keygen_opt_strs+1276) +#define HOST_KEY_name (ntp_keygen_opt_strs+1285) #define HOST_KEY_FLAGS (OPTST_DISABLED) #else /* disable host-key */ @@ -274,9 +275,9 @@ static char const ntp_keygen_opt_strs[2320] = * iffkey option description: */ #ifdef AUTOKEY -#define IFFKEY_DESC (ntp_keygen_opt_strs+1292) -#define IFFKEY_NAME (ntp_keygen_opt_strs+1316) -#define IFFKEY_name (ntp_keygen_opt_strs+1323) +#define IFFKEY_DESC (ntp_keygen_opt_strs+1294) +#define IFFKEY_NAME (ntp_keygen_opt_strs+1318) +#define IFFKEY_name (ntp_keygen_opt_strs+1325) #define IFFKEY_FLAGS (OPTST_DISABLED) #else /* disable iffkey */ @@ -290,9 +291,9 @@ static char const ntp_keygen_opt_strs[2320] = * ident option description: */ #ifdef AUTOKEY -#define IDENT_DESC (ntp_keygen_opt_strs+1330) -#define IDENT_NAME (ntp_keygen_opt_strs+1353) -#define IDENT_name (ntp_keygen_opt_strs+1359) +#define IDENT_DESC (ntp_keygen_opt_strs+1332) +#define IDENT_NAME (ntp_keygen_opt_strs+1355) +#define IDENT_name (ntp_keygen_opt_strs+1361) #define IDENT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -307,9 +308,9 @@ static char const ntp_keygen_opt_strs[2320] = * lifetime option description: */ #ifdef AUTOKEY -#define LIFETIME_DESC (ntp_keygen_opt_strs+1365) -#define LIFETIME_NAME (ntp_keygen_opt_strs+1390) -#define LIFETIME_name (ntp_keygen_opt_strs+1399) +#define LIFETIME_DESC (ntp_keygen_opt_strs+1367) +#define LIFETIME_NAME (ntp_keygen_opt_strs+1392) +#define LIFETIME_name (ntp_keygen_opt_strs+1401) #define LIFETIME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -323,18 +324,18 @@ static char const ntp_keygen_opt_strs[2320] = /* * md5key option description: */ -#define MD5KEY_DESC (ntp_keygen_opt_strs+1408) -#define MD5KEY_NAME (ntp_keygen_opt_strs+1426) -#define MD5KEY_name (ntp_keygen_opt_strs+1433) +#define MD5KEY_DESC (ntp_keygen_opt_strs+1410) +#define MD5KEY_NAME (ntp_keygen_opt_strs+1428) +#define MD5KEY_name (ntp_keygen_opt_strs+1435) #define MD5KEY_FLAGS (OPTST_DISABLED) /* * modulus option description: */ #ifdef AUTOKEY -#define MODULUS_DESC (ntp_keygen_opt_strs+1440) -#define MODULUS_NAME (ntp_keygen_opt_strs+1448) -#define MODULUS_name (ntp_keygen_opt_strs+1440) +#define MODULUS_DESC (ntp_keygen_opt_strs+1442) +#define MODULUS_NAME (ntp_keygen_opt_strs+1450) +#define MODULUS_name (ntp_keygen_opt_strs+1442) #define MODULUS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -349,9 +350,9 @@ static char const ntp_keygen_opt_strs[2320] = * pvt-cert option description: */ #ifdef AUTOKEY -#define PVT_CERT_DESC (ntp_keygen_opt_strs+1456) -#define PVT_CERT_NAME (ntp_keygen_opt_strs+1488) -#define PVT_CERT_name (ntp_keygen_opt_strs+1497) +#define PVT_CERT_DESC (ntp_keygen_opt_strs+1458) +#define PVT_CERT_NAME (ntp_keygen_opt_strs+1490) +#define PVT_CERT_name (ntp_keygen_opt_strs+1499) #define PVT_CERT_FLAGS (OPTST_DISABLED) #else /* disable pvt-cert */ @@ -365,9 +366,9 @@ static char const ntp_keygen_opt_strs[2320] = * pvt-passwd option description: */ #ifdef AUTOKEY -#define PVT_PASSWD_DESC (ntp_keygen_opt_strs+1506) -#define PVT_PASSWD_NAME (ntp_keygen_opt_strs+1530) -#define PVT_PASSWD_name (ntp_keygen_opt_strs+1541) +#define PVT_PASSWD_DESC (ntp_keygen_opt_strs+1508) +#define PVT_PASSWD_NAME (ntp_keygen_opt_strs+1532) +#define PVT_PASSWD_name (ntp_keygen_opt_strs+1543) #define PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -382,9 +383,9 @@ static char const ntp_keygen_opt_strs[2320] = * get-pvt-passwd option description: */ #ifdef AUTOKEY -#define GET_PVT_PASSWD_DESC (ntp_keygen_opt_strs+1552) -#define GET_PVT_PASSWD_NAME (ntp_keygen_opt_strs+1575) -#define GET_PVT_PASSWD_name (ntp_keygen_opt_strs+1590) +#define GET_PVT_PASSWD_DESC (ntp_keygen_opt_strs+1554) +#define GET_PVT_PASSWD_NAME (ntp_keygen_opt_strs+1577) +#define GET_PVT_PASSWD_name (ntp_keygen_opt_strs+1592) #define GET_PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -399,9 +400,9 @@ static char const ntp_keygen_opt_strs[2320] = * sign-key option description: */ #ifdef AUTOKEY -#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1605) -#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1636) -#define SIGN_KEY_name (ntp_keygen_opt_strs+1645) +#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1607) +#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1638) +#define SIGN_KEY_name (ntp_keygen_opt_strs+1647) #define SIGN_KEY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -416,9 +417,9 @@ static char const ntp_keygen_opt_strs[2320] = * subject-name option description: */ #ifdef AUTOKEY -#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1654) -#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1689) -#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1702) +#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1656) +#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1691) +#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1704) #define SUBJECT_NAME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -433,9 +434,9 @@ static char const ntp_keygen_opt_strs[2320] = * trusted-cert option description: */ #ifdef AUTOKEY -#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1715) -#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1747) -#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1760) +#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1717) +#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1749) +#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1762) #define TRUSTED_CERT_FLAGS (OPTST_DISABLED) #else /* disable trusted-cert */ @@ -449,9 +450,9 @@ static char const ntp_keygen_opt_strs[2320] = * mv-params option description: */ #ifdef AUTOKEY -#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1773) -#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1802) -#define MV_PARAMS_name (ntp_keygen_opt_strs+1812) +#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1775) +#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1804) +#define MV_PARAMS_name (ntp_keygen_opt_strs+1814) #define MV_PARAMS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -466,9 +467,9 @@ static char const ntp_keygen_opt_strs[2320] = * mv-keys option description: */ #ifdef AUTOKEY -#define MV_KEYS_DESC (ntp_keygen_opt_strs+1822) -#define MV_KEYS_NAME (ntp_keygen_opt_strs+1843) -#define MV_KEYS_name (ntp_keygen_opt_strs+1851) +#define MV_KEYS_DESC (ntp_keygen_opt_strs+1824) +#define MV_KEYS_NAME (ntp_keygen_opt_strs+1845) +#define MV_KEYS_name (ntp_keygen_opt_strs+1853) #define MV_KEYS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -482,11 +483,11 @@ static char const ntp_keygen_opt_strs[2320] = /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntp_keygen_opt_strs+1859) -#define HELP_name (ntp_keygen_opt_strs+1903) +#define HELP_DESC (ntp_keygen_opt_strs+1861) +#define HELP_name (ntp_keygen_opt_strs+1905) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntp_keygen_opt_strs+1908) -#define MORE_HELP_name (ntp_keygen_opt_strs+1953) +#define MORE_HELP_DESC (ntp_keygen_opt_strs+1910) +#define MORE_HELP_name (ntp_keygen_opt_strs+1955) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -499,14 +500,14 @@ static char const ntp_keygen_opt_strs[2320] = # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntp_keygen_opt_strs+1963) -#define VER_name (ntp_keygen_opt_strs+1999) -#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2007) -#define SAVE_OPTS_name (ntp_keygen_opt_strs+2046) -#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2056) -#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2088) -#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2098) -#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2111) +#define VER_DESC (ntp_keygen_opt_strs+1965) +#define VER_name (ntp_keygen_opt_strs+2001) +#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2009) +#define SAVE_OPTS_name (ntp_keygen_opt_strs+2048) +#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2058) +#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2090) +#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2100) +#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2113) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /* * Declare option callback procedures @@ -547,13 +548,14 @@ static tOptProc */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_NTP_KEYGEN_OPTS) */ #define VER_PROC ntpOptionPrintVersion -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Define the Ntp_Keygen Option Descriptions. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntp-keygen Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntp-keygen program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_CERTIFICATE, @@ -864,20 +866,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Define the Ntp_Keygen Option Environment + * Define the ntp-keygen Option Environment */ -#define zPROGNAME (ntp_keygen_opt_strs+2114) -#define zUsageTitle (ntp_keygen_opt_strs+2125) -#define zRcName (ntp_keygen_opt_strs+2241) +#define zPROGNAME (ntp_keygen_opt_strs+2116) +#define zUsageTitle (ntp_keygen_opt_strs+2127) +#define zRcName (ntp_keygen_opt_strs+2251) static char const * const apzHomeList[3] = { - ntp_keygen_opt_strs+2248, - ntp_keygen_opt_strs+2254, + ntp_keygen_opt_strs+2243, + ntp_keygen_opt_strs+2249, NULL }; -#define zBugsAddr (ntp_keygen_opt_strs+2256) -#define zExplain (ntp_keygen_opt_strs+2290) +#define zBugsAddr (ntp_keygen_opt_strs+2258) +#define zExplain (ntp_keygen_opt_strs+2292) #define zDetail (NULL) -#define zFullVersion (ntp_keygen_opt_strs+2293) -/* extracted from optcode.tlib near line 315 */ +#define zFullVersion (ntp_keygen_opt_strs+2295) +/* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -892,33 +894,51 @@ static char const * const apzHomeList[3] = { #define ntp_keygen_short_usage (NULL) +#endif /* not defined __doxygen__ */ + /* * Create the static procedure(s) declared above. */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { + optionUsage(&ntp_keygenOptions, NTP_KEYGEN_EXIT_SUCCESS); + /* NOTREACHED */ + (void)pOptDesc; (void)pOptions; - USAGE(NTP_KEYGEN_EXIT_SUCCESS); } #if ! defined(TEST_NTP_KEYGEN_OPTS) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the set-debug-level option. * - * For the set-debug-level option. + * @param pOptions the ntp-keygen options data structure + * @param pOptDesc the option descriptor for this option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 26 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); + (void)pOptions; } #endif /* defined(TEST_NTP_KEYGEN_OPTS) */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the modulus option, when AUTOKEY is #define-d. * - * For the modulus option, when AUTOKEY is #define-d. + * @param pOptions the ntp-keygen options data structure + * @param pOptDesc the option descriptor for this option. */ #ifdef AUTOKEY static void @@ -946,16 +966,23 @@ doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc) option_usage_fp = stderr; emit_ranges: - optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } #endif /* defined AUTOKEY */ -/* extracted from optmain.tlib near line 128 */ +/* extracted from optmain.tlib near line 48 */ #if defined(TEST_NTP_KEYGEN_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); +/** + * Generated main procedure. This will emit text that a Bourne shell can + * process to handle its command line arguments. + * + * @param argc argument count + * @param argv argument vector + * @returns program exit code + */ int main(int argc, char ** argv) { @@ -968,12 +995,19 @@ main(int argc, char ** argv) return res; } #endif /* defined TEST_NTP_KEYGEN_OPTS */ -/* extracted from optmain.tlib near line 1148 */ +/* extracted from optmain.tlib near line 1146 */ +/** + * The directory containing the data associated with ntp-keygen. + */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif +/** + * Information about the person or institution that packaged ntp-keygen + * for the current distribution. + */ #ifndef WITH_PACKAGER # define ntp_keygen_packager_info NULL #else @@ -989,7 +1023,13 @@ static char const ntp_keygen_packager_info[] = # endif "\n"; #endif +#ifndef __doxygen__ +#endif /* __doxygen__ */ +/** + * The option definitions for ntp-keygen. The one structure that + * binds them all. + */ tOptions ntp_keygenOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -1034,7 +1074,16 @@ tOptions ntp_keygenOptions = { static char* AO_gettext(char const* pz); static void coerce_it(void** s); -static char* +/** + * AutoGen specific wrapper function for gettext. + * It relies on the macro _() to convert from English to the target + * language, then strdup-duplicates the result string. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * AO_gettext(char const* pz) { char* pzRes; @@ -1054,8 +1103,9 @@ AO_gettext(char const* pz) static void coerce_it(void** s) { *s = AO_gettext(*s); } -/* - * This invokes the translation code (e.g. gettext(3)). +/** + * Translate all the translatable strings in the ntp_keygenOptions + * structure defined above. This is done only once. */ static void translate_option_strings(void) diff --git a/util/ntp-keygen-opts.h b/util/ntp-keygen-opts.h index bc00c1a81c..a869cf27d7 100644 --- a/util/ntp-keygen-opts.h +++ b/util/ntp-keygen-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) * - * It has been AutoGen-ed August 11, 2012 at 11:32:43 AM by AutoGen 5.14 + * It has been AutoGen-ed August 11, 2012 at 08:39:34 PM by AutoGen 5.16.2 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 36:1:11 templates. + * Generated from AutoOpts 36:5:11 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -53,7 +53,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 147457 +#define AO_TEMPLATE_VERSION 147461 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -122,7 +122,9 @@ typedef enum { */ typedef enum { NTP_KEYGEN_EXIT_SUCCESS = 0, - NTP_KEYGEN_EXIT_FAILURE = 1 + NTP_KEYGEN_EXIT_FAILURE = 1, + NTP_KEYGEN_EXIT_NO_CONFIG_INPUT = 66, + NTP_KEYGEN_EXIT_LIBOPTS_FAILURE = 70 } ntp_keygen_exit_code_t; /* * Make sure there are no #define name conflicts with the option names @@ -286,7 +288,7 @@ typedef enum { ntp_keygenOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c) -/* extracted from opthead.tlib near line 469 */ +/* extracted from opthead.tlib near line 484 */ #ifdef __cplusplus extern "C" { @@ -302,6 +304,12 @@ extern tOptions ntp_keygenOptions; #if defined(ENABLE_NLS) # ifndef _ # include +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include +# endif + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); diff --git a/util/ntp-keygen.1ntp-keygenman b/util/ntp-keygen.1ntp-keygenman index 92dc85e823..dff7c2cb74 100644 --- a/util/ntp-keygen.1ntp-keygenman +++ b/util/ntp-keygen.1ntp-keygenman @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:50 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:44 PM by AutoGen 5.16.2 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman-cmd.tpl .\" @@ -103,13 +103,13 @@ extracts the filestamp from the file itself. This allows clients to verify that the file and generation times are always current. The -.B +.B XXX Program Name program uses the same timestamp extension for all files generated at one time, so each generation is distinct and can be readily recognized in monitoring data. -.Ss Running the program +.SS Running the program The safest way to run the -.B +.B XXX Program Name program is logged in directly as root. The recommended procedure is change to the keys directory, usually @@ -221,13 +221,13 @@ extracts the filestamp from the file itself. This allows clients to verify that the file and generation times are always current. The -.B +.B XXX Program Name program uses the same timestamp extension for all files generated at one time, so each generation is distinct and can be readily recognized in monitoring data. -.Ss Running the program +.SS Running the program The safest way to run the -.B +.B XXX Program Name program is logged in directly as root. The recommended procedure is change to the keys directory, usually @@ -333,7 +333,7 @@ To insure a fresh fileset, remove all .Cm ntpkey files. Then run -.B +.B XXX Program Name T to generate keys and a trusted certificate. On all other hosts do the same, but leave off the @@ -346,7 +346,7 @@ throughout the subnet, but setting up the environment is completely automatic. .PP If it is necessary to use a different sign key or different digest/signature scheme than the default, run -.B +.B XXX Program Name with the S Ar type option, where @@ -358,21 +358,21 @@ or The most often need to do this is when a DSA-signed certificate is used. If it is necessary to use a different certificate scheme than the default, run -.B +.B XXX Program Name with the c Ar scheme option and selected \fIscheme\fR as needed. f -.B +.B XXX Program Name is run again without these options, it generates a new certificate using the same scheme and sign key. .PP After setting up the environment it is advisable to update certificates from time to time, if only to extend the validity interval. Simply run -.B +.B XXX Program Name with the same flags as before to generate new certificates using existing keys. However, if the host or sign key is changed, @@ -383,7 +383,7 @@ When is restarted, it loads any new files and restarts the protocol. Other dependent hosts will continue as usual until signatures are refreshed, at which time the protocol is restarted. -.Ss Identity Schemes +.SS Identity Schemes As mentioned on the Autonomous Authentication page, the default TC identity scheme is vulnerable to a middleman attack. However, there are more secure identity schemes available, @@ -412,7 +412,7 @@ only as clients have key files that contain only client keys. .PP The PC scheme supports only one trusted host in the group. On trusted host alice run -.B +.B XXX Program Name P p Ar password to generate the host key file @@ -436,7 +436,7 @@ For the IFF scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host alice run -.B +.B XXX Program Name T I p Ar password @@ -457,7 +457,7 @@ as a legitimate server and present a middleman threat. To eliminate this threat, the client keys can be extracted from the parameter file and distributed to all restricted clients. After generating the parameter file, on alice run -.B +.B XXX Program Name e and pipe the output to a file or mail program. Copy or mail this file to all restricted clients. @@ -471,7 +471,7 @@ For the GQ scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host alice run -.B +.B XXX Program Name T G p Ar password @@ -494,7 +494,7 @@ and certificates for all group hosts. For illustration assume trish is the TA, alice one of several trusted hosts and bob one of her clients. On TA trish run -.B +.B XXX Program Name V Ar n p Ar password , where @@ -524,7 +524,7 @@ On client bob install a soft link from generic to the client key file. As the MV scheme is independent of keys and certificates, these files can be refreshed as needed. -.Ss Command Line Options +.SS Command Line Options .TP .BR Fl c Ar scheme Select certificate message digest/signature encryption scheme. @@ -601,14 +601,14 @@ By default, the program generates a non-trusted certificate. .TP .BR Fl V Ar nkeys Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. -.Ss Random Seed File +.SS Random Seed File All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the library routines. The OpenSSL library uses a designated random seed file for this purpose. The file must be available when starting the NTP daemon and -.B +.B XXX Program Name program. If a site supports OpenSSL or its companion OpenSSH, it is very likely that means to do this are already available. @@ -626,7 +626,7 @@ usually called .Cm .rnd , which must be available when starting the NTP daemon or the -.B +.B XXX Program Name program. The NTP daemon will first look for the file using the path specified by the @@ -635,7 +635,7 @@ subcommand of the .Ic crypto configuration command. If not specified in this way, or when starting the -.B +.B XXX Program Name program, the OpenSSL library will look for the file using the path specified by the @@ -651,13 +651,13 @@ file in the user home directory. If the file is not available or cannot be written, the daemon exits with a message to the system log and the program exits with a suitable error message. -.Ss Cryptographic Data Files +.SS Cryptographic Data Files All other file formats begin with two lines. The first contains the file name, including the generated host name and filestamp. The second contains the datestamp in conventional Unix date format. Lines beginning with # are considered comments and ignored by the -.B +.B XXX Program Name program and .Xr ntpd 8 daemon. @@ -695,7 +695,7 @@ and entered by hand, so it is generally appropriate to specify these keys in human readable ASCII format. .PP The -.B +.B XXX Program Name program generates a MD5 symmetric keys file .Pa ntpkey_MD5key_ Ns Ar hostname.filestamp . Since the file contains private shared keys, @@ -704,7 +704,7 @@ to other subnet hosts. The NTP daemon loads the file .Pa ntp.keys , so -.B +.B XXX Program Name installs a soft link from this name to the generated file. Subsequently, similar soft links must be installed by manual or automated means on the other subnet hosts. @@ -734,7 +734,7 @@ privatekey cipher. Select the cipher which is used to encrypt the files containing private keys. The default is three-key triple DES in CBC mode, equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers -available in "openssl -h" output. +available in "openssl \-h" output. .TP .BR \-d ", " -\-debug\-level Increase debug verbosity level. @@ -775,11 +775,11 @@ set Autokey group name. Set the optional Autokey group name to name. This is used in the file name of IFF, GQ, and MV client parameters files. In that role, the default is the host name if this option is not -provided. The group name, if specified using -i/--ident or -using -s/--subject-name following an '@' character, is also a +provided. The group name, if specified using \-i/--ident or +using \-s/--subject-name following an '@' character, is also a part of the self-signed host certificate's subject and issuer names in the form host@group and should match the 'crypto ident' -or 'server ident' configuration in ntpd's configuration file. +or 'server ident' configuration in ntpd's configuration file. .TP .BR \-l " \fIlifetime\fP, " \-\-lifetime "=" \fIlifetime\fP set certificate lifetime. @@ -815,7 +815,7 @@ public certificates. output private password. .sp Encrypt generated files containing private data with the specified -password and the cipher selected with -C/--cipher. +password and the cipher selected with \-C/--cipher. .TP .BR \-q " \fIpasswd\fP, " \-\-get\-pvt\-passwd "=" \fIpasswd\fP input private password. @@ -839,7 +839,7 @@ group name. The host name, and if provided, group name are used in host@group form for the host certificate's subject and issuer fields. Specifying '-s @group' is allowed, and results in leaving the host name unchanged while appending @group to the -subject and issuer fields, as with -i group. The group name, or +subject and issuer fields, as with \-i group. The group name, or if not provided, the host name are also used in the file names of IFF, GQ, and MV client parameter files. .TP @@ -902,7 +902,7 @@ option specifies the write password and q Ar password option the read password for previously encrypted files. The -.B +.B XXX Program Name program prompts for the password if it reads an encrypted file and the password is missing or incorrect. If an encrypted file is read successfully and @@ -915,11 +915,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware .SH "COPYRIGHT" diff --git a/util/ntp-keygen.1ntp-keygenmdoc b/util/ntp-keygen.1ntp-keygenmdoc index 36e2532977..f31c57da2d 100644 --- a/util/ntp-keygen.1ntp-keygenmdoc +++ b/util/ntp-keygen.1ntp-keygenmdoc @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:54 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:39 PM by AutoGen 5.16.2 .\" From the definitions ntp-keygen-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -710,27 +710,30 @@ utilities. certificate scheme. .sp scheme is one of -RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, -DSA-SHA, or DSA-SHA1. +RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160, +DSA\-SHA, or DSA\-SHA1. +.sp Select the certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without -this option is RSA-MD5. +this option is RSA\-MD5. .It \-C " \fIcipher\fP, " \-\-cipher "=" \fIcipher\fP privatekey cipher. .sp Select the cipher which is used to encrypt the files containing -private keys. The default is three-key triple DES in CBC mode, -equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers -available in "openssl -h" output. +private keys. The default is three\-key triple DES in CBC mode, +equivalent to "\-C des\-ede3\-cbc". The openssl tool lists ciphers +available in "openssl \-h" output. .It \-d ", " -\-debug\-level Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-e ", " -\-id\-key Write IFF or GQ identity keys. .sp @@ -756,11 +759,11 @@ set Autokey group name. Set the optional Autokey group name to name. This is used in the file name of IFF, GQ, and MV client parameters files. In that role, the default is the host name if this option is not -provided. The group name, if specified using -i/--ident or -using -s/--subject-name following an '@' character, is also a -part of the self-signed host certificate's subject and issuer +provided. The group name, if specified using \-i/\-\-ident or +using \-s/\-\-subject\-name following an '@' character, is also a +part of the self\-signed host certificate's subject and issuer names in the form host@group and should match the 'crypto ident' -or 'server ident' configuration in ntpd's configuration file. +or 'server ident' configuration in ntpd's configuration file. .It \-l " \fIlifetime\fP, " \-\-lifetime "=" \fIlifetime\fP set certificate lifetime. This option takes an integer number as its argument. @@ -791,7 +794,7 @@ public certificates. output private password. .sp Encrypt generated files containing private data with the specified -password and the cipher selected with -C/--cipher. +password and the cipher selected with \-C/\-\-cipher. .It \-q " \fIpasswd\fP, " \-\-get\-pvt\-passwd "=" \fIpasswd\fP input private password. .sp @@ -810,21 +813,21 @@ following an '@' character. The host name is used in the file name of generated host and signing certificates, without the group name. The host name, and if provided, group name are used in host@group form for the host certificate's subject and issuer -fields. Specifying '-s @group' is allowed, and results in +fields. Specifying '\-s @group' is allowed, and results in leaving the host name unchanged while appending @group to the -subject and issuer fields, as with -i group. The group name, or +subject and issuer fields, as with \-i group. The group name, or if not provided, the host name are also used in the file names of IFF, GQ, and MV client parameter files. .It \-T ", " -\-trusted\-cert trusted certificate (TC scheme). .sp Generate a trusted certificate. By default, the program generates -a non-trusted certificate. +a non\-trusted certificate. .It \-V " \fInum\fP, " \-\-mv\-params "=" \fInum\fP generate MV parameters. This option takes an integer number as its argument. .sp -Generate parameters and keys for the Mu-Varadharajan (MV) +Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme. .It \-v " \fInum\fP, " \-\-mv\-keys "=" \fInum\fP update MV keys. @@ -881,10 +884,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "AUTHORS" The University of Delaware diff --git a/util/ntp-keygen.man.in b/util/ntp-keygen.man.in index 955f274e6f..5525729b7f 100644 --- a/util/ntp-keygen.man.in +++ b/util/ntp-keygen.man.in @@ -2,7 +2,7 @@ .\" .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.man) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:50 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:44 PM by AutoGen 5.16.2 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman-cmd.tpl .\" @@ -103,13 +103,13 @@ extracts the filestamp from the file itself. This allows clients to verify that the file and generation times are always current. The -.B +.B XXX Program Name program uses the same timestamp extension for all files generated at one time, so each generation is distinct and can be readily recognized in monitoring data. -.Ss Running the program +.SS Running the program The safest way to run the -.B +.B XXX Program Name program is logged in directly as root. The recommended procedure is change to the keys directory, usually @@ -221,13 +221,13 @@ extracts the filestamp from the file itself. This allows clients to verify that the file and generation times are always current. The -.B +.B XXX Program Name program uses the same timestamp extension for all files generated at one time, so each generation is distinct and can be readily recognized in monitoring data. -.Ss Running the program +.SS Running the program The safest way to run the -.B +.B XXX Program Name program is logged in directly as root. The recommended procedure is change to the keys directory, usually @@ -333,7 +333,7 @@ To insure a fresh fileset, remove all .Cm ntpkey files. Then run -.B +.B XXX Program Name T to generate keys and a trusted certificate. On all other hosts do the same, but leave off the @@ -346,7 +346,7 @@ throughout the subnet, but setting up the environment is completely automatic. .PP If it is necessary to use a different sign key or different digest/signature scheme than the default, run -.B +.B XXX Program Name with the S Ar type option, where @@ -358,21 +358,21 @@ or The most often need to do this is when a DSA-signed certificate is used. If it is necessary to use a different certificate scheme than the default, run -.B +.B XXX Program Name with the c Ar scheme option and selected \fIscheme\fR as needed. f -.B +.B XXX Program Name is run again without these options, it generates a new certificate using the same scheme and sign key. .PP After setting up the environment it is advisable to update certificates from time to time, if only to extend the validity interval. Simply run -.B +.B XXX Program Name with the same flags as before to generate new certificates using existing keys. However, if the host or sign key is changed, @@ -383,7 +383,7 @@ When is restarted, it loads any new files and restarts the protocol. Other dependent hosts will continue as usual until signatures are refreshed, at which time the protocol is restarted. -.Ss Identity Schemes +.SS Identity Schemes As mentioned on the Autonomous Authentication page, the default TC identity scheme is vulnerable to a middleman attack. However, there are more secure identity schemes available, @@ -412,7 +412,7 @@ only as clients have key files that contain only client keys. .PP The PC scheme supports only one trusted host in the group. On trusted host alice run -.B +.B XXX Program Name P p Ar password to generate the host key file @@ -436,7 +436,7 @@ For the IFF scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host alice run -.B +.B XXX Program Name T I p Ar password @@ -457,7 +457,7 @@ as a legitimate server and present a middleman threat. To eliminate this threat, the client keys can be extracted from the parameter file and distributed to all restricted clients. After generating the parameter file, on alice run -.B +.B XXX Program Name e and pipe the output to a file or mail program. Copy or mail this file to all restricted clients. @@ -471,7 +471,7 @@ For the GQ scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host alice run -.B +.B XXX Program Name T G p Ar password @@ -494,7 +494,7 @@ and certificates for all group hosts. For illustration assume trish is the TA, alice one of several trusted hosts and bob one of her clients. On TA trish run -.B +.B XXX Program Name V Ar n p Ar password , where @@ -524,7 +524,7 @@ On client bob install a soft link from generic to the client key file. As the MV scheme is independent of keys and certificates, these files can be refreshed as needed. -.Ss Command Line Options +.SS Command Line Options .TP .BR Fl c Ar scheme Select certificate message digest/signature encryption scheme. @@ -601,14 +601,14 @@ By default, the program generates a non-trusted certificate. .TP .BR Fl V Ar nkeys Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. -.Ss Random Seed File +.SS Random Seed File All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the library routines. The OpenSSL library uses a designated random seed file for this purpose. The file must be available when starting the NTP daemon and -.B +.B XXX Program Name program. If a site supports OpenSSL or its companion OpenSSH, it is very likely that means to do this are already available. @@ -626,7 +626,7 @@ usually called .Cm .rnd , which must be available when starting the NTP daemon or the -.B +.B XXX Program Name program. The NTP daemon will first look for the file using the path specified by the @@ -635,7 +635,7 @@ subcommand of the .Ic crypto configuration command. If not specified in this way, or when starting the -.B +.B XXX Program Name program, the OpenSSL library will look for the file using the path specified by the @@ -651,13 +651,13 @@ file in the user home directory. If the file is not available or cannot be written, the daemon exits with a message to the system log and the program exits with a suitable error message. -.Ss Cryptographic Data Files +.SS Cryptographic Data Files All other file formats begin with two lines. The first contains the file name, including the generated host name and filestamp. The second contains the datestamp in conventional Unix date format. Lines beginning with # are considered comments and ignored by the -.B +.B XXX Program Name program and .Xr ntpd 8 daemon. @@ -695,7 +695,7 @@ and entered by hand, so it is generally appropriate to specify these keys in human readable ASCII format. .PP The -.B +.B XXX Program Name program generates a MD5 symmetric keys file .Pa ntpkey_MD5key_ Ns Ar hostname.filestamp . Since the file contains private shared keys, @@ -704,7 +704,7 @@ to other subnet hosts. The NTP daemon loads the file .Pa ntp.keys , so -.B +.B XXX Program Name installs a soft link from this name to the generated file. Subsequently, similar soft links must be installed by manual or automated means on the other subnet hosts. @@ -734,7 +734,7 @@ privatekey cipher. Select the cipher which is used to encrypt the files containing private keys. The default is three-key triple DES in CBC mode, equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers -available in "openssl -h" output. +available in "openssl \-h" output. .TP .BR \-d ", " -\-debug\-level Increase debug verbosity level. @@ -775,11 +775,11 @@ set Autokey group name. Set the optional Autokey group name to name. This is used in the file name of IFF, GQ, and MV client parameters files. In that role, the default is the host name if this option is not -provided. The group name, if specified using -i/--ident or -using -s/--subject-name following an '@' character, is also a +provided. The group name, if specified using \-i/--ident or +using \-s/--subject-name following an '@' character, is also a part of the self-signed host certificate's subject and issuer names in the form host@group and should match the 'crypto ident' -or 'server ident' configuration in ntpd's configuration file. +or 'server ident' configuration in ntpd's configuration file. .TP .BR \-l " \fIlifetime\fP, " \-\-lifetime "=" \fIlifetime\fP set certificate lifetime. @@ -815,7 +815,7 @@ public certificates. output private password. .sp Encrypt generated files containing private data with the specified -password and the cipher selected with -C/--cipher. +password and the cipher selected with \-C/--cipher. .TP .BR \-q " \fIpasswd\fP, " \-\-get\-pvt\-passwd "=" \fIpasswd\fP input private password. @@ -839,7 +839,7 @@ group name. The host name, and if provided, group name are used in host@group form for the host certificate's subject and issuer fields. Specifying '-s @group' is allowed, and results in leaving the host name unchanged while appending @group to the -subject and issuer fields, as with -i group. The group name, or +subject and issuer fields, as with \-i group. The group name, or if not provided, the host name are also used in the file names of IFF, GQ, and MV client parameter files. .TP @@ -902,7 +902,7 @@ option specifies the write password and q Ar password option the read password for previously encrypted files. The -.B +.B XXX Program Name program prompts for the password if it reads an encrypted file and the password is missing or incorrect. If an encrypted file is read successfully and @@ -915,11 +915,18 @@ See \fBOPTION PRESETS\fP for configuration files. .SH "EXIT STATUS" One of the following exit values will be returned: .TP -.BR 0 +.BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP -.BR 1 +.BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.TP +.BR 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.BR 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware .SH "COPYRIGHT" diff --git a/util/ntp-keygen.mdoc.in b/util/ntp-keygen.mdoc.in index e82bfab20e..9392200a4f 100644 --- a/util/ntp-keygen.mdoc.in +++ b/util/ntp-keygen.mdoc.in @@ -1,9 +1,9 @@ .Dd August 11 2012 .Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands -.Os SunOS 5.10 +.Os FreeBSD 6.4-STABLE .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc) .\" -.\" It has been AutoGen-ed August 11, 2012 at 11:32:54 AM by AutoGen 5.14 +.\" It has been AutoGen-ed August 11, 2012 at 08:58:39 PM by AutoGen 5.16.2 .\" From the definitions ntp-keygen-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -710,27 +710,30 @@ utilities. certificate scheme. .sp scheme is one of -RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, -DSA-SHA, or DSA-SHA1. +RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160, +DSA\-SHA, or DSA\-SHA1. +.sp Select the certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without -this option is RSA-MD5. +this option is RSA\-MD5. .It \-C " \fIcipher\fP, " \-\-cipher "=" \fIcipher\fP privatekey cipher. .sp Select the cipher which is used to encrypt the files containing -private keys. The default is three-key triple DES in CBC mode, -equivalent to "-C des-ede3-cbc". The openssl tool lists ciphers -available in "openssl -h" output. +private keys. The default is three\-key triple DES in CBC mode, +equivalent to "\-C des\-ede3\-cbc". The openssl tool lists ciphers +available in "openssl \-h" output. .It \-d ", " -\-debug\-level Increase debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP Set the debug verbosity level. This option may appear an unlimited number of times. .sp +.sp .It \-e ", " -\-id\-key Write IFF or GQ identity keys. .sp @@ -756,11 +759,11 @@ set Autokey group name. Set the optional Autokey group name to name. This is used in the file name of IFF, GQ, and MV client parameters files. In that role, the default is the host name if this option is not -provided. The group name, if specified using -i/--ident or -using -s/--subject-name following an '@' character, is also a -part of the self-signed host certificate's subject and issuer +provided. The group name, if specified using \-i/\-\-ident or +using \-s/\-\-subject\-name following an '@' character, is also a +part of the self\-signed host certificate's subject and issuer names in the form host@group and should match the 'crypto ident' -or 'server ident' configuration in ntpd's configuration file. +or 'server ident' configuration in ntpd's configuration file. .It \-l " \fIlifetime\fP, " \-\-lifetime "=" \fIlifetime\fP set certificate lifetime. This option takes an integer number as its argument. @@ -791,7 +794,7 @@ public certificates. output private password. .sp Encrypt generated files containing private data with the specified -password and the cipher selected with -C/--cipher. +password and the cipher selected with \-C/\-\-cipher. .It \-q " \fIpasswd\fP, " \-\-get\-pvt\-passwd "=" \fIpasswd\fP input private password. .sp @@ -810,21 +813,21 @@ following an '@' character. The host name is used in the file name of generated host and signing certificates, without the group name. The host name, and if provided, group name are used in host@group form for the host certificate's subject and issuer -fields. Specifying '-s @group' is allowed, and results in +fields. Specifying '\-s @group' is allowed, and results in leaving the host name unchanged while appending @group to the -subject and issuer fields, as with -i group. The group name, or +subject and issuer fields, as with \-i group. The group name, or if not provided, the host name are also used in the file names of IFF, GQ, and MV client parameter files. .It \-T ", " -\-trusted\-cert trusted certificate (TC scheme). .sp Generate a trusted certificate. By default, the program generates -a non-trusted certificate. +a non\-trusted certificate. .It \-V " \fInum\fP, " \-\-mv\-params "=" \fInum\fP generate MV parameters. This option takes an integer number as its argument. .sp -Generate parameters and keys for the Mu-Varadharajan (MV) +Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme. .It \-v " \fInum\fP, " \-\-mv\-keys "=" \fInum\fP update MV keys. @@ -881,10 +884,15 @@ See \fBOPTION PRESETS\fP for configuration files. .Sh "EXIT STATUS" One of the following exit values will be returned: .Bl -tag -.It 0 +.It 0 " (EXIT_SUCCESS)" Successful program execution. -.It 1 +.It 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. .El .Sh "AUTHORS" The University of Delaware