diff options
author | Cy Schubert <cy@FreeBSD.org> | 2020-03-04 21:45:12 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2020-03-04 21:45:12 +0000 |
commit | 2d4e511ca269f1908d27f4e5779c53475527391d (patch) | |
tree | 3aa5b61a3376d9d890250912b7a5d7638b8ff753 /contrib/ntp/ntpd | |
parent | d718de812fe1f93f8134af58ee23a36601aebe5e (diff) | |
parent | 5171bc9b11192d9ad273db7854787eaa65eb9997 (diff) |
Notes
Diffstat (limited to 'contrib/ntp/ntpd')
55 files changed, 5928 insertions, 4321 deletions
diff --git a/contrib/ntp/ntpd/Makefile.am b/contrib/ntp/ntpd/Makefile.am index 60c5de8a1a59e..b977d5e21cb18 100644 --- a/contrib/ntp/ntpd/Makefile.am +++ b/contrib/ntp/ntpd/Makefile.am @@ -25,7 +25,7 @@ if SAVECONFIG_ENABLED if NTP_CROSSCOMPILE CHECK_SAVECONFIG= else -CHECK_SAVECONFIG= check-saveconfig +CHECK_SAVECONFIG= check-saveconfig check-pslsaveconfig endif else !SAVECONFIG_ENABLED CHECK_SAVECONFIG= @@ -110,9 +110,20 @@ DISTCLEANFILES = \ $(NULL) CLEANFILES = \ + check-psl0 \ + check-psl1 \ + check-psl2 \ + check-pslsaveconfig \ check-saveconfig \ compsave.conf \ + compsave.conf+ \ k-g-u-submake \ + psl0save.conf \ + psl0save.conf+ \ + psl1save.conf \ + psl1save.conf+ \ + psl2save.conf \ + psl2save.conf+ \ $(EXTRA_PROGRAMS) \ $(NULL) @@ -147,6 +158,9 @@ EXTRA_DIST = \ ntpd.html \ ntpd.texi \ ntpdbase-opts.def \ + psl0.conf \ + psl1.conf \ + psl2.conf \ refclock_msfees.c \ $(B_S_DIST) \ $(NULL) @@ -345,13 +359,13 @@ $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list) $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def -$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true ) -$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true ) -$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true ) ### @@ -413,13 +427,41 @@ $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(PROGRAMS): $(LDADD) -compsave.conf: ntpd complete.conf - ./ntpd --configfile complete.conf --saveconfigquit $@ - check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf cmp complete.conf compsave.conf && echo stamp > $@ +compsave.conf: ntpd complete.conf + ./ntpd --configfile complete.conf --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-pslsaveconfig: check-psl0 check-psl1 check-psl2 + echo stamp > $@ + +check-psl0: psl0.conf psl0save.conf + -diff -u $< psl0save.conf + cmp $< psl0save.conf && echo stamp > $@ + +psl0save.conf: psl0.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-psl1: psl1.conf psl1save.conf + -diff -u $< psl1save.conf + cmp $< psl1save.conf && echo stamp > $@ + +psl1save.conf: psl1.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-psl2: psl2.conf psl2save.conf + -diff -u $< psl2save.conf + cmp $< psl2save.conf && echo stamp > $@ + +psl2save.conf: psl2.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + ../libntp/libntpsim.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a diff --git a/contrib/ntp/ntpd/Makefile.in b/contrib/ntp/ntpd/Makefile.in index 8eab4f9a33bbd..c533b6d7138f9 100644 --- a/contrib/ntp/ntpd/Makefile.in +++ b/contrib/ntp/ntpd/Makefile.in @@ -615,7 +615,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP) $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB. LDADD = version.o libntpd.a $(LIBPARSE) AM_YFLAGS = -d -t -r all -@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig +@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig check-pslsaveconfig @NTP_CROSSCOMPILE_TRUE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = @SAVECONFIG_ENABLED_FALSE@CHECK_SAVECONFIG = @VPATH_HACK_FALSE@VPHACK = @@ -667,8 +667,11 @@ DISTCLEANFILES = \ $(man_MANS) \ $(NULL) -CLEANFILES = check-saveconfig compsave.conf k-g-u-submake \ - $(EXTRA_PROGRAMS) $(NULL) check-libopts check-libntp .deps-ver +CLEANFILES = check-psl0 check-psl1 check-psl2 check-pslsaveconfig \ + check-saveconfig compsave.conf compsave.conf+ k-g-u-submake \ + psl0save.conf psl0save.conf+ psl1save.conf psl1save.conf+ \ + psl2save.conf psl2save.conf+ $(EXTRA_PROGRAMS) $(NULL) \ + check-libopts check-libntp .deps-ver EXTRA_DIST = \ complete.conf.in \ invoke-ntp.conf.menu \ @@ -700,6 +703,9 @@ EXTRA_DIST = \ ntpd.html \ ntpd.texi \ ntpdbase-opts.def \ + psl0.conf \ + psl1.conf \ + psl2.conf \ refclock_msfees.c \ $(B_S_DIST) \ $(NULL) @@ -1743,13 +1749,13 @@ $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list) $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def -$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true ) -$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true ) -$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true ) ### @@ -1811,13 +1817,41 @@ $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(PROGRAMS): $(LDADD) -compsave.conf: ntpd complete.conf - ./ntpd --configfile complete.conf --saveconfigquit $@ - check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf cmp complete.conf compsave.conf && echo stamp > $@ +compsave.conf: ntpd complete.conf + ./ntpd --configfile complete.conf --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-pslsaveconfig: check-psl0 check-psl1 check-psl2 + echo stamp > $@ + +check-psl0: psl0.conf psl0save.conf + -diff -u $< psl0save.conf + cmp $< psl0save.conf && echo stamp > $@ + +psl0save.conf: psl0.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-psl1: psl1.conf psl1save.conf + -diff -u $< psl1save.conf + cmp $< psl1save.conf && echo stamp > $@ + +psl1save.conf: psl1.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + +check-psl2: psl2.conf psl2save.conf + -diff -u $< psl2save.conf + cmp $< psl2save.conf && echo stamp > $@ + +psl2save.conf: psl2.conf ntpd + ./ntpd --configfile $< --saveconfigquit $@+ + grep -v '^#' $@+ > $@ + ../libntp/libntpsim.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a diff --git a/contrib/ntp/ntpd/cmd_args.c b/contrib/ntp/ntpd/cmd_args.c index 14e86f7e87ca1..adb4a606bb319 100644 --- a/contrib/ntp/ntpd/cmd_args.c +++ b/contrib/ntp/ntpd/cmd_args.c @@ -71,7 +71,7 @@ getCmdOpts( } if (HAVE_OPT( DRIFTFILE )) - stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE )); + stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ), 0); if (HAVE_OPT( PANICGATE )) allow_panic = TRUE; @@ -90,7 +90,7 @@ getCmdOpts( getauthkeys(OPT_ARG( KEYFILE )); if (HAVE_OPT( PIDFILE )) - stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE )); + stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ), 0); if (HAVE_OPT( QUIT )) mode_ntpdate = TRUE; @@ -110,7 +110,7 @@ getCmdOpts( } while (0); if (HAVE_OPT( STATSDIR )) - stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR )); + stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ), 0); if (HAVE_OPT( TRUSTEDKEY )) { int ct = STACKCT_OPT( TRUSTEDKEY ); diff --git a/contrib/ntp/ntpd/complete.conf.in b/contrib/ntp/ntpd/complete.conf.in index 66fcbaa478de6..77b619773fbfb 100644 --- a/contrib/ntp/ntpd/complete.conf.in +++ b/contrib/ntp/ntpd/complete.conf.in @@ -1,7 +1,8 @@ saveconfigdir "/etc/ntp/conf" -driftfile "/etc/ntp.drift" 1e-7 +driftfile "/etc/ntp.drift" logfile "/var/log/ntp.log" -leapfile "/etc/ntp.leapseconds" +leapfile "/etc/ntp.leapseconds" ignorehash +leapfile "/etc/ntp.leapseconds" checkhash @HAVE_LEAPSMEARINTERVAL@ nonvolatile 1e-7 ident "udent" @@ -31,14 +32,14 @@ rlimit@HAVE_RLIMIT_MEMLOCK@@HAVE_RLIMIT_STACK@ tinker allan 1500 dispersion 15 freq 0 huffpuff 7200 panic 1000 step 0.128 stepout 900 tick 0.01 broadcastclient server 127.127.1.0 mode 4294967295 prefer true -fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd +fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd minjitter 0.2 pool 0.north-america.pool.ntp.org. iburst preempt server 1.north-america.pool.ntp.org. iburst server -4 2.north-america.pool.ntp.org. minpoll 6 maxpoll 10 iburst server -6 ntp.davehart.net. minpoll 6 maxpoll 10 version 5 burst iburst peer -6 davehart.broker.freenet6.net. ident "autokey-group" xleave autokey peer -4 192.168.192.168 key 1 noselect -server [fe80::123%1] +server [fe80::123%1] xmtnonce broadcast 192.168.192.255 manycastclient 224.0.1.1 manycastclient ff05::101 @@ -46,6 +47,7 @@ manycastserver 224.0.1.1 ff05::101 multicastclient 224.0.1.1 ff05::101 mru maxage 64 mindepth 600 initalloc 600 initmem 16 incalloc 99 incmem 4 maxdepth 1024 maxmem 4096 discard minimum 1 average 3 monitor 3000 +pollskewlist 3 1|2 4 3|4 default 6|7 restrict default ippeerlimit -1 restrict default ippeerlimit 0 nomodify limited kod noserve nomrulist restrict source ippeerlimit 1 @@ -53,6 +55,7 @@ restrict source ippeerlimit 2 nomodify limited kod restrict trusted.host.name.example.com. ippeerlimit -1 nomodify restrict [fe80::1] mask [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff] ippeerlimit -1 restrict 127.0.0.1 mask 255.255.255.255 ippeerlimit -1 +restrict 127.0.0.2 ippeerlimit -1 serverresponse fuzz restrict ::1 ippeerlimit -1 interface drop ipv6 interface ignore ipv4 diff --git a/contrib/ntp/ntpd/invoke-ntp.conf.texi b/contrib/ntp/ntpd/invoke-ntp.conf.texi index 132709eec5cfd..5ef61c7aaf3a3 100644 --- a/contrib/ntp/ntpd/invoke-ntp.conf.texi +++ b/contrib/ntp/ntpd/invoke-ntp.conf.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi) # -# It has been AutoGen-ed February 20, 2019 at 09:56:39 AM by AutoGen 5.18.5 +# It has been AutoGen-ed March 3, 2020 at 05:40:57 PM by AutoGen 5.18.5 # From the definitions ntp.conf.def # and the template file agtexi-file.tpl @end ignore @@ -134,8 +134,8 @@ qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. @table @asis -@item @code{pool} @kbd{address} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} -@item @code{server} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]} +@item @code{pool} @kbd{address} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{xmtnonce}]} +@item @code{server} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]} @code{[@code{xmtnonce}]} @item @code{peer} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]} @code{[@code{xleave}]} @item @code{broadcast} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{ttl} @kbd{ttl}]} @code{[@code{xleave}]} @item @code{manycastclient} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{ttl} @kbd{ttl}]} @@ -305,9 +305,6 @@ Marks the server as unused, except for display purposes. The server is discarded by the selection algroithm. @item @code{preempt} Says the association can be preempted. -@item @code{true} -Marks the server as a truechimer. -Use this option only for testing. @item @code{prefer} Marks the server as preferred. All other things being equal, @@ -321,7 +318,8 @@ provided in @file{/usr/share/doc/ntp}) for further information. @item @code{true} -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly @emph{only} be used while testing an association. @@ -349,6 +347,13 @@ Valid in and @code{broadcast} modes only, this flag enables interleave mode. +@item @code{xmtnonce} +Valid only for +@code{server} +and +@code{pool} +modes, this flag puts a random number in the packet's transmit timestamp. + @end table @subsubsection Auxiliary Commands @table @asis @@ -1622,6 +1627,10 @@ The @code{ntpport} is considered more specific and is sorted later in the list. +@item @code{serverresponse fuzz} +When reponding to server requests, +fuzz the low order bits of the +@code{reftime}. @item @code{version} Deny packets that do not match the current NTP version. @end table @@ -2766,6 +2775,21 @@ For the JJY driver (type 40 mode 100 - 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. +@item @code{pollskewlist} @code{[@kbd{poll} @kbd{value} | @kbd{value}]} @kbd{...} @code{[@code{default} @kbd{value} | @kbd{value}]} +Enable skewing of our poll requests to our servers. +@kbd{poll} +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. @item @code{reset} @code{[@code{allpeers}]} @code{[@code{auth}]} @code{[@code{ctl}]} @code{[@code{io}]} @code{[@code{mem}]} @code{[@code{sys}]} @code{[@code{timer}]} Reset one or more groups of counters maintained by @code{ntpd} diff --git a/contrib/ntp/ntpd/invoke-ntp.keys.texi b/contrib/ntp/ntpd/invoke-ntp.keys.texi index 9698c5480d5fd..1687d9d6b338d 100644 --- a/contrib/ntp/ntpd/invoke-ntp.keys.texi +++ b/contrib/ntp/ntpd/invoke-ntp.keys.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi) # -# It has been AutoGen-ed February 20, 2019 at 09:56:41 AM by AutoGen 5.18.5 +# It has been AutoGen-ed March 3, 2020 at 05:40:59 PM by AutoGen 5.18.5 # From the definitions ntp.keys.def # and the template file agtexi-file.tpl @end ignore diff --git a/contrib/ntp/ntpd/invoke-ntpd.texi b/contrib/ntp/ntpd/invoke-ntpd.texi index 16dce21805d57..47919ffb2105f 100644 --- a/contrib/ntp/ntpd/invoke-ntpd.texi +++ b/contrib/ntp/ntpd/invoke-ntpd.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi) # -# It has been AutoGen-ed February 20, 2019 at 09:56:42 AM by AutoGen 5.18.5 +# It has been AutoGen-ed March 3, 2020 at 05:41:00 PM by AutoGen 5.18.5 # From the definitions ntpd-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -142,7 +142,7 @@ with a status code of 0. @exampleindent 0 @example -ntpd - NTP daemon program - Ver. 4.2.8p13 +ntpd - NTP daemon program - Ver. 4.2.8p14 Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \ [ <server1> ... <serverN> ] Flg Arg Option-Name Description diff --git a/contrib/ntp/ntpd/keyword-gen-utd b/contrib/ntp/ntpd/keyword-gen-utd index 9b836ba4dc9b8..6a74fdf219832 100644 --- a/contrib/ntp/ntpd/keyword-gen-utd +++ b/contrib/ntp/ntpd/keyword-gen-utd @@ -1 +1 @@ - * Generated 2018-01-14 03:53:33 UTC diff_ignore_line + * Generated 2020-02-13 08:56:28 UTC diff_ignore_line diff --git a/contrib/ntp/ntpd/keyword-gen.c b/contrib/ntp/ntpd/keyword-gen.c index e07548a1e4c5f..fbc6423d33e35 100644 --- a/contrib/ntp/ntpd/keyword-gen.c +++ b/contrib/ntp/ntpd/keyword-gen.c @@ -43,6 +43,7 @@ struct key_tok ntp_keywords[] = { { "broadcast", T_Broadcast, FOLLBY_STRING }, { "broadcastclient", T_Broadcastclient, FOLLBY_TOKEN }, { "broadcastdelay", T_Broadcastdelay, FOLLBY_TOKEN }, +{ "checkhash", T_Checkhash, FOLLBY_TOKEN }, { "ctl", T_Ctl, FOLLBY_TOKEN }, { "disable", T_Disable, FOLLBY_TOKEN }, { "driftfile", T_Driftfile, FOLLBY_STRING }, @@ -51,6 +52,7 @@ struct key_tok ntp_keywords[] = { { "end", T_End, FOLLBY_TOKEN }, { "filegen", T_Filegen, FOLLBY_TOKEN }, { "fudge", T_Fudge, FOLLBY_STRING }, +{ "ignorehash", T_Ignorehash, FOLLBY_TOKEN }, { "io", T_Io, FOLLBY_TOKEN }, { "includefile", T_Includefile, FOLLBY_STRING }, { "leapfile", T_Leapfile, FOLLBY_STRING }, @@ -64,12 +66,16 @@ struct key_tok ntp_keywords[] = { { "peer", T_Peer, FOLLBY_STRING }, { "phone", T_Phone, FOLLBY_STRINGS_TO_EOC }, { "pidfile", T_Pidfile, FOLLBY_STRING }, +{ "pollskewlist", T_PollSkewList, FOLLBY_TOKEN }, { "pool", T_Pool, FOLLBY_STRING }, { "discard", T_Discard, FOLLBY_TOKEN }, { "reset", T_Reset, FOLLBY_TOKEN }, { "restrict", T_Restrict, FOLLBY_TOKEN }, { "rlimit", T_Rlimit, FOLLBY_TOKEN }, { "server", T_Server, FOLLBY_STRING }, +{ "serverresponse", T_Serverresponse, FOLLBY_TOKEN }, +{ "fuzz", T_Fuzz, FOLLBY_TOKEN }, +{ "poll", T_Poll, FOLLBY_TOKEN }, { "setvar", T_Setvar, FOLLBY_STRING }, { "statistics", T_Statistics, FOLLBY_TOKEN }, { "statsdir", T_Statsdir, FOLLBY_STRING }, @@ -81,6 +87,7 @@ struct key_tok ntp_keywords[] = { { "trap", T_Trap, FOLLBY_STRING }, { "unconfig", T_Unconfig, FOLLBY_STRING }, { "unpeer", T_Unpeer, FOLLBY_STRING }, +{ "xmtnonce", T_Xmtnonce, FOLLBY_TOKEN }, /* authentication_command */ { "controlkey", T_ControlKey, FOLLBY_TOKEN }, { "crypto", T_Crypto, FOLLBY_TOKEN }, @@ -199,6 +206,7 @@ struct key_tok ntp_keywords[] = { { "stratum", T_Stratum, FOLLBY_TOKEN }, { "time1", T_Time1, FOLLBY_TOKEN }, { "time2", T_Time2, FOLLBY_TOKEN }, +{ "minjitter", T_Minjitter, FOLLBY_TOKEN }, /* system_option */ { "auth", T_Auth, FOLLBY_TOKEN }, { "bclient", T_Bclient, FOLLBY_TOKEN }, diff --git a/contrib/ntp/ntpd/ntp.conf.5man b/contrib/ntp/ntpd/ntp.conf.5man index 50ae14f0eb288..a24c9866d21ee 100644 --- a/contrib/ntp/ntpd/ntp.conf.5man +++ b/contrib/ntp/ntpd/ntp.conf.5man @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp.conf 5man "20 Feb 2019" "4.2.8p13" "File Formats" +.TH ntp.conf 5man "03 Mar 2020" "4.2.8p14" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:02 PM by AutoGen 5.18.5 .\" From the definitions ntp.conf.def .\" and the template file agman-cmd.tpl .SH NAME @@ -161,9 +161,9 @@ qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. .TP 7 -.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] +.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]xmtnonce\f[]] .TP 7 -.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] +.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xmtnonce\f[]] .TP 7 .NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xleave\f[]] .TP 7 @@ -352,10 +352,6 @@ The server is discarded by the selection algroithm. .NOP \f\*[B-Font]preempt\f[] Says the association can be preempted. .TP 7 -.NOP \f\*[B-Font]true\f[] -Marks the server as a truechimer. -Use this option only for testing. -.TP 7 .NOP \f\*[B-Font]prefer\f[] Marks the server as preferred. All other things being equal, @@ -370,7 +366,8 @@ provided in for further information. .TP 7 .NOP \f\*[B-Font]true\f[] -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly \fIonly\f[] be used while testing an association. @@ -401,6 +398,13 @@ Valid in and \f\*[B-Font]broadcast\f[] modes only, this flag enables interleave mode. +.TP 7 +.NOP \f\*[B-Font]xmtnonce\f[] +Valid only for +\f\*[B-Font]server\f[] +and +\f\*[B-Font]pool\f[] +modes, this flag puts a random number in the packet's transmit timestamp. .PP .SS Auxiliary Commands .TP 7 @@ -1838,6 +1842,11 @@ The is considered more specific and is sorted later in the list. .TP 7 +.NOP \f\*[B-Font]serverresponse fuzz\f[] +When reponding to server requests, +fuzz the low order bits of the +\f\*[B-Font]reftime\f[]. +.TP 7 .NOP \f\*[B-Font]version\f[] Deny packets that do not match the current NTP version. .RE @@ -3092,6 +3101,22 @@ one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. .TP 7 +.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] +Enable skewing of our poll requests to our servers. +\f\*[I-Font]poll\f[] +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. +.TP 7 .NOP \f\*[B-Font]reset\f[] [\f\*[B-Font]allpeers\f[]] [\f\*[B-Font]auth\f[]] [\f\*[B-Font]ctl\f[]] [\f\*[B-Font]io\f[]] [\f\*[B-Font]mem\f[]] [\f\*[B-Font]sys\f[]] [\f\*[B-Font]timer\f[]] Reset one or more groups of counters maintained by \f\*[B-Font]ntpd\f[] @@ -3424,7 +3449,7 @@ RFC5905 .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH BUGS The syntax checking is not picky; some combinations of diff --git a/contrib/ntp/ntpd/ntp.conf.5mdoc b/contrib/ntp/ntpd/ntp.conf.5mdoc index 7d133286eb5bd..2272d58b27500 100644 --- a/contrib/ntp/ntpd/ntp.conf.5mdoc +++ b/contrib/ntp/ntpd/ntp.conf.5mdoc @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTP_CONF 5mdoc File Formats .Os .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:53 PM by AutoGen 5.18.5 .\" From the definitions ntp.conf.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -144,6 +144,7 @@ equivalent classes for that address family. .Op Cm prefer .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll +.Op Cm xmtnonce .Xc .It Xo Ic server Ar address .Op Cm key Ar key \&| Cm autokey @@ -154,6 +155,7 @@ equivalent classes for that address family. .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll .Op Cm true +.Op Cm xmtnonce .Xc .It Xo Ic peer Ar address .Op Cm key Ar key \&| Cm autokey @@ -346,9 +348,6 @@ Marks the server as unused, except for display purposes. The server is discarded by the selection algroithm. .It Cm preempt Says the association can be preempted. -.It Cm true -Marks the server as a truechimer. -Use this option only for testing. .It Cm prefer Marks the server as preferred. All other things being equal, @@ -362,7 +361,8 @@ provided in .Pa /usr/share/doc/ntp ) for further information. .It Cm true -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly .Em only be used while testing an association. @@ -390,6 +390,12 @@ Valid in and .Cm broadcast modes only, this flag enables interleave mode. +.It Cm xmtnonce +Valid only for +.Cm server +and +.Cm pool +modes, this flag puts a random number in the packet's transmit timestamp. .El .Ss Auxiliary Commands .Bl -tag -width indent @@ -1694,6 +1700,10 @@ The .Cm ntpport is considered more specific and is sorted later in the list. +.It Ic "serverresponse fuzz" +When reponding to server requests, +fuzz the low order bits of the +.Cm reftime . .It Cm version Deny packets that do not match the current NTP version. .El @@ -2919,6 +2929,31 @@ For the JJY driver (type 40 mode 100 \- 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. +.It Xo Cm pollskewlist +.Oo +.Ar poll +.Ar value | value +.Oc +.Ar ... +.Oo +.Cm default +.Ar value | value +.Oc +.Xc +Enable skewing of our poll requests to our servers. +.Ar poll +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one\-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. .It Xo Ic reset .Oo .Ic allpeers @@ -3255,7 +3290,7 @@ A snapshot of this documentation is available in HTML format in .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh BUGS The syntax checking is not picky; some combinations of diff --git a/contrib/ntp/ntpd/ntp.conf.def b/contrib/ntp/ntpd/ntp.conf.def index 9684fb12065cf..c1e472276fbe2 100644 --- a/contrib/ntp/ntpd/ntp.conf.def +++ b/contrib/ntp/ntpd/ntp.conf.def @@ -146,6 +146,7 @@ equivalent classes for that address family. .Op Cm prefer .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll +.Op Cm xmtnonce .Xc .It Xo Ic server Ar address .Op Cm key Ar key \&| Cm autokey @@ -156,6 +157,7 @@ equivalent classes for that address family. .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll .Op Cm true +.Op Cm xmtnonce .Xc .It Xo Ic peer Ar address .Op Cm key Ar key \&| Cm autokey @@ -348,9 +350,6 @@ Marks the server as unused, except for display purposes. The server is discarded by the selection algroithm. .It Cm preempt Says the association can be preempted. -.It Cm true -Marks the server as a truechimer. -Use this option only for testing. .It Cm prefer Marks the server as preferred. All other things being equal, @@ -364,7 +363,8 @@ provided in .Pa /usr/share/doc/ntp ) for further information. .It Cm true -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly .Em only be used while testing an association. @@ -392,6 +392,13 @@ Valid in and .Cm broadcast modes only, this flag enables interleave mode. +.It Cm xmtnonce +Valid only for +.Cm server +and +.Cm pool +modes, this flag puts a random number in the packet's transmit timestamp. + .El .Ss Auxiliary Commands .Bl -tag -width indent @@ -1696,6 +1703,10 @@ The .Cm ntpport is considered more specific and is sorted later in the list. +.It Ic "serverresponse fuzz" +When reponding to server requests, +fuzz the low order bits of the +.Cm reftime . .It Cm version Deny packets that do not match the current NTP version. .El @@ -2921,6 +2932,31 @@ For the JJY driver (type 40 mode 100 - 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. +.It Xo Cm pollskewlist +.Oo +.Ar poll +.Ar value | value +.Oc +.Ar ... +.Oo +.Cm default +.Ar value | value +.Oc +.Xc +Enable skewing of our poll requests to our servers. +.Ar poll +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. .It Xo Ic reset .Oo .Ic allpeers diff --git a/contrib/ntp/ntpd/ntp.conf.html b/contrib/ntp/ntpd/ntp.conf.html index e19e3264272da..7dc61eda73aaf 100644 --- a/contrib/ntp/ntpd/ntp.conf.html +++ b/contrib/ntp/ntpd/ntp.conf.html @@ -61,7 +61,7 @@ Next: <a href="#ntp_002econf-Description" accesskey="n" rel="next">ntp.conf Desc <p>This document describes the configuration file for the NTP Project’s <code>ntpd</code> program. </p> -<p>This document applies to version 4.2.8p13 of <code>ntp.conf</code>. +<p>This document applies to version 4.2.8p14 of <code>ntp.conf</code>. </p> <a name="SEC_Overview"></a> <h2 class="shortcontents-heading">Short Table of Contents</h2> @@ -257,8 +257,8 @@ qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. </p><dl compact="compact"> -<dt><code>pool</code> <kbd>address</kbd> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code></dt> -<dt><code>server</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code></dt> +<dt><code>pool</code> <kbd>address</kbd> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>xmtnonce</code>]</code></dt> +<dt><code>server</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code> <code>[<code>xmtnonce</code>]</code></dt> <dt><code>peer</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code> <code>[<code>xleave</code>]</code></dt> <dt><code>broadcast</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>ttl</code> <kbd>ttl</kbd>]</code> <code>[<code>xleave</code>]</code></dt> <dt><code>manycastclient</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>ttl</code> <kbd>ttl</kbd>]</code></dt> @@ -440,10 +440,6 @@ The server is discarded by the selection algroithm. <dt><code>preempt</code></dt> <dd><p>Says the association can be preempted. </p></dd> -<dt><code>true</code></dt> -<dd><p>Marks the server as a truechimer. -Use this option only for testing. -</p></dd> <dt><code>prefer</code></dt> <dd><p>Marks the server as preferred. All other things being equal, @@ -458,7 +454,8 @@ provided in for further information. </p></dd> <dt><code>true</code></dt> -<dd><p>Forces the association to always survive the selection and clustering algorithms. +<dd><p>Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly <em>only</em> be used while testing an association. @@ -490,6 +487,14 @@ and <code>broadcast</code> modes only, this flag enables interleave mode. </p></dd> +<dt><code>xmtnonce</code></dt> +<dd><p>Valid only for +<code>server</code> +and +<code>pool</code> +modes, this flag puts a random number in the packet’s transmit timestamp. +</p> +</dd> </dl> <a name="Auxiliary-Commands"></a> <h4 class="subsubsection">1.1.1.2 Auxiliary Commands</h4> @@ -1862,6 +1867,11 @@ The is considered more specific and is sorted later in the list. </p></dd> +<dt><code>serverresponse fuzz</code></dt> +<dd><p>When reponding to server requests, +fuzz the low order bits of the +<code>reftime</code>. +</p></dd> <dt><code>version</code></dt> <dd><p>Deny packets that do not match the current NTP version. </p></dd> @@ -3077,6 +3087,22 @@ one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. </p></dd> +<dt><code>pollskewlist</code> <code>[<kbd>poll</kbd> <kbd>value</kbd> | <kbd>value</kbd>]</code> <kbd>...</kbd> <code>[<code>default</code> <kbd>value</kbd> | <kbd>value</kbd>]</code></dt> +<dd><p>Enable skewing of our poll requests to our servers. +<kbd>poll</kbd> +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. +</p></dd> <dt><code>reset</code> <code>[<code>allpeers</code>]</code> <code>[<code>auth</code>]</code> <code>[<code>ctl</code>]</code> <code>[<code>io</code>]</code> <code>[<code>mem</code>]</code> <code>[<code>sys</code>]</code> <code>[<code>timer</code>]</code></dt> <dd><p>Reset one or more groups of counters maintained by <code>ntpd</code> diff --git a/contrib/ntp/ntpd/ntp.conf.man.in b/contrib/ntp/ntpd/ntp.conf.man.in index d1d9ca5620184..f871c3bb17ea4 100644 --- a/contrib/ntp/ntpd/ntp.conf.man.in +++ b/contrib/ntp/ntpd/ntp.conf.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp.conf 5 "20 Feb 2019" "4.2.8p13" "File Formats" +.TH ntp.conf 5 "03 Mar 2020" "4.2.8p14" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:02 PM by AutoGen 5.18.5 .\" From the definitions ntp.conf.def .\" and the template file agman-cmd.tpl .SH NAME @@ -161,9 +161,9 @@ qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. .TP 7 -.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] +.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]xmtnonce\f[]] .TP 7 -.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] +.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xmtnonce\f[]] .TP 7 .NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xleave\f[]] .TP 7 @@ -352,10 +352,6 @@ The server is discarded by the selection algroithm. .NOP \f\*[B-Font]preempt\f[] Says the association can be preempted. .TP 7 -.NOP \f\*[B-Font]true\f[] -Marks the server as a truechimer. -Use this option only for testing. -.TP 7 .NOP \f\*[B-Font]prefer\f[] Marks the server as preferred. All other things being equal, @@ -370,7 +366,8 @@ provided in for further information. .TP 7 .NOP \f\*[B-Font]true\f[] -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly \fIonly\f[] be used while testing an association. @@ -401,6 +398,13 @@ Valid in and \f\*[B-Font]broadcast\f[] modes only, this flag enables interleave mode. +.TP 7 +.NOP \f\*[B-Font]xmtnonce\f[] +Valid only for +\f\*[B-Font]server\f[] +and +\f\*[B-Font]pool\f[] +modes, this flag puts a random number in the packet's transmit timestamp. .PP .SS Auxiliary Commands .TP 7 @@ -1838,6 +1842,11 @@ The is considered more specific and is sorted later in the list. .TP 7 +.NOP \f\*[B-Font]serverresponse fuzz\f[] +When reponding to server requests, +fuzz the low order bits of the +\f\*[B-Font]reftime\f[]. +.TP 7 .NOP \f\*[B-Font]version\f[] Deny packets that do not match the current NTP version. .RE @@ -3092,6 +3101,22 @@ one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. .TP 7 +.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] +Enable skewing of our poll requests to our servers. +\f\*[I-Font]poll\f[] +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. +.TP 7 .NOP \f\*[B-Font]reset\f[] [\f\*[B-Font]allpeers\f[]] [\f\*[B-Font]auth\f[]] [\f\*[B-Font]ctl\f[]] [\f\*[B-Font]io\f[]] [\f\*[B-Font]mem\f[]] [\f\*[B-Font]sys\f[]] [\f\*[B-Font]timer\f[]] Reset one or more groups of counters maintained by \f\*[B-Font]ntpd\f[] @@ -3424,7 +3449,7 @@ RFC5905 .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH BUGS The syntax checking is not picky; some combinations of diff --git a/contrib/ntp/ntpd/ntp.conf.mdoc.in b/contrib/ntp/ntpd/ntp.conf.mdoc.in index a1c795da2cf87..eaaf14cb09427 100644 --- a/contrib/ntp/ntpd/ntp.conf.mdoc.in +++ b/contrib/ntp/ntpd/ntp.conf.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTP_CONF 5 File Formats .Os .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:53 PM by AutoGen 5.18.5 .\" From the definitions ntp.conf.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -144,6 +144,7 @@ equivalent classes for that address family. .Op Cm prefer .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll +.Op Cm xmtnonce .Xc .It Xo Ic server Ar address .Op Cm key Ar key \&| Cm autokey @@ -154,6 +155,7 @@ equivalent classes for that address family. .Op Cm minpoll Ar minpoll .Op Cm maxpoll Ar maxpoll .Op Cm true +.Op Cm xmtnonce .Xc .It Xo Ic peer Ar address .Op Cm key Ar key \&| Cm autokey @@ -346,9 +348,6 @@ Marks the server as unused, except for display purposes. The server is discarded by the selection algroithm. .It Cm preempt Says the association can be preempted. -.It Cm true -Marks the server as a truechimer. -Use this option only for testing. .It Cm prefer Marks the server as preferred. All other things being equal, @@ -362,7 +361,8 @@ provided in .Pa /usr/share/doc/ntp ) for further information. .It Cm true -Forces the association to always survive the selection and clustering algorithms. +Marks the server as a truechimer, +forcing the association to always survive the selection and clustering algorithms. This option should almost certainly .Em only be used while testing an association. @@ -390,6 +390,12 @@ Valid in and .Cm broadcast modes only, this flag enables interleave mode. +.It Cm xmtnonce +Valid only for +.Cm server +and +.Cm pool +modes, this flag puts a random number in the packet's transmit timestamp. .El .Ss Auxiliary Commands .Bl -tag -width indent @@ -1694,6 +1700,10 @@ The .Cm ntpport is considered more specific and is sorted later in the list. +.It Ic "serverresponse fuzz" +When reponding to server requests, +fuzz the low order bits of the +.Cm reftime . .It Cm version Deny packets that do not match the current NTP version. .El @@ -2919,6 +2929,31 @@ For the JJY driver (type 40 mode 100 \- 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. +.It Xo Cm pollskewlist +.Oo +.Ar poll +.Ar value | value +.Oc +.Ar ... +.Oo +.Cm default +.Ar value | value +.Oc +.Xc +Enable skewing of our poll requests to our servers. +.Ar poll +is a number between 3 and 17 inclusive, identifying a specific poll interval. +A poll interval is 2^n seconds in duration, +so a poll value of 3 corresponds to 8 seconds +and +a poll interval of 17 corresponds to +131,072 seconds, or about a day and a half. +The next two numbers must be between 0 and one\-half of the poll interval, +inclusive. +The first number specifies how early the poll may start, +while +the second number specifies how late the poll may be delayed. +With no arguments, internally specified default values are chosen. .It Xo Ic reset .Oo .Ic allpeers @@ -3255,7 +3290,7 @@ A snapshot of this documentation is available in HTML format in .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh BUGS The syntax checking is not picky; some combinations of diff --git a/contrib/ntp/ntpd/ntp.keys.5man b/contrib/ntp/ntpd/ntp.keys.5man index 2642c5660b810..6225ee3f0ccd1 100644 --- a/contrib/ntp/ntpd/ntp.keys.5man +++ b/contrib/ntp/ntpd/ntp.keys.5man @@ -1,8 +1,8 @@ -.TH ntp.keys 5man "20 Feb 2019" "4.2.8p13" "File Formats" +.TH ntp.keys 5man "03 Mar 2020" "4.2.8p14" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (ntp.man) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:04 PM by AutoGen 5.18.5 .\" From the definitions ntp.keys.def .\" and the template file agman-file.tpl .Sh NAME @@ -176,7 +176,7 @@ the default name of the configuration file .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH "BUGS" Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org diff --git a/contrib/ntp/ntpd/ntp.keys.5mdoc b/contrib/ntp/ntpd/ntp.keys.5mdoc index 8a2dbcbc8938e..7a728a3d435fa 100644 --- a/contrib/ntp/ntpd/ntp.keys.5mdoc +++ b/contrib/ntp/ntpd/ntp.keys.5mdoc @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTP_KEYS 5mdoc File Formats .Os FreeBSD 11.2-RELEASE_SI .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:54 PM by AutoGen 5.18.5 .\" From the definitions ntp.keys.def .\" and the template file agmdoc-file.tpl .Sh NAME @@ -163,7 +163,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh "BUGS" Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org diff --git a/contrib/ntp/ntpd/ntp.keys.html b/contrib/ntp/ntpd/ntp.keys.html index 08d89221c5cf4..0151116926273 100644 --- a/contrib/ntp/ntpd/ntp.keys.html +++ b/contrib/ntp/ntpd/ntp.keys.html @@ -61,7 +61,7 @@ Next: <a href="#ntp_002ekeys-Description" accesskey="n" rel="next">ntp.keys Desc <p>This document describes the symmetric key file for the NTP Project’s <code>ntpd</code> program. </p> -<p>This document applies to version 4.2.8p13 of <code>ntp.keys</code>. +<p>This document applies to version 4.2.8p14 of <code>ntp.keys</code>. </p> <a name="SEC_Overview"></a> <h2 class="shortcontents-heading">Short Table of Contents</h2> diff --git a/contrib/ntp/ntpd/ntp.keys.man.in b/contrib/ntp/ntpd/ntp.keys.man.in index 9d8b995ca9482..dac04dda45fd4 100644 --- a/contrib/ntp/ntpd/ntp.keys.man.in +++ b/contrib/ntp/ntpd/ntp.keys.man.in @@ -1,8 +1,8 @@ -.TH ntp.keys 5 "20 Feb 2019" "4.2.8p13" "File Formats" +.TH ntp.keys 5 "03 Mar 2020" "4.2.8p14" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (ntp.man) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:04 PM by AutoGen 5.18.5 .\" From the definitions ntp.keys.def .\" and the template file agman-file.tpl .Sh NAME @@ -176,7 +176,7 @@ the default name of the configuration file .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH "BUGS" Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org diff --git a/contrib/ntp/ntpd/ntp.keys.mdoc.in b/contrib/ntp/ntpd/ntp.keys.mdoc.in index 1bc36e3ef75f0..0cbb20e0f4329 100644 --- a/contrib/ntp/ntpd/ntp.keys.mdoc.in +++ b/contrib/ntp/ntpd/ntp.keys.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTP_KEYS 5 File Formats .Os FreeBSD 11.2-RELEASE_SI .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:54 PM by AutoGen 5.18.5 .\" From the definitions ntp.keys.def .\" and the template file agmdoc-file.tpl .Sh NAME @@ -163,7 +163,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh "BUGS" Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org diff --git a/contrib/ntp/ntpd/ntp_config.c b/contrib/ntp/ntpd/ntp_config.c index 0597393513f55..ee9df318a630a 100644 --- a/contrib/ntp/ntpd/ntp_config.c +++ b/contrib/ntp/ntpd/ntp_config.c @@ -29,6 +29,7 @@ #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif +#include <time.h> #include <isc/net.h> #include <isc/result.h> @@ -148,7 +149,7 @@ typedef struct peer_resolved_ctx_tag { */ extern int yydebug; /* ntp_parser.c (.y) */ config_tree cfgt; /* Parser output stored here */ -struct config_tree_tag *cfg_tree_history; /* History of configs */ +config_tree *cfg_tree_history; /* History of configs */ char * sys_phone[MAXPHONE] = {NULL}; /* ACTS phone numbers */ char default_keysdir[] = NTP_KEYSDIR; char * keysdir = default_keysdir; /* crypto keys directory */ @@ -324,6 +325,7 @@ static void config_ntpdsim(config_tree *); static void config_ntpd(config_tree *, int/*BOOL*/ input_from_file); static void config_other_modes(config_tree *); static void config_auth(config_tree *); +static void attrtopsl(int poll, attr_val *avp); static void config_access(config_tree *); static void config_mdnstries(config_tree *); static void config_phone(config_tree *); @@ -500,6 +502,13 @@ dump_all_config_trees( { config_tree * cfg_ptr; int return_value; + time_t now = time(NULL); + struct tm tm = *localtime(&now); + + fprintf(df, "#NTF:D %04d%02d%02d@%02d:%02d:%02d\n", + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); + fprintf(df, "#NTF:V %s\n", Version); return_value = 0; for (cfg_ptr = cfg_tree_history; @@ -531,7 +540,6 @@ dump_config_tree( setvar_node *setv_node; nic_rule_node *rule_node; int_node *i_n; - int_node *flag_tok_fifo; int_node *counter_set; string_node *str_node; @@ -591,6 +599,11 @@ dump_config_tree( atrv = atrv->link; fprintf(df, " %s\n", normal_dtoa(atrv->value.d)); + } else if (T_Leapfile == atrv->attr) { + fputs((atrv->flag + ? " checkhash\n" + : " ignorehash\n"), + df); } else { fprintf(df, "\n"); } @@ -925,6 +938,21 @@ dump_config_tree( fprintf(df, "\n"); } + atrv = HEAD_PFIFO(ptree->pollskewlist); + if (atrv != NULL) { + fprintf(df, "pollskewlist"); + for ( ; atrv != NULL; atrv = atrv->link) { + if (-1 == atrv->attr) { + fprintf(df, " default"); + } else { + fprintf(df, " %d", atrv->attr); + } + fprintf(df, " %d|%d", + atrv->value.r.first, atrv->value.r.last); + } + fprintf(df, "\n"); + } + for (rest_node = HEAD_PFIFO(ptree->restrict_opts); rest_node != NULL; rest_node = rest_node->link) { @@ -933,9 +961,10 @@ dump_config_tree( if (NULL == rest_node->addr) { s = "default"; /* Don't need to set is_default=1 here */ - flag_tok_fifo = HEAD_PFIFO(rest_node->flag_tok_fifo); - for ( ; flag_tok_fifo != NULL; flag_tok_fifo = flag_tok_fifo->link) { - if (T_Source == flag_tok_fifo->i) { + atrv = HEAD_PFIFO(rest_node->flag_tok_fifo); + for ( ; atrv != NULL; atrv = atrv->link) { + if ( T_Integer == atrv->type + && T_Source == atrv->attr) { s = "source"; break; } @@ -967,11 +996,34 @@ dump_config_tree( fprintf(df, " mask %s", rest_node->mask->address); fprintf(df, " ippeerlimit %d", rest_node->ippeerlimit); - flag_tok_fifo = HEAD_PFIFO(rest_node->flag_tok_fifo); - for ( ; flag_tok_fifo != NULL; flag_tok_fifo = flag_tok_fifo->link) - if (T_Source != flag_tok_fifo->i) - fprintf(df, " %s", keyword(flag_tok_fifo->i)); - fprintf(df, "\n"); + atrv = HEAD_PFIFO(rest_node->flag_tok_fifo); + for ( ; atrv != NULL; atrv = atrv->link) { + if ( T_Integer == atrv->type + && T_Source != atrv->attr) { + fprintf(df, " %s", keyword(atrv->attr)); + } + } + fprintf(df, "\n"); +/**/ +#if 0 +msyslog(LOG_INFO, "Dumping flag_tok_fifo:"); +atrv = HEAD_PFIFO(rest_node->flag_tok_fifo); +for ( ; atrv != NULL; atrv = atrv->link) { + msyslog(LOG_INFO, "- flag_tok_fifo: flags: %08x", atrv->flag); + switch(atrv->type) { + case T_Integer: + msyslog(LOG_INFO, "- T_Integer: attr <%s>/%d, value %d", + keyword(atrv->attr), atrv->attr, atrv->value.i); + break; + default: + msyslog(LOG_INFO, "- Other: attr <%s>/%d, value ???", + keyword(atrv->attr), atrv->attr); + break; + + } +} +#endif +/**/ } rule_node = HEAD_PFIFO(ptree->nic_rules); @@ -1053,7 +1105,6 @@ dump_config_tree( #endif /* SAVECONFIG */ - /* generic fifo routines for structs linked by 1st member */ void * append_gen_fifo( @@ -1191,7 +1242,7 @@ create_attr_uval( attr_val * -create_attr_rangeval( +create_attr_rval( int attr, int first, int last @@ -1480,8 +1531,8 @@ create_restrict_node( address_node * addr, address_node * mask, short ippeerlimit, - int_fifo * flag_tok_fifo, - int line_no + attr_val_fifo * flag_tok_fifo, + int nline ) { restrict_node *my_node; @@ -1491,7 +1542,7 @@ create_restrict_node( my_node->mask = mask; my_node->ippeerlimit = ippeerlimit; my_node->flag_tok_fifo = flag_tok_fifo; - my_node->line_no = line_no; + my_node->line_no = nline; return my_node; } @@ -1507,7 +1558,7 @@ destroy_restrict_node( */ destroy_address_node(my_node->addr); destroy_address_node(my_node->mask); - destroy_int_fifo(my_node->flag_tok_fifo); + destroy_attr_val_fifo(my_node->flag_tok_fifo); free(my_node); } @@ -2307,7 +2358,7 @@ config_monitor( /* Set the statistics directory */ if (ptree->stats_dir) - stats_config(STATS_STATSDIR, ptree->stats_dir); + stats_config(STATS_STATSDIR, ptree->stats_dir, 0); /* NOTE: * Calling filegen_get is brain dead. Doing a string @@ -2472,7 +2523,6 @@ config_access( static int warned_signd; attr_val * my_opt; restrict_node * my_node; - int_node * curr_tok_fifo; sockaddr_u addr; sockaddr_u mask; struct addrinfo hints; @@ -2484,6 +2534,9 @@ config_access( u_short mflags; short ippeerlimit; int range_err; + psl_item my_psl_item; + attr_val * atrv; + attr_val * dflt_psl_atr; const char * signd_warning = #ifdef HAVE_NTP_SIGND "MS-SNTP signd operations currently block ntpd degrading service to all clients."; @@ -2599,25 +2652,24 @@ config_access( } } - /* Configure the restrict options */ + /* Configure each line of restrict options */ my_node = HEAD_PFIFO(ptree->restrict_opts); for (; my_node != NULL; my_node = my_node->link) { + /* Grab the ippeerlmit */ ippeerlimit = my_node->ippeerlimit; -DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippeerlimit)); - /* Parse the flags */ rflags = 0; mflags = 0; - curr_tok_fifo = HEAD_PFIFO(my_node->flag_tok_fifo); - for (; curr_tok_fifo != NULL; curr_tok_fifo = curr_tok_fifo->link) { - switch (curr_tok_fifo->i) { + my_opt = HEAD_PFIFO(my_node->flag_tok_fifo); + for (; my_opt != NULL; my_opt = my_opt->link) { + switch (my_opt->attr) { default: - fatal_error("config_access: flag-type-token=%d", curr_tok_fifo->i); + fatal_error("config_access: Unknown flag-type-token=%s/%d", keyword(my_opt->attr), my_opt->attr); case T_Ntpport: mflags |= RESM_NTPONLY; @@ -2639,10 +2691,6 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee rflags |= RES_KOD; break; - case T_Mssntp: - rflags |= RES_MSSNTP; - break; - case T_Limited: rflags |= RES_LIMITED; break; @@ -2651,6 +2699,10 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee rflags |= RES_LPTRAP; break; + case T_Mssntp: + rflags |= RES_MSSNTP; + break; + case T_Nomodify: rflags |= RES_NOMODIFY; break; @@ -2683,6 +2735,10 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee rflags |= RES_DONTTRUST; break; + case T_ServerresponseFuzz: + rflags |= RES_SRVRSPFUZ; + break; + case T_Version: rflags |= RES_VERSION; break; @@ -2822,10 +2878,171 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee if (ai_list != NULL) freeaddrinfo(ai_list); } + + /* Deal with the Poll Skew List */ + + ZERO(psl); + ZERO(my_psl_item); + + /* + * First, find the last default pollskewlist item. + * There should only be one of these with the current grammar, + * but better safe than sorry. + */ + dflt_psl_atr = NULL; + atrv = HEAD_PFIFO(ptree->pollskewlist); + for ( ; atrv != NULL; atrv = atrv->link) { + switch (atrv->attr) { + case -1: /* default */ + dflt_psl_atr = atrv; + break; + + case 3: /* Fall through */ + case 4: /* Fall through */ + case 5: /* Fall through */ + case 6: /* Fall through */ + case 7: /* Fall through */ + case 8: /* Fall through */ + case 9: /* Fall through */ + case 10: /* Fall through */ + case 11: /* Fall through */ + case 12: /* Fall through */ + case 13: /* Fall through */ + case 14: /* Fall through */ + case 15: /* Fall through */ + case 16: /* Fall through */ + case 17: + /* ignore */ + break; + + default: + msyslog(LOG_ERR, + "config_access: default PSL scan: ignoring unexpected poll value %d", + atrv->attr); + break; + } + } + + /* If we have a nonzero default, initialize the PSL */ + if ( dflt_psl_atr + && ( 0 != dflt_psl_atr->value.r.first + || 0 != dflt_psl_atr->value.r.last)) { + int i; + + for (i = 3; i <= 17; ++i) { + attrtopsl(i, dflt_psl_atr); + } + } + + /* Finally, update the PSL with any explicit entries */ + atrv = HEAD_PFIFO(ptree->pollskewlist); + for ( ; atrv != NULL; atrv = atrv->link) { + switch (atrv->attr) { + case -1: /* default */ + /* Ignore */ + break; + + case 3: /* Fall through */ + case 4: /* Fall through */ + case 5: /* Fall through */ + case 6: /* Fall through */ + case 7: /* Fall through */ + case 8: /* Fall through */ + case 9: /* Fall through */ + case 10: /* Fall through */ + case 11: /* Fall through */ + case 12: /* Fall through */ + case 13: /* Fall through */ + case 14: /* Fall through */ + case 15: /* Fall through */ + case 16: /* Fall through */ + case 17: + attrtopsl(atrv->attr, atrv); + break; + + default: + break; /* Ignore - we reported this above */ + } + } + +#if 0 + int p; + msyslog(LOG_INFO, "Dumping PSL:"); + for (p = 3; p <= 17; ++p) { + psl_item psi; + + if (0 == get_pollskew(p, &psi)) { + msyslog(LOG_INFO, "poll %d: sub %d, qty %d, msk %d", + p, psi.sub, psi.qty, psi.msk); + } else { + msyslog(LOG_ERR, "Dumping PSL: get_pollskew(%d) failed!", p); + } + } +#endif } + + +void +attrtopsl(int poll, attr_val *avp) +{ + + DEBUG_INSIST((poll - 3) < sizeof psl); + if (poll < 3 || poll > 17) { + msyslog(LOG_ERR, "attrtopsl(%d, ...): Poll value is out of range - ignoring", poll); + } else { + int pao = poll - 3; /* poll array offset */ + int lower = avp->value.r.first; /* a positive number */ + int upper = avp->value.r.last; + int psmax = 1 << (poll - 1); + int qmsk; + + if (lower > psmax) { + msyslog(LOG_WARNING, "attrtopsl: default: poll %d lower bound reduced from %d to %d", + poll, lower, psmax); + lower = psmax; + } + if (upper > psmax) { + msyslog(LOG_WARNING, "attrtopsl: default: poll %d upper bound reduced from %d to %d", + poll, upper, psmax); + upper = psmax; + } + psl[pao].sub = lower; + psl[pao].qty = lower + upper; + + qmsk = 1; + while (qmsk < (lower + upper)) { + qmsk <<= 1; + qmsk |= 1; + }; + psl[pao].msk = qmsk; + } + + return; +} #endif /* !SIM */ +int +get_pollskew( + int p, + psl_item *rv + ) +{ + + DEBUG_INSIST(3 <= p && 17 >= p); + if (3 <= p && 17 >= p) { + *rv = psl[p - 3]; + + return 0; + } else { + msyslog(LOG_ERR, "get_pollskew(%d): poll is not between 3 and 17!", p); + return -1; + } + + /* NOTREACHED */ +} + + #ifdef FREE_CFG_T static void free_config_access( @@ -3644,6 +3861,13 @@ config_fudge( /* Parse all the options to the fudge command */ ZERO(clock_stat); + /* some things are not necessarily cleared by ZERO...*/ + clock_stat.fudgeminjitter = 0.0; + clock_stat.fudgetime1 = 0.0; + clock_stat.fudgetime2 = 0.0; + clock_stat.p_lastcode = NULL; + clock_stat.clockdesc = NULL; + clock_stat.kv_list = NULL; curr_opt = HEAD_PFIFO(curr_fudge->options); for (; curr_opt != NULL; curr_opt = curr_opt->link) { switch (curr_opt->attr) { @@ -3665,10 +3889,9 @@ config_fudge( case T_Refid: clock_stat.haveflags |= CLK_HAVEVAL2; - clock_stat.fudgeval2 = 0; - memcpy(&clock_stat.fudgeval2, - curr_opt->value.s, - min(strlen(curr_opt->value.s), 4)); + /* strncpy() does exactly what we want here: */ + strncpy((char*)&clock_stat.fudgeval2, + curr_opt->value.s, 4); break; case T_Flag1: @@ -3703,6 +3926,11 @@ config_fudge( clock_stat.flags &= ~CLK_FLAG4; break; + case T_Minjitter: + clock_stat.haveflags |= CLK_HAVEMINJIT; + clock_stat.fudgeminjitter = curr_opt->value.d; + break; + default: msyslog(LOG_ERR, "Unexpected fudge flag %s (%d) for %s", @@ -3757,7 +3985,7 @@ config_vars( stats_drift_file = 0; msyslog(LOG_INFO, "config: driftfile disabled"); } else - stats_config(STATS_FREQ_FILE, curr_var->value.s); + stats_config(STATS_FREQ_FILE, curr_var->value.s, 0); break; case T_Dscp: @@ -3775,7 +4003,7 @@ config_vars( break; case T_Leapfile: - stats_config(STATS_LEAP_FILE, curr_var->value.s); + stats_config(STATS_LEAP_FILE, curr_var->value.s, curr_var->flag); break; #ifdef LEAP_SMEAR @@ -3786,7 +4014,7 @@ config_vars( #endif case T_Pidfile: - stats_config(STATS_PID_FILE, curr_var->value.s); + stats_config(STATS_PID_FILE, curr_var->value.s, 0); break; case T_Logfile: @@ -3866,9 +4094,9 @@ is_sane_resolved_address( return 0; } /* - * Shouldn't be able to specify multicast - * address for server/peer! - * and unicast address for manycastclient! + * Shouldn't be able to specify: + * - multicast address for server/peer! + * - unicast address for manycastclient! */ if ((T_Server == hmode || T_Peer == hmode || T_Pool == hmode) && IS_MCAST(peeraddr)) { @@ -3928,9 +4156,12 @@ peerflag_bits( { int peerflags; attr_val *option; + int hmode; + DEBUG_INSIST(pn); /* translate peerflags options to bits */ peerflags = 0; + hmode = pn->host_mode; option = HEAD_PFIFO(pn->peerflags); for (; option != NULL; option = option->link) { switch (option->value.i) { @@ -3969,6 +4200,12 @@ peerflag_bits( case T_Xleave: peerflags |= FLAG_XLEAVE; break; + + case T_Xmtnonce: + if ( MODE_CLIENT == hmode ) { + peerflags |= FLAG_LOOPNONCE; + } + break; } } @@ -5278,7 +5515,9 @@ ntp_rlimit( char * -build_iflags(u_int32 iflags) +build_iflags( + u_int32 iflags + ) { static char ifs[1024]; @@ -5351,7 +5590,9 @@ build_iflags(u_int32 iflags) char * -build_mflags(u_short mflags) +build_mflags( + u_short mflags + ) { static char mfs[1024]; @@ -5379,7 +5620,9 @@ build_mflags(u_short mflags) char * -build_rflags(u_short rflags) +build_rflags( + u_short rflags + ) { static char rfs[1024]; @@ -5455,6 +5698,11 @@ build_rflags(u_short rflags) appendstr(rfs, sizeof rfs, "notrust"); } + if (rflags & RES_SRVRSPFUZ) { + rflags &= ~RES_SRVRSPFUZ; + appendstr(rfs, sizeof rfs, "srvrspfuz"); + } + if (rflags & RES_VERSION) { rflags &= ~RES_VERSION; appendstr(rfs, sizeof rfs, "version"); diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c index 49a197ed7c61c..9c408034a4d7d 100644 --- a/contrib/ntp/ntpd/ntp_control.c +++ b/contrib/ntp/ntpd/ntp_control.c @@ -28,6 +28,8 @@ #include "ntp_leapsec.h" #include "ntp_md5.h" /* provides OpenSSL digest API */ #include "lib_strbuf.h" +#include "timexsup.h" + #include <rc_cmdlength.h> #ifdef KERNEL_PLL # include "ntp_syscall.h" @@ -327,7 +329,8 @@ static const struct ctl_proc control_codes[] = { #define CC_FLAGS 11 #define CC_DEVICE 12 #define CC_VARLIST 13 -#define CC_MAXCODE CC_VARLIST +#define CC_FUDGEMINJIT 14 +#define CC_MAXCODE CC_FUDGEMINJIT /* * System variable values. The array can be indexed by the variable @@ -625,7 +628,8 @@ static const struct ctl_var clock_var[] = { { CC_FLAGS, RO, "flags" }, /* 11 */ { CC_DEVICE, RO, "device" }, /* 12 */ { CC_VARLIST, RO, "clock_var_list" }, /* 13 */ - { 0, EOV, "" } /* 14 */ + { CC_FUDGEMINJIT, RO, "minjitter" }, /* 14 */ + { 0, EOV, "" } /* 15 */ }; @@ -640,6 +644,7 @@ static const u_char def_clock_var[] = { CC_NOREPLY, CC_BADFORMAT, CC_BADDATA, + CC_FUDGEMINJIT, CC_FUDGETIME1, CC_FUDGETIME2, CC_FUDGEVAL1, @@ -1187,15 +1192,21 @@ process_control( pkt = (struct ntp_control *)&rbufp->recv_pkt; /* - * If the length is less than required for the header, or - * it is a response or a fragment, ignore this. + * If the length is less than required for the header, + * ignore it. */ - if (rbufp->recv_length < (int)CTL_HEADER_LEN - || (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op + if (rbufp->recv_length < (int)CTL_HEADER_LEN) { + DPRINTF(1, ("Short control packet\n")); + numctltooshort++; + return; + } + + /* + * If this packet is a response or a fragment, ignore it. + */ + if ( (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op || pkt->offset != 0) { DPRINTF(1, ("invalid format in control packet\n")); - if (rbufp->recv_length < (int)CTL_HEADER_LEN) - numctltooshort++; if (CTL_RESPONSE & pkt->r_m_e_op) numctlinputresp++; if (CTL_MORE & pkt->r_m_e_op) @@ -1206,6 +1217,7 @@ process_control( numctlbadoffset++; return; } + res_version = PKT_VERSION(pkt->li_vn_mode); if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) { DPRINTF(1, ("unknown version %d in control packet\n", @@ -1910,15 +1922,6 @@ ctl_putsys( static struct timex ntx; static u_long ntp_adjtime_time; - static const double to_ms_usec = - 1.0e-3; /* usec to msec */ - static const double to_ms_nusec = -# ifdef STA_NANO - 1.0e-6; /* nsec to msec */ -# else - to_ms_usec; -# endif - /* * CS_K_* variables depend on up-to-date output of ntp_adjtime() */ @@ -2321,7 +2324,8 @@ ctl_putsys( case CS_K_OFFSET: CTL_IF_KERNLOOP( ctl_putdblf, - (sys_var[varid].text, 0, -1, to_ms_nusec * ntx.offset) + (sys_var[varid].text, 0, -1, + 1000 * dbl_from_var_long(ntx.offset, ntx.status)) ); break; @@ -2336,7 +2340,7 @@ ctl_putsys( CTL_IF_KERNLOOP( ctl_putdblf, (sys_var[varid].text, 0, 6, - to_ms_usec * ntx.maxerror) + 1000 * dbl_from_usec_long(ntx.maxerror)) ); break; @@ -2344,7 +2348,7 @@ ctl_putsys( CTL_IF_KERNLOOP( ctl_putdblf, (sys_var[varid].text, 0, 6, - to_ms_usec * ntx.esterror) + 1000 * dbl_from_usec_long(ntx.esterror)) ); break; @@ -2368,7 +2372,7 @@ ctl_putsys( CTL_IF_KERNLOOP( ctl_putdblf, (sys_var[varid].text, 0, 6, - to_ms_usec * ntx.precision) + 1000 * dbl_from_var_long(ntx.precision, ntx.status)) ); break; @@ -2396,7 +2400,8 @@ ctl_putsys( case CS_K_PPS_JITTER: CTL_IF_KERNPPS( ctl_putdbl, - (sys_var[varid].text, to_ms_nusec * ntx.jitter) + (sys_var[varid].text, + 1000 * dbl_from_var_long(ntx.jitter, ntx.status)) ); break; @@ -2965,14 +2970,9 @@ ctl_putclock( break; case CC_FUDGEVAL2: - if (mustput || (pcs->haveflags & CLK_HAVEVAL2)) { - if (pcs->fudgeval1 > 1) - ctl_putadr(clock_var[id].text, - pcs->fudgeval2, NULL); - else - ctl_putrefid(clock_var[id].text, - pcs->fudgeval2); - } + /* RefID of clocks are always text even if stratum is fudged */ + if (mustput || (pcs->haveflags & CLK_HAVEVAL2)) + ctl_putrefid(clock_var[id].text, pcs->fudgeval2); break; case CC_FLAGS: @@ -3045,6 +3045,16 @@ ctl_putclock( *s = '\0'; ctl_putdata(buf, (unsigned)(s - buf), 0); break; + + case CC_FUDGEMINJIT: + if (mustput || (pcs->haveflags & CLK_HAVEMINJIT)) + ctl_putdbl(clock_var[id].text, + pcs->fudgeminjitter * 1e3); + break; + + default: + break; + } } #endif diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index b89b996e9310c..4ad1c7fbc3e5f 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -177,7 +177,7 @@ endpt * any_interface; /* wildcard ipv4 interface */ endpt * any6_interface; /* wildcard ipv6 interface */ endpt * loopback_interface; /* loopback ipv4 interface */ -isc_boolean_t broadcast_client_enabled; /* is broadcast client enabled */ +static isc_boolean_t broadcast_client_enabled; /* is broadcast client enabled */ u_int sys_ifnum; /* next .ifnum to assign */ int ninterfaces; /* Total number of interfaces */ @@ -2011,10 +2011,7 @@ update_interfaces( */ refresh_all_peerinterfaces(); - if (broadcast_client_enabled) - io_setbclient(); - - if (sys_bclient) + if (broadcast_client_enabled || sys_bclient) io_setbclient(); #ifdef MCAST @@ -2343,11 +2340,12 @@ socket_broadcast_disable( /* * return the broadcast client flag value */ -isc_boolean_t +/*isc_boolean_t get_broadcastclient_flag(void) { return (broadcast_client_enabled); } +*/ /* * Check to see if the address is a multicast address @@ -2605,32 +2603,38 @@ void io_setbclient(void) { #ifdef OPEN_BCAST_SOCKET - struct interface * interf; - unsigned int nif; + endpt * ep; + unsigned int nif, ni4, ni6; - nif = 0; + nif = ni4 = ni6 = 0; set_reuseaddr(1); - for (interf = ep_list; - interf != NULL; - interf = interf->elink) { - - if (interf->flags & (INT_WILDCARD | INT_LOOPBACK)) + for (ep = ep_list; ep != NULL; ep = ep->elink) { + /* count IPv6 vs IPv4 interfaces. Needed later to decide + * if we should log an error or not. + */ + switch (ep->family) { + case AF_INET : ++ni4; break; + case AF_INET6: ++ni6; break; + default : break; + } + + if (ep->flags & (INT_WILDCARD | INT_LOOPBACK)) continue; /* use only allowed addresses */ - if (interf->ignore_packets) + if (ep->ignore_packets) continue; /* Need a broadcast-capable interface */ - if (!(interf->flags & INT_BROADCAST)) + if (!(ep->flags & INT_BROADCAST)) continue; /* Only IPv4 addresses are valid for broadcast */ - REQUIRE(IS_IPV4(&interf->bcast)); + REQUIRE(IS_IPV4(&ep->bcast)); /* Do we already have the broadcast address open? */ - if (interf->flags & INT_BCASTOPEN) { + if (ep->flags & INT_BCASTOPEN) { /* * account for already open interfaces to avoid * misleading warning below @@ -2642,19 +2646,19 @@ io_setbclient(void) /* * Try to open the broadcast address */ - interf->family = AF_INET; - interf->bfd = open_socket(&interf->bcast, 1, 0, interf); + ep->family = AF_INET; + ep->bfd = open_socket(&ep->bcast, 1, 0, ep); /* * If we succeeded then we use it otherwise enable * broadcast on the interface address */ - if (interf->bfd != INVALID_SOCKET) { + if (ep->bfd != INVALID_SOCKET) { nif++; - interf->flags |= INT_BCASTOPEN; + ep->flags |= INT_BCASTOPEN; msyslog(LOG_INFO, "Listen for broadcasts to %s on interface #%d %s", - stoa(&interf->bcast), interf->ifnum, interf->name); + stoa(&ep->bcast), ep->ifnum, ep->name); } else switch (errno) { /* Silently ignore EADDRINUSE as we probably * opened the socket already for an address in @@ -2668,8 +2672,8 @@ io_setbclient(void) * regular socket, it's quite useless to try this * again. */ - if (interf->fd != INVALID_SOCKET) { - interf->flags |= INT_BCASTOPEN; + if (ep->fd != INVALID_SOCKET) { + ep->flags |= INT_BCASTOPEN; nif++; } # endif @@ -2678,7 +2682,7 @@ io_setbclient(void) default: msyslog(LOG_INFO, "failed to listen for broadcasts to %s on interface #%d %s", - stoa(&interf->bcast), interf->ifnum, interf->name); + stoa(&ep->bcast), ep->ifnum, ep->name); break; } } @@ -2688,8 +2692,14 @@ io_setbclient(void) DPRINTF(1, ("io_setbclient: listening to %d broadcast addresses\n", nif)); } else { broadcast_client_enabled = ISC_FALSE; - msyslog(LOG_ERR, - "Unable to listen for broadcasts, no broadcast interfaces available"); + /* This is expected when having only IPv6 interfaces + * and no IPv4 interfaces at all. We suppress the error + * log in that case... everything else should work! + */ + if (ni4 && !ni6) { + msyslog(LOG_ERR, + "Unable to listen for broadcasts, no broadcast interfaces available"); + } } #else msyslog(LOG_ERR, @@ -3134,7 +3144,8 @@ sendpkt( int rc; u_char cttl; l_fp fp_zero = { { 0 }, 0 }; - + l_fp org, rec, xmt; + ismcast = IS_MCAST(dest); if (!ismcast) src = ep; @@ -3219,11 +3230,14 @@ sendpkt( } while (ismcast && src != NULL); /* HMS: pkt->rootdisp is usually random here */ + NTOHL_FP(&pkt->org, &org); + NTOHL_FP(&pkt->rec, &rec); + NTOHL_FP(&pkt->xmt, &xmt); record_raw_stats(src ? &src->sin : NULL, dest, - &pkt->org, &pkt->rec, &pkt->xmt, &fp_zero, - PKT_MODE(pkt->li_vn_mode), - PKT_VERSION(pkt->li_vn_mode), + &org, &rec, &xmt, &fp_zero, PKT_LEAP(pkt->li_vn_mode), + PKT_VERSION(pkt->li_vn_mode), + PKT_MODE(pkt->li_vn_mode), pkt->stratum, pkt->ppoll, pkt->precision, pkt->rootdelay, pkt->rootdisp, pkt->refid, diff --git a/contrib/ntp/ntpd/ntp_keyword.h b/contrib/ntp/ntpd/ntp_keyword.h index 663881006a6c9..ab96b47c0d7a2 100644 --- a/contrib/ntp/ntpd/ntp_keyword.h +++ b/contrib/ntp/ntpd/ntp_keyword.h @@ -2,7 +2,7 @@ * ntp_keyword.h * * NOTE: edit this file with caution, it is generated by keyword-gen.c - * Generated 2018-01-14 03:53:33 UTC diff_ignore_line + * Generated 2020-02-13 08:56:28 UTC diff_ignore_line * */ #include "ntp_scanner.h" @@ -10,7 +10,7 @@ #define LOWEST_KEYWORD_ID 258 -const char * const keyword_text[200] = { +const char * const keyword_text[209] = { /* 0 258 T_Abbrev */ "abbrev", /* 1 259 T_Age */ "age", /* 2 260 T_All */ "all", @@ -30,197 +30,206 @@ const char * const keyword_text[200] = { /* 16 274 T_Burst */ "burst", /* 17 275 T_Calibrate */ "calibrate", /* 18 276 T_Ceiling */ "ceiling", - /* 19 277 T_Clockstats */ "clockstats", - /* 20 278 T_Cohort */ "cohort", - /* 21 279 T_ControlKey */ "controlkey", - /* 22 280 T_Crypto */ "crypto", - /* 23 281 T_Cryptostats */ "cryptostats", - /* 24 282 T_Ctl */ "ctl", - /* 25 283 T_Day */ "day", - /* 26 284 T_Default */ "default", - /* 27 285 T_Digest */ "digest", - /* 28 286 T_Disable */ "disable", - /* 29 287 T_Discard */ "discard", - /* 30 288 T_Dispersion */ "dispersion", - /* 31 289 T_Double */ NULL, - /* 32 290 T_Driftfile */ "driftfile", - /* 33 291 T_Drop */ "drop", - /* 34 292 T_Dscp */ "dscp", - /* 35 293 T_Ellipsis */ "...", - /* 36 294 T_Enable */ "enable", - /* 37 295 T_End */ "end", - /* 38 296 T_Epeer */ "epeer", - /* 39 297 T_False */ NULL, - /* 40 298 T_File */ "file", - /* 41 299 T_Filegen */ "filegen", - /* 42 300 T_Filenum */ "filenum", - /* 43 301 T_Flag1 */ "flag1", - /* 44 302 T_Flag2 */ "flag2", - /* 45 303 T_Flag3 */ "flag3", - /* 46 304 T_Flag4 */ "flag4", - /* 47 305 T_Flake */ "flake", - /* 48 306 T_Floor */ "floor", - /* 49 307 T_Freq */ "freq", - /* 50 308 T_Fudge */ "fudge", - /* 51 309 T_Host */ "host", - /* 52 310 T_Huffpuff */ "huffpuff", - /* 53 311 T_Iburst */ "iburst", - /* 54 312 T_Ident */ "ident", - /* 55 313 T_Ignore */ "ignore", - /* 56 314 T_Incalloc */ "incalloc", - /* 57 315 T_Incmem */ "incmem", - /* 58 316 T_Initalloc */ "initalloc", - /* 59 317 T_Initmem */ "initmem", - /* 60 318 T_Includefile */ "includefile", - /* 61 319 T_Integer */ NULL, - /* 62 320 T_Interface */ "interface", - /* 63 321 T_Intrange */ NULL, - /* 64 322 T_Io */ "io", - /* 65 323 T_Ippeerlimit */ "ippeerlimit", - /* 66 324 T_Ipv4 */ "ipv4", - /* 67 325 T_Ipv4_flag */ "-4", - /* 68 326 T_Ipv6 */ "ipv6", - /* 69 327 T_Ipv6_flag */ "-6", - /* 70 328 T_Kernel */ "kernel", - /* 71 329 T_Key */ "key", - /* 72 330 T_Keys */ "keys", - /* 73 331 T_Keysdir */ "keysdir", - /* 74 332 T_Kod */ "kod", - /* 75 333 T_Mssntp */ "mssntp", - /* 76 334 T_Leapfile */ "leapfile", - /* 77 335 T_Leapsmearinterval */ "leapsmearinterval", - /* 78 336 T_Limited */ "limited", - /* 79 337 T_Link */ "link", - /* 80 338 T_Listen */ "listen", - /* 81 339 T_Logconfig */ "logconfig", - /* 82 340 T_Logfile */ "logfile", - /* 83 341 T_Loopstats */ "loopstats", - /* 84 342 T_Lowpriotrap */ "lowpriotrap", - /* 85 343 T_Manycastclient */ "manycastclient", - /* 86 344 T_Manycastserver */ "manycastserver", - /* 87 345 T_Mask */ "mask", - /* 88 346 T_Maxage */ "maxage", - /* 89 347 T_Maxclock */ "maxclock", - /* 90 348 T_Maxdepth */ "maxdepth", - /* 91 349 T_Maxdist */ "maxdist", - /* 92 350 T_Maxmem */ "maxmem", - /* 93 351 T_Maxpoll */ "maxpoll", - /* 94 352 T_Mdnstries */ "mdnstries", - /* 95 353 T_Mem */ "mem", - /* 96 354 T_Memlock */ "memlock", - /* 97 355 T_Minclock */ "minclock", - /* 98 356 T_Mindepth */ "mindepth", - /* 99 357 T_Mindist */ "mindist", - /* 100 358 T_Minimum */ "minimum", - /* 101 359 T_Minpoll */ "minpoll", - /* 102 360 T_Minsane */ "minsane", - /* 103 361 T_Mode */ "mode", - /* 104 362 T_Mode7 */ "mode7", - /* 105 363 T_Monitor */ "monitor", - /* 106 364 T_Month */ "month", - /* 107 365 T_Mru */ "mru", - /* 108 366 T_Multicastclient */ "multicastclient", - /* 109 367 T_Nic */ "nic", - /* 110 368 T_Nolink */ "nolink", - /* 111 369 T_Nomodify */ "nomodify", - /* 112 370 T_Nomrulist */ "nomrulist", - /* 113 371 T_None */ "none", - /* 114 372 T_Nonvolatile */ "nonvolatile", - /* 115 373 T_Noepeer */ "noepeer", - /* 116 374 T_Nopeer */ "nopeer", - /* 117 375 T_Noquery */ "noquery", - /* 118 376 T_Noselect */ "noselect", - /* 119 377 T_Noserve */ "noserve", - /* 120 378 T_Notrap */ "notrap", - /* 121 379 T_Notrust */ "notrust", - /* 122 380 T_Ntp */ "ntp", - /* 123 381 T_Ntpport */ "ntpport", - /* 124 382 T_NtpSignDsocket */ "ntpsigndsocket", - /* 125 383 T_Orphan */ "orphan", - /* 126 384 T_Orphanwait */ "orphanwait", - /* 127 385 T_PCEdigest */ "peer_clear_digest_early", - /* 128 386 T_Panic */ "panic", - /* 129 387 T_Peer */ "peer", - /* 130 388 T_Peerstats */ "peerstats", - /* 131 389 T_Phone */ "phone", - /* 132 390 T_Pid */ "pid", - /* 133 391 T_Pidfile */ "pidfile", - /* 134 392 T_Pool */ "pool", - /* 135 393 T_Port */ "port", - /* 136 394 T_Preempt */ "preempt", - /* 137 395 T_Prefer */ "prefer", - /* 138 396 T_Protostats */ "protostats", - /* 139 397 T_Pw */ "pw", - /* 140 398 T_Randfile */ "randfile", - /* 141 399 T_Rawstats */ "rawstats", - /* 142 400 T_Refid */ "refid", - /* 143 401 T_Requestkey */ "requestkey", - /* 144 402 T_Reset */ "reset", - /* 145 403 T_Restrict */ "restrict", - /* 146 404 T_Revoke */ "revoke", - /* 147 405 T_Rlimit */ "rlimit", - /* 148 406 T_Saveconfigdir */ "saveconfigdir", - /* 149 407 T_Server */ "server", - /* 150 408 T_Setvar */ "setvar", - /* 151 409 T_Source */ "source", - /* 152 410 T_Stacksize */ "stacksize", - /* 153 411 T_Statistics */ "statistics", - /* 154 412 T_Stats */ "stats", - /* 155 413 T_Statsdir */ "statsdir", - /* 156 414 T_Step */ "step", - /* 157 415 T_Stepback */ "stepback", - /* 158 416 T_Stepfwd */ "stepfwd", - /* 159 417 T_Stepout */ "stepout", - /* 160 418 T_Stratum */ "stratum", - /* 161 419 T_String */ NULL, - /* 162 420 T_Sys */ "sys", - /* 163 421 T_Sysstats */ "sysstats", - /* 164 422 T_Tick */ "tick", - /* 165 423 T_Time1 */ "time1", - /* 166 424 T_Time2 */ "time2", - /* 167 425 T_Timer */ "timer", - /* 168 426 T_Timingstats */ "timingstats", - /* 169 427 T_Tinker */ "tinker", - /* 170 428 T_Tos */ "tos", - /* 171 429 T_Trap */ "trap", - /* 172 430 T_True */ "true", - /* 173 431 T_Trustedkey */ "trustedkey", - /* 174 432 T_Ttl */ "ttl", - /* 175 433 T_Type */ "type", - /* 176 434 T_U_int */ NULL, - /* 177 435 T_UEcrypto */ "unpeer_crypto_early", - /* 178 436 T_UEcryptonak */ "unpeer_crypto_nak_early", - /* 179 437 T_UEdigest */ "unpeer_digest_early", - /* 180 438 T_Unconfig */ "unconfig", - /* 181 439 T_Unpeer */ "unpeer", - /* 182 440 T_Version */ "version", - /* 183 441 T_WanderThreshold */ NULL, - /* 184 442 T_Week */ "week", - /* 185 443 T_Wildcard */ "wildcard", - /* 186 444 T_Xleave */ "xleave", - /* 187 445 T_Year */ "year", - /* 188 446 T_Flag */ NULL, - /* 189 447 T_EOC */ NULL, - /* 190 448 T_Simulate */ "simulate", - /* 191 449 T_Beep_Delay */ "beep_delay", - /* 192 450 T_Sim_Duration */ "simulation_duration", - /* 193 451 T_Server_Offset */ "server_offset", - /* 194 452 T_Duration */ "duration", - /* 195 453 T_Freq_Offset */ "freq_offset", - /* 196 454 T_Wander */ "wander", - /* 197 455 T_Jitter */ "jitter", - /* 198 456 T_Prop_Delay */ "prop_delay", - /* 199 457 T_Proc_Delay */ "proc_delay" + /* 19 277 T_Checkhash */ "checkhash", + /* 20 278 T_Clockstats */ "clockstats", + /* 21 279 T_Cohort */ "cohort", + /* 22 280 T_ControlKey */ "controlkey", + /* 23 281 T_Crypto */ "crypto", + /* 24 282 T_Cryptostats */ "cryptostats", + /* 25 283 T_Ctl */ "ctl", + /* 26 284 T_Day */ "day", + /* 27 285 T_Default */ "default", + /* 28 286 T_Digest */ "digest", + /* 29 287 T_Disable */ "disable", + /* 30 288 T_Discard */ "discard", + /* 31 289 T_Dispersion */ "dispersion", + /* 32 290 T_Double */ NULL, + /* 33 291 T_Driftfile */ "driftfile", + /* 34 292 T_Drop */ "drop", + /* 35 293 T_Dscp */ "dscp", + /* 36 294 T_Ellipsis */ "...", + /* 37 295 T_Enable */ "enable", + /* 38 296 T_End */ "end", + /* 39 297 T_Epeer */ "epeer", + /* 40 298 T_False */ NULL, + /* 41 299 T_File */ "file", + /* 42 300 T_Filegen */ "filegen", + /* 43 301 T_Filenum */ "filenum", + /* 44 302 T_Flag1 */ "flag1", + /* 45 303 T_Flag2 */ "flag2", + /* 46 304 T_Flag3 */ "flag3", + /* 47 305 T_Flag4 */ "flag4", + /* 48 306 T_Flake */ "flake", + /* 49 307 T_Floor */ "floor", + /* 50 308 T_Freq */ "freq", + /* 51 309 T_Fudge */ "fudge", + /* 52 310 T_Fuzz */ "fuzz", + /* 53 311 T_Host */ "host", + /* 54 312 T_Huffpuff */ "huffpuff", + /* 55 313 T_Iburst */ "iburst", + /* 56 314 T_Ident */ "ident", + /* 57 315 T_Ignore */ "ignore", + /* 58 316 T_Ignorehash */ "ignorehash", + /* 59 317 T_Incalloc */ "incalloc", + /* 60 318 T_Incmem */ "incmem", + /* 61 319 T_Initalloc */ "initalloc", + /* 62 320 T_Initmem */ "initmem", + /* 63 321 T_Includefile */ "includefile", + /* 64 322 T_Integer */ NULL, + /* 65 323 T_Interface */ "interface", + /* 66 324 T_Intrange */ NULL, + /* 67 325 T_Io */ "io", + /* 68 326 T_Ippeerlimit */ "ippeerlimit", + /* 69 327 T_Ipv4 */ "ipv4", + /* 70 328 T_Ipv4_flag */ "-4", + /* 71 329 T_Ipv6 */ "ipv6", + /* 72 330 T_Ipv6_flag */ "-6", + /* 73 331 T_Kernel */ "kernel", + /* 74 332 T_Key */ "key", + /* 75 333 T_Keys */ "keys", + /* 76 334 T_Keysdir */ "keysdir", + /* 77 335 T_Kod */ "kod", + /* 78 336 T_Leapfile */ "leapfile", + /* 79 337 T_Leapsmearinterval */ "leapsmearinterval", + /* 80 338 T_Limited */ "limited", + /* 81 339 T_Link */ "link", + /* 82 340 T_Listen */ "listen", + /* 83 341 T_Logconfig */ "logconfig", + /* 84 342 T_Logfile */ "logfile", + /* 85 343 T_Loopstats */ "loopstats", + /* 86 344 T_Lowpriotrap */ "lowpriotrap", + /* 87 345 T_Manycastclient */ "manycastclient", + /* 88 346 T_Manycastserver */ "manycastserver", + /* 89 347 T_Mask */ "mask", + /* 90 348 T_Maxage */ "maxage", + /* 91 349 T_Maxclock */ "maxclock", + /* 92 350 T_Maxdepth */ "maxdepth", + /* 93 351 T_Maxdist */ "maxdist", + /* 94 352 T_Maxmem */ "maxmem", + /* 95 353 T_Maxpoll */ "maxpoll", + /* 96 354 T_Mdnstries */ "mdnstries", + /* 97 355 T_Mem */ "mem", + /* 98 356 T_Memlock */ "memlock", + /* 99 357 T_Minclock */ "minclock", + /* 100 358 T_Mindepth */ "mindepth", + /* 101 359 T_Mindist */ "mindist", + /* 102 360 T_Minimum */ "minimum", + /* 103 361 T_Minjitter */ "minjitter", + /* 104 362 T_Minpoll */ "minpoll", + /* 105 363 T_Minsane */ "minsane", + /* 106 364 T_Mode */ "mode", + /* 107 365 T_Mode7 */ "mode7", + /* 108 366 T_Monitor */ "monitor", + /* 109 367 T_Month */ "month", + /* 110 368 T_Mru */ "mru", + /* 111 369 T_Mssntp */ "mssntp", + /* 112 370 T_Multicastclient */ "multicastclient", + /* 113 371 T_Nic */ "nic", + /* 114 372 T_Nolink */ "nolink", + /* 115 373 T_Nomodify */ "nomodify", + /* 116 374 T_Nomrulist */ "nomrulist", + /* 117 375 T_None */ "none", + /* 118 376 T_Nonvolatile */ "nonvolatile", + /* 119 377 T_Noepeer */ "noepeer", + /* 120 378 T_Nopeer */ "nopeer", + /* 121 379 T_Noquery */ "noquery", + /* 122 380 T_Noselect */ "noselect", + /* 123 381 T_Noserve */ "noserve", + /* 124 382 T_Notrap */ "notrap", + /* 125 383 T_Notrust */ "notrust", + /* 126 384 T_Ntp */ "ntp", + /* 127 385 T_Ntpport */ "ntpport", + /* 128 386 T_NtpSignDsocket */ "ntpsigndsocket", + /* 129 387 T_Orphan */ "orphan", + /* 130 388 T_Orphanwait */ "orphanwait", + /* 131 389 T_PCEdigest */ "peer_clear_digest_early", + /* 132 390 T_Panic */ "panic", + /* 133 391 T_Peer */ "peer", + /* 134 392 T_Peerstats */ "peerstats", + /* 135 393 T_Phone */ "phone", + /* 136 394 T_Pid */ "pid", + /* 137 395 T_Pidfile */ "pidfile", + /* 138 396 T_Poll */ "poll", + /* 139 397 T_PollSkewList */ "pollskewlist", + /* 140 398 T_Pool */ "pool", + /* 141 399 T_Port */ "port", + /* 142 400 T_Preempt */ "preempt", + /* 143 401 T_Prefer */ "prefer", + /* 144 402 T_Protostats */ "protostats", + /* 145 403 T_Pw */ "pw", + /* 146 404 T_Randfile */ "randfile", + /* 147 405 T_Rawstats */ "rawstats", + /* 148 406 T_Refid */ "refid", + /* 149 407 T_Requestkey */ "requestkey", + /* 150 408 T_Reset */ "reset", + /* 151 409 T_Restrict */ "restrict", + /* 152 410 T_Revoke */ "revoke", + /* 153 411 T_Rlimit */ "rlimit", + /* 154 412 T_Saveconfigdir */ "saveconfigdir", + /* 155 413 T_Server */ "server", + /* 156 414 T_Serverresponse */ "serverresponse", + /* 157 415 T_ServerresponseFuzz */ NULL, + /* 158 416 T_Setvar */ "setvar", + /* 159 417 T_Source */ "source", + /* 160 418 T_Stacksize */ "stacksize", + /* 161 419 T_Statistics */ "statistics", + /* 162 420 T_Stats */ "stats", + /* 163 421 T_Statsdir */ "statsdir", + /* 164 422 T_Step */ "step", + /* 165 423 T_Stepback */ "stepback", + /* 166 424 T_Stepfwd */ "stepfwd", + /* 167 425 T_Stepout */ "stepout", + /* 168 426 T_Stratum */ "stratum", + /* 169 427 T_String */ NULL, + /* 170 428 T_Sys */ "sys", + /* 171 429 T_Sysstats */ "sysstats", + /* 172 430 T_Tick */ "tick", + /* 173 431 T_Time1 */ "time1", + /* 174 432 T_Time2 */ "time2", + /* 175 433 T_Timer */ "timer", + /* 176 434 T_Timingstats */ "timingstats", + /* 177 435 T_Tinker */ "tinker", + /* 178 436 T_Tos */ "tos", + /* 179 437 T_Trap */ "trap", + /* 180 438 T_True */ "true", + /* 181 439 T_Trustedkey */ "trustedkey", + /* 182 440 T_Ttl */ "ttl", + /* 183 441 T_Type */ "type", + /* 184 442 T_U_int */ NULL, + /* 185 443 T_UEcrypto */ "unpeer_crypto_early", + /* 186 444 T_UEcryptonak */ "unpeer_crypto_nak_early", + /* 187 445 T_UEdigest */ "unpeer_digest_early", + /* 188 446 T_Unconfig */ "unconfig", + /* 189 447 T_Unpeer */ "unpeer", + /* 190 448 T_Version */ "version", + /* 191 449 T_WanderThreshold */ NULL, + /* 192 450 T_Week */ "week", + /* 193 451 T_Wildcard */ "wildcard", + /* 194 452 T_Xleave */ "xleave", + /* 195 453 T_Xmtnonce */ "xmtnonce", + /* 196 454 T_Year */ "year", + /* 197 455 T_Flag */ NULL, + /* 198 456 T_EOC */ NULL, + /* 199 457 T_Simulate */ "simulate", + /* 200 458 T_Beep_Delay */ "beep_delay", + /* 201 459 T_Sim_Duration */ "simulation_duration", + /* 202 460 T_Server_Offset */ "server_offset", + /* 203 461 T_Duration */ "duration", + /* 204 462 T_Freq_Offset */ "freq_offset", + /* 205 463 T_Wander */ "wander", + /* 206 464 T_Jitter */ "jitter", + /* 207 465 T_Prop_Delay */ "prop_delay", + /* 208 466 T_Proc_Delay */ "proc_delay" }; -#define SCANNER_INIT_S 940 +#define SCANNER_INIT_S 985 -const scan_state sst[943] = { +const scan_state sst[988] = { /*SS_T( ch, f-by, match, other ), */ 0, /* 0 */ - S_ST( '-', 3, 327, 0 ), /* 1 */ + S_ST( '-', 3, 330, 0 ), /* 1 */ S_ST( '.', 3, 3, 1 ), /* 2 */ - S_ST( '.', 3, 293, 0 ), /* 3 . */ + S_ST( '.', 3, 294, 0 ), /* 3 . */ S_ST( 'a', 3, 23, 2 ), /* 4 */ S_ST( 'b', 3, 6, 0 ), /* 5 a */ S_ST( 'b', 3, 7, 0 ), /* 6 ab */ @@ -275,7 +284,7 @@ const scan_state sst[943] = { S_ST( 'd', 3, 56, 0 ), /* 55 beep_ */ S_ST( 'e', 3, 57, 0 ), /* 56 beep_d */ S_ST( 'l', 3, 58, 0 ), /* 57 beep_de */ - S_ST( 'a', 3, 449, 0 ), /* 58 beep_del */ + S_ST( 'a', 3, 458, 0 ), /* 58 beep_del */ S_ST( 'r', 3, 60, 48 ), /* 59 b */ S_ST( 'o', 3, 61, 0 ), /* 60 br */ S_ST( 'a', 3, 62, 0 ), /* 61 bro */ @@ -295,7 +304,7 @@ const scan_state sst[943] = { S_ST( 'u', 3, 76, 59 ), /* 75 b */ S_ST( 'r', 3, 77, 0 ), /* 76 bu */ S_ST( 's', 3, 274, 0 ), /* 77 bur */ - S_ST( 'c', 3, 118, 28 ), /* 78 */ + S_ST( 'c', 3, 125, 28 ), /* 78 */ S_ST( 'a', 3, 80, 0 ), /* 79 c */ S_ST( 'l', 3, 81, 0 ), /* 80 ca */ S_ST( 'i', 3, 82, 0 ), /* 81 cal */ @@ -308,173 +317,173 @@ const scan_state sst[943] = { S_ST( 'l', 3, 89, 0 ), /* 88 cei */ S_ST( 'i', 3, 90, 0 ), /* 89 ceil */ S_ST( 'n', 3, 276, 0 ), /* 90 ceili */ - S_ST( 'l', 3, 92, 86 ), /* 91 c */ - S_ST( 'o', 3, 93, 0 ), /* 92 cl */ - S_ST( 'c', 3, 94, 0 ), /* 93 clo */ - S_ST( 'k', 3, 95, 0 ), /* 94 cloc */ - S_ST( 's', 3, 96, 0 ), /* 95 clock */ - S_ST( 't', 3, 97, 0 ), /* 96 clocks */ - S_ST( 'a', 3, 98, 0 ), /* 97 clockst */ - S_ST( 't', 3, 277, 0 ), /* 98 clocksta */ - S_ST( 'o', 3, 103, 91 ), /* 99 c */ - S_ST( 'h', 3, 101, 0 ), /* 100 co */ - S_ST( 'o', 3, 102, 0 ), /* 101 coh */ - S_ST( 'r', 3, 278, 0 ), /* 102 coho */ - S_ST( 'n', 3, 104, 100 ), /* 103 co */ - S_ST( 't', 3, 105, 0 ), /* 104 con */ - S_ST( 'r', 3, 106, 0 ), /* 105 cont */ - S_ST( 'o', 3, 107, 0 ), /* 106 contr */ - S_ST( 'l', 3, 108, 0 ), /* 107 contro */ - S_ST( 'k', 3, 109, 0 ), /* 108 control */ - S_ST( 'e', 3, 279, 0 ), /* 109 controlk */ - S_ST( 'r', 3, 111, 99 ), /* 110 c */ - S_ST( 'y', 3, 112, 0 ), /* 111 cr */ - S_ST( 'p', 3, 113, 0 ), /* 112 cry */ - S_ST( 't', 3, 280, 0 ), /* 113 cryp */ - S_ST( 's', 3, 115, 0 ), /* 114 crypto */ - S_ST( 't', 3, 116, 0 ), /* 115 cryptos */ - S_ST( 'a', 3, 117, 0 ), /* 116 cryptost */ - S_ST( 't', 3, 281, 0 ), /* 117 cryptosta */ - S_ST( 't', 3, 282, 110 ), /* 118 c */ - S_ST( 'd', 3, 153, 78 ), /* 119 */ - S_ST( 'a', 3, 283, 0 ), /* 120 d */ - S_ST( 'e', 3, 122, 120 ), /* 121 d */ - S_ST( 'f', 3, 123, 0 ), /* 122 de */ - S_ST( 'a', 3, 124, 0 ), /* 123 def */ - S_ST( 'u', 3, 125, 0 ), /* 124 defa */ - S_ST( 'l', 3, 284, 0 ), /* 125 defau */ - S_ST( 'i', 3, 130, 121 ), /* 126 d */ - S_ST( 'g', 3, 128, 0 ), /* 127 di */ - S_ST( 'e', 3, 129, 0 ), /* 128 dig */ - S_ST( 's', 3, 285, 0 ), /* 129 dige */ - S_ST( 's', 3, 137, 127 ), /* 130 di */ - S_ST( 'a', 3, 132, 0 ), /* 131 dis */ - S_ST( 'b', 3, 133, 0 ), /* 132 disa */ - S_ST( 'l', 3, 286, 0 ), /* 133 disab */ - S_ST( 'c', 3, 135, 131 ), /* 134 dis */ - S_ST( 'a', 3, 136, 0 ), /* 135 disc */ - S_ST( 'r', 3, 287, 0 ), /* 136 disca */ - S_ST( 'p', 3, 138, 134 ), /* 137 dis */ - S_ST( 'e', 3, 139, 0 ), /* 138 disp */ - S_ST( 'r', 3, 140, 0 ), /* 139 dispe */ - S_ST( 's', 3, 141, 0 ), /* 140 disper */ - S_ST( 'i', 3, 142, 0 ), /* 141 dispers */ - S_ST( 'o', 3, 288, 0 ), /* 142 dispersi */ - S_ST( 'r', 3, 150, 126 ), /* 143 d */ - S_ST( 'i', 3, 145, 0 ), /* 144 dr */ - S_ST( 'f', 3, 146, 0 ), /* 145 dri */ - S_ST( 't', 3, 147, 0 ), /* 146 drif */ - S_ST( 'f', 3, 148, 0 ), /* 147 drift */ - S_ST( 'i', 3, 149, 0 ), /* 148 driftf */ - S_ST( 'l', 3, 290, 0 ), /* 149 driftfi */ - S_ST( 'o', 3, 291, 144 ), /* 150 dr */ - S_ST( 's', 3, 152, 143 ), /* 151 d */ - S_ST( 'c', 3, 292, 0 ), /* 152 ds */ - S_ST( 'u', 3, 154, 151 ), /* 153 d */ - S_ST( 'r', 3, 155, 0 ), /* 154 du */ - S_ST( 'a', 3, 156, 0 ), /* 155 dur */ - S_ST( 't', 3, 157, 0 ), /* 156 dura */ - S_ST( 'i', 3, 158, 0 ), /* 157 durat */ - S_ST( 'o', 3, 452, 0 ), /* 158 durati */ - S_ST( 'e', 3, 164, 119 ), /* 159 */ - S_ST( 'n', 3, 295, 0 ), /* 160 e */ - S_ST( 'a', 3, 162, 0 ), /* 161 en */ - S_ST( 'b', 3, 163, 0 ), /* 162 ena */ - S_ST( 'l', 3, 294, 0 ), /* 163 enab */ - S_ST( 'p', 3, 165, 160 ), /* 164 e */ - S_ST( 'e', 3, 166, 0 ), /* 165 ep */ - S_ST( 'e', 3, 296, 0 ), /* 166 epe */ - S_ST( 'f', 3, 188, 159 ), /* 167 */ - S_ST( 'i', 3, 169, 0 ), /* 168 f */ - S_ST( 'l', 3, 298, 0 ), /* 169 fi */ - S_ST( 'g', 3, 171, 0 ), /* 170 file */ - S_ST( 'e', 3, 299, 0 ), /* 171 fileg */ - S_ST( 'n', 3, 173, 170 ), /* 172 file */ - S_ST( 'u', 3, 300, 0 ), /* 173 filen */ - S_ST( 'l', 3, 178, 168 ), /* 174 f */ - S_ST( 'a', 3, 177, 0 ), /* 175 fl */ - S_ST( 'g', 3, 304, 0 ), /* 176 fla */ - S_ST( 'k', 3, 305, 176 ), /* 177 fla */ - S_ST( 'o', 3, 179, 175 ), /* 178 fl */ - S_ST( 'o', 3, 306, 0 ), /* 179 flo */ - S_ST( 'r', 3, 181, 174 ), /* 180 f */ - S_ST( 'e', 3, 307, 0 ), /* 181 fr */ - S_ST( '_', 3, 183, 0 ), /* 182 freq */ - S_ST( 'o', 3, 184, 0 ), /* 183 freq_ */ - S_ST( 'f', 3, 185, 0 ), /* 184 freq_o */ - S_ST( 'f', 3, 186, 0 ), /* 185 freq_of */ - S_ST( 's', 3, 187, 0 ), /* 186 freq_off */ - S_ST( 'e', 3, 453, 0 ), /* 187 freq_offs */ - S_ST( 'u', 3, 189, 180 ), /* 188 f */ - S_ST( 'd', 3, 190, 0 ), /* 189 fu */ - S_ST( 'g', 3, 308, 0 ), /* 190 fud */ - S_ST( 'h', 3, 194, 167 ), /* 191 */ - S_ST( 'o', 3, 193, 0 ), /* 192 h */ - S_ST( 's', 3, 309, 0 ), /* 193 ho */ - S_ST( 'u', 3, 195, 192 ), /* 194 h */ - S_ST( 'f', 3, 196, 0 ), /* 195 hu */ - S_ST( 'f', 3, 197, 0 ), /* 196 huf */ - S_ST( 'p', 3, 198, 0 ), /* 197 huff */ - S_ST( 'u', 3, 199, 0 ), /* 198 huffp */ - S_ST( 'f', 3, 310, 0 ), /* 199 huffpu */ - S_ST( 'i', 3, 241, 191 ), /* 200 */ - S_ST( 'b', 3, 202, 0 ), /* 201 i */ - S_ST( 'u', 3, 203, 0 ), /* 202 ib */ - S_ST( 'r', 3, 204, 0 ), /* 203 ibu */ - S_ST( 's', 3, 311, 0 ), /* 204 ibur */ - S_ST( 'd', 3, 206, 201 ), /* 205 i */ - S_ST( 'e', 3, 207, 0 ), /* 206 id */ - S_ST( 'n', 3, 312, 0 ), /* 207 ide */ - S_ST( 'g', 3, 209, 205 ), /* 208 i */ - S_ST( 'n', 3, 210, 0 ), /* 209 ig */ - S_ST( 'o', 3, 211, 0 ), /* 210 ign */ - S_ST( 'r', 3, 313, 0 ), /* 211 igno */ - S_ST( 'n', 3, 235, 208 ), /* 212 i */ - S_ST( 'c', 3, 225, 0 ), /* 213 in */ - S_ST( 'a', 3, 215, 0 ), /* 214 inc */ - S_ST( 'l', 3, 216, 0 ), /* 215 inca */ - S_ST( 'l', 3, 217, 0 ), /* 216 incal */ - S_ST( 'o', 3, 314, 0 ), /* 217 incall */ - S_ST( 'l', 3, 219, 214 ), /* 218 inc */ - S_ST( 'u', 3, 220, 0 ), /* 219 incl */ - S_ST( 'd', 3, 221, 0 ), /* 220 inclu */ - S_ST( 'e', 3, 222, 0 ), /* 221 includ */ - S_ST( 'f', 3, 223, 0 ), /* 222 include */ - S_ST( 'i', 3, 224, 0 ), /* 223 includef */ - S_ST( 'l', 3, 318, 0 ), /* 224 includefi */ - S_ST( 'm', 3, 226, 218 ), /* 225 inc */ - S_ST( 'e', 3, 315, 0 ), /* 226 incm */ - S_ST( 'i', 3, 228, 213 ), /* 227 in */ - S_ST( 't', 3, 233, 0 ), /* 228 ini */ - S_ST( 'a', 3, 230, 0 ), /* 229 init */ - S_ST( 'l', 3, 231, 0 ), /* 230 inita */ - S_ST( 'l', 3, 232, 0 ), /* 231 inital */ - S_ST( 'o', 3, 316, 0 ), /* 232 initall */ - S_ST( 'm', 3, 234, 229 ), /* 233 init */ - S_ST( 'e', 3, 317, 0 ), /* 234 initm */ - S_ST( 't', 3, 236, 227 ), /* 235 in */ - S_ST( 'e', 3, 237, 0 ), /* 236 int */ - S_ST( 'r', 3, 238, 0 ), /* 237 inte */ - S_ST( 'f', 3, 239, 0 ), /* 238 inter */ - S_ST( 'a', 3, 240, 0 ), /* 239 interf */ - S_ST( 'c', 3, 320, 0 ), /* 240 interfa */ - S_ST( 'p', 3, 250, 322 ), /* 241 i */ - S_ST( 'p', 3, 243, 0 ), /* 242 ip */ - S_ST( 'e', 3, 244, 0 ), /* 243 ipp */ - S_ST( 'e', 3, 245, 0 ), /* 244 ippe */ - S_ST( 'r', 3, 246, 0 ), /* 245 ippee */ - S_ST( 'l', 3, 247, 0 ), /* 246 ippeer */ - S_ST( 'i', 3, 248, 0 ), /* 247 ippeerl */ - S_ST( 'm', 3, 249, 0 ), /* 248 ippeerli */ - S_ST( 'i', 3, 323, 0 ), /* 249 ippeerlim */ - S_ST( 'v', 3, 326, 242 ), /* 250 ip */ - S_ST( 'j', 3, 252, 200 ), /* 251 */ - S_ST( 'i', 3, 253, 0 ), /* 252 j */ - S_ST( 't', 3, 254, 0 ), /* 253 ji */ - S_ST( 't', 3, 255, 0 ), /* 254 jit */ - S_ST( 'e', 3, 455, 0 ), /* 255 jitt */ - S_ST( 'k', 3, 434, 251 ), /* 256 */ - S_ST( 'e', 3, 329, 0 ), /* 257 k */ + S_ST( 'h', 3, 92, 86 ), /* 91 c */ + S_ST( 'e', 3, 93, 0 ), /* 92 ch */ + S_ST( 'c', 3, 94, 0 ), /* 93 che */ + S_ST( 'k', 3, 95, 0 ), /* 94 chec */ + S_ST( 'h', 3, 96, 0 ), /* 95 check */ + S_ST( 'a', 3, 97, 0 ), /* 96 checkh */ + S_ST( 's', 3, 277, 0 ), /* 97 checkha */ + S_ST( 'l', 3, 99, 91 ), /* 98 c */ + S_ST( 'o', 3, 100, 0 ), /* 99 cl */ + S_ST( 'c', 3, 101, 0 ), /* 100 clo */ + S_ST( 'k', 3, 102, 0 ), /* 101 cloc */ + S_ST( 's', 3, 103, 0 ), /* 102 clock */ + S_ST( 't', 3, 104, 0 ), /* 103 clocks */ + S_ST( 'a', 3, 105, 0 ), /* 104 clockst */ + S_ST( 't', 3, 278, 0 ), /* 105 clocksta */ + S_ST( 'o', 3, 110, 98 ), /* 106 c */ + S_ST( 'h', 3, 108, 0 ), /* 107 co */ + S_ST( 'o', 3, 109, 0 ), /* 108 coh */ + S_ST( 'r', 3, 279, 0 ), /* 109 coho */ + S_ST( 'n', 3, 111, 107 ), /* 110 co */ + S_ST( 't', 3, 112, 0 ), /* 111 con */ + S_ST( 'r', 3, 113, 0 ), /* 112 cont */ + S_ST( 'o', 3, 114, 0 ), /* 113 contr */ + S_ST( 'l', 3, 115, 0 ), /* 114 contro */ + S_ST( 'k', 3, 116, 0 ), /* 115 control */ + S_ST( 'e', 3, 280, 0 ), /* 116 controlk */ + S_ST( 'r', 3, 118, 106 ), /* 117 c */ + S_ST( 'y', 3, 119, 0 ), /* 118 cr */ + S_ST( 'p', 3, 120, 0 ), /* 119 cry */ + S_ST( 't', 3, 281, 0 ), /* 120 cryp */ + S_ST( 's', 3, 122, 0 ), /* 121 crypto */ + S_ST( 't', 3, 123, 0 ), /* 122 cryptos */ + S_ST( 'a', 3, 124, 0 ), /* 123 cryptost */ + S_ST( 't', 3, 282, 0 ), /* 124 cryptosta */ + S_ST( 't', 3, 283, 117 ), /* 125 c */ + S_ST( 'd', 3, 160, 78 ), /* 126 */ + S_ST( 'a', 3, 284, 0 ), /* 127 d */ + S_ST( 'e', 3, 129, 127 ), /* 128 d */ + S_ST( 'f', 3, 130, 0 ), /* 129 de */ + S_ST( 'a', 3, 131, 0 ), /* 130 def */ + S_ST( 'u', 3, 132, 0 ), /* 131 defa */ + S_ST( 'l', 3, 285, 0 ), /* 132 defau */ + S_ST( 'i', 3, 137, 128 ), /* 133 d */ + S_ST( 'g', 3, 135, 0 ), /* 134 di */ + S_ST( 'e', 3, 136, 0 ), /* 135 dig */ + S_ST( 's', 3, 286, 0 ), /* 136 dige */ + S_ST( 's', 3, 144, 134 ), /* 137 di */ + S_ST( 'a', 3, 139, 0 ), /* 138 dis */ + S_ST( 'b', 3, 140, 0 ), /* 139 disa */ + S_ST( 'l', 3, 287, 0 ), /* 140 disab */ + S_ST( 'c', 3, 142, 138 ), /* 141 dis */ + S_ST( 'a', 3, 143, 0 ), /* 142 disc */ + S_ST( 'r', 3, 288, 0 ), /* 143 disca */ + S_ST( 'p', 3, 145, 141 ), /* 144 dis */ + S_ST( 'e', 3, 146, 0 ), /* 145 disp */ + S_ST( 'r', 3, 147, 0 ), /* 146 dispe */ + S_ST( 's', 3, 148, 0 ), /* 147 disper */ + S_ST( 'i', 3, 149, 0 ), /* 148 dispers */ + S_ST( 'o', 3, 289, 0 ), /* 149 dispersi */ + S_ST( 'r', 3, 157, 133 ), /* 150 d */ + S_ST( 'i', 3, 152, 0 ), /* 151 dr */ + S_ST( 'f', 3, 153, 0 ), /* 152 dri */ + S_ST( 't', 3, 154, 0 ), /* 153 drif */ + S_ST( 'f', 3, 155, 0 ), /* 154 drift */ + S_ST( 'i', 3, 156, 0 ), /* 155 driftf */ + S_ST( 'l', 3, 291, 0 ), /* 156 driftfi */ + S_ST( 'o', 3, 292, 151 ), /* 157 dr */ + S_ST( 's', 3, 159, 150 ), /* 158 d */ + S_ST( 'c', 3, 293, 0 ), /* 159 ds */ + S_ST( 'u', 3, 161, 158 ), /* 160 d */ + S_ST( 'r', 3, 162, 0 ), /* 161 du */ + S_ST( 'a', 3, 163, 0 ), /* 162 dur */ + S_ST( 't', 3, 164, 0 ), /* 163 dura */ + S_ST( 'i', 3, 165, 0 ), /* 164 durat */ + S_ST( 'o', 3, 461, 0 ), /* 165 durati */ + S_ST( 'e', 3, 171, 126 ), /* 166 */ + S_ST( 'n', 3, 296, 0 ), /* 167 e */ + S_ST( 'a', 3, 169, 0 ), /* 168 en */ + S_ST( 'b', 3, 170, 0 ), /* 169 ena */ + S_ST( 'l', 3, 295, 0 ), /* 170 enab */ + S_ST( 'p', 3, 172, 167 ), /* 171 e */ + S_ST( 'e', 3, 173, 0 ), /* 172 ep */ + S_ST( 'e', 3, 297, 0 ), /* 173 epe */ + S_ST( 'f', 3, 195, 166 ), /* 174 */ + S_ST( 'i', 3, 176, 0 ), /* 175 f */ + S_ST( 'l', 3, 299, 0 ), /* 176 fi */ + S_ST( 'g', 3, 178, 0 ), /* 177 file */ + S_ST( 'e', 3, 300, 0 ), /* 178 fileg */ + S_ST( 'n', 3, 180, 177 ), /* 179 file */ + S_ST( 'u', 3, 301, 0 ), /* 180 filen */ + S_ST( 'l', 3, 185, 175 ), /* 181 f */ + S_ST( 'a', 3, 184, 0 ), /* 182 fl */ + S_ST( 'g', 3, 305, 0 ), /* 183 fla */ + S_ST( 'k', 3, 306, 183 ), /* 184 fla */ + S_ST( 'o', 3, 186, 182 ), /* 185 fl */ + S_ST( 'o', 3, 307, 0 ), /* 186 flo */ + S_ST( 'r', 3, 188, 181 ), /* 187 f */ + S_ST( 'e', 3, 308, 0 ), /* 188 fr */ + S_ST( '_', 3, 190, 0 ), /* 189 freq */ + S_ST( 'o', 3, 191, 0 ), /* 190 freq_ */ + S_ST( 'f', 3, 192, 0 ), /* 191 freq_o */ + S_ST( 'f', 3, 193, 0 ), /* 192 freq_of */ + S_ST( 's', 3, 194, 0 ), /* 193 freq_off */ + S_ST( 'e', 3, 462, 0 ), /* 194 freq_offs */ + S_ST( 'u', 3, 198, 187 ), /* 195 f */ + S_ST( 'd', 3, 197, 0 ), /* 196 fu */ + S_ST( 'g', 3, 309, 0 ), /* 197 fud */ + S_ST( 'z', 3, 310, 196 ), /* 198 fu */ + S_ST( 'h', 3, 202, 174 ), /* 199 */ + S_ST( 'o', 3, 201, 0 ), /* 200 h */ + S_ST( 's', 3, 311, 0 ), /* 201 ho */ + S_ST( 'u', 3, 203, 200 ), /* 202 h */ + S_ST( 'f', 3, 204, 0 ), /* 203 hu */ + S_ST( 'f', 3, 205, 0 ), /* 204 huf */ + S_ST( 'p', 3, 206, 0 ), /* 205 huff */ + S_ST( 'u', 3, 207, 0 ), /* 206 huffp */ + S_ST( 'f', 3, 312, 0 ), /* 207 huffpu */ + S_ST( 'i', 3, 252, 199 ), /* 208 */ + S_ST( 'b', 3, 210, 0 ), /* 209 i */ + S_ST( 'u', 3, 211, 0 ), /* 210 ib */ + S_ST( 'r', 3, 212, 0 ), /* 211 ibu */ + S_ST( 's', 3, 313, 0 ), /* 212 ibur */ + S_ST( 'd', 3, 214, 209 ), /* 213 i */ + S_ST( 'e', 3, 215, 0 ), /* 214 id */ + S_ST( 'n', 3, 314, 0 ), /* 215 ide */ + S_ST( 'g', 3, 217, 213 ), /* 216 i */ + S_ST( 'n', 3, 218, 0 ), /* 217 ig */ + S_ST( 'o', 3, 219, 0 ), /* 218 ign */ + S_ST( 'r', 3, 315, 0 ), /* 219 igno */ + S_ST( 'h', 3, 221, 0 ), /* 220 ignore */ + S_ST( 'a', 3, 222, 0 ), /* 221 ignoreh */ + S_ST( 's', 3, 316, 0 ), /* 222 ignoreha */ + S_ST( 'n', 3, 246, 216 ), /* 223 i */ + S_ST( 'c', 3, 236, 0 ), /* 224 in */ + S_ST( 'a', 3, 226, 0 ), /* 225 inc */ + S_ST( 'l', 3, 227, 0 ), /* 226 inca */ + S_ST( 'l', 3, 228, 0 ), /* 227 incal */ + S_ST( 'o', 3, 317, 0 ), /* 228 incall */ + S_ST( 'l', 3, 230, 225 ), /* 229 inc */ + S_ST( 'u', 3, 231, 0 ), /* 230 incl */ + S_ST( 'd', 3, 232, 0 ), /* 231 inclu */ + S_ST( 'e', 3, 233, 0 ), /* 232 includ */ + S_ST( 'f', 3, 234, 0 ), /* 233 include */ + S_ST( 'i', 3, 235, 0 ), /* 234 includef */ + S_ST( 'l', 3, 321, 0 ), /* 235 includefi */ + S_ST( 'm', 3, 237, 229 ), /* 236 inc */ + S_ST( 'e', 3, 318, 0 ), /* 237 incm */ + S_ST( 'i', 3, 239, 224 ), /* 238 in */ + S_ST( 't', 3, 244, 0 ), /* 239 ini */ + S_ST( 'a', 3, 241, 0 ), /* 240 init */ + S_ST( 'l', 3, 242, 0 ), /* 241 inita */ + S_ST( 'l', 3, 243, 0 ), /* 242 inital */ + S_ST( 'o', 3, 319, 0 ), /* 243 initall */ + S_ST( 'm', 3, 245, 240 ), /* 244 init */ + S_ST( 'e', 3, 320, 0 ), /* 245 initm */ + S_ST( 't', 3, 247, 238 ), /* 246 in */ + S_ST( 'e', 3, 248, 0 ), /* 247 int */ + S_ST( 'r', 3, 249, 0 ), /* 248 inte */ + S_ST( 'f', 3, 250, 0 ), /* 249 inter */ + S_ST( 'a', 3, 251, 0 ), /* 250 interf */ + S_ST( 'c', 3, 323, 0 ), /* 251 interfa */ + S_ST( 'p', 3, 324, 325 ), /* 252 i */ + S_ST( 'p', 3, 254, 0 ), /* 253 ip */ + S_ST( 'e', 3, 255, 0 ), /* 254 ipp */ + S_ST( 'e', 3, 256, 0 ), /* 255 ippe */ + S_ST( 'r', 3, 257, 0 ), /* 256 ippee */ + S_ST( 'l', 3, 290, 0 ), /* 257 ippeer */ S_ST( 'v', 1, 0, 0 ), /* 258 T_Abbrev */ S_ST( 'e', 0, 0, 0 ), /* 259 T_Age */ S_ST( 'l', 0, 12, 0 ), /* 260 T_All */ @@ -494,671 +503,716 @@ const scan_state sst[943] = { S_ST( 't', 0, 0, 0 ), /* 274 T_Burst */ S_ST( 'e', 0, 0, 0 ), /* 275 T_Calibrate */ S_ST( 'g', 0, 0, 0 ), /* 276 T_Ceiling */ - S_ST( 's', 0, 0, 0 ), /* 277 T_Clockstats */ - S_ST( 't', 0, 0, 0 ), /* 278 T_Cohort */ - S_ST( 'y', 0, 0, 0 ), /* 279 T_ControlKey */ - S_ST( 'o', 0, 114, 0 ), /* 280 T_Crypto */ - S_ST( 's', 0, 0, 0 ), /* 281 T_Cryptostats */ - S_ST( 'l', 0, 0, 0 ), /* 282 T_Ctl */ - S_ST( 'y', 0, 0, 0 ), /* 283 T_Day */ - S_ST( 't', 0, 0, 0 ), /* 284 T_Default */ - S_ST( 't', 1, 0, 0 ), /* 285 T_Digest */ - S_ST( 'e', 0, 0, 0 ), /* 286 T_Disable */ - S_ST( 'd', 0, 0, 0 ), /* 287 T_Discard */ - S_ST( 'n', 0, 0, 0 ), /* 288 T_Dispersion */ - S_ST( 'r', 3, 297, 0 ), /* 289 ke */ - S_ST( 'e', 1, 0, 0 ), /* 290 T_Driftfile */ - S_ST( 'p', 0, 0, 0 ), /* 291 T_Drop */ - S_ST( 'p', 0, 0, 0 ), /* 292 T_Dscp */ - S_ST( '.', 0, 0, 0 ), /* 293 T_Ellipsis */ - S_ST( 'e', 0, 0, 0 ), /* 294 T_Enable */ - S_ST( 'd', 0, 0, 161 ), /* 295 T_End */ - S_ST( 'r', 0, 0, 0 ), /* 296 T_Epeer */ - S_ST( 'n', 3, 319, 0 ), /* 297 ker */ - S_ST( 'e', 1, 172, 0 ), /* 298 T_File */ - S_ST( 'n', 0, 0, 0 ), /* 299 T_Filegen */ - S_ST( 'm', 0, 0, 0 ), /* 300 T_Filenum */ - S_ST( '1', 0, 0, 0 ), /* 301 T_Flag1 */ - S_ST( '2', 0, 0, 301 ), /* 302 T_Flag2 */ - S_ST( '3', 0, 0, 302 ), /* 303 T_Flag3 */ - S_ST( '4', 0, 0, 303 ), /* 304 T_Flag4 */ - S_ST( 'e', 0, 0, 0 ), /* 305 T_Flake */ - S_ST( 'r', 0, 0, 0 ), /* 306 T_Floor */ - S_ST( 'q', 0, 182, 0 ), /* 307 T_Freq */ - S_ST( 'e', 1, 0, 0 ), /* 308 T_Fudge */ - S_ST( 't', 1, 0, 0 ), /* 309 T_Host */ - S_ST( 'f', 0, 0, 0 ), /* 310 T_Huffpuff */ - S_ST( 't', 0, 0, 0 ), /* 311 T_Iburst */ - S_ST( 't', 1, 0, 0 ), /* 312 T_Ident */ - S_ST( 'e', 0, 0, 0 ), /* 313 T_Ignore */ - S_ST( 'c', 0, 0, 0 ), /* 314 T_Incalloc */ - S_ST( 'm', 0, 0, 0 ), /* 315 T_Incmem */ - S_ST( 'c', 0, 0, 0 ), /* 316 T_Initalloc */ - S_ST( 'm', 0, 0, 0 ), /* 317 T_Initmem */ - S_ST( 'e', 1, 0, 0 ), /* 318 T_Includefile */ - S_ST( 'e', 3, 328, 0 ), /* 319 kern */ - S_ST( 'e', 0, 0, 0 ), /* 320 T_Interface */ - S_ST( 'd', 3, 419, 0 ), /* 321 keys */ - S_ST( 'o', 0, 0, 212 ), /* 322 T_Io */ - S_ST( 't', 0, 0, 0 ), /* 323 T_Ippeerlimit */ - S_ST( '4', 0, 0, 0 ), /* 324 T_Ipv4 */ - S_ST( '4', 0, 0, 0 ), /* 325 T_Ipv4_flag */ - S_ST( '6', 0, 0, 324 ), /* 326 T_Ipv6 */ - S_ST( '6', 0, 0, 325 ), /* 327 T_Ipv6_flag */ - S_ST( 'l', 0, 0, 0 ), /* 328 T_Kernel */ - S_ST( 'y', 0, 330, 289 ), /* 329 T_Key */ - S_ST( 's', 1, 321, 0 ), /* 330 T_Keys */ - S_ST( 'r', 1, 0, 0 ), /* 331 T_Keysdir */ - S_ST( 'd', 0, 0, 0 ), /* 332 T_Kod */ - S_ST( 'p', 0, 0, 0 ), /* 333 T_Mssntp */ - S_ST( 'e', 1, 0, 0 ), /* 334 T_Leapfile */ - S_ST( 'l', 0, 0, 0 ), /* 335 T_Leapsmearinterval */ - S_ST( 'd', 0, 0, 0 ), /* 336 T_Limited */ - S_ST( 'k', 0, 0, 0 ), /* 337 T_Link */ - S_ST( 'n', 0, 0, 0 ), /* 338 T_Listen */ - S_ST( 'g', 2, 0, 0 ), /* 339 T_Logconfig */ - S_ST( 'e', 1, 0, 0 ), /* 340 T_Logfile */ - S_ST( 's', 0, 0, 0 ), /* 341 T_Loopstats */ - S_ST( 'p', 0, 0, 0 ), /* 342 T_Lowpriotrap */ - S_ST( 't', 1, 0, 0 ), /* 343 T_Manycastclient */ - S_ST( 'r', 2, 0, 0 ), /* 344 T_Manycastserver */ - S_ST( 'k', 0, 0, 0 ), /* 345 T_Mask */ - S_ST( 'e', 0, 0, 0 ), /* 346 T_Maxage */ - S_ST( 'k', 0, 0, 0 ), /* 347 T_Maxclock */ - S_ST( 'h', 0, 0, 0 ), /* 348 T_Maxdepth */ - S_ST( 't', 0, 0, 0 ), /* 349 T_Maxdist */ - S_ST( 'm', 0, 0, 0 ), /* 350 T_Maxmem */ - S_ST( 'l', 0, 0, 0 ), /* 351 T_Maxpoll */ - S_ST( 's', 0, 0, 0 ), /* 352 T_Mdnstries */ - S_ST( 'm', 0, 552, 0 ), /* 353 T_Mem */ - S_ST( 'k', 0, 0, 0 ), /* 354 T_Memlock */ - S_ST( 'k', 0, 0, 0 ), /* 355 T_Minclock */ - S_ST( 'h', 0, 0, 0 ), /* 356 T_Mindepth */ - S_ST( 't', 0, 0, 0 ), /* 357 T_Mindist */ - S_ST( 'm', 0, 0, 0 ), /* 358 T_Minimum */ - S_ST( 'l', 0, 0, 0 ), /* 359 T_Minpoll */ - S_ST( 'e', 0, 0, 0 ), /* 360 T_Minsane */ - S_ST( 'e', 0, 362, 0 ), /* 361 T_Mode */ - S_ST( '7', 0, 0, 0 ), /* 362 T_Mode7 */ - S_ST( 'r', 0, 0, 0 ), /* 363 T_Monitor */ - S_ST( 'h', 0, 0, 0 ), /* 364 T_Month */ - S_ST( 'u', 0, 0, 0 ), /* 365 T_Mru */ - S_ST( 't', 2, 0, 0 ), /* 366 T_Multicastclient */ - S_ST( 'c', 0, 0, 0 ), /* 367 T_Nic */ - S_ST( 'k', 0, 0, 0 ), /* 368 T_Nolink */ - S_ST( 'y', 0, 0, 0 ), /* 369 T_Nomodify */ - S_ST( 't', 0, 0, 0 ), /* 370 T_Nomrulist */ - S_ST( 'e', 0, 0, 0 ), /* 371 T_None */ - S_ST( 'e', 0, 0, 0 ), /* 372 T_Nonvolatile */ - S_ST( 'r', 0, 0, 0 ), /* 373 T_Noepeer */ - S_ST( 'r', 0, 0, 0 ), /* 374 T_Nopeer */ - S_ST( 'y', 0, 0, 0 ), /* 375 T_Noquery */ - S_ST( 't', 0, 0, 0 ), /* 376 T_Noselect */ - S_ST( 'e', 0, 0, 0 ), /* 377 T_Noserve */ - S_ST( 'p', 0, 0, 0 ), /* 378 T_Notrap */ - S_ST( 't', 0, 0, 0 ), /* 379 T_Notrust */ - S_ST( 'p', 0, 652, 0 ), /* 380 T_Ntp */ - S_ST( 't', 0, 0, 0 ), /* 381 T_Ntpport */ - S_ST( 't', 1, 0, 0 ), /* 382 T_NtpSignDsocket */ - S_ST( 'n', 0, 667, 0 ), /* 383 T_Orphan */ - S_ST( 't', 0, 0, 0 ), /* 384 T_Orphanwait */ - S_ST( 'y', 0, 0, 0 ), /* 385 T_PCEdigest */ - S_ST( 'c', 0, 0, 0 ), /* 386 T_Panic */ - S_ST( 'r', 1, 694, 0 ), /* 387 T_Peer */ - S_ST( 's', 0, 0, 0 ), /* 388 T_Peerstats */ - S_ST( 'e', 2, 0, 0 ), /* 389 T_Phone */ - S_ST( 'd', 0, 702, 0 ), /* 390 T_Pid */ - S_ST( 'e', 1, 0, 0 ), /* 391 T_Pidfile */ - S_ST( 'l', 1, 0, 0 ), /* 392 T_Pool */ - S_ST( 't', 0, 0, 0 ), /* 393 T_Port */ - S_ST( 't', 0, 0, 0 ), /* 394 T_Preempt */ - S_ST( 'r', 0, 0, 0 ), /* 395 T_Prefer */ - S_ST( 's', 0, 0, 0 ), /* 396 T_Protostats */ - S_ST( 'w', 1, 0, 708 ), /* 397 T_Pw */ - S_ST( 'e', 1, 0, 0 ), /* 398 T_Randfile */ - S_ST( 's', 0, 0, 0 ), /* 399 T_Rawstats */ - S_ST( 'd', 1, 0, 0 ), /* 400 T_Refid */ - S_ST( 'y', 0, 0, 0 ), /* 401 T_Requestkey */ - S_ST( 't', 0, 0, 0 ), /* 402 T_Reset */ - S_ST( 't', 0, 0, 0 ), /* 403 T_Restrict */ - S_ST( 'e', 0, 0, 0 ), /* 404 T_Revoke */ - S_ST( 't', 0, 0, 0 ), /* 405 T_Rlimit */ - S_ST( 'r', 1, 0, 0 ), /* 406 T_Saveconfigdir */ - S_ST( 'r', 1, 785, 0 ), /* 407 T_Server */ - S_ST( 'r', 1, 0, 0 ), /* 408 T_Setvar */ - S_ST( 'e', 0, 0, 0 ), /* 409 T_Source */ - S_ST( 'e', 0, 0, 0 ), /* 410 T_Stacksize */ - S_ST( 's', 0, 0, 0 ), /* 411 T_Statistics */ - S_ST( 's', 0, 828, 823 ), /* 412 T_Stats */ - S_ST( 'r', 1, 0, 0 ), /* 413 T_Statsdir */ - S_ST( 'p', 0, 836, 0 ), /* 414 T_Step */ - S_ST( 'k', 0, 0, 0 ), /* 415 T_Stepback */ - S_ST( 'd', 0, 0, 0 ), /* 416 T_Stepfwd */ - S_ST( 't', 0, 0, 0 ), /* 417 T_Stepout */ - S_ST( 'm', 0, 0, 0 ), /* 418 T_Stratum */ - S_ST( 'i', 3, 331, 0 ), /* 419 keysd */ - S_ST( 's', 0, 843, 0 ), /* 420 T_Sys */ - S_ST( 's', 0, 0, 0 ), /* 421 T_Sysstats */ - S_ST( 'k', 0, 0, 0 ), /* 422 T_Tick */ - S_ST( '1', 0, 0, 0 ), /* 423 T_Time1 */ - S_ST( '2', 0, 0, 423 ), /* 424 T_Time2 */ - S_ST( 'r', 0, 0, 424 ), /* 425 T_Timer */ - S_ST( 's', 0, 0, 0 ), /* 426 T_Timingstats */ - S_ST( 'r', 0, 0, 0 ), /* 427 T_Tinker */ - S_ST( 's', 0, 0, 0 ), /* 428 T_Tos */ - S_ST( 'p', 1, 0, 0 ), /* 429 T_Trap */ - S_ST( 'e', 0, 0, 0 ), /* 430 T_True */ - S_ST( 'y', 0, 0, 0 ), /* 431 T_Trustedkey */ - S_ST( 'l', 0, 0, 0 ), /* 432 T_Ttl */ - S_ST( 'e', 0, 0, 0 ), /* 433 T_Type */ - S_ST( 'o', 3, 332, 257 ), /* 434 k */ - S_ST( 'y', 0, 0, 0 ), /* 435 T_UEcrypto */ - S_ST( 'y', 0, 0, 0 ), /* 436 T_UEcryptonak */ - S_ST( 'y', 0, 0, 0 ), /* 437 T_UEdigest */ - S_ST( 'g', 1, 0, 0 ), /* 438 T_Unconfig */ - S_ST( 'r', 1, 885, 0 ), /* 439 T_Unpeer */ - S_ST( 'n', 0, 0, 0 ), /* 440 T_Version */ - S_ST( 'l', 3, 483, 256 ), /* 441 */ - S_ST( 'k', 0, 0, 0 ), /* 442 T_Week */ - S_ST( 'd', 0, 0, 0 ), /* 443 T_Wildcard */ - S_ST( 'e', 0, 0, 0 ), /* 444 T_Xleave */ - S_ST( 'r', 0, 0, 0 ), /* 445 T_Year */ - S_ST( 'e', 3, 447, 0 ), /* 446 l */ - S_ST( 'a', 3, 458, 0 ), /* 447 le */ - S_ST( 'e', 0, 0, 0 ), /* 448 T_Simulate */ - S_ST( 'y', 0, 0, 0 ), /* 449 T_Beep_Delay */ - S_ST( 'n', 0, 0, 0 ), /* 450 T_Sim_Duration */ - S_ST( 't', 0, 0, 0 ), /* 451 T_Server_Offset */ - S_ST( 'n', 0, 0, 0 ), /* 452 T_Duration */ - S_ST( 't', 0, 0, 0 ), /* 453 T_Freq_Offset */ - S_ST( 'r', 0, 0, 0 ), /* 454 T_Wander */ - S_ST( 'r', 0, 0, 0 ), /* 455 T_Jitter */ - S_ST( 'y', 0, 0, 0 ), /* 456 T_Prop_Delay */ - S_ST( 'y', 0, 0, 0 ), /* 457 T_Proc_Delay */ - S_ST( 'p', 3, 462, 0 ), /* 458 lea */ - S_ST( 'f', 3, 460, 0 ), /* 459 leap */ - S_ST( 'i', 3, 461, 0 ), /* 460 leapf */ - S_ST( 'l', 3, 334, 0 ), /* 461 leapfi */ - S_ST( 's', 3, 463, 459 ), /* 462 leap */ - S_ST( 'm', 3, 464, 0 ), /* 463 leaps */ - S_ST( 'e', 3, 465, 0 ), /* 464 leapsm */ - S_ST( 'a', 3, 466, 0 ), /* 465 leapsme */ - S_ST( 'r', 3, 467, 0 ), /* 466 leapsmea */ - S_ST( 'i', 3, 468, 0 ), /* 467 leapsmear */ - S_ST( 'n', 3, 469, 0 ), /* 468 leapsmeari */ - S_ST( 't', 3, 470, 0 ), /* 469 leapsmearin */ - S_ST( 'e', 3, 471, 0 ), /* 470 leapsmearint */ - S_ST( 'r', 3, 472, 0 ), /* 471 leapsmearinte */ - S_ST( 'v', 3, 473, 0 ), /* 472 leapsmearinter */ - S_ST( 'a', 3, 335, 0 ), /* 473 leapsmearinterv */ - S_ST( 'i', 3, 480, 446 ), /* 474 l */ - S_ST( 'm', 3, 476, 0 ), /* 475 li */ - S_ST( 'i', 3, 477, 0 ), /* 476 lim */ - S_ST( 't', 3, 478, 0 ), /* 477 limi */ - S_ST( 'e', 3, 336, 0 ), /* 478 limit */ - S_ST( 'n', 3, 337, 475 ), /* 479 li */ - S_ST( 's', 3, 481, 479 ), /* 480 li */ - S_ST( 't', 3, 482, 0 ), /* 481 lis */ - S_ST( 'e', 3, 338, 0 ), /* 482 list */ - S_ST( 'o', 3, 499, 474 ), /* 483 l */ - S_ST( 'g', 3, 490, 0 ), /* 484 lo */ - S_ST( 'c', 3, 486, 0 ), /* 485 log */ - S_ST( 'o', 3, 487, 0 ), /* 486 logc */ - S_ST( 'n', 3, 488, 0 ), /* 487 logco */ - S_ST( 'f', 3, 489, 0 ), /* 488 logcon */ - S_ST( 'i', 3, 339, 0 ), /* 489 logconf */ - S_ST( 'f', 3, 491, 485 ), /* 490 log */ - S_ST( 'i', 3, 492, 0 ), /* 491 logf */ - S_ST( 'l', 3, 340, 0 ), /* 492 logfi */ - S_ST( 'o', 3, 494, 484 ), /* 493 lo */ - S_ST( 'p', 3, 495, 0 ), /* 494 loo */ - S_ST( 's', 3, 496, 0 ), /* 495 loop */ - S_ST( 't', 3, 497, 0 ), /* 496 loops */ - S_ST( 'a', 3, 498, 0 ), /* 497 loopst */ - S_ST( 't', 3, 341, 0 ), /* 498 loopsta */ - S_ST( 'w', 3, 500, 493 ), /* 499 lo */ - S_ST( 'p', 3, 501, 0 ), /* 500 low */ - S_ST( 'r', 3, 502, 0 ), /* 501 lowp */ - S_ST( 'i', 3, 503, 0 ), /* 502 lowpr */ - S_ST( 'o', 3, 504, 0 ), /* 503 lowpri */ - S_ST( 't', 3, 505, 0 ), /* 504 lowprio */ - S_ST( 'r', 3, 506, 0 ), /* 505 lowpriot */ - S_ST( 'a', 3, 342, 0 ), /* 506 lowpriotr */ - S_ST( 'm', 3, 588, 441 ), /* 507 */ - S_ST( 'a', 3, 526, 0 ), /* 508 m */ - S_ST( 'n', 3, 510, 0 ), /* 509 ma */ - S_ST( 'y', 3, 511, 0 ), /* 510 man */ - S_ST( 'c', 3, 512, 0 ), /* 511 many */ - S_ST( 'a', 3, 513, 0 ), /* 512 manyc */ - S_ST( 's', 3, 514, 0 ), /* 513 manyca */ - S_ST( 't', 3, 520, 0 ), /* 514 manycas */ - S_ST( 'c', 3, 516, 0 ), /* 515 manycast */ - S_ST( 'l', 3, 517, 0 ), /* 516 manycastc */ - S_ST( 'i', 3, 518, 0 ), /* 517 manycastcl */ - S_ST( 'e', 3, 519, 0 ), /* 518 manycastcli */ - S_ST( 'n', 3, 343, 0 ), /* 519 manycastclie */ - S_ST( 's', 3, 521, 515 ), /* 520 manycast */ - S_ST( 'e', 3, 522, 0 ), /* 521 manycasts */ - S_ST( 'r', 3, 523, 0 ), /* 522 manycastse */ - S_ST( 'v', 3, 524, 0 ), /* 523 manycastser */ - S_ST( 'e', 3, 344, 0 ), /* 524 manycastserv */ - S_ST( 's', 3, 345, 509 ), /* 525 ma */ - S_ST( 'x', 3, 541, 525 ), /* 526 ma */ - S_ST( 'a', 3, 528, 0 ), /* 527 max */ - S_ST( 'g', 3, 346, 0 ), /* 528 maxa */ - S_ST( 'c', 3, 530, 527 ), /* 529 max */ - S_ST( 'l', 3, 531, 0 ), /* 530 maxc */ - S_ST( 'o', 3, 532, 0 ), /* 531 maxcl */ - S_ST( 'c', 3, 347, 0 ), /* 532 maxclo */ - S_ST( 'd', 3, 537, 529 ), /* 533 max */ - S_ST( 'e', 3, 535, 0 ), /* 534 maxd */ - S_ST( 'p', 3, 536, 0 ), /* 535 maxde */ - S_ST( 't', 3, 348, 0 ), /* 536 maxdep */ - S_ST( 'i', 3, 538, 534 ), /* 537 maxd */ - S_ST( 's', 3, 349, 0 ), /* 538 maxdi */ - S_ST( 'm', 3, 540, 533 ), /* 539 max */ - S_ST( 'e', 3, 350, 0 ), /* 540 maxm */ - S_ST( 'p', 3, 542, 539 ), /* 541 max */ - S_ST( 'o', 3, 543, 0 ), /* 542 maxp */ - S_ST( 'l', 3, 351, 0 ), /* 543 maxpo */ - S_ST( 'd', 3, 545, 508 ), /* 544 m */ - S_ST( 'n', 3, 546, 0 ), /* 545 md */ - S_ST( 's', 3, 547, 0 ), /* 546 mdn */ - S_ST( 't', 3, 548, 0 ), /* 547 mdns */ - S_ST( 'r', 3, 549, 0 ), /* 548 mdnst */ - S_ST( 'i', 3, 550, 0 ), /* 549 mdnstr */ - S_ST( 'e', 3, 352, 0 ), /* 550 mdnstri */ - S_ST( 'e', 3, 353, 544 ), /* 551 m */ - S_ST( 'l', 3, 553, 0 ), /* 552 mem */ - S_ST( 'o', 3, 554, 0 ), /* 553 meml */ - S_ST( 'c', 3, 354, 0 ), /* 554 memlo */ - S_ST( 'i', 3, 556, 551 ), /* 555 m */ - S_ST( 'n', 3, 573, 0 ), /* 556 mi */ - S_ST( 'c', 3, 558, 0 ), /* 557 min */ - S_ST( 'l', 3, 559, 0 ), /* 558 minc */ - S_ST( 'o', 3, 560, 0 ), /* 559 mincl */ - S_ST( 'c', 3, 355, 0 ), /* 560 minclo */ - S_ST( 'd', 3, 565, 557 ), /* 561 min */ - S_ST( 'e', 3, 563, 0 ), /* 562 mind */ - S_ST( 'p', 3, 564, 0 ), /* 563 minde */ - S_ST( 't', 3, 356, 0 ), /* 564 mindep */ - S_ST( 'i', 3, 566, 562 ), /* 565 mind */ - S_ST( 's', 3, 357, 0 ), /* 566 mindi */ - S_ST( 'i', 3, 568, 561 ), /* 567 min */ - S_ST( 'm', 3, 569, 0 ), /* 568 mini */ - S_ST( 'u', 3, 358, 0 ), /* 569 minim */ - S_ST( 'p', 3, 571, 567 ), /* 570 min */ - S_ST( 'o', 3, 572, 0 ), /* 571 minp */ - S_ST( 'l', 3, 359, 0 ), /* 572 minpo */ - S_ST( 's', 3, 574, 570 ), /* 573 min */ - S_ST( 'a', 3, 575, 0 ), /* 574 mins */ - S_ST( 'n', 3, 360, 0 ), /* 575 minsa */ - S_ST( 'o', 3, 578, 555 ), /* 576 m */ - S_ST( 'd', 3, 361, 0 ), /* 577 mo */ - S_ST( 'n', 3, 582, 577 ), /* 578 mo */ - S_ST( 'i', 3, 580, 0 ), /* 579 mon */ - S_ST( 't', 3, 581, 0 ), /* 580 moni */ - S_ST( 'o', 3, 363, 0 ), /* 581 monit */ - S_ST( 't', 3, 364, 579 ), /* 582 mon */ - S_ST( 'r', 3, 365, 576 ), /* 583 m */ - S_ST( 's', 3, 585, 583 ), /* 584 m */ - S_ST( 's', 3, 586, 0 ), /* 585 ms */ - S_ST( 'n', 3, 587, 0 ), /* 586 mss */ - S_ST( 't', 3, 333, 0 ), /* 587 mssn */ - S_ST( 'u', 3, 589, 584 ), /* 588 m */ - S_ST( 'l', 3, 590, 0 ), /* 589 mu */ - S_ST( 't', 3, 591, 0 ), /* 590 mul */ - S_ST( 'i', 3, 592, 0 ), /* 591 mult */ - S_ST( 'c', 3, 593, 0 ), /* 592 multi */ - S_ST( 'a', 3, 594, 0 ), /* 593 multic */ - S_ST( 's', 3, 595, 0 ), /* 594 multica */ - S_ST( 't', 3, 596, 0 ), /* 595 multicas */ - S_ST( 'c', 3, 597, 0 ), /* 596 multicast */ - S_ST( 'l', 3, 598, 0 ), /* 597 multicastc */ - S_ST( 'i', 3, 599, 0 ), /* 598 multicastcl */ - S_ST( 'e', 3, 600, 0 ), /* 599 multicastcli */ - S_ST( 'n', 3, 366, 0 ), /* 600 multicastclie */ - S_ST( 'n', 3, 648, 507 ), /* 601 */ - S_ST( 'i', 3, 367, 0 ), /* 602 n */ - S_ST( 'o', 3, 643, 602 ), /* 603 n */ - S_ST( 'e', 3, 605, 0 ), /* 604 no */ - S_ST( 'p', 3, 606, 0 ), /* 605 noe */ - S_ST( 'e', 3, 607, 0 ), /* 606 noep */ - S_ST( 'e', 3, 373, 0 ), /* 607 noepe */ - S_ST( 'l', 3, 609, 604 ), /* 608 no */ - S_ST( 'i', 3, 610, 0 ), /* 609 nol */ - S_ST( 'n', 3, 368, 0 ), /* 610 noli */ - S_ST( 'm', 3, 616, 608 ), /* 611 no */ - S_ST( 'o', 3, 613, 0 ), /* 612 nom */ - S_ST( 'd', 3, 614, 0 ), /* 613 nomo */ - S_ST( 'i', 3, 615, 0 ), /* 614 nomod */ - S_ST( 'f', 3, 369, 0 ), /* 615 nomodi */ - S_ST( 'r', 3, 617, 612 ), /* 616 nom */ - S_ST( 'u', 3, 618, 0 ), /* 617 nomr */ - S_ST( 'l', 3, 619, 0 ), /* 618 nomru */ - S_ST( 'i', 3, 620, 0 ), /* 619 nomrul */ - S_ST( 's', 3, 370, 0 ), /* 620 nomruli */ - S_ST( 'n', 3, 622, 611 ), /* 621 no */ - S_ST( 'v', 3, 623, 371 ), /* 622 non */ - S_ST( 'o', 3, 624, 0 ), /* 623 nonv */ - S_ST( 'l', 3, 625, 0 ), /* 624 nonvo */ - S_ST( 'a', 3, 626, 0 ), /* 625 nonvol */ - S_ST( 't', 3, 627, 0 ), /* 626 nonvola */ - S_ST( 'i', 3, 628, 0 ), /* 627 nonvolat */ - S_ST( 'l', 3, 372, 0 ), /* 628 nonvolati */ - S_ST( 'p', 3, 630, 621 ), /* 629 no */ - S_ST( 'e', 3, 631, 0 ), /* 630 nop */ - S_ST( 'e', 3, 374, 0 ), /* 631 nope */ - S_ST( 'q', 3, 633, 629 ), /* 632 no */ - S_ST( 'u', 3, 634, 0 ), /* 633 noq */ - S_ST( 'e', 3, 635, 0 ), /* 634 noqu */ - S_ST( 'r', 3, 375, 0 ), /* 635 noque */ - S_ST( 's', 3, 637, 632 ), /* 636 no */ - S_ST( 'e', 3, 641, 0 ), /* 637 nos */ - S_ST( 'l', 3, 639, 0 ), /* 638 nose */ - S_ST( 'e', 3, 640, 0 ), /* 639 nosel */ - S_ST( 'c', 3, 376, 0 ), /* 640 nosele */ - S_ST( 'r', 3, 642, 638 ), /* 641 nose */ - S_ST( 'v', 3, 377, 0 ), /* 642 noser */ - S_ST( 't', 3, 644, 636 ), /* 643 no */ - S_ST( 'r', 3, 646, 0 ), /* 644 not */ - S_ST( 'a', 3, 378, 0 ), /* 645 notr */ - S_ST( 'u', 3, 647, 645 ), /* 646 notr */ - S_ST( 's', 3, 379, 0 ), /* 647 notru */ - S_ST( 't', 3, 380, 603 ), /* 648 n */ - S_ST( 'p', 3, 650, 0 ), /* 649 ntp */ - S_ST( 'o', 3, 651, 0 ), /* 650 ntpp */ - S_ST( 'r', 3, 381, 0 ), /* 651 ntppo */ - S_ST( 's', 3, 653, 649 ), /* 652 ntp */ - S_ST( 'i', 3, 654, 0 ), /* 653 ntps */ - S_ST( 'g', 3, 655, 0 ), /* 654 ntpsi */ - S_ST( 'n', 3, 656, 0 ), /* 655 ntpsig */ - S_ST( 'd', 3, 657, 0 ), /* 656 ntpsign */ - S_ST( 's', 3, 658, 0 ), /* 657 ntpsignd */ - S_ST( 'o', 3, 659, 0 ), /* 658 ntpsignds */ - S_ST( 'c', 3, 660, 0 ), /* 659 ntpsigndso */ - S_ST( 'k', 3, 661, 0 ), /* 660 ntpsigndsoc */ - S_ST( 'e', 3, 382, 0 ), /* 661 ntpsigndsock */ - S_ST( 'o', 3, 663, 601 ), /* 662 */ - S_ST( 'r', 3, 664, 0 ), /* 663 o */ - S_ST( 'p', 3, 665, 0 ), /* 664 or */ - S_ST( 'h', 3, 666, 0 ), /* 665 orp */ - S_ST( 'a', 3, 383, 0 ), /* 666 orph */ - S_ST( 'w', 3, 668, 0 ), /* 667 orphan */ - S_ST( 'a', 3, 669, 0 ), /* 668 orphanw */ - S_ST( 'i', 3, 384, 0 ), /* 669 orphanwa */ - S_ST( 'p', 3, 397, 662 ), /* 670 */ - S_ST( 'a', 3, 672, 0 ), /* 671 p */ - S_ST( 'n', 3, 673, 0 ), /* 672 pa */ - S_ST( 'i', 3, 386, 0 ), /* 673 pan */ - S_ST( 'e', 3, 675, 671 ), /* 674 p */ - S_ST( 'e', 3, 387, 0 ), /* 675 pe */ - S_ST( '_', 3, 677, 0 ), /* 676 peer */ - S_ST( 'c', 3, 678, 0 ), /* 677 peer_ */ - S_ST( 'l', 3, 679, 0 ), /* 678 peer_c */ - S_ST( 'e', 3, 680, 0 ), /* 679 peer_cl */ - S_ST( 'a', 3, 681, 0 ), /* 680 peer_cle */ - S_ST( 'r', 3, 682, 0 ), /* 681 peer_clea */ - S_ST( '_', 3, 683, 0 ), /* 682 peer_clear */ - S_ST( 'd', 3, 684, 0 ), /* 683 peer_clear_ */ - S_ST( 'i', 3, 685, 0 ), /* 684 peer_clear_d */ - S_ST( 'g', 3, 686, 0 ), /* 685 peer_clear_di */ - S_ST( 'e', 3, 687, 0 ), /* 686 peer_clear_dig */ - S_ST( 's', 3, 688, 0 ), /* 687 peer_clear_dige */ - S_ST( 't', 3, 689, 0 ), /* 688 peer_clear_diges */ - S_ST( '_', 3, 690, 0 ), /* 689 peer_clear_digest */ - S_ST( 'e', 3, 691, 0 ), /* 690 peer_clear_digest_ */ - S_ST( 'a', 3, 692, 0 ), /* 691 peer_clear_digest_e */ - S_ST( 'r', 3, 693, 0 ), /* 692 peer_clear_digest_ea */ - S_ST( 'l', 3, 385, 0 ), /* 693 peer_clear_digest_ear */ - S_ST( 's', 3, 695, 676 ), /* 694 peer */ - S_ST( 't', 3, 696, 0 ), /* 695 peers */ - S_ST( 'a', 3, 697, 0 ), /* 696 peerst */ - S_ST( 't', 3, 388, 0 ), /* 697 peersta */ - S_ST( 'h', 3, 699, 674 ), /* 698 p */ - S_ST( 'o', 3, 700, 0 ), /* 699 ph */ - S_ST( 'n', 3, 389, 0 ), /* 700 pho */ - S_ST( 'i', 3, 390, 698 ), /* 701 p */ - S_ST( 'f', 3, 703, 0 ), /* 702 pid */ - S_ST( 'i', 3, 704, 0 ), /* 703 pidf */ - S_ST( 'l', 3, 391, 0 ), /* 704 pidfi */ - S_ST( 'o', 3, 707, 701 ), /* 705 p */ - S_ST( 'o', 3, 392, 0 ), /* 706 po */ - S_ST( 'r', 3, 393, 706 ), /* 707 po */ - S_ST( 'r', 3, 715, 705 ), /* 708 p */ - S_ST( 'e', 3, 713, 0 ), /* 709 pr */ - S_ST( 'e', 3, 711, 0 ), /* 710 pre */ - S_ST( 'm', 3, 712, 0 ), /* 711 pree */ - S_ST( 'p', 3, 394, 0 ), /* 712 preem */ - S_ST( 'f', 3, 714, 710 ), /* 713 pre */ - S_ST( 'e', 3, 395, 0 ), /* 714 pref */ - S_ST( 'o', 3, 728, 709 ), /* 715 pr */ - S_ST( 'c', 3, 717, 0 ), /* 716 pro */ - S_ST( '_', 3, 718, 0 ), /* 717 proc */ - S_ST( 'd', 3, 719, 0 ), /* 718 proc_ */ - S_ST( 'e', 3, 720, 0 ), /* 719 proc_d */ - S_ST( 'l', 3, 721, 0 ), /* 720 proc_de */ - S_ST( 'a', 3, 457, 0 ), /* 721 proc_del */ - S_ST( 'p', 3, 723, 716 ), /* 722 pro */ - S_ST( '_', 3, 724, 0 ), /* 723 prop */ - S_ST( 'd', 3, 725, 0 ), /* 724 prop_ */ - S_ST( 'e', 3, 726, 0 ), /* 725 prop_d */ - S_ST( 'l', 3, 727, 0 ), /* 726 prop_de */ - S_ST( 'a', 3, 456, 0 ), /* 727 prop_del */ - S_ST( 't', 3, 729, 722 ), /* 728 pro */ - S_ST( 'o', 3, 730, 0 ), /* 729 prot */ - S_ST( 's', 3, 731, 0 ), /* 730 proto */ - S_ST( 't', 3, 732, 0 ), /* 731 protos */ - S_ST( 'a', 3, 733, 0 ), /* 732 protost */ - S_ST( 't', 3, 396, 0 ), /* 733 protosta */ - S_ST( 'r', 3, 765, 670 ), /* 734 */ - S_ST( 'a', 3, 741, 0 ), /* 735 r */ - S_ST( 'n', 3, 737, 0 ), /* 736 ra */ - S_ST( 'd', 3, 738, 0 ), /* 737 ran */ - S_ST( 'f', 3, 739, 0 ), /* 738 rand */ - S_ST( 'i', 3, 740, 0 ), /* 739 randf */ - S_ST( 'l', 3, 398, 0 ), /* 740 randfi */ - S_ST( 'w', 3, 742, 736 ), /* 741 ra */ - S_ST( 's', 3, 743, 0 ), /* 742 raw */ - S_ST( 't', 3, 744, 0 ), /* 743 raws */ - S_ST( 'a', 3, 745, 0 ), /* 744 rawst */ - S_ST( 't', 3, 399, 0 ), /* 745 rawsta */ - S_ST( 'e', 3, 762, 735 ), /* 746 r */ - S_ST( 'f', 3, 748, 0 ), /* 747 re */ - S_ST( 'i', 3, 400, 0 ), /* 748 ref */ - S_ST( 'q', 3, 750, 747 ), /* 749 re */ - S_ST( 'u', 3, 751, 0 ), /* 750 req */ - S_ST( 'e', 3, 752, 0 ), /* 751 requ */ - S_ST( 's', 3, 753, 0 ), /* 752 reque */ - S_ST( 't', 3, 754, 0 ), /* 753 reques */ - S_ST( 'k', 3, 755, 0 ), /* 754 request */ - S_ST( 'e', 3, 401, 0 ), /* 755 requestk */ - S_ST( 's', 3, 758, 749 ), /* 756 re */ - S_ST( 'e', 3, 402, 0 ), /* 757 res */ - S_ST( 't', 3, 759, 757 ), /* 758 res */ - S_ST( 'r', 3, 760, 0 ), /* 759 rest */ - S_ST( 'i', 3, 761, 0 ), /* 760 restr */ - S_ST( 'c', 3, 403, 0 ), /* 761 restri */ - S_ST( 'v', 3, 763, 756 ), /* 762 re */ - S_ST( 'o', 3, 764, 0 ), /* 763 rev */ - S_ST( 'k', 3, 404, 0 ), /* 764 revo */ - S_ST( 'l', 3, 766, 746 ), /* 765 r */ - S_ST( 'i', 3, 767, 0 ), /* 766 rl */ - S_ST( 'm', 3, 768, 0 ), /* 767 rli */ - S_ST( 'i', 3, 405, 0 ), /* 768 rlim */ - S_ST( 's', 3, 842, 734 ), /* 769 */ - S_ST( 'a', 3, 771, 0 ), /* 770 s */ - S_ST( 'v', 3, 772, 0 ), /* 771 sa */ - S_ST( 'e', 3, 773, 0 ), /* 772 sav */ - S_ST( 'c', 3, 774, 0 ), /* 773 save */ - S_ST( 'o', 3, 775, 0 ), /* 774 savec */ - S_ST( 'n', 3, 776, 0 ), /* 775 saveco */ - S_ST( 'f', 3, 777, 0 ), /* 776 savecon */ - S_ST( 'i', 3, 778, 0 ), /* 777 saveconf */ - S_ST( 'g', 3, 779, 0 ), /* 778 saveconfi */ - S_ST( 'd', 3, 780, 0 ), /* 779 saveconfig */ - S_ST( 'i', 3, 406, 0 ), /* 780 saveconfigd */ - S_ST( 'e', 3, 791, 770 ), /* 781 s */ - S_ST( 'r', 3, 783, 0 ), /* 782 se */ - S_ST( 'v', 3, 784, 0 ), /* 783 ser */ - S_ST( 'e', 3, 407, 0 ), /* 784 serv */ - S_ST( '_', 3, 786, 0 ), /* 785 server */ - S_ST( 'o', 3, 787, 0 ), /* 786 server_ */ - S_ST( 'f', 3, 788, 0 ), /* 787 server_o */ - S_ST( 'f', 3, 789, 0 ), /* 788 server_of */ - S_ST( 's', 3, 790, 0 ), /* 789 server_off */ - S_ST( 'e', 3, 451, 0 ), /* 790 server_offs */ - S_ST( 't', 3, 792, 782 ), /* 791 se */ - S_ST( 'v', 3, 793, 0 ), /* 792 set */ - S_ST( 'a', 3, 408, 0 ), /* 793 setv */ - S_ST( 'i', 3, 795, 781 ), /* 794 s */ - S_ST( 'm', 3, 796, 0 ), /* 795 si */ - S_ST( 'u', 3, 797, 0 ), /* 796 sim */ - S_ST( 'l', 3, 798, 0 ), /* 797 simu */ - S_ST( 'a', 3, 799, 0 ), /* 798 simul */ - S_ST( 't', 3, 800, 0 ), /* 799 simula */ - S_ST( 'i', 3, 801, 448 ), /* 800 simulat */ - S_ST( 'o', 3, 802, 0 ), /* 801 simulati */ - S_ST( 'n', 3, 803, 0 ), /* 802 simulatio */ - S_ST( '_', 3, 804, 0 ), /* 803 simulation */ - S_ST( 'd', 3, 805, 0 ), /* 804 simulation_ */ - S_ST( 'u', 3, 806, 0 ), /* 805 simulation_d */ - S_ST( 'r', 3, 807, 0 ), /* 806 simulation_du */ - S_ST( 'a', 3, 808, 0 ), /* 807 simulation_dur */ - S_ST( 't', 3, 809, 0 ), /* 808 simulation_dura */ - S_ST( 'i', 3, 810, 0 ), /* 809 simulation_durat */ - S_ST( 'o', 3, 450, 0 ), /* 810 simulation_durati */ - S_ST( 'o', 3, 812, 794 ), /* 811 s */ - S_ST( 'u', 3, 813, 0 ), /* 812 so */ - S_ST( 'r', 3, 814, 0 ), /* 813 sou */ - S_ST( 'c', 3, 409, 0 ), /* 814 sour */ - S_ST( 't', 3, 838, 811 ), /* 815 s */ - S_ST( 'a', 3, 822, 0 ), /* 816 st */ - S_ST( 'c', 3, 818, 0 ), /* 817 sta */ - S_ST( 'k', 3, 819, 0 ), /* 818 stac */ - S_ST( 's', 3, 820, 0 ), /* 819 stack */ - S_ST( 'i', 3, 821, 0 ), /* 820 stacks */ - S_ST( 'z', 3, 410, 0 ), /* 821 stacksi */ - S_ST( 't', 3, 412, 817 ), /* 822 sta */ - S_ST( 'i', 3, 824, 0 ), /* 823 stat */ - S_ST( 's', 3, 825, 0 ), /* 824 stati */ - S_ST( 't', 3, 826, 0 ), /* 825 statis */ - S_ST( 'i', 3, 827, 0 ), /* 826 statist */ - S_ST( 'c', 3, 411, 0 ), /* 827 statisti */ - S_ST( 'd', 3, 829, 0 ), /* 828 stats */ - S_ST( 'i', 3, 413, 0 ), /* 829 statsd */ - S_ST( 'e', 3, 414, 816 ), /* 830 st */ - S_ST( 'b', 3, 832, 0 ), /* 831 step */ - S_ST( 'a', 3, 833, 0 ), /* 832 stepb */ - S_ST( 'c', 3, 415, 0 ), /* 833 stepba */ - S_ST( 'f', 3, 835, 831 ), /* 834 step */ - S_ST( 'w', 3, 416, 0 ), /* 835 stepf */ - S_ST( 'o', 3, 837, 834 ), /* 836 step */ - S_ST( 'u', 3, 417, 0 ), /* 837 stepo */ - S_ST( 'r', 3, 839, 830 ), /* 838 st */ - S_ST( 'a', 3, 840, 0 ), /* 839 str */ - S_ST( 't', 3, 841, 0 ), /* 840 stra */ - S_ST( 'u', 3, 418, 0 ), /* 841 strat */ - S_ST( 'y', 3, 420, 815 ), /* 842 s */ - S_ST( 's', 3, 844, 0 ), /* 843 sys */ - S_ST( 't', 3, 845, 0 ), /* 844 syss */ - S_ST( 'a', 3, 846, 0 ), /* 845 sysst */ - S_ST( 't', 3, 421, 0 ), /* 846 syssta */ - S_ST( 't', 3, 873, 769 ), /* 847 */ - S_ST( 'i', 3, 859, 0 ), /* 848 t */ - S_ST( 'c', 3, 422, 0 ), /* 849 ti */ - S_ST( 'm', 3, 852, 849 ), /* 850 ti */ - S_ST( 'e', 3, 425, 0 ), /* 851 tim */ - S_ST( 'i', 3, 853, 851 ), /* 852 tim */ - S_ST( 'n', 3, 854, 0 ), /* 853 timi */ - S_ST( 'g', 3, 855, 0 ), /* 854 timin */ - S_ST( 's', 3, 856, 0 ), /* 855 timing */ - S_ST( 't', 3, 857, 0 ), /* 856 timings */ - S_ST( 'a', 3, 858, 0 ), /* 857 timingst */ - S_ST( 't', 3, 426, 0 ), /* 858 timingsta */ - S_ST( 'n', 3, 860, 850 ), /* 859 ti */ - S_ST( 'k', 3, 861, 0 ), /* 860 tin */ - S_ST( 'e', 3, 427, 0 ), /* 861 tink */ - S_ST( 'o', 3, 428, 848 ), /* 862 t */ - S_ST( 'r', 3, 865, 862 ), /* 863 t */ - S_ST( 'a', 3, 429, 0 ), /* 864 tr */ - S_ST( 'u', 3, 866, 864 ), /* 865 tr */ - S_ST( 's', 3, 867, 430 ), /* 866 tru */ - S_ST( 't', 3, 868, 0 ), /* 867 trus */ - S_ST( 'e', 3, 869, 0 ), /* 868 trust */ - S_ST( 'd', 3, 870, 0 ), /* 869 truste */ - S_ST( 'k', 3, 871, 0 ), /* 870 trusted */ - S_ST( 'e', 3, 431, 0 ), /* 871 trustedk */ - S_ST( 't', 3, 432, 863 ), /* 872 t */ - S_ST( 'y', 3, 874, 872 ), /* 873 t */ - S_ST( 'p', 3, 433, 0 ), /* 874 ty */ - S_ST( 'u', 3, 876, 847 ), /* 875 */ - S_ST( 'n', 3, 882, 0 ), /* 876 u */ - S_ST( 'c', 3, 878, 0 ), /* 877 un */ - S_ST( 'o', 3, 879, 0 ), /* 878 unc */ - S_ST( 'n', 3, 880, 0 ), /* 879 unco */ - S_ST( 'f', 3, 881, 0 ), /* 880 uncon */ - S_ST( 'i', 3, 438, 0 ), /* 881 unconf */ - S_ST( 'p', 3, 883, 877 ), /* 882 un */ - S_ST( 'e', 3, 884, 0 ), /* 883 unp */ - S_ST( 'e', 3, 439, 0 ), /* 884 unpe */ - S_ST( '_', 3, 905, 0 ), /* 885 unpeer */ - S_ST( 'c', 3, 887, 0 ), /* 886 unpeer_ */ - S_ST( 'r', 3, 888, 0 ), /* 887 unpeer_c */ - S_ST( 'y', 3, 889, 0 ), /* 888 unpeer_cr */ - S_ST( 'p', 3, 890, 0 ), /* 889 unpeer_cry */ - S_ST( 't', 3, 891, 0 ), /* 890 unpeer_cryp */ - S_ST( 'o', 3, 892, 0 ), /* 891 unpeer_crypt */ - S_ST( '_', 3, 897, 0 ), /* 892 unpeer_crypto */ - S_ST( 'e', 3, 894, 0 ), /* 893 unpeer_crypto_ */ - S_ST( 'a', 3, 895, 0 ), /* 894 unpeer_crypto_e */ - S_ST( 'r', 3, 896, 0 ), /* 895 unpeer_crypto_ea */ - S_ST( 'l', 3, 435, 0 ), /* 896 unpeer_crypto_ear */ - S_ST( 'n', 3, 898, 893 ), /* 897 unpeer_crypto_ */ - S_ST( 'a', 3, 899, 0 ), /* 898 unpeer_crypto_n */ - S_ST( 'k', 3, 900, 0 ), /* 899 unpeer_crypto_na */ - S_ST( '_', 3, 901, 0 ), /* 900 unpeer_crypto_nak */ - S_ST( 'e', 3, 902, 0 ), /* 901 unpeer_crypto_nak_ */ - S_ST( 'a', 3, 903, 0 ), /* 902 unpeer_crypto_nak_e */ - S_ST( 'r', 3, 904, 0 ), /* 903 unpeer_crypto_nak_ea */ - S_ST( 'l', 3, 436, 0 ), /* 904 unpeer_crypto_nak_ear */ - S_ST( 'd', 3, 906, 886 ), /* 905 unpeer_ */ - S_ST( 'i', 3, 907, 0 ), /* 906 unpeer_d */ - S_ST( 'g', 3, 908, 0 ), /* 907 unpeer_di */ - S_ST( 'e', 3, 909, 0 ), /* 908 unpeer_dig */ - S_ST( 's', 3, 910, 0 ), /* 909 unpeer_dige */ - S_ST( 't', 3, 911, 0 ), /* 910 unpeer_diges */ - S_ST( '_', 3, 912, 0 ), /* 911 unpeer_digest */ - S_ST( 'e', 3, 913, 0 ), /* 912 unpeer_digest_ */ - S_ST( 'a', 3, 914, 0 ), /* 913 unpeer_digest_e */ - S_ST( 'r', 3, 915, 0 ), /* 914 unpeer_digest_ea */ - S_ST( 'l', 3, 437, 0 ), /* 915 unpeer_digest_ear */ - S_ST( 'v', 3, 917, 875 ), /* 916 */ - S_ST( 'e', 3, 918, 0 ), /* 917 v */ - S_ST( 'r', 3, 919, 0 ), /* 918 ve */ - S_ST( 's', 3, 920, 0 ), /* 919 ver */ - S_ST( 'i', 3, 921, 0 ), /* 920 vers */ - S_ST( 'o', 3, 440, 0 ), /* 921 versi */ - S_ST( 'w', 3, 929, 916 ), /* 922 */ - S_ST( 'a', 3, 924, 0 ), /* 923 w */ - S_ST( 'n', 3, 925, 0 ), /* 924 wa */ - S_ST( 'd', 3, 926, 0 ), /* 925 wan */ - S_ST( 'e', 3, 454, 0 ), /* 926 wand */ - S_ST( 'e', 3, 928, 923 ), /* 927 w */ - S_ST( 'e', 3, 442, 0 ), /* 928 we */ - S_ST( 'i', 3, 930, 927 ), /* 929 w */ - S_ST( 'l', 3, 931, 0 ), /* 930 wi */ - S_ST( 'd', 3, 932, 0 ), /* 931 wil */ - S_ST( 'c', 3, 933, 0 ), /* 932 wild */ - S_ST( 'a', 3, 934, 0 ), /* 933 wildc */ - S_ST( 'r', 3, 443, 0 ), /* 934 wildca */ - S_ST( 'x', 3, 936, 922 ), /* 935 */ - S_ST( 'l', 3, 937, 0 ), /* 936 x */ - S_ST( 'e', 3, 938, 0 ), /* 937 xl */ - S_ST( 'a', 3, 939, 0 ), /* 938 xle */ - S_ST( 'v', 3, 444, 0 ), /* 939 xlea */ - S_ST( 'y', 3, 941, 935 ), /* 940 [initial state] */ - S_ST( 'e', 3, 942, 0 ), /* 941 y */ - S_ST( 'a', 3, 445, 0 ) /* 942 ye */ + S_ST( 'h', 0, 0, 0 ), /* 277 T_Checkhash */ + S_ST( 's', 0, 0, 0 ), /* 278 T_Clockstats */ + S_ST( 't', 0, 0, 0 ), /* 279 T_Cohort */ + S_ST( 'y', 0, 0, 0 ), /* 280 T_ControlKey */ + S_ST( 'o', 0, 121, 0 ), /* 281 T_Crypto */ + S_ST( 's', 0, 0, 0 ), /* 282 T_Cryptostats */ + S_ST( 'l', 0, 0, 0 ), /* 283 T_Ctl */ + S_ST( 'y', 0, 0, 0 ), /* 284 T_Day */ + S_ST( 't', 0, 0, 0 ), /* 285 T_Default */ + S_ST( 't', 1, 0, 0 ), /* 286 T_Digest */ + S_ST( 'e', 0, 0, 0 ), /* 287 T_Disable */ + S_ST( 'd', 0, 0, 0 ), /* 288 T_Discard */ + S_ST( 'n', 0, 0, 0 ), /* 289 T_Dispersion */ + S_ST( 'i', 3, 298, 0 ), /* 290 ippeerl */ + S_ST( 'e', 1, 0, 0 ), /* 291 T_Driftfile */ + S_ST( 'p', 0, 0, 0 ), /* 292 T_Drop */ + S_ST( 'p', 0, 0, 0 ), /* 293 T_Dscp */ + S_ST( '.', 0, 0, 0 ), /* 294 T_Ellipsis */ + S_ST( 'e', 0, 0, 0 ), /* 295 T_Enable */ + S_ST( 'd', 0, 0, 168 ), /* 296 T_End */ + S_ST( 'r', 0, 0, 0 ), /* 297 T_Epeer */ + S_ST( 'm', 3, 322, 0 ), /* 298 ippeerli */ + S_ST( 'e', 1, 179, 0 ), /* 299 T_File */ + S_ST( 'n', 0, 0, 0 ), /* 300 T_Filegen */ + S_ST( 'm', 0, 0, 0 ), /* 301 T_Filenum */ + S_ST( '1', 0, 0, 0 ), /* 302 T_Flag1 */ + S_ST( '2', 0, 0, 302 ), /* 303 T_Flag2 */ + S_ST( '3', 0, 0, 303 ), /* 304 T_Flag3 */ + S_ST( '4', 0, 0, 304 ), /* 305 T_Flag4 */ + S_ST( 'e', 0, 0, 0 ), /* 306 T_Flake */ + S_ST( 'r', 0, 0, 0 ), /* 307 T_Floor */ + S_ST( 'q', 0, 189, 0 ), /* 308 T_Freq */ + S_ST( 'e', 1, 0, 0 ), /* 309 T_Fudge */ + S_ST( 'z', 0, 0, 0 ), /* 310 T_Fuzz */ + S_ST( 't', 1, 0, 0 ), /* 311 T_Host */ + S_ST( 'f', 0, 0, 0 ), /* 312 T_Huffpuff */ + S_ST( 't', 0, 0, 0 ), /* 313 T_Iburst */ + S_ST( 't', 1, 0, 0 ), /* 314 T_Ident */ + S_ST( 'e', 0, 220, 0 ), /* 315 T_Ignore */ + S_ST( 'h', 0, 0, 0 ), /* 316 T_Ignorehash */ + S_ST( 'c', 0, 0, 0 ), /* 317 T_Incalloc */ + S_ST( 'm', 0, 0, 0 ), /* 318 T_Incmem */ + S_ST( 'c', 0, 0, 0 ), /* 319 T_Initalloc */ + S_ST( 'm', 0, 0, 0 ), /* 320 T_Initmem */ + S_ST( 'e', 1, 0, 0 ), /* 321 T_Includefile */ + S_ST( 'i', 3, 326, 0 ), /* 322 ippeerlim */ + S_ST( 'e', 0, 0, 0 ), /* 323 T_Interface */ + S_ST( 'v', 3, 329, 253 ), /* 324 ip */ + S_ST( 'o', 0, 0, 223 ), /* 325 T_Io */ + S_ST( 't', 0, 0, 0 ), /* 326 T_Ippeerlimit */ + S_ST( '4', 0, 0, 0 ), /* 327 T_Ipv4 */ + S_ST( '4', 0, 0, 0 ), /* 328 T_Ipv4_flag */ + S_ST( '6', 0, 0, 327 ), /* 329 T_Ipv6 */ + S_ST( '6', 0, 0, 328 ), /* 330 T_Ipv6_flag */ + S_ST( 'l', 0, 0, 0 ), /* 331 T_Kernel */ + S_ST( 'y', 0, 333, 468 ), /* 332 T_Key */ + S_ST( 's', 1, 471, 0 ), /* 333 T_Keys */ + S_ST( 'r', 1, 0, 0 ), /* 334 T_Keysdir */ + S_ST( 'd', 0, 0, 0 ), /* 335 T_Kod */ + S_ST( 'e', 1, 0, 0 ), /* 336 T_Leapfile */ + S_ST( 'l', 0, 0, 0 ), /* 337 T_Leapsmearinterval */ + S_ST( 'd', 0, 0, 0 ), /* 338 T_Limited */ + S_ST( 'k', 0, 0, 0 ), /* 339 T_Link */ + S_ST( 'n', 0, 0, 0 ), /* 340 T_Listen */ + S_ST( 'g', 2, 0, 0 ), /* 341 T_Logconfig */ + S_ST( 'e', 1, 0, 0 ), /* 342 T_Logfile */ + S_ST( 's', 0, 0, 0 ), /* 343 T_Loopstats */ + S_ST( 'p', 0, 0, 0 ), /* 344 T_Lowpriotrap */ + S_ST( 't', 1, 0, 0 ), /* 345 T_Manycastclient */ + S_ST( 'r', 2, 0, 0 ), /* 346 T_Manycastserver */ + S_ST( 'k', 0, 0, 0 ), /* 347 T_Mask */ + S_ST( 'e', 0, 0, 0 ), /* 348 T_Maxage */ + S_ST( 'k', 0, 0, 0 ), /* 349 T_Maxclock */ + S_ST( 'h', 0, 0, 0 ), /* 350 T_Maxdepth */ + S_ST( 't', 0, 0, 0 ), /* 351 T_Maxdist */ + S_ST( 'm', 0, 0, 0 ), /* 352 T_Maxmem */ + S_ST( 'l', 0, 0, 0 ), /* 353 T_Maxpoll */ + S_ST( 's', 0, 0, 0 ), /* 354 T_Mdnstries */ + S_ST( 'm', 0, 571, 0 ), /* 355 T_Mem */ + S_ST( 'k', 0, 0, 0 ), /* 356 T_Memlock */ + S_ST( 'k', 0, 0, 0 ), /* 357 T_Minclock */ + S_ST( 'h', 0, 0, 0 ), /* 358 T_Mindepth */ + S_ST( 't', 0, 0, 0 ), /* 359 T_Mindist */ + S_ST( 'm', 0, 0, 0 ), /* 360 T_Minimum */ + S_ST( 'r', 0, 0, 0 ), /* 361 T_Minjitter */ + S_ST( 'l', 0, 0, 0 ), /* 362 T_Minpoll */ + S_ST( 'e', 0, 0, 0 ), /* 363 T_Minsane */ + S_ST( 'e', 0, 365, 0 ), /* 364 T_Mode */ + S_ST( '7', 0, 0, 0 ), /* 365 T_Mode7 */ + S_ST( 'r', 0, 0, 0 ), /* 366 T_Monitor */ + S_ST( 'h', 0, 0, 0 ), /* 367 T_Month */ + S_ST( 'u', 0, 0, 0 ), /* 368 T_Mru */ + S_ST( 'p', 0, 0, 0 ), /* 369 T_Mssntp */ + S_ST( 't', 2, 0, 0 ), /* 370 T_Multicastclient */ + S_ST( 'c', 0, 0, 0 ), /* 371 T_Nic */ + S_ST( 'k', 0, 0, 0 ), /* 372 T_Nolink */ + S_ST( 'y', 0, 0, 0 ), /* 373 T_Nomodify */ + S_ST( 't', 0, 0, 0 ), /* 374 T_Nomrulist */ + S_ST( 'e', 0, 0, 0 ), /* 375 T_None */ + S_ST( 'e', 0, 0, 0 ), /* 376 T_Nonvolatile */ + S_ST( 'r', 0, 0, 0 ), /* 377 T_Noepeer */ + S_ST( 'r', 0, 0, 0 ), /* 378 T_Nopeer */ + S_ST( 'y', 0, 0, 0 ), /* 379 T_Noquery */ + S_ST( 't', 0, 0, 0 ), /* 380 T_Noselect */ + S_ST( 'e', 0, 0, 0 ), /* 381 T_Noserve */ + S_ST( 'p', 0, 0, 0 ), /* 382 T_Notrap */ + S_ST( 't', 0, 0, 0 ), /* 383 T_Notrust */ + S_ST( 'p', 0, 676, 0 ), /* 384 T_Ntp */ + S_ST( 't', 0, 0, 0 ), /* 385 T_Ntpport */ + S_ST( 't', 1, 0, 0 ), /* 386 T_NtpSignDsocket */ + S_ST( 'n', 0, 691, 0 ), /* 387 T_Orphan */ + S_ST( 't', 0, 0, 0 ), /* 388 T_Orphanwait */ + S_ST( 'y', 0, 0, 0 ), /* 389 T_PCEdigest */ + S_ST( 'c', 0, 0, 0 ), /* 390 T_Panic */ + S_ST( 'r', 1, 718, 0 ), /* 391 T_Peer */ + S_ST( 's', 0, 0, 0 ), /* 392 T_Peerstats */ + S_ST( 'e', 2, 0, 0 ), /* 393 T_Phone */ + S_ST( 'd', 0, 726, 0 ), /* 394 T_Pid */ + S_ST( 'e', 1, 0, 0 ), /* 395 T_Pidfile */ + S_ST( 'l', 0, 731, 0 ), /* 396 T_Poll */ + S_ST( 't', 0, 0, 0 ), /* 397 T_PollSkewList */ + S_ST( 'l', 1, 0, 0 ), /* 398 T_Pool */ + S_ST( 't', 0, 0, 0 ), /* 399 T_Port */ + S_ST( 't', 0, 0, 0 ), /* 400 T_Preempt */ + S_ST( 'r', 0, 0, 0 ), /* 401 T_Prefer */ + S_ST( 's', 0, 0, 0 ), /* 402 T_Protostats */ + S_ST( 'w', 1, 0, 740 ), /* 403 T_Pw */ + S_ST( 'e', 1, 0, 0 ), /* 404 T_Randfile */ + S_ST( 's', 0, 0, 0 ), /* 405 T_Rawstats */ + S_ST( 'd', 1, 0, 0 ), /* 406 T_Refid */ + S_ST( 'y', 0, 0, 0 ), /* 407 T_Requestkey */ + S_ST( 't', 0, 0, 0 ), /* 408 T_Reset */ + S_ST( 't', 0, 0, 0 ), /* 409 T_Restrict */ + S_ST( 'e', 0, 0, 0 ), /* 410 T_Revoke */ + S_ST( 't', 0, 0, 0 ), /* 411 T_Rlimit */ + S_ST( 'r', 1, 0, 0 ), /* 412 T_Saveconfigdir */ + S_ST( 'r', 1, 823, 0 ), /* 413 T_Server */ + S_ST( 'e', 0, 0, 0 ), /* 414 T_Serverresponse */ + S_ST( 'j', 3, 427, 208 ), /* 415 */ + S_ST( 'r', 1, 0, 0 ), /* 416 T_Setvar */ + S_ST( 'e', 0, 0, 0 ), /* 417 T_Source */ + S_ST( 'e', 0, 0, 0 ), /* 418 T_Stacksize */ + S_ST( 's', 0, 0, 0 ), /* 419 T_Statistics */ + S_ST( 's', 0, 867, 862 ), /* 420 T_Stats */ + S_ST( 'r', 1, 0, 0 ), /* 421 T_Statsdir */ + S_ST( 'p', 0, 875, 0 ), /* 422 T_Step */ + S_ST( 'k', 0, 0, 0 ), /* 423 T_Stepback */ + S_ST( 'd', 0, 0, 0 ), /* 424 T_Stepfwd */ + S_ST( 't', 0, 0, 0 ), /* 425 T_Stepout */ + S_ST( 'm', 0, 0, 0 ), /* 426 T_Stratum */ + S_ST( 'i', 3, 442, 0 ), /* 427 j */ + S_ST( 's', 0, 882, 0 ), /* 428 T_Sys */ + S_ST( 's', 0, 0, 0 ), /* 429 T_Sysstats */ + S_ST( 'k', 0, 0, 0 ), /* 430 T_Tick */ + S_ST( '1', 0, 0, 0 ), /* 431 T_Time1 */ + S_ST( '2', 0, 0, 431 ), /* 432 T_Time2 */ + S_ST( 'r', 0, 0, 432 ), /* 433 T_Timer */ + S_ST( 's', 0, 0, 0 ), /* 434 T_Timingstats */ + S_ST( 'r', 0, 0, 0 ), /* 435 T_Tinker */ + S_ST( 's', 0, 0, 0 ), /* 436 T_Tos */ + S_ST( 'p', 1, 0, 0 ), /* 437 T_Trap */ + S_ST( 'e', 0, 0, 0 ), /* 438 T_True */ + S_ST( 'y', 0, 0, 0 ), /* 439 T_Trustedkey */ + S_ST( 'l', 0, 0, 0 ), /* 440 T_Ttl */ + S_ST( 'e', 0, 0, 0 ), /* 441 T_Type */ + S_ST( 't', 3, 449, 0 ), /* 442 ji */ + S_ST( 'y', 0, 0, 0 ), /* 443 T_UEcrypto */ + S_ST( 'y', 0, 0, 0 ), /* 444 T_UEcryptonak */ + S_ST( 'y', 0, 0, 0 ), /* 445 T_UEdigest */ + S_ST( 'g', 1, 0, 0 ), /* 446 T_Unconfig */ + S_ST( 'r', 1, 924, 0 ), /* 447 T_Unpeer */ + S_ST( 'n', 0, 0, 0 ), /* 448 T_Version */ + S_ST( 't', 3, 455, 0 ), /* 449 jit */ + S_ST( 'k', 0, 0, 0 ), /* 450 T_Week */ + S_ST( 'd', 0, 0, 0 ), /* 451 T_Wildcard */ + S_ST( 'e', 0, 0, 0 ), /* 452 T_Xleave */ + S_ST( 'e', 0, 0, 0 ), /* 453 T_Xmtnonce */ + S_ST( 'r', 0, 0, 0 ), /* 454 T_Year */ + S_ST( 'e', 3, 464, 0 ), /* 455 jitt */ + S_ST( 'k', 3, 473, 415 ), /* 456 */ + S_ST( 'e', 0, 0, 0 ), /* 457 T_Simulate */ + S_ST( 'y', 0, 0, 0 ), /* 458 T_Beep_Delay */ + S_ST( 'n', 0, 0, 0 ), /* 459 T_Sim_Duration */ + S_ST( 't', 0, 0, 0 ), /* 460 T_Server_Offset */ + S_ST( 'n', 0, 0, 0 ), /* 461 T_Duration */ + S_ST( 't', 0, 0, 0 ), /* 462 T_Freq_Offset */ + S_ST( 'r', 0, 0, 0 ), /* 463 T_Wander */ + S_ST( 'r', 0, 0, 0 ), /* 464 T_Jitter */ + S_ST( 'y', 0, 0, 0 ), /* 465 T_Prop_Delay */ + S_ST( 'y', 0, 0, 0 ), /* 466 T_Proc_Delay */ + S_ST( 'e', 3, 332, 0 ), /* 467 k */ + S_ST( 'r', 3, 469, 0 ), /* 468 ke */ + S_ST( 'n', 3, 470, 0 ), /* 469 ker */ + S_ST( 'e', 3, 331, 0 ), /* 470 kern */ + S_ST( 'd', 3, 472, 0 ), /* 471 keys */ + S_ST( 'i', 3, 334, 0 ), /* 472 keysd */ + S_ST( 'o', 3, 335, 467 ), /* 473 k */ + S_ST( 'l', 3, 502, 456 ), /* 474 */ + S_ST( 'e', 3, 476, 0 ), /* 475 l */ + S_ST( 'a', 3, 477, 0 ), /* 476 le */ + S_ST( 'p', 3, 481, 0 ), /* 477 lea */ + S_ST( 'f', 3, 479, 0 ), /* 478 leap */ + S_ST( 'i', 3, 480, 0 ), /* 479 leapf */ + S_ST( 'l', 3, 336, 0 ), /* 480 leapfi */ + S_ST( 's', 3, 482, 478 ), /* 481 leap */ + S_ST( 'm', 3, 483, 0 ), /* 482 leaps */ + S_ST( 'e', 3, 484, 0 ), /* 483 leapsm */ + S_ST( 'a', 3, 485, 0 ), /* 484 leapsme */ + S_ST( 'r', 3, 486, 0 ), /* 485 leapsmea */ + S_ST( 'i', 3, 487, 0 ), /* 486 leapsmear */ + S_ST( 'n', 3, 488, 0 ), /* 487 leapsmeari */ + S_ST( 't', 3, 489, 0 ), /* 488 leapsmearin */ + S_ST( 'e', 3, 490, 0 ), /* 489 leapsmearint */ + S_ST( 'r', 3, 491, 0 ), /* 490 leapsmearinte */ + S_ST( 'v', 3, 492, 0 ), /* 491 leapsmearinter */ + S_ST( 'a', 3, 337, 0 ), /* 492 leapsmearinterv */ + S_ST( 'i', 3, 499, 475 ), /* 493 l */ + S_ST( 'm', 3, 495, 0 ), /* 494 li */ + S_ST( 'i', 3, 496, 0 ), /* 495 lim */ + S_ST( 't', 3, 497, 0 ), /* 496 limi */ + S_ST( 'e', 3, 338, 0 ), /* 497 limit */ + S_ST( 'n', 3, 339, 494 ), /* 498 li */ + S_ST( 's', 3, 500, 498 ), /* 499 li */ + S_ST( 't', 3, 501, 0 ), /* 500 lis */ + S_ST( 'e', 3, 340, 0 ), /* 501 list */ + S_ST( 'o', 3, 518, 493 ), /* 502 l */ + S_ST( 'g', 3, 509, 0 ), /* 503 lo */ + S_ST( 'c', 3, 505, 0 ), /* 504 log */ + S_ST( 'o', 3, 506, 0 ), /* 505 logc */ + S_ST( 'n', 3, 507, 0 ), /* 506 logco */ + S_ST( 'f', 3, 508, 0 ), /* 507 logcon */ + S_ST( 'i', 3, 341, 0 ), /* 508 logconf */ + S_ST( 'f', 3, 510, 504 ), /* 509 log */ + S_ST( 'i', 3, 511, 0 ), /* 510 logf */ + S_ST( 'l', 3, 342, 0 ), /* 511 logfi */ + S_ST( 'o', 3, 513, 503 ), /* 512 lo */ + S_ST( 'p', 3, 514, 0 ), /* 513 loo */ + S_ST( 's', 3, 515, 0 ), /* 514 loop */ + S_ST( 't', 3, 516, 0 ), /* 515 loops */ + S_ST( 'a', 3, 517, 0 ), /* 516 loopst */ + S_ST( 't', 3, 343, 0 ), /* 517 loopsta */ + S_ST( 'w', 3, 519, 512 ), /* 518 lo */ + S_ST( 'p', 3, 520, 0 ), /* 519 low */ + S_ST( 'r', 3, 521, 0 ), /* 520 lowp */ + S_ST( 'i', 3, 522, 0 ), /* 521 lowpr */ + S_ST( 'o', 3, 523, 0 ), /* 522 lowpri */ + S_ST( 't', 3, 524, 0 ), /* 523 lowprio */ + S_ST( 'r', 3, 525, 0 ), /* 524 lowpriot */ + S_ST( 'a', 3, 344, 0 ), /* 525 lowpriotr */ + S_ST( 'm', 3, 612, 474 ), /* 526 */ + S_ST( 'a', 3, 545, 0 ), /* 527 m */ + S_ST( 'n', 3, 529, 0 ), /* 528 ma */ + S_ST( 'y', 3, 530, 0 ), /* 529 man */ + S_ST( 'c', 3, 531, 0 ), /* 530 many */ + S_ST( 'a', 3, 532, 0 ), /* 531 manyc */ + S_ST( 's', 3, 533, 0 ), /* 532 manyca */ + S_ST( 't', 3, 539, 0 ), /* 533 manycas */ + S_ST( 'c', 3, 535, 0 ), /* 534 manycast */ + S_ST( 'l', 3, 536, 0 ), /* 535 manycastc */ + S_ST( 'i', 3, 537, 0 ), /* 536 manycastcl */ + S_ST( 'e', 3, 538, 0 ), /* 537 manycastcli */ + S_ST( 'n', 3, 345, 0 ), /* 538 manycastclie */ + S_ST( 's', 3, 540, 534 ), /* 539 manycast */ + S_ST( 'e', 3, 541, 0 ), /* 540 manycasts */ + S_ST( 'r', 3, 542, 0 ), /* 541 manycastse */ + S_ST( 'v', 3, 543, 0 ), /* 542 manycastser */ + S_ST( 'e', 3, 346, 0 ), /* 543 manycastserv */ + S_ST( 's', 3, 347, 528 ), /* 544 ma */ + S_ST( 'x', 3, 560, 544 ), /* 545 ma */ + S_ST( 'a', 3, 547, 0 ), /* 546 max */ + S_ST( 'g', 3, 348, 0 ), /* 547 maxa */ + S_ST( 'c', 3, 549, 546 ), /* 548 max */ + S_ST( 'l', 3, 550, 0 ), /* 549 maxc */ + S_ST( 'o', 3, 551, 0 ), /* 550 maxcl */ + S_ST( 'c', 3, 349, 0 ), /* 551 maxclo */ + S_ST( 'd', 3, 556, 548 ), /* 552 max */ + S_ST( 'e', 3, 554, 0 ), /* 553 maxd */ + S_ST( 'p', 3, 555, 0 ), /* 554 maxde */ + S_ST( 't', 3, 350, 0 ), /* 555 maxdep */ + S_ST( 'i', 3, 557, 553 ), /* 556 maxd */ + S_ST( 's', 3, 351, 0 ), /* 557 maxdi */ + S_ST( 'm', 3, 559, 552 ), /* 558 max */ + S_ST( 'e', 3, 352, 0 ), /* 559 maxm */ + S_ST( 'p', 3, 561, 558 ), /* 560 max */ + S_ST( 'o', 3, 562, 0 ), /* 561 maxp */ + S_ST( 'l', 3, 353, 0 ), /* 562 maxpo */ + S_ST( 'd', 3, 564, 527 ), /* 563 m */ + S_ST( 'n', 3, 565, 0 ), /* 564 md */ + S_ST( 's', 3, 566, 0 ), /* 565 mdn */ + S_ST( 't', 3, 567, 0 ), /* 566 mdns */ + S_ST( 'r', 3, 568, 0 ), /* 567 mdnst */ + S_ST( 'i', 3, 569, 0 ), /* 568 mdnstr */ + S_ST( 'e', 3, 354, 0 ), /* 569 mdnstri */ + S_ST( 'e', 3, 355, 563 ), /* 570 m */ + S_ST( 'l', 3, 572, 0 ), /* 571 mem */ + S_ST( 'o', 3, 573, 0 ), /* 572 meml */ + S_ST( 'c', 3, 356, 0 ), /* 573 memlo */ + S_ST( 'i', 3, 575, 570 ), /* 574 m */ + S_ST( 'n', 3, 597, 0 ), /* 575 mi */ + S_ST( 'c', 3, 577, 0 ), /* 576 min */ + S_ST( 'l', 3, 578, 0 ), /* 577 minc */ + S_ST( 'o', 3, 579, 0 ), /* 578 mincl */ + S_ST( 'c', 3, 357, 0 ), /* 579 minclo */ + S_ST( 'd', 3, 584, 576 ), /* 580 min */ + S_ST( 'e', 3, 582, 0 ), /* 581 mind */ + S_ST( 'p', 3, 583, 0 ), /* 582 minde */ + S_ST( 't', 3, 358, 0 ), /* 583 mindep */ + S_ST( 'i', 3, 585, 581 ), /* 584 mind */ + S_ST( 's', 3, 359, 0 ), /* 585 mindi */ + S_ST( 'i', 3, 587, 580 ), /* 586 min */ + S_ST( 'm', 3, 588, 0 ), /* 587 mini */ + S_ST( 'u', 3, 360, 0 ), /* 588 minim */ + S_ST( 'j', 3, 590, 586 ), /* 589 min */ + S_ST( 'i', 3, 591, 0 ), /* 590 minj */ + S_ST( 't', 3, 592, 0 ), /* 591 minji */ + S_ST( 't', 3, 593, 0 ), /* 592 minjit */ + S_ST( 'e', 3, 361, 0 ), /* 593 minjitt */ + S_ST( 'p', 3, 595, 589 ), /* 594 min */ + S_ST( 'o', 3, 596, 0 ), /* 595 minp */ + S_ST( 'l', 3, 362, 0 ), /* 596 minpo */ + S_ST( 's', 3, 598, 594 ), /* 597 min */ + S_ST( 'a', 3, 599, 0 ), /* 598 mins */ + S_ST( 'n', 3, 363, 0 ), /* 599 minsa */ + S_ST( 'o', 3, 602, 574 ), /* 600 m */ + S_ST( 'd', 3, 364, 0 ), /* 601 mo */ + S_ST( 'n', 3, 606, 601 ), /* 602 mo */ + S_ST( 'i', 3, 604, 0 ), /* 603 mon */ + S_ST( 't', 3, 605, 0 ), /* 604 moni */ + S_ST( 'o', 3, 366, 0 ), /* 605 monit */ + S_ST( 't', 3, 367, 603 ), /* 606 mon */ + S_ST( 'r', 3, 368, 600 ), /* 607 m */ + S_ST( 's', 3, 609, 607 ), /* 608 m */ + S_ST( 's', 3, 610, 0 ), /* 609 ms */ + S_ST( 'n', 3, 611, 0 ), /* 610 mss */ + S_ST( 't', 3, 369, 0 ), /* 611 mssn */ + S_ST( 'u', 3, 613, 608 ), /* 612 m */ + S_ST( 'l', 3, 614, 0 ), /* 613 mu */ + S_ST( 't', 3, 615, 0 ), /* 614 mul */ + S_ST( 'i', 3, 616, 0 ), /* 615 mult */ + S_ST( 'c', 3, 617, 0 ), /* 616 multi */ + S_ST( 'a', 3, 618, 0 ), /* 617 multic */ + S_ST( 's', 3, 619, 0 ), /* 618 multica */ + S_ST( 't', 3, 620, 0 ), /* 619 multicas */ + S_ST( 'c', 3, 621, 0 ), /* 620 multicast */ + S_ST( 'l', 3, 622, 0 ), /* 621 multicastc */ + S_ST( 'i', 3, 623, 0 ), /* 622 multicastcl */ + S_ST( 'e', 3, 624, 0 ), /* 623 multicastcli */ + S_ST( 'n', 3, 370, 0 ), /* 624 multicastclie */ + S_ST( 'n', 3, 672, 526 ), /* 625 */ + S_ST( 'i', 3, 371, 0 ), /* 626 n */ + S_ST( 'o', 3, 667, 626 ), /* 627 n */ + S_ST( 'e', 3, 629, 0 ), /* 628 no */ + S_ST( 'p', 3, 630, 0 ), /* 629 noe */ + S_ST( 'e', 3, 631, 0 ), /* 630 noep */ + S_ST( 'e', 3, 377, 0 ), /* 631 noepe */ + S_ST( 'l', 3, 633, 628 ), /* 632 no */ + S_ST( 'i', 3, 634, 0 ), /* 633 nol */ + S_ST( 'n', 3, 372, 0 ), /* 634 noli */ + S_ST( 'm', 3, 640, 632 ), /* 635 no */ + S_ST( 'o', 3, 637, 0 ), /* 636 nom */ + S_ST( 'd', 3, 638, 0 ), /* 637 nomo */ + S_ST( 'i', 3, 639, 0 ), /* 638 nomod */ + S_ST( 'f', 3, 373, 0 ), /* 639 nomodi */ + S_ST( 'r', 3, 641, 636 ), /* 640 nom */ + S_ST( 'u', 3, 642, 0 ), /* 641 nomr */ + S_ST( 'l', 3, 643, 0 ), /* 642 nomru */ + S_ST( 'i', 3, 644, 0 ), /* 643 nomrul */ + S_ST( 's', 3, 374, 0 ), /* 644 nomruli */ + S_ST( 'n', 3, 646, 635 ), /* 645 no */ + S_ST( 'v', 3, 647, 375 ), /* 646 non */ + S_ST( 'o', 3, 648, 0 ), /* 647 nonv */ + S_ST( 'l', 3, 649, 0 ), /* 648 nonvo */ + S_ST( 'a', 3, 650, 0 ), /* 649 nonvol */ + S_ST( 't', 3, 651, 0 ), /* 650 nonvola */ + S_ST( 'i', 3, 652, 0 ), /* 651 nonvolat */ + S_ST( 'l', 3, 376, 0 ), /* 652 nonvolati */ + S_ST( 'p', 3, 654, 645 ), /* 653 no */ + S_ST( 'e', 3, 655, 0 ), /* 654 nop */ + S_ST( 'e', 3, 378, 0 ), /* 655 nope */ + S_ST( 'q', 3, 657, 653 ), /* 656 no */ + S_ST( 'u', 3, 658, 0 ), /* 657 noq */ + S_ST( 'e', 3, 659, 0 ), /* 658 noqu */ + S_ST( 'r', 3, 379, 0 ), /* 659 noque */ + S_ST( 's', 3, 661, 656 ), /* 660 no */ + S_ST( 'e', 3, 665, 0 ), /* 661 nos */ + S_ST( 'l', 3, 663, 0 ), /* 662 nose */ + S_ST( 'e', 3, 664, 0 ), /* 663 nosel */ + S_ST( 'c', 3, 380, 0 ), /* 664 nosele */ + S_ST( 'r', 3, 666, 662 ), /* 665 nose */ + S_ST( 'v', 3, 381, 0 ), /* 666 noser */ + S_ST( 't', 3, 668, 660 ), /* 667 no */ + S_ST( 'r', 3, 670, 0 ), /* 668 not */ + S_ST( 'a', 3, 382, 0 ), /* 669 notr */ + S_ST( 'u', 3, 671, 669 ), /* 670 notr */ + S_ST( 's', 3, 383, 0 ), /* 671 notru */ + S_ST( 't', 3, 384, 627 ), /* 672 n */ + S_ST( 'p', 3, 674, 0 ), /* 673 ntp */ + S_ST( 'o', 3, 675, 0 ), /* 674 ntpp */ + S_ST( 'r', 3, 385, 0 ), /* 675 ntppo */ + S_ST( 's', 3, 677, 673 ), /* 676 ntp */ + S_ST( 'i', 3, 678, 0 ), /* 677 ntps */ + S_ST( 'g', 3, 679, 0 ), /* 678 ntpsi */ + S_ST( 'n', 3, 680, 0 ), /* 679 ntpsig */ + S_ST( 'd', 3, 681, 0 ), /* 680 ntpsign */ + S_ST( 's', 3, 682, 0 ), /* 681 ntpsignd */ + S_ST( 'o', 3, 683, 0 ), /* 682 ntpsignds */ + S_ST( 'c', 3, 684, 0 ), /* 683 ntpsigndso */ + S_ST( 'k', 3, 685, 0 ), /* 684 ntpsigndsoc */ + S_ST( 'e', 3, 386, 0 ), /* 685 ntpsigndsock */ + S_ST( 'o', 3, 687, 625 ), /* 686 */ + S_ST( 'r', 3, 688, 0 ), /* 687 o */ + S_ST( 'p', 3, 689, 0 ), /* 688 or */ + S_ST( 'h', 3, 690, 0 ), /* 689 orp */ + S_ST( 'a', 3, 387, 0 ), /* 690 orph */ + S_ST( 'w', 3, 692, 0 ), /* 691 orphan */ + S_ST( 'a', 3, 693, 0 ), /* 692 orphanw */ + S_ST( 'i', 3, 388, 0 ), /* 693 orphanwa */ + S_ST( 'p', 3, 403, 686 ), /* 694 */ + S_ST( 'a', 3, 696, 0 ), /* 695 p */ + S_ST( 'n', 3, 697, 0 ), /* 696 pa */ + S_ST( 'i', 3, 390, 0 ), /* 697 pan */ + S_ST( 'e', 3, 699, 695 ), /* 698 p */ + S_ST( 'e', 3, 391, 0 ), /* 699 pe */ + S_ST( '_', 3, 701, 0 ), /* 700 peer */ + S_ST( 'c', 3, 702, 0 ), /* 701 peer_ */ + S_ST( 'l', 3, 703, 0 ), /* 702 peer_c */ + S_ST( 'e', 3, 704, 0 ), /* 703 peer_cl */ + S_ST( 'a', 3, 705, 0 ), /* 704 peer_cle */ + S_ST( 'r', 3, 706, 0 ), /* 705 peer_clea */ + S_ST( '_', 3, 707, 0 ), /* 706 peer_clear */ + S_ST( 'd', 3, 708, 0 ), /* 707 peer_clear_ */ + S_ST( 'i', 3, 709, 0 ), /* 708 peer_clear_d */ + S_ST( 'g', 3, 710, 0 ), /* 709 peer_clear_di */ + S_ST( 'e', 3, 711, 0 ), /* 710 peer_clear_dig */ + S_ST( 's', 3, 712, 0 ), /* 711 peer_clear_dige */ + S_ST( 't', 3, 713, 0 ), /* 712 peer_clear_diges */ + S_ST( '_', 3, 714, 0 ), /* 713 peer_clear_digest */ + S_ST( 'e', 3, 715, 0 ), /* 714 peer_clear_digest_ */ + S_ST( 'a', 3, 716, 0 ), /* 715 peer_clear_digest_e */ + S_ST( 'r', 3, 717, 0 ), /* 716 peer_clear_digest_ea */ + S_ST( 'l', 3, 389, 0 ), /* 717 peer_clear_digest_ear */ + S_ST( 's', 3, 719, 700 ), /* 718 peer */ + S_ST( 't', 3, 720, 0 ), /* 719 peers */ + S_ST( 'a', 3, 721, 0 ), /* 720 peerst */ + S_ST( 't', 3, 392, 0 ), /* 721 peersta */ + S_ST( 'h', 3, 723, 698 ), /* 722 p */ + S_ST( 'o', 3, 724, 0 ), /* 723 ph */ + S_ST( 'n', 3, 393, 0 ), /* 724 pho */ + S_ST( 'i', 3, 394, 722 ), /* 725 p */ + S_ST( 'f', 3, 727, 0 ), /* 726 pid */ + S_ST( 'i', 3, 728, 0 ), /* 727 pidf */ + S_ST( 'l', 3, 395, 0 ), /* 728 pidfi */ + S_ST( 'o', 3, 739, 725 ), /* 729 p */ + S_ST( 'l', 3, 396, 0 ), /* 730 po */ + S_ST( 's', 3, 732, 0 ), /* 731 poll */ + S_ST( 'k', 3, 733, 0 ), /* 732 polls */ + S_ST( 'e', 3, 734, 0 ), /* 733 pollsk */ + S_ST( 'w', 3, 735, 0 ), /* 734 pollske */ + S_ST( 'l', 3, 736, 0 ), /* 735 pollskew */ + S_ST( 'i', 3, 737, 0 ), /* 736 pollskewl */ + S_ST( 's', 3, 397, 0 ), /* 737 pollskewli */ + S_ST( 'o', 3, 398, 730 ), /* 738 po */ + S_ST( 'r', 3, 399, 738 ), /* 739 po */ + S_ST( 'r', 3, 747, 729 ), /* 740 p */ + S_ST( 'e', 3, 745, 0 ), /* 741 pr */ + S_ST( 'e', 3, 743, 0 ), /* 742 pre */ + S_ST( 'm', 3, 744, 0 ), /* 743 pree */ + S_ST( 'p', 3, 400, 0 ), /* 744 preem */ + S_ST( 'f', 3, 746, 742 ), /* 745 pre */ + S_ST( 'e', 3, 401, 0 ), /* 746 pref */ + S_ST( 'o', 3, 760, 741 ), /* 747 pr */ + S_ST( 'c', 3, 749, 0 ), /* 748 pro */ + S_ST( '_', 3, 750, 0 ), /* 749 proc */ + S_ST( 'd', 3, 751, 0 ), /* 750 proc_ */ + S_ST( 'e', 3, 752, 0 ), /* 751 proc_d */ + S_ST( 'l', 3, 753, 0 ), /* 752 proc_de */ + S_ST( 'a', 3, 466, 0 ), /* 753 proc_del */ + S_ST( 'p', 3, 755, 748 ), /* 754 pro */ + S_ST( '_', 3, 756, 0 ), /* 755 prop */ + S_ST( 'd', 3, 757, 0 ), /* 756 prop_ */ + S_ST( 'e', 3, 758, 0 ), /* 757 prop_d */ + S_ST( 'l', 3, 759, 0 ), /* 758 prop_de */ + S_ST( 'a', 3, 465, 0 ), /* 759 prop_del */ + S_ST( 't', 3, 761, 754 ), /* 760 pro */ + S_ST( 'o', 3, 762, 0 ), /* 761 prot */ + S_ST( 's', 3, 763, 0 ), /* 762 proto */ + S_ST( 't', 3, 764, 0 ), /* 763 protos */ + S_ST( 'a', 3, 765, 0 ), /* 764 protost */ + S_ST( 't', 3, 402, 0 ), /* 765 protosta */ + S_ST( 'r', 3, 797, 694 ), /* 766 */ + S_ST( 'a', 3, 773, 0 ), /* 767 r */ + S_ST( 'n', 3, 769, 0 ), /* 768 ra */ + S_ST( 'd', 3, 770, 0 ), /* 769 ran */ + S_ST( 'f', 3, 771, 0 ), /* 770 rand */ + S_ST( 'i', 3, 772, 0 ), /* 771 randf */ + S_ST( 'l', 3, 404, 0 ), /* 772 randfi */ + S_ST( 'w', 3, 774, 768 ), /* 773 ra */ + S_ST( 's', 3, 775, 0 ), /* 774 raw */ + S_ST( 't', 3, 776, 0 ), /* 775 raws */ + S_ST( 'a', 3, 777, 0 ), /* 776 rawst */ + S_ST( 't', 3, 405, 0 ), /* 777 rawsta */ + S_ST( 'e', 3, 794, 767 ), /* 778 r */ + S_ST( 'f', 3, 780, 0 ), /* 779 re */ + S_ST( 'i', 3, 406, 0 ), /* 780 ref */ + S_ST( 'q', 3, 782, 779 ), /* 781 re */ + S_ST( 'u', 3, 783, 0 ), /* 782 req */ + S_ST( 'e', 3, 784, 0 ), /* 783 requ */ + S_ST( 's', 3, 785, 0 ), /* 784 reque */ + S_ST( 't', 3, 786, 0 ), /* 785 reques */ + S_ST( 'k', 3, 787, 0 ), /* 786 request */ + S_ST( 'e', 3, 407, 0 ), /* 787 requestk */ + S_ST( 's', 3, 790, 781 ), /* 788 re */ + S_ST( 'e', 3, 408, 0 ), /* 789 res */ + S_ST( 't', 3, 791, 789 ), /* 790 res */ + S_ST( 'r', 3, 792, 0 ), /* 791 rest */ + S_ST( 'i', 3, 793, 0 ), /* 792 restr */ + S_ST( 'c', 3, 409, 0 ), /* 793 restri */ + S_ST( 'v', 3, 795, 788 ), /* 794 re */ + S_ST( 'o', 3, 796, 0 ), /* 795 rev */ + S_ST( 'k', 3, 410, 0 ), /* 796 revo */ + S_ST( 'l', 3, 798, 778 ), /* 797 r */ + S_ST( 'i', 3, 799, 0 ), /* 798 rl */ + S_ST( 'm', 3, 800, 0 ), /* 799 rli */ + S_ST( 'i', 3, 411, 0 ), /* 800 rlim */ + S_ST( 's', 3, 881, 766 ), /* 801 */ + S_ST( 'a', 3, 803, 0 ), /* 802 s */ + S_ST( 'v', 3, 804, 0 ), /* 803 sa */ + S_ST( 'e', 3, 805, 0 ), /* 804 sav */ + S_ST( 'c', 3, 806, 0 ), /* 805 save */ + S_ST( 'o', 3, 807, 0 ), /* 806 savec */ + S_ST( 'n', 3, 808, 0 ), /* 807 saveco */ + S_ST( 'f', 3, 809, 0 ), /* 808 savecon */ + S_ST( 'i', 3, 810, 0 ), /* 809 saveconf */ + S_ST( 'g', 3, 811, 0 ), /* 810 saveconfi */ + S_ST( 'd', 3, 812, 0 ), /* 811 saveconfig */ + S_ST( 'i', 3, 412, 0 ), /* 812 saveconfigd */ + S_ST( 'e', 3, 830, 802 ), /* 813 s */ + S_ST( 'r', 3, 815, 0 ), /* 814 se */ + S_ST( 'v', 3, 816, 0 ), /* 815 ser */ + S_ST( 'e', 3, 413, 0 ), /* 816 serv */ + S_ST( '_', 3, 818, 0 ), /* 817 server */ + S_ST( 'o', 3, 819, 0 ), /* 818 server_ */ + S_ST( 'f', 3, 820, 0 ), /* 819 server_o */ + S_ST( 'f', 3, 821, 0 ), /* 820 server_of */ + S_ST( 's', 3, 822, 0 ), /* 821 server_off */ + S_ST( 'e', 3, 460, 0 ), /* 822 server_offs */ + S_ST( 'r', 3, 824, 817 ), /* 823 server */ + S_ST( 'e', 3, 825, 0 ), /* 824 serverr */ + S_ST( 's', 3, 826, 0 ), /* 825 serverre */ + S_ST( 'p', 3, 827, 0 ), /* 826 serverres */ + S_ST( 'o', 3, 828, 0 ), /* 827 serverresp */ + S_ST( 'n', 3, 829, 0 ), /* 828 serverrespo */ + S_ST( 's', 3, 414, 0 ), /* 829 serverrespon */ + S_ST( 't', 3, 831, 814 ), /* 830 se */ + S_ST( 'v', 3, 832, 0 ), /* 831 set */ + S_ST( 'a', 3, 416, 0 ), /* 832 setv */ + S_ST( 'i', 3, 834, 813 ), /* 833 s */ + S_ST( 'm', 3, 835, 0 ), /* 834 si */ + S_ST( 'u', 3, 836, 0 ), /* 835 sim */ + S_ST( 'l', 3, 837, 0 ), /* 836 simu */ + S_ST( 'a', 3, 838, 0 ), /* 837 simul */ + S_ST( 't', 3, 839, 0 ), /* 838 simula */ + S_ST( 'i', 3, 840, 457 ), /* 839 simulat */ + S_ST( 'o', 3, 841, 0 ), /* 840 simulati */ + S_ST( 'n', 3, 842, 0 ), /* 841 simulatio */ + S_ST( '_', 3, 843, 0 ), /* 842 simulation */ + S_ST( 'd', 3, 844, 0 ), /* 843 simulation_ */ + S_ST( 'u', 3, 845, 0 ), /* 844 simulation_d */ + S_ST( 'r', 3, 846, 0 ), /* 845 simulation_du */ + S_ST( 'a', 3, 847, 0 ), /* 846 simulation_dur */ + S_ST( 't', 3, 848, 0 ), /* 847 simulation_dura */ + S_ST( 'i', 3, 849, 0 ), /* 848 simulation_durat */ + S_ST( 'o', 3, 459, 0 ), /* 849 simulation_durati */ + S_ST( 'o', 3, 851, 833 ), /* 850 s */ + S_ST( 'u', 3, 852, 0 ), /* 851 so */ + S_ST( 'r', 3, 853, 0 ), /* 852 sou */ + S_ST( 'c', 3, 417, 0 ), /* 853 sour */ + S_ST( 't', 3, 877, 850 ), /* 854 s */ + S_ST( 'a', 3, 861, 0 ), /* 855 st */ + S_ST( 'c', 3, 857, 0 ), /* 856 sta */ + S_ST( 'k', 3, 858, 0 ), /* 857 stac */ + S_ST( 's', 3, 859, 0 ), /* 858 stack */ + S_ST( 'i', 3, 860, 0 ), /* 859 stacks */ + S_ST( 'z', 3, 418, 0 ), /* 860 stacksi */ + S_ST( 't', 3, 420, 856 ), /* 861 sta */ + S_ST( 'i', 3, 863, 0 ), /* 862 stat */ + S_ST( 's', 3, 864, 0 ), /* 863 stati */ + S_ST( 't', 3, 865, 0 ), /* 864 statis */ + S_ST( 'i', 3, 866, 0 ), /* 865 statist */ + S_ST( 'c', 3, 419, 0 ), /* 866 statisti */ + S_ST( 'd', 3, 868, 0 ), /* 867 stats */ + S_ST( 'i', 3, 421, 0 ), /* 868 statsd */ + S_ST( 'e', 3, 422, 855 ), /* 869 st */ + S_ST( 'b', 3, 871, 0 ), /* 870 step */ + S_ST( 'a', 3, 872, 0 ), /* 871 stepb */ + S_ST( 'c', 3, 423, 0 ), /* 872 stepba */ + S_ST( 'f', 3, 874, 870 ), /* 873 step */ + S_ST( 'w', 3, 424, 0 ), /* 874 stepf */ + S_ST( 'o', 3, 876, 873 ), /* 875 step */ + S_ST( 'u', 3, 425, 0 ), /* 876 stepo */ + S_ST( 'r', 3, 878, 869 ), /* 877 st */ + S_ST( 'a', 3, 879, 0 ), /* 878 str */ + S_ST( 't', 3, 880, 0 ), /* 879 stra */ + S_ST( 'u', 3, 426, 0 ), /* 880 strat */ + S_ST( 'y', 3, 428, 854 ), /* 881 s */ + S_ST( 's', 3, 883, 0 ), /* 882 sys */ + S_ST( 't', 3, 884, 0 ), /* 883 syss */ + S_ST( 'a', 3, 885, 0 ), /* 884 sysst */ + S_ST( 't', 3, 429, 0 ), /* 885 syssta */ + S_ST( 't', 3, 912, 801 ), /* 886 */ + S_ST( 'i', 3, 898, 0 ), /* 887 t */ + S_ST( 'c', 3, 430, 0 ), /* 888 ti */ + S_ST( 'm', 3, 891, 888 ), /* 889 ti */ + S_ST( 'e', 3, 433, 0 ), /* 890 tim */ + S_ST( 'i', 3, 892, 890 ), /* 891 tim */ + S_ST( 'n', 3, 893, 0 ), /* 892 timi */ + S_ST( 'g', 3, 894, 0 ), /* 893 timin */ + S_ST( 's', 3, 895, 0 ), /* 894 timing */ + S_ST( 't', 3, 896, 0 ), /* 895 timings */ + S_ST( 'a', 3, 897, 0 ), /* 896 timingst */ + S_ST( 't', 3, 434, 0 ), /* 897 timingsta */ + S_ST( 'n', 3, 899, 889 ), /* 898 ti */ + S_ST( 'k', 3, 900, 0 ), /* 899 tin */ + S_ST( 'e', 3, 435, 0 ), /* 900 tink */ + S_ST( 'o', 3, 436, 887 ), /* 901 t */ + S_ST( 'r', 3, 904, 901 ), /* 902 t */ + S_ST( 'a', 3, 437, 0 ), /* 903 tr */ + S_ST( 'u', 3, 905, 903 ), /* 904 tr */ + S_ST( 's', 3, 906, 438 ), /* 905 tru */ + S_ST( 't', 3, 907, 0 ), /* 906 trus */ + S_ST( 'e', 3, 908, 0 ), /* 907 trust */ + S_ST( 'd', 3, 909, 0 ), /* 908 truste */ + S_ST( 'k', 3, 910, 0 ), /* 909 trusted */ + S_ST( 'e', 3, 439, 0 ), /* 910 trustedk */ + S_ST( 't', 3, 440, 902 ), /* 911 t */ + S_ST( 'y', 3, 913, 911 ), /* 912 t */ + S_ST( 'p', 3, 441, 0 ), /* 913 ty */ + S_ST( 'u', 3, 915, 886 ), /* 914 */ + S_ST( 'n', 3, 921, 0 ), /* 915 u */ + S_ST( 'c', 3, 917, 0 ), /* 916 un */ + S_ST( 'o', 3, 918, 0 ), /* 917 unc */ + S_ST( 'n', 3, 919, 0 ), /* 918 unco */ + S_ST( 'f', 3, 920, 0 ), /* 919 uncon */ + S_ST( 'i', 3, 446, 0 ), /* 920 unconf */ + S_ST( 'p', 3, 922, 916 ), /* 921 un */ + S_ST( 'e', 3, 923, 0 ), /* 922 unp */ + S_ST( 'e', 3, 447, 0 ), /* 923 unpe */ + S_ST( '_', 3, 944, 0 ), /* 924 unpeer */ + S_ST( 'c', 3, 926, 0 ), /* 925 unpeer_ */ + S_ST( 'r', 3, 927, 0 ), /* 926 unpeer_c */ + S_ST( 'y', 3, 928, 0 ), /* 927 unpeer_cr */ + S_ST( 'p', 3, 929, 0 ), /* 928 unpeer_cry */ + S_ST( 't', 3, 930, 0 ), /* 929 unpeer_cryp */ + S_ST( 'o', 3, 931, 0 ), /* 930 unpeer_crypt */ + S_ST( '_', 3, 936, 0 ), /* 931 unpeer_crypto */ + S_ST( 'e', 3, 933, 0 ), /* 932 unpeer_crypto_ */ + S_ST( 'a', 3, 934, 0 ), /* 933 unpeer_crypto_e */ + S_ST( 'r', 3, 935, 0 ), /* 934 unpeer_crypto_ea */ + S_ST( 'l', 3, 443, 0 ), /* 935 unpeer_crypto_ear */ + S_ST( 'n', 3, 937, 932 ), /* 936 unpeer_crypto_ */ + S_ST( 'a', 3, 938, 0 ), /* 937 unpeer_crypto_n */ + S_ST( 'k', 3, 939, 0 ), /* 938 unpeer_crypto_na */ + S_ST( '_', 3, 940, 0 ), /* 939 unpeer_crypto_nak */ + S_ST( 'e', 3, 941, 0 ), /* 940 unpeer_crypto_nak_ */ + S_ST( 'a', 3, 942, 0 ), /* 941 unpeer_crypto_nak_e */ + S_ST( 'r', 3, 943, 0 ), /* 942 unpeer_crypto_nak_ea */ + S_ST( 'l', 3, 444, 0 ), /* 943 unpeer_crypto_nak_ear */ + S_ST( 'd', 3, 945, 925 ), /* 944 unpeer_ */ + S_ST( 'i', 3, 946, 0 ), /* 945 unpeer_d */ + S_ST( 'g', 3, 947, 0 ), /* 946 unpeer_di */ + S_ST( 'e', 3, 948, 0 ), /* 947 unpeer_dig */ + S_ST( 's', 3, 949, 0 ), /* 948 unpeer_dige */ + S_ST( 't', 3, 950, 0 ), /* 949 unpeer_diges */ + S_ST( '_', 3, 951, 0 ), /* 950 unpeer_digest */ + S_ST( 'e', 3, 952, 0 ), /* 951 unpeer_digest_ */ + S_ST( 'a', 3, 953, 0 ), /* 952 unpeer_digest_e */ + S_ST( 'r', 3, 954, 0 ), /* 953 unpeer_digest_ea */ + S_ST( 'l', 3, 445, 0 ), /* 954 unpeer_digest_ear */ + S_ST( 'v', 3, 956, 914 ), /* 955 */ + S_ST( 'e', 3, 957, 0 ), /* 956 v */ + S_ST( 'r', 3, 958, 0 ), /* 957 ve */ + S_ST( 's', 3, 959, 0 ), /* 958 ver */ + S_ST( 'i', 3, 960, 0 ), /* 959 vers */ + S_ST( 'o', 3, 448, 0 ), /* 960 versi */ + S_ST( 'w', 3, 968, 955 ), /* 961 */ + S_ST( 'a', 3, 963, 0 ), /* 962 w */ + S_ST( 'n', 3, 964, 0 ), /* 963 wa */ + S_ST( 'd', 3, 965, 0 ), /* 964 wan */ + S_ST( 'e', 3, 463, 0 ), /* 965 wand */ + S_ST( 'e', 3, 967, 962 ), /* 966 w */ + S_ST( 'e', 3, 450, 0 ), /* 967 we */ + S_ST( 'i', 3, 969, 966 ), /* 968 w */ + S_ST( 'l', 3, 970, 0 ), /* 969 wi */ + S_ST( 'd', 3, 971, 0 ), /* 970 wil */ + S_ST( 'c', 3, 972, 0 ), /* 971 wild */ + S_ST( 'a', 3, 973, 0 ), /* 972 wildc */ + S_ST( 'r', 3, 451, 0 ), /* 973 wildca */ + S_ST( 'x', 3, 979, 961 ), /* 974 */ + S_ST( 'l', 3, 976, 0 ), /* 975 x */ + S_ST( 'e', 3, 977, 0 ), /* 976 xl */ + S_ST( 'a', 3, 978, 0 ), /* 977 xle */ + S_ST( 'v', 3, 452, 0 ), /* 978 xlea */ + S_ST( 'm', 3, 980, 975 ), /* 979 x */ + S_ST( 't', 3, 981, 0 ), /* 980 xm */ + S_ST( 'n', 3, 982, 0 ), /* 981 xmt */ + S_ST( 'o', 3, 983, 0 ), /* 982 xmtn */ + S_ST( 'n', 3, 984, 0 ), /* 983 xmtno */ + S_ST( 'c', 3, 453, 0 ), /* 984 xmtnon */ + S_ST( 'y', 3, 986, 974 ), /* 985 [initial state] */ + S_ST( 'e', 3, 987, 0 ), /* 986 y */ + S_ST( 'a', 3, 454, 0 ) /* 987 ye */ }; diff --git a/contrib/ntp/ntpd/ntp_leapsec.c b/contrib/ntp/ntpd/ntp_leapsec.c index 95a06736751ba..7d20873d618d4 100644 --- a/contrib/ntp/ntpd/ntp_leapsec.c +++ b/contrib/ntp/ntpd/ntp_leapsec.c @@ -422,7 +422,8 @@ int/*BOOL*/ leapsec_load_stream( FILE * ifp , const char * fname, - int/*BOOL*/ logall) + int/*BOOL*/ logall, + int/*BOOL*/ vhash) { leap_table_t *pt; int rcheck; @@ -430,36 +431,37 @@ leapsec_load_stream( if (NULL == fname) fname = "<unknown>"; - rcheck = leapsec_validate((leapsec_reader)getc, ifp); - if (logall) - switch (rcheck) - { - case LSVALID_GOODHASH: - msyslog(LOG_NOTICE, "%s ('%s'): good hash signature", - logPrefix, fname); - break; - - case LSVALID_NOHASH: - msyslog(LOG_ERR, "%s ('%s'): no hash signature", - logPrefix, fname); - break; - case LSVALID_BADHASH: - msyslog(LOG_ERR, "%s ('%s'): signature mismatch", - logPrefix, fname); - break; - case LSVALID_BADFORMAT: - msyslog(LOG_ERR, "%s ('%s'): malformed hash signature", - logPrefix, fname); - break; - default: - msyslog(LOG_ERR, "%s ('%s'): unknown error code %d", - logPrefix, fname, rcheck); - break; - } - if (rcheck < 0) - return FALSE; - - rewind(ifp); + if (vhash) { + rcheck = leapsec_validate((leapsec_reader)getc, ifp); + if (logall) + switch (rcheck) + { + case LSVALID_GOODHASH: + msyslog(LOG_NOTICE, "%s ('%s'): good hash signature", + logPrefix, fname); + break; + + case LSVALID_NOHASH: + msyslog(LOG_ERR, "%s ('%s'): no hash signature", + logPrefix, fname); + break; + case LSVALID_BADHASH: + msyslog(LOG_ERR, "%s ('%s'): signature mismatch", + logPrefix, fname); + break; + case LSVALID_BADFORMAT: + msyslog(LOG_ERR, "%s ('%s'): malformed hash signature", + logPrefix, fname); + break; + default: + msyslog(LOG_ERR, "%s ('%s'): unknown error code %d", + logPrefix, fname, rcheck); + break; + } + if (rcheck < 0) + return FALSE; + rewind(ifp); + } pt = leapsec_get_table(TRUE); if (!leapsec_load(pt, (leapsec_reader)getc, ifp, TRUE)) { switch (errno) { @@ -498,7 +500,8 @@ leapsec_load_file( const char * fname, struct stat * sb_old, int/*BOOL*/ force, - int/*BOOL*/ logall) + int/*BOOL*/ logall, + int/*BOOL*/ vhash) { FILE * fp; struct stat sb_new; @@ -551,7 +554,7 @@ leapsec_load_file( return FALSE; } - rc = leapsec_load_stream(fp, fname, logall); + rc = leapsec_load_stream(fp, fname, logall, vhash); fclose(fp); return rc; } diff --git a/contrib/ntp/ntpd/ntp_leapsec.h b/contrib/ntp/ntpd/ntp_leapsec.h index 120b75fcbb3f1..1298979d4d581 100644 --- a/contrib/ntp/ntpd/ntp_leapsec.h +++ b/contrib/ntp/ntpd/ntp_leapsec.h @@ -174,7 +174,7 @@ extern void leapsec_dump(const leap_table_t*, leapsec_dumper func, void *farg); * around the generic load function, 'leapsec_load()'. */ extern int/*BOOL*/ leapsec_load_stream(FILE * fp, const char * fname, - int/*BOOL*/logall); + int/*BOOL*/logall, int/*BOOL*/vhash); /* Read a leap second file from file. It checks that the file exists and * (if 'force' is not applied) the ctime/mtime has changed since the @@ -184,7 +184,8 @@ extern int/*BOOL*/ leapsec_load_stream(FILE * fp, const char * fname, * otherwise. Uses 'leapsec_load_stream()' internally. */ extern int/*BOOL*/ leapsec_load_file(const char * fname, struct stat * sb, - int/*BOOL*/force, int/*BOOL*/logall); + int/*BOOL*/force, int/*BOOL*/logall, + int/*BOOL*/vhash); /* Get the current leap data signature. This consists of the last * ransition, the table expiration, and the total TAI difference at the diff --git a/contrib/ntp/ntpd/ntp_loopfilter.c b/contrib/ntp/ntpd/ntp_loopfilter.c index 01772bd1ffe9e..b7a742bbd183e 100644 --- a/contrib/ntp/ntpd/ntp_loopfilter.c +++ b/contrib/ntp/ntpd/ntp_loopfilter.c @@ -15,6 +15,7 @@ #include "ntp_io.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include "timexsup.h" #include <limits.h> #include <stdio.h> @@ -167,6 +168,9 @@ u_char sys_poll; /* time constant/poll (log2 s) */ int tc_counter; /* jiggle counter */ double last_offset; /* last offset (s) */ +u_int tc_twinlo; /* TC step down not before this time */ +u_int tc_twinhi; /* TC step up not before this time */ + /* * Huff-n'-puff filter variables */ @@ -761,30 +765,21 @@ local_clock( if (ext_enable) { ntv.modes = MOD_STATUS; } else { -#ifdef STA_NANO - ntv.modes = MOD_BITS | MOD_NANO; -#else /* STA_NANO */ ntv.modes = MOD_BITS; -#endif /* STA_NANO */ - if (clock_offset < 0) - dtemp = -.5; - else - dtemp = .5; + ntv.offset = var_long_from_dbl( + clock_offset, &ntv.modes); #ifdef STA_NANO - ntv.offset = (int32)(clock_offset * 1e9 + - dtemp); ntv.constant = sys_poll; #else /* STA_NANO */ - ntv.offset = (int32)(clock_offset * 1e6 + - dtemp); ntv.constant = sys_poll - 4; #endif /* STA_NANO */ if (ntv.constant < 0) ntv.constant = 0; - ntv.esterror = (u_int32)(clock_jitter * 1e6); - ntv.maxerror = (u_int32)((sys_rootdelay / 2 + - sys_rootdisp) * 1e6); + ntv.esterror = usec_long_from_dbl( + clock_jitter); + ntv.maxerror = usec_long_from_dbl( + sys_rootdelay / 2 + sys_rootdisp); ntv.status = STA_PLL; /* @@ -823,22 +818,15 @@ local_clock( ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1); } pll_status = ntv.status; -#ifdef STA_NANO - clock_offset = ntv.offset / 1e9; -#else /* STA_NANO */ - clock_offset = ntv.offset / 1e6; -#endif /* STA_NANO */ + clock_offset = dbl_from_var_long(ntv.offset, ntv.status); clock_frequency = FREQTOD(ntv.freq); /* * If the kernel PPS is lit, monitor its performance. */ if (ntv.status & STA_PPSTIME) { -#ifdef STA_NANO - clock_jitter = ntv.jitter / 1e9; -#else /* STA_NANO */ - clock_jitter = ntv.jitter / 1e6; -#endif /* STA_NANO */ + clock_jitter = dbl_from_var_long( + ntv.jitter, ntv.status); } #if defined(STA_NANO) && NTP_API == 4 @@ -888,34 +876,52 @@ local_clock( * increased, otherwise it is decreased. A bit of hysteresis * helps calm the dance. Works best using burst mode. Don't * fiddle with the poll during the startup clamp period. + * [Bug 3615] also observe time gates to avoid eager stepping */ if (freq_cnt > 0) { tc_counter = 0; + tc_twinlo = current_time; + tc_twinhi = current_time; } else if (fabs(clock_offset) < CLOCK_PGATE * clock_jitter) { tc_counter += sys_poll; if (tc_counter > CLOCK_LIMIT) { tc_counter = CLOCK_LIMIT; - if (sys_poll < peer->maxpoll) { - tc_counter = 0; - sys_poll++; - } + if (sys_poll < peer->maxpoll) + sys_poll += (current_time >= tc_twinhi); } } else { tc_counter -= sys_poll << 1; if (tc_counter < -CLOCK_LIMIT) { tc_counter = -CLOCK_LIMIT; - if (sys_poll > peer->minpoll) { - tc_counter = 0; - sys_poll--; - } + if (sys_poll > peer->minpoll) + sys_poll -= (current_time >= tc_twinlo); } } /* * If the time constant has changed, update the poll variables. + * + * [bug 3615] also set new time gates + * The time limit for stepping down will be half the TC interval + * or 60 secs from now, whatever is bigger, and the step up time + * limit will be half the TC interval after the step down limit. + * + * The 'sys_poll' value affects the servo loop gain, and + * overshooting sys_poll slows it down unnecessarily. Stepping + * down too fast also has bad effects. + * + * The 'tc_counter' dance itself is something that *should* + * happen *once* every (1 << sys_poll) seconds, I think, but + * that's not how it works right now, and adding time guards + * seems the least intrusive way to handle this. */ - if (osys_poll != sys_poll) - poll_update(peer, sys_poll); + if (osys_poll != sys_poll) { + u_int deadband = 1u << (sys_poll - 1); + tc_counter = 0; + tc_twinlo = current_time + max(deadband, 60); + tc_twinhi = tc_twinlo + deadband; + poll_update(peer, sys_poll, 0); + } /* * Yibbidy, yibbbidy, yibbidy; that'h all folks. diff --git a/contrib/ntp/ntpd/ntp_parser.c b/contrib/ntp/ntpd/ntp_parser.c index 8156a5f51f4df..dfaa8db24cc19 100644 --- a/contrib/ntp/ntpd/ntp_parser.c +++ b/contrib/ntp/ntpd/ntp_parser.c @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -#line 11 "ntp_parser.y" /* yacc.c:339 */ +#line 11 "../../ntpd/ntp_parser.y" /* yacc.c:339 */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -97,7 +97,7 @@ # define ONLY_SIM(a) NULL #endif -#line 101 "ntp_parser.c" /* yacc.c:339 */ +#line 101 "../../ntpd/ntp_parser.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -117,8 +117,8 @@ /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ -#ifndef YY_YY_NTP_PARSER_H_INCLUDED -# define YY_YY_NTP_PARSER_H_INCLUDED +#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED +# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -151,187 +151,196 @@ extern int yydebug; T_Burst = 274, T_Calibrate = 275, T_Ceiling = 276, - T_Clockstats = 277, - T_Cohort = 278, - T_ControlKey = 279, - T_Crypto = 280, - T_Cryptostats = 281, - T_Ctl = 282, - T_Day = 283, - T_Default = 284, - T_Digest = 285, - T_Disable = 286, - T_Discard = 287, - T_Dispersion = 288, - T_Double = 289, - T_Driftfile = 290, - T_Drop = 291, - T_Dscp = 292, - T_Ellipsis = 293, - T_Enable = 294, - T_End = 295, - T_Epeer = 296, - T_False = 297, - T_File = 298, - T_Filegen = 299, - T_Filenum = 300, - T_Flag1 = 301, - T_Flag2 = 302, - T_Flag3 = 303, - T_Flag4 = 304, - T_Flake = 305, - T_Floor = 306, - T_Freq = 307, - T_Fudge = 308, - T_Host = 309, - T_Huffpuff = 310, - T_Iburst = 311, - T_Ident = 312, - T_Ignore = 313, - T_Incalloc = 314, - T_Incmem = 315, - T_Initalloc = 316, - T_Initmem = 317, - T_Includefile = 318, - T_Integer = 319, - T_Interface = 320, - T_Intrange = 321, - T_Io = 322, - T_Ippeerlimit = 323, - T_Ipv4 = 324, - T_Ipv4_flag = 325, - T_Ipv6 = 326, - T_Ipv6_flag = 327, - T_Kernel = 328, - T_Key = 329, - T_Keys = 330, - T_Keysdir = 331, - T_Kod = 332, - T_Mssntp = 333, - T_Leapfile = 334, - T_Leapsmearinterval = 335, - T_Limited = 336, - T_Link = 337, - T_Listen = 338, - T_Logconfig = 339, - T_Logfile = 340, - T_Loopstats = 341, - T_Lowpriotrap = 342, - T_Manycastclient = 343, - T_Manycastserver = 344, - T_Mask = 345, - T_Maxage = 346, - T_Maxclock = 347, - T_Maxdepth = 348, - T_Maxdist = 349, - T_Maxmem = 350, - T_Maxpoll = 351, - T_Mdnstries = 352, - T_Mem = 353, - T_Memlock = 354, - T_Minclock = 355, - T_Mindepth = 356, - T_Mindist = 357, - T_Minimum = 358, - T_Minpoll = 359, - T_Minsane = 360, - T_Mode = 361, - T_Mode7 = 362, - T_Monitor = 363, - T_Month = 364, - T_Mru = 365, - T_Multicastclient = 366, - T_Nic = 367, - T_Nolink = 368, - T_Nomodify = 369, - T_Nomrulist = 370, - T_None = 371, - T_Nonvolatile = 372, - T_Noepeer = 373, - T_Nopeer = 374, - T_Noquery = 375, - T_Noselect = 376, - T_Noserve = 377, - T_Notrap = 378, - T_Notrust = 379, - T_Ntp = 380, - T_Ntpport = 381, - T_NtpSignDsocket = 382, - T_Orphan = 383, - T_Orphanwait = 384, - T_PCEdigest = 385, - T_Panic = 386, - T_Peer = 387, - T_Peerstats = 388, - T_Phone = 389, - T_Pid = 390, - T_Pidfile = 391, - T_Pool = 392, - T_Port = 393, - T_Preempt = 394, - T_Prefer = 395, - T_Protostats = 396, - T_Pw = 397, - T_Randfile = 398, - T_Rawstats = 399, - T_Refid = 400, - T_Requestkey = 401, - T_Reset = 402, - T_Restrict = 403, - T_Revoke = 404, - T_Rlimit = 405, - T_Saveconfigdir = 406, - T_Server = 407, - T_Setvar = 408, - T_Source = 409, - T_Stacksize = 410, - T_Statistics = 411, - T_Stats = 412, - T_Statsdir = 413, - T_Step = 414, - T_Stepback = 415, - T_Stepfwd = 416, - T_Stepout = 417, - T_Stratum = 418, - T_String = 419, - T_Sys = 420, - T_Sysstats = 421, - T_Tick = 422, - T_Time1 = 423, - T_Time2 = 424, - T_Timer = 425, - T_Timingstats = 426, - T_Tinker = 427, - T_Tos = 428, - T_Trap = 429, - T_True = 430, - T_Trustedkey = 431, - T_Ttl = 432, - T_Type = 433, - T_U_int = 434, - T_UEcrypto = 435, - T_UEcryptonak = 436, - T_UEdigest = 437, - T_Unconfig = 438, - T_Unpeer = 439, - T_Version = 440, - T_WanderThreshold = 441, - T_Week = 442, - T_Wildcard = 443, - T_Xleave = 444, - T_Year = 445, - T_Flag = 446, - T_EOC = 447, - T_Simulate = 448, - T_Beep_Delay = 449, - T_Sim_Duration = 450, - T_Server_Offset = 451, - T_Duration = 452, - T_Freq_Offset = 453, - T_Wander = 454, - T_Jitter = 455, - T_Prop_Delay = 456, - T_Proc_Delay = 457 + T_Checkhash = 277, + T_Clockstats = 278, + T_Cohort = 279, + T_ControlKey = 280, + T_Crypto = 281, + T_Cryptostats = 282, + T_Ctl = 283, + T_Day = 284, + T_Default = 285, + T_Digest = 286, + T_Disable = 287, + T_Discard = 288, + T_Dispersion = 289, + T_Double = 290, + T_Driftfile = 291, + T_Drop = 292, + T_Dscp = 293, + T_Ellipsis = 294, + T_Enable = 295, + T_End = 296, + T_Epeer = 297, + T_False = 298, + T_File = 299, + T_Filegen = 300, + T_Filenum = 301, + T_Flag1 = 302, + T_Flag2 = 303, + T_Flag3 = 304, + T_Flag4 = 305, + T_Flake = 306, + T_Floor = 307, + T_Freq = 308, + T_Fudge = 309, + T_Fuzz = 310, + T_Host = 311, + T_Huffpuff = 312, + T_Iburst = 313, + T_Ident = 314, + T_Ignore = 315, + T_Ignorehash = 316, + T_Incalloc = 317, + T_Incmem = 318, + T_Initalloc = 319, + T_Initmem = 320, + T_Includefile = 321, + T_Integer = 322, + T_Interface = 323, + T_Intrange = 324, + T_Io = 325, + T_Ippeerlimit = 326, + T_Ipv4 = 327, + T_Ipv4_flag = 328, + T_Ipv6 = 329, + T_Ipv6_flag = 330, + T_Kernel = 331, + T_Key = 332, + T_Keys = 333, + T_Keysdir = 334, + T_Kod = 335, + T_Leapfile = 336, + T_Leapsmearinterval = 337, + T_Limited = 338, + T_Link = 339, + T_Listen = 340, + T_Logconfig = 341, + T_Logfile = 342, + T_Loopstats = 343, + T_Lowpriotrap = 344, + T_Manycastclient = 345, + T_Manycastserver = 346, + T_Mask = 347, + T_Maxage = 348, + T_Maxclock = 349, + T_Maxdepth = 350, + T_Maxdist = 351, + T_Maxmem = 352, + T_Maxpoll = 353, + T_Mdnstries = 354, + T_Mem = 355, + T_Memlock = 356, + T_Minclock = 357, + T_Mindepth = 358, + T_Mindist = 359, + T_Minimum = 360, + T_Minjitter = 361, + T_Minpoll = 362, + T_Minsane = 363, + T_Mode = 364, + T_Mode7 = 365, + T_Monitor = 366, + T_Month = 367, + T_Mru = 368, + T_Mssntp = 369, + T_Multicastclient = 370, + T_Nic = 371, + T_Nolink = 372, + T_Nomodify = 373, + T_Nomrulist = 374, + T_None = 375, + T_Nonvolatile = 376, + T_Noepeer = 377, + T_Nopeer = 378, + T_Noquery = 379, + T_Noselect = 380, + T_Noserve = 381, + T_Notrap = 382, + T_Notrust = 383, + T_Ntp = 384, + T_Ntpport = 385, + T_NtpSignDsocket = 386, + T_Orphan = 387, + T_Orphanwait = 388, + T_PCEdigest = 389, + T_Panic = 390, + T_Peer = 391, + T_Peerstats = 392, + T_Phone = 393, + T_Pid = 394, + T_Pidfile = 395, + T_Poll = 396, + T_PollSkewList = 397, + T_Pool = 398, + T_Port = 399, + T_Preempt = 400, + T_Prefer = 401, + T_Protostats = 402, + T_Pw = 403, + T_Randfile = 404, + T_Rawstats = 405, + T_Refid = 406, + T_Requestkey = 407, + T_Reset = 408, + T_Restrict = 409, + T_Revoke = 410, + T_Rlimit = 411, + T_Saveconfigdir = 412, + T_Server = 413, + T_Serverresponse = 414, + T_ServerresponseFuzz = 415, + T_Setvar = 416, + T_Source = 417, + T_Stacksize = 418, + T_Statistics = 419, + T_Stats = 420, + T_Statsdir = 421, + T_Step = 422, + T_Stepback = 423, + T_Stepfwd = 424, + T_Stepout = 425, + T_Stratum = 426, + T_String = 427, + T_Sys = 428, + T_Sysstats = 429, + T_Tick = 430, + T_Time1 = 431, + T_Time2 = 432, + T_Timer = 433, + T_Timingstats = 434, + T_Tinker = 435, + T_Tos = 436, + T_Trap = 437, + T_True = 438, + T_Trustedkey = 439, + T_Ttl = 440, + T_Type = 441, + T_U_int = 442, + T_UEcrypto = 443, + T_UEcryptonak = 444, + T_UEdigest = 445, + T_Unconfig = 446, + T_Unpeer = 447, + T_Version = 448, + T_WanderThreshold = 449, + T_Week = 450, + T_Wildcard = 451, + T_Xleave = 452, + T_Xmtnonce = 453, + T_Year = 454, + T_Flag = 455, + T_EOC = 456, + T_Simulate = 457, + T_Beep_Delay = 458, + T_Sim_Duration = 459, + T_Server_Offset = 460, + T_Duration = 461, + T_Freq_Offset = 462, + T_Wander = 463, + T_Jitter = 464, + T_Prop_Delay = 465, + T_Proc_Delay = 466 }; #endif /* Tokens. */ @@ -354,194 +363,203 @@ extern int yydebug; #define T_Burst 274 #define T_Calibrate 275 #define T_Ceiling 276 -#define T_Clockstats 277 -#define T_Cohort 278 -#define T_ControlKey 279 -#define T_Crypto 280 -#define T_Cryptostats 281 -#define T_Ctl 282 -#define T_Day 283 -#define T_Default 284 -#define T_Digest 285 -#define T_Disable 286 -#define T_Discard 287 -#define T_Dispersion 288 -#define T_Double 289 -#define T_Driftfile 290 -#define T_Drop 291 -#define T_Dscp 292 -#define T_Ellipsis 293 -#define T_Enable 294 -#define T_End 295 -#define T_Epeer 296 -#define T_False 297 -#define T_File 298 -#define T_Filegen 299 -#define T_Filenum 300 -#define T_Flag1 301 -#define T_Flag2 302 -#define T_Flag3 303 -#define T_Flag4 304 -#define T_Flake 305 -#define T_Floor 306 -#define T_Freq 307 -#define T_Fudge 308 -#define T_Host 309 -#define T_Huffpuff 310 -#define T_Iburst 311 -#define T_Ident 312 -#define T_Ignore 313 -#define T_Incalloc 314 -#define T_Incmem 315 -#define T_Initalloc 316 -#define T_Initmem 317 -#define T_Includefile 318 -#define T_Integer 319 -#define T_Interface 320 -#define T_Intrange 321 -#define T_Io 322 -#define T_Ippeerlimit 323 -#define T_Ipv4 324 -#define T_Ipv4_flag 325 -#define T_Ipv6 326 -#define T_Ipv6_flag 327 -#define T_Kernel 328 -#define T_Key 329 -#define T_Keys 330 -#define T_Keysdir 331 -#define T_Kod 332 -#define T_Mssntp 333 -#define T_Leapfile 334 -#define T_Leapsmearinterval 335 -#define T_Limited 336 -#define T_Link 337 -#define T_Listen 338 -#define T_Logconfig 339 -#define T_Logfile 340 -#define T_Loopstats 341 -#define T_Lowpriotrap 342 -#define T_Manycastclient 343 -#define T_Manycastserver 344 -#define T_Mask 345 -#define T_Maxage 346 -#define T_Maxclock 347 -#define T_Maxdepth 348 -#define T_Maxdist 349 -#define T_Maxmem 350 -#define T_Maxpoll 351 -#define T_Mdnstries 352 -#define T_Mem 353 -#define T_Memlock 354 -#define T_Minclock 355 -#define T_Mindepth 356 -#define T_Mindist 357 -#define T_Minimum 358 -#define T_Minpoll 359 -#define T_Minsane 360 -#define T_Mode 361 -#define T_Mode7 362 -#define T_Monitor 363 -#define T_Month 364 -#define T_Mru 365 -#define T_Multicastclient 366 -#define T_Nic 367 -#define T_Nolink 368 -#define T_Nomodify 369 -#define T_Nomrulist 370 -#define T_None 371 -#define T_Nonvolatile 372 -#define T_Noepeer 373 -#define T_Nopeer 374 -#define T_Noquery 375 -#define T_Noselect 376 -#define T_Noserve 377 -#define T_Notrap 378 -#define T_Notrust 379 -#define T_Ntp 380 -#define T_Ntpport 381 -#define T_NtpSignDsocket 382 -#define T_Orphan 383 -#define T_Orphanwait 384 -#define T_PCEdigest 385 -#define T_Panic 386 -#define T_Peer 387 -#define T_Peerstats 388 -#define T_Phone 389 -#define T_Pid 390 -#define T_Pidfile 391 -#define T_Pool 392 -#define T_Port 393 -#define T_Preempt 394 -#define T_Prefer 395 -#define T_Protostats 396 -#define T_Pw 397 -#define T_Randfile 398 -#define T_Rawstats 399 -#define T_Refid 400 -#define T_Requestkey 401 -#define T_Reset 402 -#define T_Restrict 403 -#define T_Revoke 404 -#define T_Rlimit 405 -#define T_Saveconfigdir 406 -#define T_Server 407 -#define T_Setvar 408 -#define T_Source 409 -#define T_Stacksize 410 -#define T_Statistics 411 -#define T_Stats 412 -#define T_Statsdir 413 -#define T_Step 414 -#define T_Stepback 415 -#define T_Stepfwd 416 -#define T_Stepout 417 -#define T_Stratum 418 -#define T_String 419 -#define T_Sys 420 -#define T_Sysstats 421 -#define T_Tick 422 -#define T_Time1 423 -#define T_Time2 424 -#define T_Timer 425 -#define T_Timingstats 426 -#define T_Tinker 427 -#define T_Tos 428 -#define T_Trap 429 -#define T_True 430 -#define T_Trustedkey 431 -#define T_Ttl 432 -#define T_Type 433 -#define T_U_int 434 -#define T_UEcrypto 435 -#define T_UEcryptonak 436 -#define T_UEdigest 437 -#define T_Unconfig 438 -#define T_Unpeer 439 -#define T_Version 440 -#define T_WanderThreshold 441 -#define T_Week 442 -#define T_Wildcard 443 -#define T_Xleave 444 -#define T_Year 445 -#define T_Flag 446 -#define T_EOC 447 -#define T_Simulate 448 -#define T_Beep_Delay 449 -#define T_Sim_Duration 450 -#define T_Server_Offset 451 -#define T_Duration 452 -#define T_Freq_Offset 453 -#define T_Wander 454 -#define T_Jitter 455 -#define T_Prop_Delay 456 -#define T_Proc_Delay 457 +#define T_Checkhash 277 +#define T_Clockstats 278 +#define T_Cohort 279 +#define T_ControlKey 280 +#define T_Crypto 281 +#define T_Cryptostats 282 +#define T_Ctl 283 +#define T_Day 284 +#define T_Default 285 +#define T_Digest 286 +#define T_Disable 287 +#define T_Discard 288 +#define T_Dispersion 289 +#define T_Double 290 +#define T_Driftfile 291 +#define T_Drop 292 +#define T_Dscp 293 +#define T_Ellipsis 294 +#define T_Enable 295 +#define T_End 296 +#define T_Epeer 297 +#define T_False 298 +#define T_File 299 +#define T_Filegen 300 +#define T_Filenum 301 +#define T_Flag1 302 +#define T_Flag2 303 +#define T_Flag3 304 +#define T_Flag4 305 +#define T_Flake 306 +#define T_Floor 307 +#define T_Freq 308 +#define T_Fudge 309 +#define T_Fuzz 310 +#define T_Host 311 +#define T_Huffpuff 312 +#define T_Iburst 313 +#define T_Ident 314 +#define T_Ignore 315 +#define T_Ignorehash 316 +#define T_Incalloc 317 +#define T_Incmem 318 +#define T_Initalloc 319 +#define T_Initmem 320 +#define T_Includefile 321 +#define T_Integer 322 +#define T_Interface 323 +#define T_Intrange 324 +#define T_Io 325 +#define T_Ippeerlimit 326 +#define T_Ipv4 327 +#define T_Ipv4_flag 328 +#define T_Ipv6 329 +#define T_Ipv6_flag 330 +#define T_Kernel 331 +#define T_Key 332 +#define T_Keys 333 +#define T_Keysdir 334 +#define T_Kod 335 +#define T_Leapfile 336 +#define T_Leapsmearinterval 337 +#define T_Limited 338 +#define T_Link 339 +#define T_Listen 340 +#define T_Logconfig 341 +#define T_Logfile 342 +#define T_Loopstats 343 +#define T_Lowpriotrap 344 +#define T_Manycastclient 345 +#define T_Manycastserver 346 +#define T_Mask 347 +#define T_Maxage 348 +#define T_Maxclock 349 +#define T_Maxdepth 350 +#define T_Maxdist 351 +#define T_Maxmem 352 +#define T_Maxpoll 353 +#define T_Mdnstries 354 +#define T_Mem 355 +#define T_Memlock 356 +#define T_Minclock 357 +#define T_Mindepth 358 +#define T_Mindist 359 +#define T_Minimum 360 +#define T_Minjitter 361 +#define T_Minpoll 362 +#define T_Minsane 363 +#define T_Mode 364 +#define T_Mode7 365 +#define T_Monitor 366 +#define T_Month 367 +#define T_Mru 368 +#define T_Mssntp 369 +#define T_Multicastclient 370 +#define T_Nic 371 +#define T_Nolink 372 +#define T_Nomodify 373 +#define T_Nomrulist 374 +#define T_None 375 +#define T_Nonvolatile 376 +#define T_Noepeer 377 +#define T_Nopeer 378 +#define T_Noquery 379 +#define T_Noselect 380 +#define T_Noserve 381 +#define T_Notrap 382 +#define T_Notrust 383 +#define T_Ntp 384 +#define T_Ntpport 385 +#define T_NtpSignDsocket 386 +#define T_Orphan 387 +#define T_Orphanwait 388 +#define T_PCEdigest 389 +#define T_Panic 390 +#define T_Peer 391 +#define T_Peerstats 392 +#define T_Phone 393 +#define T_Pid 394 +#define T_Pidfile 395 +#define T_Poll 396 +#define T_PollSkewList 397 +#define T_Pool 398 +#define T_Port 399 +#define T_Preempt 400 +#define T_Prefer 401 +#define T_Protostats 402 +#define T_Pw 403 +#define T_Randfile 404 +#define T_Rawstats 405 +#define T_Refid 406 +#define T_Requestkey 407 +#define T_Reset 408 +#define T_Restrict 409 +#define T_Revoke 410 +#define T_Rlimit 411 +#define T_Saveconfigdir 412 +#define T_Server 413 +#define T_Serverresponse 414 +#define T_ServerresponseFuzz 415 +#define T_Setvar 416 +#define T_Source 417 +#define T_Stacksize 418 +#define T_Statistics 419 +#define T_Stats 420 +#define T_Statsdir 421 +#define T_Step 422 +#define T_Stepback 423 +#define T_Stepfwd 424 +#define T_Stepout 425 +#define T_Stratum 426 +#define T_String 427 +#define T_Sys 428 +#define T_Sysstats 429 +#define T_Tick 430 +#define T_Time1 431 +#define T_Time2 432 +#define T_Timer 433 +#define T_Timingstats 434 +#define T_Tinker 435 +#define T_Tos 436 +#define T_Trap 437 +#define T_True 438 +#define T_Trustedkey 439 +#define T_Ttl 440 +#define T_Type 441 +#define T_U_int 442 +#define T_UEcrypto 443 +#define T_UEcryptonak 444 +#define T_UEdigest 445 +#define T_Unconfig 446 +#define T_Unpeer 447 +#define T_Version 448 +#define T_WanderThreshold 449 +#define T_Week 450 +#define T_Wildcard 451 +#define T_Xleave 452 +#define T_Xmtnonce 453 +#define T_Year 454 +#define T_Flag 455 +#define T_EOC 456 +#define T_Simulate 457 +#define T_Beep_Delay 458 +#define T_Sim_Duration 459 +#define T_Server_Offset 460 +#define T_Duration 461 +#define T_Freq_Offset 462 +#define T_Wander 463 +#define T_Jitter 464 +#define T_Prop_Delay 465 +#define T_Proc_Delay 466 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 52 "ntp_parser.y" /* yacc.c:355 */ +#line 52 "../../ntpd/ntp_parser.y" /* yacc.c:355 */ char * String; double Double; @@ -560,7 +578,7 @@ union YYSTYPE script_info * Sim_script; script_info_fifo * Sim_script_fifo; -#line 564 "ntp_parser.c" /* yacc.c:355 */ +#line 582 "../../ntpd/ntp_parser.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; @@ -573,11 +591,11 @@ extern YYSTYPE yylval; int yyparse (void); -#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */ +#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 581 "ntp_parser.c" /* yacc.c:358 */ +#line 599 "../../ntpd/ntp_parser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -817,23 +835,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 216 +#define YYFINAL 219 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 662 +#define YYLAST 740 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 208 +#define YYNTOKENS 218 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 107 +#define YYNNTS 111 /* YYNRULES -- Number of rules. */ -#define YYNRULES 324 +#define YYNRULES 336 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 436 +#define YYNSTATES 453 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 457 +#define YYMAXUTOK 466 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -846,15 +864,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 204, 205, 2, 2, 2, 2, 2, 2, 2, 2, + 214, 215, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 203, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 213, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 206, 2, 207, 2, 2, 2, 2, + 2, 2, 2, 216, 212, 217, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -887,46 +905,48 @@ static const yytype_uint8 yytranslate[] = 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202 + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 378, 378, 382, 383, 384, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 420, 430, 431, 432, 433, 434, 438, 439, 444, 449, - 451, 457, 458, 466, 467, 468, 472, 477, 478, 479, - 480, 481, 482, 483, 484, 488, 490, 495, 496, 497, - 498, 499, 500, 504, 509, 518, 528, 529, 539, 541, - 543, 545, 556, 563, 565, 570, 572, 574, 576, 578, - 588, 594, 595, 603, 605, 617, 618, 619, 620, 621, - 630, 635, 640, 648, 650, 652, 654, 659, 660, 661, - 662, 663, 664, 665, 666, 667, 671, 672, 681, 683, - 692, 702, 707, 715, 716, 717, 718, 719, 720, 721, - 722, 727, 728, 736, 746, 755, 770, 775, 776, 780, - 781, 785, 786, 787, 788, 789, 790, 791, 800, 804, - 808, 816, 824, 832, 847, 862, 875, 876, 896, 897, - 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, - 915, 916, 917, 918, 919, 920, 921, 925, 930, 938, - 943, 944, 945, 949, 954, 962, 967, 968, 969, 970, - 971, 972, 973, 974, 982, 992, 997, 1005, 1007, 1009, - 1018, 1020, 1025, 1026, 1030, 1031, 1032, 1033, 1041, 1046, - 1051, 1059, 1064, 1065, 1066, 1075, 1077, 1082, 1087, 1095, - 1097, 1114, 1115, 1116, 1117, 1118, 1119, 1123, 1124, 1125, - 1126, 1127, 1128, 1136, 1141, 1146, 1154, 1159, 1160, 1161, - 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1177, 1178, 1179, - 1186, 1193, 1200, 1216, 1235, 1237, 1239, 1241, 1243, 1245, - 1252, 1257, 1258, 1259, 1263, 1267, 1276, 1277, 1281, 1282, - 1283, 1287, 1298, 1316, 1328, 1333, 1335, 1340, 1341, 1349, - 1351, 1359, 1364, 1372, 1397, 1404, 1414, 1415, 1419, 1420, - 1421, 1422, 1426, 1427, 1428, 1432, 1437, 1442, 1450, 1451, - 1452, 1453, 1454, 1455, 1456, 1466, 1471, 1479, 1484, 1492, - 1494, 1498, 1503, 1508, 1516, 1521, 1529, 1538, 1539, 1543, - 1544, 1548, 1556, 1574, 1578, 1583, 1591, 1596, 1597, 1601, - 1606, 1614, 1619, 1624, 1629, 1634, 1642, 1647, 1652, 1660, - 1665, 1666, 1667, 1668, 1669 + 0, 391, 391, 395, 396, 397, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 433, 443, 444, 445, 446, 447, 451, 452, 457, 462, + 464, 470, 471, 479, 480, 481, 485, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 502, 504, 509, 510, + 511, 512, 513, 514, 518, 523, 532, 542, 543, 553, + 555, 557, 559, 570, 577, 579, 584, 586, 588, 590, + 592, 602, 608, 609, 617, 619, 631, 632, 633, 634, + 635, 644, 649, 654, 662, 664, 666, 668, 673, 674, + 675, 676, 677, 678, 679, 680, 681, 685, 686, 695, + 697, 706, 716, 721, 729, 730, 731, 732, 733, 734, + 735, 736, 741, 742, 750, 760, 769, 784, 789, 790, + 794, 795, 799, 800, 801, 802, 803, 804, 805, 814, + 818, 822, 830, 838, 846, 861, 876, 889, 890, 910, + 911, 919, 930, 931, 932, 933, 934, 935, 936, 937, + 938, 939, 940, 941, 942, 943, 944, 945, 946, 950, + 955, 963, 968, 969, 970, 974, 979, 987, 992, 993, + 994, 995, 996, 997, 998, 999, 1007, 1017, 1022, 1030, + 1032, 1034, 1043, 1045, 1050, 1051, 1052, 1056, 1057, 1058, + 1059, 1067, 1072, 1077, 1085, 1090, 1091, 1092, 1101, 1103, + 1108, 1113, 1121, 1123, 1140, 1141, 1142, 1143, 1144, 1145, + 1149, 1150, 1151, 1152, 1153, 1154, 1162, 1167, 1172, 1180, + 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, + 1203, 1204, 1205, 1212, 1219, 1226, 1242, 1261, 1269, 1271, + 1273, 1275, 1277, 1279, 1281, 1288, 1293, 1294, 1295, 1299, + 1303, 1312, 1314, 1317, 1321, 1325, 1326, 1327, 1331, 1342, + 1360, 1373, 1374, 1379, 1405, 1406, 1411, 1416, 1418, 1423, + 1424, 1432, 1434, 1442, 1447, 1455, 1480, 1487, 1497, 1498, + 1502, 1503, 1504, 1505, 1509, 1510, 1511, 1515, 1520, 1525, + 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1549, 1554, 1562, + 1567, 1575, 1577, 1581, 1586, 1591, 1599, 1604, 1612, 1621, + 1622, 1626, 1627, 1631, 1639, 1657, 1661, 1666, 1674, 1679, + 1680, 1684, 1689, 1697, 1702, 1707, 1712, 1717, 1725, 1730, + 1735, 1743, 1748, 1749, 1750, 1751, 1752 }; #endif @@ -939,55 +959,57 @@ static const char *const yytname[] = "T_Allpeers", "T_Auth", "T_Autokey", "T_Automax", "T_Average", "T_Basedate", "T_Bclient", "T_Bcpollbstep", "T_Beacon", "T_Broadcast", "T_Broadcastclient", "T_Broadcastdelay", "T_Burst", "T_Calibrate", - "T_Ceiling", "T_Clockstats", "T_Cohort", "T_ControlKey", "T_Crypto", - "T_Cryptostats", "T_Ctl", "T_Day", "T_Default", "T_Digest", "T_Disable", - "T_Discard", "T_Dispersion", "T_Double", "T_Driftfile", "T_Drop", - "T_Dscp", "T_Ellipsis", "T_Enable", "T_End", "T_Epeer", "T_False", - "T_File", "T_Filegen", "T_Filenum", "T_Flag1", "T_Flag2", "T_Flag3", - "T_Flag4", "T_Flake", "T_Floor", "T_Freq", "T_Fudge", "T_Host", - "T_Huffpuff", "T_Iburst", "T_Ident", "T_Ignore", "T_Incalloc", - "T_Incmem", "T_Initalloc", "T_Initmem", "T_Includefile", "T_Integer", - "T_Interface", "T_Intrange", "T_Io", "T_Ippeerlimit", "T_Ipv4", - "T_Ipv4_flag", "T_Ipv6", "T_Ipv6_flag", "T_Kernel", "T_Key", "T_Keys", - "T_Keysdir", "T_Kod", "T_Mssntp", "T_Leapfile", "T_Leapsmearinterval", - "T_Limited", "T_Link", "T_Listen", "T_Logconfig", "T_Logfile", - "T_Loopstats", "T_Lowpriotrap", "T_Manycastclient", "T_Manycastserver", - "T_Mask", "T_Maxage", "T_Maxclock", "T_Maxdepth", "T_Maxdist", - "T_Maxmem", "T_Maxpoll", "T_Mdnstries", "T_Mem", "T_Memlock", - "T_Minclock", "T_Mindepth", "T_Mindist", "T_Minimum", "T_Minpoll", - "T_Minsane", "T_Mode", "T_Mode7", "T_Monitor", "T_Month", "T_Mru", - "T_Multicastclient", "T_Nic", "T_Nolink", "T_Nomodify", "T_Nomrulist", - "T_None", "T_Nonvolatile", "T_Noepeer", "T_Nopeer", "T_Noquery", - "T_Noselect", "T_Noserve", "T_Notrap", "T_Notrust", "T_Ntp", "T_Ntpport", + "T_Ceiling", "T_Checkhash", "T_Clockstats", "T_Cohort", "T_ControlKey", + "T_Crypto", "T_Cryptostats", "T_Ctl", "T_Day", "T_Default", "T_Digest", + "T_Disable", "T_Discard", "T_Dispersion", "T_Double", "T_Driftfile", + "T_Drop", "T_Dscp", "T_Ellipsis", "T_Enable", "T_End", "T_Epeer", + "T_False", "T_File", "T_Filegen", "T_Filenum", "T_Flag1", "T_Flag2", + "T_Flag3", "T_Flag4", "T_Flake", "T_Floor", "T_Freq", "T_Fudge", + "T_Fuzz", "T_Host", "T_Huffpuff", "T_Iburst", "T_Ident", "T_Ignore", + "T_Ignorehash", "T_Incalloc", "T_Incmem", "T_Initalloc", "T_Initmem", + "T_Includefile", "T_Integer", "T_Interface", "T_Intrange", "T_Io", + "T_Ippeerlimit", "T_Ipv4", "T_Ipv4_flag", "T_Ipv6", "T_Ipv6_flag", + "T_Kernel", "T_Key", "T_Keys", "T_Keysdir", "T_Kod", "T_Leapfile", + "T_Leapsmearinterval", "T_Limited", "T_Link", "T_Listen", "T_Logconfig", + "T_Logfile", "T_Loopstats", "T_Lowpriotrap", "T_Manycastclient", + "T_Manycastserver", "T_Mask", "T_Maxage", "T_Maxclock", "T_Maxdepth", + "T_Maxdist", "T_Maxmem", "T_Maxpoll", "T_Mdnstries", "T_Mem", + "T_Memlock", "T_Minclock", "T_Mindepth", "T_Mindist", "T_Minimum", + "T_Minjitter", "T_Minpoll", "T_Minsane", "T_Mode", "T_Mode7", + "T_Monitor", "T_Month", "T_Mru", "T_Mssntp", "T_Multicastclient", + "T_Nic", "T_Nolink", "T_Nomodify", "T_Nomrulist", "T_None", + "T_Nonvolatile", "T_Noepeer", "T_Nopeer", "T_Noquery", "T_Noselect", + "T_Noserve", "T_Notrap", "T_Notrust", "T_Ntp", "T_Ntpport", "T_NtpSignDsocket", "T_Orphan", "T_Orphanwait", "T_PCEdigest", "T_Panic", - "T_Peer", "T_Peerstats", "T_Phone", "T_Pid", "T_Pidfile", "T_Pool", - "T_Port", "T_Preempt", "T_Prefer", "T_Protostats", "T_Pw", "T_Randfile", - "T_Rawstats", "T_Refid", "T_Requestkey", "T_Reset", "T_Restrict", - "T_Revoke", "T_Rlimit", "T_Saveconfigdir", "T_Server", "T_Setvar", - "T_Source", "T_Stacksize", "T_Statistics", "T_Stats", "T_Statsdir", - "T_Step", "T_Stepback", "T_Stepfwd", "T_Stepout", "T_Stratum", - "T_String", "T_Sys", "T_Sysstats", "T_Tick", "T_Time1", "T_Time2", - "T_Timer", "T_Timingstats", "T_Tinker", "T_Tos", "T_Trap", "T_True", - "T_Trustedkey", "T_Ttl", "T_Type", "T_U_int", "T_UEcrypto", - "T_UEcryptonak", "T_UEdigest", "T_Unconfig", "T_Unpeer", "T_Version", - "T_WanderThreshold", "T_Week", "T_Wildcard", "T_Xleave", "T_Year", - "T_Flag", "T_EOC", "T_Simulate", "T_Beep_Delay", "T_Sim_Duration", - "T_Server_Offset", "T_Duration", "T_Freq_Offset", "T_Wander", "T_Jitter", - "T_Prop_Delay", "T_Proc_Delay", "'='", "'('", "')'", "'{'", "'}'", - "$accept", "configuration", "command_list", "command", "server_command", - "client_type", "address", "ip_address", "address_fam", "option_list", - "option", "option_flag", "option_flag_keyword", "option_int", - "option_int_keyword", "option_str", "option_str_keyword", - "unpeer_command", "unpeer_keyword", "other_mode_command", - "authentication_command", "crypto_command_list", "crypto_command", - "crypto_str_keyword", "orphan_mode_command", "tos_option_list", - "tos_option", "tos_option_int_keyword", "tos_option_dbl_keyword", - "monitoring_command", "stats_list", "stat", "filegen_option_list", - "filegen_option", "link_nolink", "enable_disable", "filegen_type", - "access_control_command", "res_ippeerlimit", "ac_flag_list", - "access_control_flag", "discard_option_list", "discard_option", - "discard_option_keyword", "mru_option_list", "mru_option", - "mru_option_keyword", "fudge_command", "fudge_factor_list", + "T_Peer", "T_Peerstats", "T_Phone", "T_Pid", "T_Pidfile", "T_Poll", + "T_PollSkewList", "T_Pool", "T_Port", "T_Preempt", "T_Prefer", + "T_Protostats", "T_Pw", "T_Randfile", "T_Rawstats", "T_Refid", + "T_Requestkey", "T_Reset", "T_Restrict", "T_Revoke", "T_Rlimit", + "T_Saveconfigdir", "T_Server", "T_Serverresponse", + "T_ServerresponseFuzz", "T_Setvar", "T_Source", "T_Stacksize", + "T_Statistics", "T_Stats", "T_Statsdir", "T_Step", "T_Stepback", + "T_Stepfwd", "T_Stepout", "T_Stratum", "T_String", "T_Sys", "T_Sysstats", + "T_Tick", "T_Time1", "T_Time2", "T_Timer", "T_Timingstats", "T_Tinker", + "T_Tos", "T_Trap", "T_True", "T_Trustedkey", "T_Ttl", "T_Type", + "T_U_int", "T_UEcrypto", "T_UEcryptonak", "T_UEdigest", "T_Unconfig", + "T_Unpeer", "T_Version", "T_WanderThreshold", "T_Week", "T_Wildcard", + "T_Xleave", "T_Xmtnonce", "T_Year", "T_Flag", "T_EOC", "T_Simulate", + "T_Beep_Delay", "T_Sim_Duration", "T_Server_Offset", "T_Duration", + "T_Freq_Offset", "T_Wander", "T_Jitter", "T_Prop_Delay", "T_Proc_Delay", + "'|'", "'='", "'('", "')'", "'{'", "'}'", "$accept", "configuration", + "command_list", "command", "server_command", "client_type", "address", + "ip_address", "address_fam", "option_list", "option", "option_flag", + "option_flag_keyword", "option_int", "option_int_keyword", "option_str", + "option_str_keyword", "unpeer_command", "unpeer_keyword", + "other_mode_command", "authentication_command", "crypto_command_list", + "crypto_command", "crypto_str_keyword", "orphan_mode_command", + "tos_option_list", "tos_option", "tos_option_int_keyword", + "tos_option_dbl_keyword", "monitoring_command", "stats_list", "stat", + "filegen_option_list", "filegen_option", "link_nolink", "enable_disable", + "filegen_type", "access_control_command", "res_ippeerlimit", + "ac_flag_list", "access_control_flag", "discard_option_list", + "discard_option", "discard_option_keyword", "mru_option_list", + "mru_option", "mru_option_keyword", "fudge_command", "fudge_factor_list", "fudge_factor", "fudge_factor_dbl_keyword", "fudge_factor_bool_keyword", "rlimit_command", "rlimit_option_list", "rlimit_option", "rlimit_option_keyword", "system_option_command", "system_option_list", @@ -995,7 +1017,8 @@ static const char *const yytname[] = "system_option_local_flag_keyword", "tinker_command", "tinker_option_list", "tinker_option", "tinker_option_keyword", "miscellaneous_command", "misc_cmd_dbl_keyword", "misc_cmd_int_keyword", - "misc_cmd_str_keyword", "misc_cmd_str_lcl_keyword", "drift_parm", + "opt_hash_check", "misc_cmd_str_keyword", "misc_cmd_str_lcl_keyword", + "drift_parm", "pollskew_list", "pollskew_spec", "pollskew_cycle", "variable_assign", "t_default_or_zero", "trap_option_list", "trap_option", "log_config_list", "log_config_command", "interface_command", "interface_nic", "nic_rule_class", @@ -1035,14 +1058,15 @@ static const yytype_uint16 yytoknum[] = 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 61, 40, 41, 123, 125 + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 124, 61, 40, 41, 123, 125 }; # endif -#define YYPACT_NINF -215 +#define YYPACT_NINF -261 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-215))) + (!!((Yystate) == (-261))) #define YYTABLE_NINF -7 @@ -1053,50 +1077,52 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 11, -175, 2, -215, -215, -215, 3, -215, 93, 9, - -138, -215, 93, -215, 66, -40, -215, -93, -215, -87, - -82, -215, -215, -81, -215, -215, -40, 20, 210, -40, - -215, -215, -70, -215, -67, -215, -215, 34, 6, -13, - 47, -6, -215, -215, -48, 66, -45, -215, 412, 483, - -39, -60, 62, -215, -215, -215, 127, 203, -63, -215, - -40, -215, -40, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -11, 75, -24, -22, -215, -18, -215, - -215, -53, -215, -215, -215, 48, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, 93, -215, - -215, -215, -215, -215, -215, 9, -215, 82, 120, -215, - 93, -215, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, 86, -215, 4, 373, -215, -215, -215, - -81, -215, -215, -40, -215, -215, -215, -215, -215, -215, - -215, -215, -215, 210, -215, 106, -40, -215, -215, 15, - -215, -215, -215, -215, -215, -215, -215, -215, 6, -215, - 105, 146, 151, 105, -30, -215, -215, -215, -215, -6, - -215, 117, -21, -215, 66, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, 412, -215, -11, - 22, -215, -215, -215, -20, -215, -215, -215, -215, -215, - -215, -215, -215, 483, -215, 128, -11, -215, -215, -215, - 129, -60, -215, -215, -215, 132, -215, 10, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, - 1, -133, -215, -215, -215, -215, -215, 134, -215, 41, - -215, -215, -215, -215, -28, 42, -215, -215, -215, -215, - 45, 148, -215, -215, 86, -215, -11, -20, -215, -215, - -215, -215, -215, -215, -215, -215, 150, -215, 105, 105, - -215, -39, -215, -215, -215, 51, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -57, 178, -215, - -215, -215, 288, -215, -215, -215, -215, -215, -215, -215, - -215, -115, 25, 23, -215, -215, -215, -215, 61, -215, - -215, 21, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, 477, -215, -215, 477, 105, 477, 201, -39, - 169, -215, 172, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -59, -215, 77, 36, 52, -100, -215, 39, - -215, -11, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, -215, 477, - 477, -215, -215, -215, -215, -215, 43, -215, -215, -215, - -40, -215, -215, -215, 55, -215, 477, -215, -215, 49, - 56, -11, 54, -166, -215, 67, -11, -215, -215, -215, - 70, 63, -215, -215, -215, -215, -215, 124, 85, 64, - -215, 89, -215, -11, -215, -215 + 19, -163, -36, -261, -261, -261, -25, -261, 326, 77, + -125, -261, 326, -261, 16, -45, -261, -119, -261, -103, + -100, -98, -261, -95, -261, -261, -45, 13, 238, -45, + -261, -261, -88, -261, -86, -261, -261, -261, 22, 109, + -8, 23, -38, -261, -261, -81, 16, -80, -261, 443, + 607, -73, -58, 35, -261, -261, -261, 103, 229, -90, + -261, -45, -261, -45, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -9, 45, -53, -51, -261, -19, + -261, -261, -102, -261, -261, -261, 82, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, 326, + -261, -261, -261, -261, -261, -261, 77, -261, 55, 91, + -261, 326, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, 46, -261, -42, 407, -261, -261, + -11, -261, -95, -261, -261, -45, -261, -261, -261, -261, + -261, -261, -261, -261, -261, 238, -261, 64, -45, -261, + -261, -28, -13, -261, -261, -261, -261, -261, -261, -261, + -261, 109, -261, 74, 118, 119, 74, -31, -261, -261, + -261, -261, -38, -261, 93, -55, -261, 16, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + 443, -261, -9, -7, -261, -261, -261, -40, -261, -261, + -261, -261, -261, -261, -261, -261, 607, -261, 100, -9, + -261, -261, -261, 101, -58, -261, -261, -261, 102, -261, + -23, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, 9, -170, -261, -261, -261, -261, -261, + 122, -261, -2, -261, -261, -261, -261, 107, 14, -261, + -261, -261, -261, -261, 20, 126, -261, -261, 46, -261, + -9, -40, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, 129, -261, 139, -261, 74, + 74, -261, -73, -261, -261, -261, 36, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -62, 168, + -261, -261, -261, 410, -261, -261, -261, -261, -261, -261, + -261, -261, -96, 17, 6, -261, -261, -261, -261, 61, + -261, -261, 3, -261, -261, -261, -261, -261, -261, -261, + -261, -261, 24, -261, 534, -261, -261, 534, 74, 534, + 204, -73, 173, -261, 174, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -63, -261, 70, 31, 47, + -146, -261, 33, -261, -9, -261, -261, -261, -261, -261, + -261, -261, -261, -261, 183, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, 196, -261, -261, 534, 534, -261, -261, -261, -261, + -261, 37, -261, -261, -261, -45, -261, -261, -261, 48, + -261, -261, -261, 534, -261, -261, 43, 51, -9, 50, + -193, -261, 57, -9, -261, -261, -261, 52, 5, -261, + -261, -261, -261, -261, 18, 58, 53, -261, 63, -261, + -9, -261, -261 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1104,82 +1130,86 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 0, 0, 24, 58, 241, 0, 71, 0, 0, - 253, 244, 0, 234, 0, 0, 246, 0, 266, 0, - 0, 247, 245, 0, 248, 25, 0, 0, 0, 0, - 267, 242, 0, 23, 0, 249, 22, 0, 0, 0, - 0, 0, 250, 21, 0, 0, 0, 243, 0, 0, - 0, 0, 0, 56, 57, 303, 0, 2, 0, 7, - 0, 8, 0, 9, 10, 13, 11, 12, 14, 15, - 16, 17, 18, 0, 0, 0, 0, 227, 0, 228, - 19, 0, 5, 62, 63, 64, 201, 202, 203, 204, - 207, 205, 206, 208, 209, 210, 211, 212, 196, 198, - 199, 200, 160, 161, 162, 128, 158, 0, 251, 235, - 195, 103, 104, 105, 106, 110, 107, 108, 109, 111, - 29, 30, 28, 0, 26, 0, 6, 65, 66, 263, - 236, 262, 295, 59, 61, 166, 167, 168, 169, 170, - 171, 172, 173, 129, 164, 0, 60, 70, 293, 237, - 67, 278, 279, 280, 281, 282, 283, 284, 275, 277, - 136, 29, 30, 136, 136, 68, 194, 192, 193, 188, - 190, 0, 0, 238, 98, 102, 99, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 213, 215, 0, - 0, 87, 88, 89, 0, 90, 91, 97, 92, 96, - 93, 94, 95, 80, 82, 0, 0, 86, 257, 289, - 0, 69, 288, 290, 286, 240, 1, 0, 4, 31, - 55, 300, 299, 229, 230, 231, 232, 274, 273, 272, - 0, 0, 79, 75, 76, 77, 78, 0, 72, 0, - 197, 157, 159, 252, 100, 0, 184, 185, 186, 187, - 0, 0, 182, 183, 174, 176, 0, 0, 27, 233, - 261, 294, 163, 165, 292, 276, 0, 138, 136, 136, - 138, 0, 138, 189, 191, 0, 101, 214, 216, 301, - 298, 296, 297, 85, 81, 83, 84, 239, 0, 287, - 285, 3, 20, 268, 269, 270, 265, 271, 264, 307, - 308, 0, 0, 0, 74, 73, 120, 119, 0, 117, - 118, 0, 112, 115, 116, 180, 181, 179, 175, 177, - 178, 137, 132, 138, 138, 135, 136, 130, 256, 0, - 0, 258, 0, 37, 38, 39, 54, 47, 49, 48, - 51, 40, 41, 42, 43, 50, 52, 44, 32, 33, - 36, 34, 0, 35, 0, 0, 0, 0, 310, 0, - 305, 0, 113, 127, 123, 125, 121, 122, 124, 126, - 114, 140, 141, 142, 143, 144, 145, 146, 148, 149, - 147, 150, 151, 152, 153, 154, 155, 156, 139, 133, - 134, 138, 255, 254, 260, 259, 0, 45, 46, 53, - 0, 304, 302, 309, 0, 306, 131, 291, 313, 0, - 0, 0, 0, 0, 315, 0, 0, 311, 314, 312, - 0, 0, 320, 321, 322, 323, 324, 0, 0, 0, - 316, 0, 318, 0, 317, 319 + 0, 0, 0, 24, 59, 246, 0, 72, 0, 0, + 260, 249, 0, 238, 0, 0, 254, 0, 278, 0, + 0, 0, 250, 0, 255, 25, 0, 0, 0, 0, + 279, 247, 0, 23, 0, 256, 261, 22, 0, 0, + 0, 0, 0, 257, 21, 0, 0, 0, 248, 0, + 0, 0, 0, 0, 57, 58, 315, 0, 2, 0, + 7, 0, 8, 0, 9, 10, 13, 11, 12, 14, + 15, 16, 17, 18, 0, 0, 0, 0, 230, 0, + 231, 19, 0, 5, 63, 64, 65, 204, 205, 206, + 207, 210, 208, 209, 211, 212, 213, 214, 215, 199, + 201, 202, 203, 162, 163, 164, 129, 160, 0, 258, + 239, 198, 104, 105, 106, 107, 111, 108, 109, 110, + 112, 29, 30, 28, 0, 26, 0, 6, 66, 67, + 253, 275, 240, 274, 307, 60, 62, 168, 169, 170, + 171, 172, 173, 174, 175, 130, 166, 0, 61, 71, + 305, 241, 242, 68, 290, 291, 292, 293, 294, 295, + 296, 287, 289, 137, 29, 30, 137, 137, 69, 197, + 195, 196, 191, 193, 0, 0, 243, 99, 103, 100, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 216, 218, 0, 0, 88, 89, 90, 0, 91, 92, + 98, 93, 97, 94, 95, 96, 81, 83, 0, 0, + 87, 269, 301, 0, 70, 300, 302, 298, 245, 1, + 0, 4, 31, 56, 312, 311, 232, 233, 234, 235, + 286, 285, 284, 0, 0, 80, 76, 77, 78, 79, + 0, 73, 0, 200, 159, 161, 259, 101, 0, 187, + 188, 189, 190, 186, 0, 0, 184, 185, 176, 178, + 0, 0, 27, 236, 252, 251, 237, 273, 306, 165, + 167, 304, 265, 264, 262, 0, 288, 0, 139, 137, + 137, 139, 0, 139, 192, 194, 0, 102, 217, 219, + 313, 310, 308, 309, 86, 82, 84, 85, 244, 0, + 299, 297, 3, 20, 280, 281, 282, 277, 283, 276, + 319, 320, 0, 0, 0, 75, 74, 121, 120, 0, + 118, 119, 0, 113, 116, 117, 182, 183, 181, 177, + 179, 180, 0, 138, 133, 139, 139, 136, 137, 131, + 268, 0, 0, 270, 0, 37, 38, 39, 55, 48, + 50, 49, 52, 40, 41, 42, 43, 51, 53, 44, + 45, 32, 33, 36, 34, 0, 35, 0, 0, 0, + 0, 322, 0, 317, 0, 114, 128, 124, 126, 122, + 123, 125, 127, 115, 0, 142, 143, 144, 145, 146, + 147, 148, 150, 151, 149, 152, 153, 154, 155, 156, + 157, 0, 158, 140, 134, 135, 139, 267, 266, 272, + 271, 0, 46, 47, 54, 0, 316, 314, 321, 0, + 318, 263, 141, 132, 303, 325, 0, 0, 0, 0, + 0, 327, 0, 0, 323, 326, 324, 0, 0, 332, + 333, 334, 335, 336, 0, 0, 0, 328, 0, 330, + 0, 329, 331 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -215, -215, -215, -23, -215, -215, -15, -49, -215, -215, - -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, 81, -215, -215, -215, - -215, -38, -215, -215, -215, -215, -215, -215, -154, -214, - -215, -215, 153, -215, -215, 142, -215, -215, -215, 32, - -215, -215, -215, -215, 121, -215, -215, 277, -35, -215, - -215, -215, -215, 107, -215, -215, -215, -215, -215, -215, - -215, -215, -215, -215, -215, -215, 163, -215, -215, -215, - -215, -215, -215, 137, -215, -215, 87, -215, -215, 267, - 53, -187, -215, -215, -215, -215, -2, -215, -215, -55, - -215, -215, -215, -109, -215, -121, -215 + -261, -261, -261, -48, -261, -261, -15, -50, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, 65, -261, -261, -261, + -261, -41, -261, -261, -261, -261, -261, -261, -151, -260, + -261, -261, 166, -261, -261, 128, -261, -261, -261, 21, + -261, -261, -261, -261, 104, -261, -261, 263, -43, -261, + -261, -261, -261, 87, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + 146, -261, -261, -261, -261, -261, -261, 120, -261, -261, + 66, -261, -261, 255, 25, -190, -261, -261, -261, -261, + -27, -261, -261, -78, -261, -261, -261, -141, -261, -154, + -261 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 56, 57, 58, 59, 60, 132, 124, 125, 292, - 348, 349, 350, 351, 352, 353, 354, 61, 62, 63, - 64, 85, 238, 239, 65, 203, 204, 205, 206, 66, - 174, 119, 244, 312, 313, 314, 370, 67, 267, 322, - 388, 105, 106, 107, 143, 144, 145, 68, 254, 255, - 256, 257, 69, 169, 170, 171, 70, 98, 99, 100, - 101, 71, 187, 188, 189, 72, 73, 74, 75, 76, - 109, 173, 393, 287, 331, 130, 131, 77, 78, 298, - 230, 79, 158, 159, 215, 211, 212, 213, 149, 133, - 283, 223, 207, 80, 81, 301, 302, 303, 357, 358, - 410, 359, 413, 414, 427, 428, 429 + -1, 57, 58, 59, 60, 61, 134, 125, 126, 303, + 361, 362, 363, 364, 365, 366, 367, 62, 63, 64, + 65, 86, 241, 242, 66, 206, 207, 208, 209, 67, + 177, 120, 247, 323, 324, 325, 383, 68, 278, 334, + 403, 106, 107, 108, 145, 146, 147, 69, 258, 259, + 260, 261, 70, 172, 173, 174, 71, 99, 100, 101, + 102, 72, 190, 191, 192, 73, 74, 75, 266, 76, + 77, 110, 152, 274, 275, 176, 408, 298, 343, 132, + 133, 78, 79, 309, 233, 80, 161, 162, 218, 214, + 215, 216, 151, 135, 294, 226, 210, 81, 82, 312, + 313, 314, 370, 371, 427, 372, 430, 431, 444, 445, + 446 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1187,232 +1217,251 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 123, 208, 278, 306, 209, 397, 293, 175, 329, 270, - 272, 307, 1, 151, 152, 308, 160, 82, 227, 286, - 102, 2, 280, 221, 164, 363, 108, 3, 4, 5, - 120, 412, 121, 153, 217, 6, 7, 355, 266, 166, - 228, 417, 8, 9, 281, 219, 10, 220, 11, 364, - 12, 13, 355, 222, 309, 14, 325, 161, 327, 162, - 271, 299, 300, 240, 15, 229, 83, 84, 16, 319, - 294, 126, 295, 154, 17, 240, 18, 127, 232, 299, - 300, 330, 128, 129, 134, 310, 19, 20, 111, 245, - 21, 22, 112, 167, 147, 23, 24, 148, 150, 25, - 26, 86, 233, 259, 155, 234, 87, 402, 27, 389, - 390, 165, 103, 88, 323, 324, 172, 104, 261, 176, - 398, 28, 29, 30, 122, 122, 214, 216, 31, 218, - 365, 261, 246, 247, 248, 249, 276, 366, 32, 224, - 225, 163, 226, 33, 210, 34, 242, 35, 36, 168, - 311, 122, 113, 231, 243, 282, 367, 37, 38, 39, - 40, 41, 42, 43, 44, 296, 89, 45, 258, 46, - 263, 156, 391, 266, 405, 268, 157, 406, 47, 264, - 269, 274, 275, 48, 49, 50, 279, 51, 52, 297, - 235, 236, 285, 288, 53, 54, 290, 237, 304, 114, - 90, 91, 291, -6, 55, 305, 315, 115, 368, 316, - 116, 369, 317, 2, 321, 328, 332, 360, 92, 3, - 4, 5, 326, 93, 415, 362, 361, 6, 7, 420, - 392, 250, 117, 395, 8, 9, 396, 118, 10, 400, - 11, 399, 12, 13, 401, 404, 435, 14, 407, 251, - 94, 409, 411, 412, 252, 253, 15, 416, 241, 419, - 16, 422, 423, 424, 425, 426, 17, 433, 18, 135, - 136, 137, 138, 95, 96, 97, 421, 432, 19, 20, - 394, 434, 21, 22, 284, 262, 318, 23, 24, 110, - 273, 25, 26, 260, 277, 265, 146, 333, 289, 356, - 27, 139, 403, 140, 418, 141, 431, 334, 0, 0, - 320, 142, 0, 28, 29, 30, 0, 0, 0, 0, - 31, 0, 422, 423, 424, 425, 426, 0, 0, 0, - 32, 430, 0, 0, 0, 33, 0, 34, 0, 35, - 36, 0, 0, 0, 335, 336, 0, 0, 0, 37, - 38, 39, 40, 41, 42, 43, 44, 0, 0, 45, - 0, 46, 337, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 0, 48, 49, 50, 0, 51, - 52, 0, 0, 2, 338, 408, 53, 54, 0, 3, - 4, 5, 339, 0, 340, -6, 55, 6, 7, 0, - 0, 0, 0, 0, 8, 9, 0, 0, 10, 341, - 11, 0, 12, 13, 0, 0, 0, 14, 177, 0, - 0, 0, 0, 0, 0, 0, 15, 342, 343, 0, - 16, 0, 0, 0, 0, 0, 17, 0, 18, 0, - 0, 0, 0, 0, 0, 178, 0, 0, 19, 20, - 0, 0, 21, 22, 0, 0, 0, 23, 24, 0, - 0, 25, 26, 344, 179, 345, 0, 180, 0, 0, - 27, 0, 0, 346, 0, 0, 0, 347, 0, 0, - 0, 0, 0, 28, 29, 30, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 190, 0, 191, 192, 0, - 32, 0, 0, 0, 193, 33, 194, 34, 0, 35, - 36, 0, 0, 0, 0, 0, 0, 0, 371, 37, - 38, 39, 40, 41, 42, 43, 44, 372, 0, 45, - 0, 46, 0, 0, 195, 373, 0, 0, 0, 0, - 47, 0, 0, 181, 0, 48, 49, 50, 0, 51, - 52, 0, 0, 0, 374, 375, 53, 54, 376, 0, - 0, 0, 0, 0, 377, 0, 55, 0, 0, 0, - 0, 182, 183, 184, 185, 196, 0, 197, 0, 186, - 0, 0, 0, 198, 0, 199, 0, 0, 200, 0, - 0, 378, 379, 0, 0, 380, 381, 382, 0, 383, - 384, 385, 0, 386, 0, 0, 0, 0, 0, 0, - 0, 201, 202, 0, 0, 0, 0, 0, 0, 0, + 124, 211, 289, 291, 412, 178, 341, 376, 169, 212, + 220, 264, 368, 429, 304, 281, 283, 272, 230, 297, + 1, 337, 163, 339, 434, 167, 224, 292, 121, 2, + 122, 84, 377, 310, 311, 3, 4, 5, 83, 112, + 277, 231, 85, 113, 6, 7, 222, 109, 223, 248, + 265, 8, 9, 127, 273, 10, 243, 11, 225, 12, + 13, 282, 368, 170, 14, 164, 232, 165, 243, 128, + 330, 417, 129, 15, 130, 404, 405, 131, 16, 263, + 136, 305, 342, 306, 149, 17, 150, 18, 103, 153, + 168, 175, 179, 249, 250, 251, 252, 19, 20, 123, + 21, 22, 217, 219, 114, 23, 24, 310, 311, 25, + 26, 221, 227, 235, 234, 378, 154, 155, 27, 228, + 268, 229, 245, 379, 413, 171, 246, 123, 335, 336, + 262, 270, 28, 268, 29, 30, 287, 156, 236, 317, + 31, 237, 380, 293, 271, 277, 423, 318, 279, 280, + 32, 319, 253, 115, 166, 33, 213, 34, 286, 35, + 285, 36, 37, 116, 123, 290, 117, 296, 299, 301, + 316, 38, 39, 40, 41, 42, 43, 44, 302, 157, + 45, 307, 104, 46, 420, 47, 326, 406, 105, 315, + 118, 320, 327, 328, 48, 119, 332, 254, 381, 49, + 50, 51, 382, 52, 53, 308, 333, 344, 340, 158, + 54, 55, 439, 440, 441, 442, 443, 255, 373, 374, + -6, 56, 256, 257, 321, 439, 440, 441, 442, 443, + 238, 239, 338, 375, 407, 447, 384, 240, 432, 2, + 410, 411, 414, 437, 415, 3, 4, 5, 416, 419, + 421, 422, 424, 426, 6, 7, 428, 429, 436, 449, + 452, 8, 9, 433, 451, 10, 450, 11, 438, 12, + 13, 295, 244, 269, 14, 111, 284, 288, 267, 329, + 300, 276, 159, 15, 148, 369, 331, 160, 16, 435, + 448, 409, 418, 322, 0, 17, 0, 18, 0, 0, + 137, 138, 139, 140, 0, 0, 0, 19, 20, 0, + 21, 22, 0, 0, 0, 23, 24, 0, 0, 25, + 26, 0, 0, 0, 0, 0, 0, 0, 27, 0, + 0, 141, 0, 142, 87, 143, 0, 0, 0, 88, + 0, 144, 28, 0, 29, 30, 89, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 34, 0, 35, + 0, 36, 37, 0, 0, 0, 0, 0, 0, 0, + 0, 38, 39, 40, 41, 42, 43, 44, 0, 0, + 45, 0, 0, 46, 0, 47, 0, 0, 0, 0, + 425, 0, 90, 0, 48, 0, 0, 0, 0, 49, + 50, 51, 0, 52, 53, 0, 0, 2, 0, 345, + 54, 55, 0, 3, 4, 5, 0, 0, 0, 346, + -6, 56, 6, 7, 0, 0, 91, 92, 0, 8, + 9, 0, 0, 10, 0, 11, 0, 12, 13, 180, + 0, 0, 14, 0, 0, 93, 0, 0, 0, 0, + 94, 15, 0, 0, 0, 0, 16, 0, 347, 348, + 0, 0, 0, 17, 0, 18, 0, 181, 0, 0, + 0, 0, 0, 0, 0, 19, 20, 349, 21, 22, + 0, 95, 0, 23, 24, 0, 182, 25, 26, 0, + 183, 0, 0, 0, 0, 0, 27, 0, 350, 0, + 0, 0, 0, 0, 96, 97, 98, 351, 0, 352, + 28, 0, 29, 30, 0, 0, 0, 0, 31, 0, + 0, 0, 0, 0, 0, 353, 0, 0, 32, 0, + 0, 0, 0, 33, 0, 34, 0, 35, 0, 36, + 37, 0, 0, 0, 0, 354, 355, 0, 0, 38, + 39, 40, 41, 42, 43, 44, 0, 0, 45, 0, + 0, 46, 0, 47, 0, 0, 385, 0, 184, 0, + 0, 0, 48, 0, 0, 386, 0, 49, 50, 51, + 0, 52, 53, 356, 387, 357, 0, 0, 54, 55, + 0, 0, 0, 358, 0, 0, 0, 359, 360, 56, + 185, 186, 187, 188, 388, 0, 0, 389, 189, 193, + 0, 194, 195, 390, 0, 0, 0, 0, 196, 0, + 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 391, 0, + 0, 0, 392, 393, 0, 0, 394, 395, 396, 198, + 397, 398, 399, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 387 + 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, + 0, 199, 0, 200, 0, 0, 0, 0, 0, 201, + 0, 202, 0, 0, 0, 203, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 402, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, + 205 }; static const yytype_int16 yycheck[] = { - 15, 50, 189, 31, 64, 64, 5, 45, 65, 163, - 164, 39, 1, 7, 8, 43, 29, 192, 36, 206, - 11, 10, 42, 34, 39, 4, 164, 16, 17, 18, - 70, 197, 72, 27, 57, 24, 25, 152, 68, 45, - 58, 207, 31, 32, 64, 60, 35, 62, 37, 28, - 39, 40, 152, 64, 82, 44, 270, 70, 272, 72, - 90, 194, 195, 98, 53, 83, 64, 64, 57, 256, - 69, 164, 71, 67, 63, 110, 65, 164, 30, 194, - 195, 138, 164, 164, 64, 113, 75, 76, 22, 3, - 79, 80, 26, 99, 164, 84, 85, 164, 64, 88, - 89, 8, 54, 126, 98, 57, 13, 207, 97, 323, - 324, 64, 103, 20, 268, 269, 164, 108, 133, 164, - 179, 110, 111, 112, 164, 164, 64, 0, 117, 192, - 109, 146, 46, 47, 48, 49, 174, 116, 127, 64, - 164, 154, 164, 132, 204, 134, 64, 136, 137, 155, - 178, 164, 86, 206, 34, 175, 135, 146, 147, 148, - 149, 150, 151, 152, 153, 164, 73, 156, 164, 158, - 64, 165, 326, 68, 361, 29, 170, 391, 167, 164, - 29, 64, 203, 172, 173, 174, 164, 176, 177, 188, - 142, 143, 64, 64, 183, 184, 64, 149, 64, 133, - 107, 108, 192, 192, 193, 164, 164, 141, 187, 164, - 144, 190, 64, 10, 64, 164, 38, 192, 125, 16, - 17, 18, 271, 130, 411, 164, 203, 24, 25, 416, - 29, 145, 166, 64, 31, 32, 64, 171, 35, 203, - 37, 164, 39, 40, 192, 206, 433, 44, 205, 163, - 157, 196, 203, 197, 168, 169, 53, 203, 105, 192, - 57, 198, 199, 200, 201, 202, 63, 203, 65, 59, - 60, 61, 62, 180, 181, 182, 206, 192, 75, 76, - 329, 192, 79, 80, 203, 143, 254, 84, 85, 12, - 169, 88, 89, 130, 187, 158, 29, 9, 211, 301, - 97, 91, 357, 93, 413, 95, 427, 19, -1, -1, - 257, 101, -1, 110, 111, 112, -1, -1, -1, -1, - 117, -1, 198, 199, 200, 201, 202, -1, -1, -1, - 127, 207, -1, -1, -1, 132, -1, 134, -1, 136, - 137, -1, -1, -1, 56, 57, -1, -1, -1, 146, - 147, 148, 149, 150, 151, 152, 153, -1, -1, 156, - -1, 158, 74, -1, -1, -1, -1, -1, -1, -1, - 167, -1, -1, -1, -1, 172, 173, 174, -1, 176, - 177, -1, -1, 10, 96, 400, 183, 184, -1, 16, - 17, 18, 104, -1, 106, 192, 193, 24, 25, -1, - -1, -1, -1, -1, 31, 32, -1, -1, 35, 121, - 37, -1, 39, 40, -1, -1, -1, 44, 6, -1, - -1, -1, -1, -1, -1, -1, 53, 139, 140, -1, - 57, -1, -1, -1, -1, -1, 63, -1, 65, -1, - -1, -1, -1, -1, -1, 33, -1, -1, 75, 76, - -1, -1, 79, 80, -1, -1, -1, 84, 85, -1, - -1, 88, 89, 175, 52, 177, -1, 55, -1, -1, - 97, -1, -1, 185, -1, -1, -1, 189, -1, -1, - -1, -1, -1, 110, 111, 112, -1, -1, -1, -1, - 117, -1, -1, -1, -1, 12, -1, 14, 15, -1, - 127, -1, -1, -1, 21, 132, 23, 134, -1, 136, - 137, -1, -1, -1, -1, -1, -1, -1, 41, 146, - 147, 148, 149, 150, 151, 152, 153, 50, -1, 156, - -1, 158, -1, -1, 51, 58, -1, -1, -1, -1, - 167, -1, -1, 131, -1, 172, 173, 174, -1, 176, - 177, -1, -1, -1, 77, 78, 183, 184, 81, -1, - -1, -1, -1, -1, 87, -1, 193, -1, -1, -1, - -1, 159, 160, 161, 162, 92, -1, 94, -1, 167, - -1, -1, -1, 100, -1, 102, -1, -1, 105, -1, - -1, 114, 115, -1, -1, 118, 119, 120, -1, 122, - 123, 124, -1, 126, -1, -1, -1, -1, -1, -1, - -1, 128, 129, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 15, 51, 192, 43, 67, 46, 68, 4, 46, 67, + 58, 22, 158, 206, 5, 166, 167, 30, 37, 209, + 1, 281, 30, 283, 217, 40, 35, 67, 73, 10, + 75, 67, 29, 203, 204, 16, 17, 18, 201, 23, + 71, 60, 67, 27, 25, 26, 61, 172, 63, 3, + 61, 32, 33, 172, 67, 36, 99, 38, 67, 40, + 41, 92, 158, 101, 45, 73, 85, 75, 111, 172, + 260, 217, 172, 54, 172, 335, 336, 172, 59, 127, + 67, 72, 144, 74, 172, 66, 172, 68, 11, 67, + 67, 172, 172, 47, 48, 49, 50, 78, 79, 172, + 81, 82, 67, 0, 88, 86, 87, 203, 204, 90, + 91, 201, 67, 31, 216, 112, 7, 8, 99, 172, + 135, 172, 67, 120, 187, 163, 35, 172, 279, 280, + 172, 67, 113, 148, 115, 116, 177, 28, 56, 32, + 121, 59, 139, 183, 172, 71, 406, 40, 30, 30, + 131, 44, 106, 137, 162, 136, 214, 138, 213, 140, + 67, 142, 143, 147, 172, 172, 150, 67, 67, 67, + 172, 152, 153, 154, 155, 156, 157, 158, 201, 70, + 161, 172, 105, 164, 374, 166, 172, 338, 111, 67, + 174, 84, 172, 67, 175, 179, 67, 151, 195, 180, + 181, 182, 199, 184, 185, 196, 67, 39, 172, 100, + 191, 192, 207, 208, 209, 210, 211, 171, 201, 213, + 201, 202, 176, 177, 117, 207, 208, 209, 210, 211, + 148, 149, 282, 172, 30, 217, 212, 155, 428, 10, + 67, 67, 172, 433, 213, 16, 17, 18, 201, 216, + 67, 55, 215, 205, 25, 26, 213, 206, 201, 201, + 450, 32, 33, 213, 201, 36, 213, 38, 216, 40, + 41, 206, 106, 145, 45, 12, 172, 190, 132, 258, + 214, 161, 173, 54, 29, 312, 261, 178, 59, 430, + 444, 341, 370, 186, -1, 66, -1, 68, -1, -1, + 62, 63, 64, 65, -1, -1, -1, 78, 79, -1, + 81, 82, -1, -1, -1, 86, 87, -1, -1, 90, + 91, -1, -1, -1, -1, -1, -1, -1, 99, -1, + -1, 93, -1, 95, 8, 97, -1, -1, -1, 13, + -1, 103, 113, -1, 115, 116, 20, -1, -1, -1, + 121, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 131, -1, -1, -1, -1, 136, -1, 138, -1, 140, + -1, 142, 143, -1, -1, -1, -1, -1, -1, -1, + -1, 152, 153, 154, 155, 156, 157, 158, -1, -1, + 161, -1, -1, 164, -1, 166, -1, -1, -1, -1, + 415, -1, 76, -1, 175, -1, -1, -1, -1, 180, + 181, 182, -1, 184, 185, -1, -1, 10, -1, 9, + 191, 192, -1, 16, 17, 18, -1, -1, -1, 19, + 201, 202, 25, 26, -1, -1, 110, 111, -1, 32, + 33, -1, -1, 36, -1, 38, -1, 40, 41, 6, + -1, -1, 45, -1, -1, 129, -1, -1, -1, -1, + 134, 54, -1, -1, -1, -1, 59, -1, 58, 59, + -1, -1, -1, 66, -1, 68, -1, 34, -1, -1, + -1, -1, -1, -1, -1, 78, 79, 77, 81, 82, + -1, 165, -1, 86, 87, -1, 53, 90, 91, -1, + 57, -1, -1, -1, -1, -1, 99, -1, 98, -1, + -1, -1, -1, -1, 188, 189, 190, 107, -1, 109, + 113, -1, 115, 116, -1, -1, -1, -1, 121, -1, + -1, -1, -1, -1, -1, 125, -1, -1, 131, -1, + -1, -1, -1, 136, -1, 138, -1, 140, -1, 142, + 143, -1, -1, -1, -1, 145, 146, -1, -1, 152, + 153, 154, 155, 156, 157, 158, -1, -1, 161, -1, + -1, 164, -1, 166, -1, -1, 42, -1, 135, -1, + -1, -1, 175, -1, -1, 51, -1, 180, 181, 182, + -1, 184, 185, 183, 60, 185, -1, -1, 191, 192, + -1, -1, -1, 193, -1, -1, -1, 197, 198, 202, + 167, 168, 169, 170, 80, -1, -1, 83, 175, 12, + -1, 14, 15, 89, -1, -1, -1, -1, 21, -1, + -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, + -1, -1, 118, 119, -1, -1, 122, 123, 124, 52, + 126, 127, 128, -1, 130, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 185 + -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, + -1, 94, -1, 96, -1, -1, -1, -1, -1, 102, + -1, 104, -1, -1, -1, 108, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 132, + 133 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 1, 10, 16, 17, 18, 24, 25, 31, 32, - 35, 37, 39, 40, 44, 53, 57, 63, 65, 75, - 76, 79, 80, 84, 85, 88, 89, 97, 110, 111, - 112, 117, 127, 132, 134, 136, 137, 146, 147, 148, - 149, 150, 151, 152, 153, 156, 158, 167, 172, 173, - 174, 176, 177, 183, 184, 193, 209, 210, 211, 212, - 213, 225, 226, 227, 228, 232, 237, 245, 255, 260, - 264, 269, 273, 274, 275, 276, 277, 285, 286, 289, - 301, 302, 192, 64, 64, 229, 8, 13, 20, 73, - 107, 108, 125, 130, 157, 180, 181, 182, 265, 266, - 267, 268, 11, 103, 108, 249, 250, 251, 164, 278, - 265, 22, 26, 86, 133, 141, 144, 166, 171, 239, - 70, 72, 164, 214, 215, 216, 164, 164, 164, 164, - 283, 284, 214, 297, 64, 59, 60, 61, 62, 91, - 93, 95, 101, 252, 253, 254, 297, 164, 164, 296, - 64, 7, 8, 27, 67, 98, 165, 170, 290, 291, - 29, 70, 72, 154, 214, 64, 45, 99, 155, 261, - 262, 263, 164, 279, 238, 239, 164, 6, 33, 52, - 55, 131, 159, 160, 161, 162, 167, 270, 271, 272, - 12, 14, 15, 21, 23, 51, 92, 94, 100, 102, - 105, 128, 129, 233, 234, 235, 236, 300, 215, 64, - 204, 293, 294, 295, 64, 292, 0, 211, 192, 214, - 214, 34, 64, 299, 64, 164, 164, 36, 58, 83, - 288, 206, 30, 54, 57, 142, 143, 149, 230, 231, - 266, 250, 64, 34, 240, 3, 46, 47, 48, 49, - 145, 163, 168, 169, 256, 257, 258, 259, 164, 211, - 284, 214, 253, 64, 164, 291, 68, 246, 29, 29, - 246, 90, 246, 262, 64, 203, 239, 271, 299, 164, - 42, 64, 175, 298, 234, 64, 299, 281, 64, 294, - 64, 192, 217, 5, 69, 71, 164, 188, 287, 194, - 195, 303, 304, 305, 64, 164, 31, 39, 43, 82, - 113, 178, 241, 242, 243, 164, 164, 64, 257, 299, - 298, 64, 247, 246, 246, 247, 215, 247, 164, 65, - 138, 282, 38, 9, 19, 56, 57, 74, 96, 104, - 106, 121, 139, 140, 175, 177, 185, 189, 218, 219, - 220, 221, 222, 223, 224, 152, 304, 306, 307, 309, - 192, 203, 164, 4, 28, 109, 116, 135, 187, 190, - 244, 41, 50, 58, 77, 78, 81, 87, 114, 115, - 118, 119, 120, 122, 123, 124, 126, 185, 248, 247, - 247, 246, 29, 280, 215, 64, 64, 64, 179, 164, - 203, 192, 207, 307, 206, 299, 247, 205, 214, 196, - 308, 203, 197, 310, 311, 299, 203, 207, 311, 192, - 299, 206, 198, 199, 200, 201, 202, 312, 313, 314, - 207, 313, 192, 203, 192, 299 + 0, 1, 10, 16, 17, 18, 25, 26, 32, 33, + 36, 38, 40, 41, 45, 54, 59, 66, 68, 78, + 79, 81, 82, 86, 87, 90, 91, 99, 113, 115, + 116, 121, 131, 136, 138, 140, 142, 143, 152, 153, + 154, 155, 156, 157, 158, 161, 164, 166, 175, 180, + 181, 182, 184, 185, 191, 192, 202, 219, 220, 221, + 222, 223, 235, 236, 237, 238, 242, 247, 255, 265, + 270, 274, 279, 283, 284, 285, 287, 288, 299, 300, + 303, 315, 316, 201, 67, 67, 239, 8, 13, 20, + 76, 110, 111, 129, 134, 165, 188, 189, 190, 275, + 276, 277, 278, 11, 105, 111, 259, 260, 261, 172, + 289, 275, 23, 27, 88, 137, 147, 150, 174, 179, + 249, 73, 75, 172, 224, 225, 226, 172, 172, 172, + 172, 172, 297, 298, 224, 311, 67, 62, 63, 64, + 65, 93, 95, 97, 103, 262, 263, 264, 311, 172, + 172, 310, 290, 67, 7, 8, 28, 70, 100, 173, + 178, 304, 305, 30, 73, 75, 162, 224, 67, 46, + 101, 163, 271, 272, 273, 172, 293, 248, 249, 172, + 6, 34, 53, 57, 135, 167, 168, 169, 170, 175, + 280, 281, 282, 12, 14, 15, 21, 24, 52, 94, + 96, 102, 104, 108, 132, 133, 243, 244, 245, 246, + 314, 225, 67, 214, 307, 308, 309, 67, 306, 0, + 221, 201, 224, 224, 35, 67, 313, 67, 172, 172, + 37, 60, 85, 302, 216, 31, 56, 59, 148, 149, + 155, 240, 241, 276, 260, 67, 35, 250, 3, 47, + 48, 49, 50, 106, 151, 171, 176, 177, 266, 267, + 268, 269, 172, 221, 22, 61, 286, 298, 224, 263, + 67, 172, 30, 67, 291, 292, 305, 71, 256, 30, + 30, 256, 92, 256, 272, 67, 213, 249, 281, 313, + 172, 43, 67, 183, 312, 244, 67, 313, 295, 67, + 308, 67, 201, 227, 5, 72, 74, 172, 196, 301, + 203, 204, 317, 318, 319, 67, 172, 32, 40, 44, + 84, 117, 186, 251, 252, 253, 172, 172, 67, 267, + 313, 312, 67, 67, 257, 256, 256, 257, 225, 257, + 172, 68, 144, 296, 39, 9, 19, 58, 59, 77, + 98, 107, 109, 125, 145, 146, 183, 185, 193, 197, + 198, 228, 229, 230, 231, 232, 233, 234, 158, 318, + 320, 321, 323, 201, 213, 172, 4, 29, 112, 120, + 139, 195, 199, 254, 212, 42, 51, 60, 80, 83, + 89, 114, 118, 119, 122, 123, 124, 126, 127, 128, + 130, 159, 193, 258, 257, 257, 256, 30, 294, 225, + 67, 67, 67, 187, 172, 213, 201, 217, 321, 216, + 313, 67, 55, 257, 215, 224, 205, 322, 213, 206, + 324, 325, 313, 213, 217, 325, 201, 313, 216, 207, + 208, 209, 210, 211, 326, 327, 328, 217, 327, 201, + 213, 201, 313 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 208, 209, 210, 210, 210, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 212, 213, 213, 213, 213, 213, 214, 214, 215, 216, - 216, 217, 217, 218, 218, 218, 219, 220, 220, 220, - 220, 220, 220, 220, 220, 221, 221, 222, 222, 222, - 222, 222, 222, 223, 224, 225, 226, 226, 227, 227, - 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, - 228, 229, 229, 230, 230, 231, 231, 231, 231, 231, - 232, 233, 233, 234, 234, 234, 234, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 236, 236, 237, 237, - 237, 238, 238, 239, 239, 239, 239, 239, 239, 239, - 239, 240, 240, 241, 241, 241, 241, 242, 242, 243, - 243, 244, 244, 244, 244, 244, 244, 244, 245, 245, - 245, 245, 245, 245, 245, 245, 246, 246, 247, 247, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 249, 249, 250, - 251, 251, 251, 252, 252, 253, 254, 254, 254, 254, - 254, 254, 254, 254, 255, 256, 256, 257, 257, 257, - 257, 257, 258, 258, 259, 259, 259, 259, 260, 261, - 261, 262, 263, 263, 263, 264, 264, 265, 265, 266, - 266, 267, 267, 267, 267, 267, 267, 268, 268, 268, - 268, 268, 268, 269, 270, 270, 271, 272, 272, 272, - 272, 272, 272, 272, 272, 272, 272, 273, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, - 273, 274, 274, 274, 275, 275, 276, 276, 277, 277, - 277, 278, 278, 278, 279, 280, 280, 281, 281, 282, - 282, 283, 283, 284, 285, 285, 286, 286, 287, 287, - 287, 287, 288, 288, 288, 289, 290, 290, 291, 291, - 291, 291, 291, 291, 291, 292, 292, 293, 293, 294, - 294, 295, 296, 296, 297, 297, 298, 298, 298, 299, - 299, 300, 301, 302, 303, 303, 304, 305, 305, 306, - 306, 307, 308, 309, 310, 310, 311, 312, 312, 313, - 314, 314, 314, 314, 314 + 0, 218, 219, 220, 220, 220, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 222, 223, 223, 223, 223, 223, 224, 224, 225, 226, + 226, 227, 227, 228, 228, 228, 229, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 231, 231, 232, 232, + 232, 232, 232, 232, 233, 234, 235, 236, 236, 237, + 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 239, 239, 240, 240, 241, 241, 241, 241, + 241, 242, 243, 243, 244, 244, 244, 244, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 246, 246, 247, + 247, 247, 248, 248, 249, 249, 249, 249, 249, 249, + 249, 249, 250, 250, 251, 251, 251, 251, 252, 252, + 253, 253, 254, 254, 254, 254, 254, 254, 254, 255, + 255, 255, 255, 255, 255, 255, 255, 256, 256, 257, + 257, 257, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 259, + 259, 260, 261, 261, 261, 262, 262, 263, 264, 264, + 264, 264, 264, 264, 264, 264, 265, 266, 266, 267, + 267, 267, 267, 267, 268, 268, 268, 269, 269, 269, + 269, 270, 271, 271, 272, 273, 273, 273, 274, 274, + 275, 275, 276, 276, 277, 277, 277, 277, 277, 277, + 278, 278, 278, 278, 278, 278, 279, 280, 280, 281, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 284, 284, 284, 285, + 285, 286, 286, 286, 287, 288, 288, 288, 289, 289, + 289, 290, 290, 291, 292, 292, 293, 294, 294, 295, + 295, 296, 296, 297, 297, 298, 299, 299, 300, 300, + 301, 301, 301, 301, 302, 302, 302, 303, 304, 304, + 305, 305, 305, 305, 305, 305, 305, 306, 306, 307, + 307, 308, 308, 309, 310, 310, 311, 311, 312, 312, + 312, 313, 313, 314, 315, 316, 317, 317, 318, 319, + 319, 320, 320, 321, 322, 323, 324, 324, 325, 326, + 326, 327, 328, 328, 328, 328, 328 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1422,35 +1471,36 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, + 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 2, 1, 1, 1, 1, 1, - 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 2, 2, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 4, 6, 4, 5, 5, 4, 0, 2, 0, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, - 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 1, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, - 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, + 2, 2, 0, 2, 2, 2, 1, 1, 1, 1, + 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 3, 1, 2, 2, 2, 2, 3, + 2, 4, 6, 4, 5, 5, 4, 0, 2, 0, + 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 2, 1, 2, + 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 4, 1, 0, 0, 2, 2, - 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, - 1, 5, 2, 1, 2, 1, 1, 1, 1, 1, - 1, 2, 5, 1, 3, 2, 3, 1, 1, 2, - 1, 5, 4, 3, 2, 1, 6, 3, 2, 3, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 3, 3, 1, 2, + 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, + 0, 0, 2, 4, 1, 1, 4, 1, 0, 0, + 2, 2, 2, 2, 1, 1, 3, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, + 1, 1, 1, 5, 2, 1, 2, 1, 1, 1, + 1, 1, 1, 2, 5, 1, 3, 2, 3, 1, + 1, 2, 1, 5, 4, 3, 2, 1, 6, 3, + 2, 3, 1, 1, 1, 1, 1 }; @@ -2127,7 +2177,7 @@ yyreduce: switch (yyn) { case 5: -#line 385 "ntp_parser.y" /* yacc.c:1646 */ +#line 398 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { /* I will need to incorporate much more fine grained * error messages. The following should suffice for @@ -2140,85 +2190,85 @@ yyreduce: ip_ctx->errpos.nline, ip_ctx->errpos.ncol); } -#line 2144 "ntp_parser.c" /* yacc.c:1646 */ +#line 2194 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 20: -#line 421 "ntp_parser.y" /* yacc.c:1646 */ +#line 434 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { peer_node *my_node; my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.peers, my_node); } -#line 2155 "ntp_parser.c" /* yacc.c:1646 */ +#line 2205 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 27: -#line 440 "ntp_parser.y" /* yacc.c:1646 */ +#line 453 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); } -#line 2161 "ntp_parser.c" /* yacc.c:1646 */ +#line 2211 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 28: -#line 445 "ntp_parser.y" /* yacc.c:1646 */ +#line 458 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); } -#line 2167 "ntp_parser.c" /* yacc.c:1646 */ +#line 2217 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 29: -#line 450 "ntp_parser.y" /* yacc.c:1646 */ +#line 463 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = AF_INET; } -#line 2173 "ntp_parser.c" /* yacc.c:1646 */ +#line 2223 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 30: -#line 452 "ntp_parser.y" /* yacc.c:1646 */ +#line 465 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = AF_INET6; } -#line 2179 "ntp_parser.c" /* yacc.c:1646 */ +#line 2229 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 31: -#line 457 "ntp_parser.y" /* yacc.c:1646 */ +#line 470 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2185 "ntp_parser.c" /* yacc.c:1646 */ +#line 2235 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 32: -#line 459 "ntp_parser.y" /* yacc.c:1646 */ +#line 472 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2194 "ntp_parser.c" /* yacc.c:1646 */ +#line 2244 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 36: -#line 473 "ntp_parser.y" /* yacc.c:1646 */ +#line 486 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2200 "ntp_parser.c" /* yacc.c:1646 */ +#line 2250 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 45: -#line 489 "ntp_parser.y" /* yacc.c:1646 */ + case 46: +#line 503 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2206 "ntp_parser.c" /* yacc.c:1646 */ +#line 2256 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 46: -#line 491 "ntp_parser.y" /* yacc.c:1646 */ + case 47: +#line 505 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2212 "ntp_parser.c" /* yacc.c:1646 */ +#line 2262 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 53: -#line 505 "ntp_parser.y" /* yacc.c:1646 */ + case 54: +#line 519 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2218 "ntp_parser.c" /* yacc.c:1646 */ +#line 2268 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 55: -#line 519 "ntp_parser.y" /* yacc.c:1646 */ + case 56: +#line 533 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { unpeer_node *my_node; @@ -2226,85 +2276,85 @@ yyreduce: if (my_node) APPEND_G_FIFO(cfgt.unpeers, my_node); } -#line 2230 "ntp_parser.c" /* yacc.c:1646 */ +#line 2280 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 58: -#line 540 "ntp_parser.y" /* yacc.c:1646 */ + case 59: +#line 554 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.broadcastclient = 1; } -#line 2236 "ntp_parser.c" /* yacc.c:1646 */ +#line 2286 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 59: -#line 542 "ntp_parser.y" /* yacc.c:1646 */ + case 60: +#line 556 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); } -#line 2242 "ntp_parser.c" /* yacc.c:1646 */ +#line 2292 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 60: -#line 544 "ntp_parser.y" /* yacc.c:1646 */ + case 61: +#line 558 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); } -#line 2248 "ntp_parser.c" /* yacc.c:1646 */ +#line 2298 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 61: -#line 546 "ntp_parser.y" /* yacc.c:1646 */ + case 62: +#line 560 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.mdnstries = (yyvsp[0].Integer); } -#line 2254 "ntp_parser.c" /* yacc.c:1646 */ +#line 2304 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 62: -#line 557 "ntp_parser.y" /* yacc.c:1646 */ + case 63: +#line 571 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { attr_val *atrv; atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); APPEND_G_FIFO(cfgt.vars, atrv); } -#line 2265 "ntp_parser.c" /* yacc.c:1646 */ +#line 2315 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 63: -#line 564 "ntp_parser.y" /* yacc.c:1646 */ + case 64: +#line 578 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.control_key = (yyvsp[0].Integer); } -#line 2271 "ntp_parser.c" /* yacc.c:1646 */ +#line 2321 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 64: -#line 566 "ntp_parser.y" /* yacc.c:1646 */ + case 65: +#line 580 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.cryptosw++; CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo)); } -#line 2280 "ntp_parser.c" /* yacc.c:1646 */ +#line 2330 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 65: -#line 571 "ntp_parser.y" /* yacc.c:1646 */ + case 66: +#line 585 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.keys = (yyvsp[0].String); } -#line 2286 "ntp_parser.c" /* yacc.c:1646 */ +#line 2336 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 66: -#line 573 "ntp_parser.y" /* yacc.c:1646 */ + case 67: +#line 587 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.keysdir = (yyvsp[0].String); } -#line 2292 "ntp_parser.c" /* yacc.c:1646 */ +#line 2342 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 67: -#line 575 "ntp_parser.y" /* yacc.c:1646 */ + case 68: +#line 589 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.request_key = (yyvsp[0].Integer); } -#line 2298 "ntp_parser.c" /* yacc.c:1646 */ +#line 2348 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 68: -#line 577 "ntp_parser.y" /* yacc.c:1646 */ + case 69: +#line 591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.revoke = (yyvsp[0].Integer); } -#line 2304 "ntp_parser.c" /* yacc.c:1646 */ +#line 2354 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 69: -#line 579 "ntp_parser.y" /* yacc.c:1646 */ + case 70: +#line 593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { /* [Bug 948] leaves it open if appending or * replacing the trusted key list is the right @@ -2314,38 +2364,38 @@ yyreduce: DESTROY_G_FIFO(cfgt.auth.trusted_key_list, destroy_attr_val); /* remove for append */ CONCAT_G_FIFOS(cfgt.auth.trusted_key_list, (yyvsp[0].Attr_val_fifo)); } -#line 2318 "ntp_parser.c" /* yacc.c:1646 */ +#line 2368 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 70: -#line 589 "ntp_parser.y" /* yacc.c:1646 */ + case 71: +#line 603 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.ntp_signd_socket = (yyvsp[0].String); } -#line 2324 "ntp_parser.c" /* yacc.c:1646 */ +#line 2374 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 71: -#line 594 "ntp_parser.y" /* yacc.c:1646 */ + case 72: +#line 608 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2330 "ntp_parser.c" /* yacc.c:1646 */ +#line 2380 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 72: -#line 596 "ntp_parser.y" /* yacc.c:1646 */ + case 73: +#line 610 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2339 "ntp_parser.c" /* yacc.c:1646 */ +#line 2389 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 73: -#line 604 "ntp_parser.y" /* yacc.c:1646 */ + case 74: +#line 618 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2345 "ntp_parser.c" /* yacc.c:1646 */ +#line 2395 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 74: -#line 606 "ntp_parser.y" /* yacc.c:1646 */ + case 75: +#line 620 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = NULL; cfgt.auth.revoke = (yyvsp[0].Integer); @@ -2354,65 +2404,65 @@ yyreduce: "please use 'revoke %d' instead.", cfgt.auth.revoke, cfgt.auth.revoke); } -#line 2358 "ntp_parser.c" /* yacc.c:1646 */ +#line 2408 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 80: -#line 631 "ntp_parser.y" /* yacc.c:1646 */ + case 81: +#line 645 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); } -#line 2364 "ntp_parser.c" /* yacc.c:1646 */ +#line 2414 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 81: -#line 636 "ntp_parser.y" /* yacc.c:1646 */ + case 82: +#line 650 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2373 "ntp_parser.c" /* yacc.c:1646 */ +#line 2423 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 82: -#line 641 "ntp_parser.y" /* yacc.c:1646 */ + case 83: +#line 655 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2382 "ntp_parser.c" /* yacc.c:1646 */ +#line 2432 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 83: -#line 649 "ntp_parser.y" /* yacc.c:1646 */ + case 84: +#line 663 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); } -#line 2388 "ntp_parser.c" /* yacc.c:1646 */ +#line 2438 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 84: -#line 651 "ntp_parser.y" /* yacc.c:1646 */ + case 85: +#line 665 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2394 "ntp_parser.c" /* yacc.c:1646 */ +#line 2444 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 85: -#line 653 "ntp_parser.y" /* yacc.c:1646 */ + case 86: +#line 667 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); } -#line 2400 "ntp_parser.c" /* yacc.c:1646 */ +#line 2450 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 86: -#line 655 "ntp_parser.y" /* yacc.c:1646 */ + case 87: +#line 669 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Basedate, (yyvsp[0].Integer)); } -#line 2406 "ntp_parser.c" /* yacc.c:1646 */ +#line 2456 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 98: -#line 682 "ntp_parser.y" /* yacc.c:1646 */ + case 99: +#line 696 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); } -#line 2412 "ntp_parser.c" /* yacc.c:1646 */ +#line 2462 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 99: -#line 684 "ntp_parser.y" /* yacc.c:1646 */ + case 100: +#line 698 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { cfgt.stats_dir = (yyvsp[0].String); @@ -2421,55 +2471,55 @@ yyreduce: yyerror("statsdir remote configuration ignored"); } } -#line 2425 "ntp_parser.c" /* yacc.c:1646 */ +#line 2475 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 100: -#line 693 "ntp_parser.y" /* yacc.c:1646 */ + case 101: +#line 707 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { filegen_node *fgn; fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.filegen_opts, fgn); } -#line 2436 "ntp_parser.c" /* yacc.c:1646 */ +#line 2486 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 101: -#line 703 "ntp_parser.y" /* yacc.c:1646 */ + case 102: +#line 717 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 2445 "ntp_parser.c" /* yacc.c:1646 */ +#line 2495 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 102: -#line 708 "ntp_parser.y" /* yacc.c:1646 */ + case 103: +#line 722 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 2454 "ntp_parser.c" /* yacc.c:1646 */ +#line 2504 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 111: -#line 727 "ntp_parser.y" /* yacc.c:1646 */ + case 112: +#line 741 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2460 "ntp_parser.c" /* yacc.c:1646 */ +#line 2510 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 112: -#line 729 "ntp_parser.y" /* yacc.c:1646 */ + case 113: +#line 743 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2469 "ntp_parser.c" /* yacc.c:1646 */ +#line 2519 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 113: -#line 737 "ntp_parser.y" /* yacc.c:1646 */ + case 114: +#line 751 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); @@ -2479,11 +2529,11 @@ yyreduce: yyerror("filegen file remote config ignored"); } } -#line 2483 "ntp_parser.c" /* yacc.c:1646 */ +#line 2533 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 114: -#line 747 "ntp_parser.y" /* yacc.c:1646 */ + case 115: +#line 761 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); @@ -2492,11 +2542,11 @@ yyreduce: yyerror("filegen type remote config ignored"); } } -#line 2496 "ntp_parser.c" /* yacc.c:1646 */ +#line 2546 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 115: -#line 756 "ntp_parser.y" /* yacc.c:1646 */ + case 116: +#line 770 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { const char *err; @@ -2511,69 +2561,69 @@ yyreduce: yyerror(err); } } -#line 2515 "ntp_parser.c" /* yacc.c:1646 */ +#line 2565 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 116: -#line 771 "ntp_parser.y" /* yacc.c:1646 */ + case 117: +#line 785 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2521 "ntp_parser.c" /* yacc.c:1646 */ +#line 2571 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 128: -#line 801 "ntp_parser.y" /* yacc.c:1646 */ + case 129: +#line 815 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2529 "ntp_parser.c" /* yacc.c:1646 */ +#line 2579 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 129: -#line 805 "ntp_parser.y" /* yacc.c:1646 */ + case 130: +#line 819 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2537 "ntp_parser.c" /* yacc.c:1646 */ +#line 2587 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 130: -#line 809 "ntp_parser.y" /* yacc.c:1646 */ + case 131: +#line 823 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; - rn = create_restrict_node((yyvsp[-2].Address_node), NULL, (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), + rn = create_restrict_node((yyvsp[-2].Address_node), NULL, (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2549 "ntp_parser.c" /* yacc.c:1646 */ +#line 2599 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 131: -#line 817 "ntp_parser.y" /* yacc.c:1646 */ + case 132: +#line 831 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; - rn = create_restrict_node((yyvsp[-4].Address_node), (yyvsp[-2].Address_node), (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), + rn = create_restrict_node((yyvsp[-4].Address_node), (yyvsp[-2].Address_node), (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2561 "ntp_parser.c" /* yacc.c:1646 */ +#line 2611 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 132: -#line 825 "ntp_parser.y" /* yacc.c:1646 */ + case 133: +#line 839 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; - rn = create_restrict_node(NULL, NULL, (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), + rn = create_restrict_node(NULL, NULL, (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2573 "ntp_parser.c" /* yacc.c:1646 */ +#line 2623 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 133: -#line 833 "ntp_parser.y" /* yacc.c:1646 */ + case 134: +#line 847 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2584,15 +2634,15 @@ yyreduce: create_address_node( estrdup("0.0.0.0"), AF_INET), - (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), + (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2592 "ntp_parser.c" /* yacc.c:1646 */ +#line 2642 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 134: -#line 848 "ntp_parser.y" /* yacc.c:1646 */ + case 135: +#line 862 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2603,34 +2653,34 @@ yyreduce: create_address_node( estrdup("::"), AF_INET6), - (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), + (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2611 "ntp_parser.c" /* yacc.c:1646 */ +#line 2661 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 135: -#line 863 "ntp_parser.y" /* yacc.c:1646 */ + case 136: +#line 877 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { restrict_node * rn; - APPEND_G_FIFO((yyvsp[0].Int_fifo), create_int_node((yyvsp[-2].Integer))); + APPEND_G_FIFO((yyvsp[0].Attr_val_fifo), create_attr_ival((yyvsp[-2].Integer), 1)); rn = create_restrict_node( - NULL, NULL, (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), lex_current()->curpos.nline); + NULL, NULL, (yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo), lex_current()->curpos.nline); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2624 "ntp_parser.c" /* yacc.c:1646 */ +#line 2674 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 136: -#line 875 "ntp_parser.y" /* yacc.c:1646 */ + case 137: +#line 889 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = -1; } -#line 2630 "ntp_parser.c" /* yacc.c:1646 */ +#line 2680 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 137: -#line 877 "ntp_parser.y" /* yacc.c:1646 */ + case 138: +#line 891 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (((yyvsp[0].Integer) < -1) || ((yyvsp[0].Integer) > 100)) { struct FILE_INFO * ip_ctx; @@ -2646,115 +2696,130 @@ yyreduce: } (yyval.Integer) = (yyvsp[0].Integer); } -#line 2650 "ntp_parser.c" /* yacc.c:1646 */ +#line 2700 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 138: -#line 896 "ntp_parser.y" /* yacc.c:1646 */ - { (yyval.Int_fifo) = NULL; } -#line 2656 "ntp_parser.c" /* yacc.c:1646 */ + case 139: +#line 910 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val_fifo) = NULL; } +#line 2706 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 139: -#line 898 "ntp_parser.y" /* yacc.c:1646 */ + case 140: +#line 912 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { - (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); - APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); + attr_val *av; + + (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); + av = create_attr_ival((yyvsp[0].Integer), 1); + APPEND_G_FIFO((yyval.Attr_val_fifo), av); } -#line 2665 "ntp_parser.c" /* yacc.c:1646 */ +#line 2718 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 157: -#line 926 "ntp_parser.y" /* yacc.c:1646 */ + case 141: +#line 920 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { + attr_val *av; + + (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo); + av = create_attr_ival(T_ServerresponseFuzz, 1); + APPEND_G_FIFO((yyval.Attr_val_fifo), av); + } +#line 2730 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 159: +#line 951 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2674 "ntp_parser.c" /* yacc.c:1646 */ +#line 2739 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 158: -#line 931 "ntp_parser.y" /* yacc.c:1646 */ + case 160: +#line 956 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2683 "ntp_parser.c" /* yacc.c:1646 */ +#line 2748 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 159: -#line 939 "ntp_parser.y" /* yacc.c:1646 */ + case 161: +#line 964 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2689 "ntp_parser.c" /* yacc.c:1646 */ +#line 2754 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 163: -#line 950 "ntp_parser.y" /* yacc.c:1646 */ + case 165: +#line 975 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2698 "ntp_parser.c" /* yacc.c:1646 */ +#line 2763 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 164: -#line 955 "ntp_parser.y" /* yacc.c:1646 */ + case 166: +#line 980 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2707 "ntp_parser.c" /* yacc.c:1646 */ +#line 2772 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 165: -#line 963 "ntp_parser.y" /* yacc.c:1646 */ + case 167: +#line 988 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2713 "ntp_parser.c" /* yacc.c:1646 */ +#line 2778 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 174: -#line 983 "ntp_parser.y" /* yacc.c:1646 */ + case 176: +#line 1008 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { addr_opts_node *aon; aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.fudge, aon); } -#line 2724 "ntp_parser.c" /* yacc.c:1646 */ +#line 2789 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 175: -#line 993 "ntp_parser.y" /* yacc.c:1646 */ + case 177: +#line 1018 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2733 "ntp_parser.c" /* yacc.c:1646 */ +#line 2798 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 176: -#line 998 "ntp_parser.y" /* yacc.c:1646 */ + case 178: +#line 1023 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2742 "ntp_parser.c" /* yacc.c:1646 */ +#line 2807 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 177: -#line 1006 "ntp_parser.y" /* yacc.c:1646 */ + case 179: +#line 1031 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2748 "ntp_parser.c" /* yacc.c:1646 */ +#line 2813 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 178: -#line 1008 "ntp_parser.y" /* yacc.c:1646 */ + case 180: +#line 1033 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2754 "ntp_parser.c" /* yacc.c:1646 */ +#line 2819 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 179: -#line 1010 "ntp_parser.y" /* yacc.c:1646 */ + case 181: +#line 1035 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if ((yyvsp[0].Integer) >= 0 && (yyvsp[0].Integer) <= 16) { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); @@ -2763,89 +2828,89 @@ yyreduce: yyerror("fudge factor: stratum value not in [0..16], ignored"); } } -#line 2767 "ntp_parser.c" /* yacc.c:1646 */ +#line 2832 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 180: -#line 1019 "ntp_parser.y" /* yacc.c:1646 */ + case 182: +#line 1044 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2773 "ntp_parser.c" /* yacc.c:1646 */ +#line 2838 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 181: -#line 1021 "ntp_parser.y" /* yacc.c:1646 */ + case 183: +#line 1046 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2779 "ntp_parser.c" /* yacc.c:1646 */ +#line 2844 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 188: -#line 1042 "ntp_parser.y" /* yacc.c:1646 */ + case 191: +#line 1068 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); } -#line 2785 "ntp_parser.c" /* yacc.c:1646 */ +#line 2850 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 189: -#line 1047 "ntp_parser.y" /* yacc.c:1646 */ + case 192: +#line 1073 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2794 "ntp_parser.c" /* yacc.c:1646 */ +#line 2859 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 190: -#line 1052 "ntp_parser.y" /* yacc.c:1646 */ + case 193: +#line 1078 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2803 "ntp_parser.c" /* yacc.c:1646 */ +#line 2868 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 191: -#line 1060 "ntp_parser.y" /* yacc.c:1646 */ + case 194: +#line 1086 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2809 "ntp_parser.c" /* yacc.c:1646 */ +#line 2874 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 195: -#line 1076 "ntp_parser.y" /* yacc.c:1646 */ + case 198: +#line 1102 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2815 "ntp_parser.c" /* yacc.c:1646 */ +#line 2880 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 196: -#line 1078 "ntp_parser.y" /* yacc.c:1646 */ + case 199: +#line 1104 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2821 "ntp_parser.c" /* yacc.c:1646 */ +#line 2886 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 197: -#line 1083 "ntp_parser.y" /* yacc.c:1646 */ + case 200: +#line 1109 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2830 "ntp_parser.c" /* yacc.c:1646 */ +#line 2895 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 198: -#line 1088 "ntp_parser.y" /* yacc.c:1646 */ + case 201: +#line 1114 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2839 "ntp_parser.c" /* yacc.c:1646 */ +#line 2904 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 199: -#line 1096 "ntp_parser.y" /* yacc.c:1646 */ + case 202: +#line 1122 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2845 "ntp_parser.c" /* yacc.c:1646 */ +#line 2910 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 200: -#line 1098 "ntp_parser.y" /* yacc.c:1646 */ + case 203: +#line 1124 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); @@ -2859,74 +2924,74 @@ yyreduce: yyerror(err_str); } } -#line 2863 "ntp_parser.c" /* yacc.c:1646 */ +#line 2928 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 213: -#line 1137 "ntp_parser.y" /* yacc.c:1646 */ + case 216: +#line 1163 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); } -#line 2869 "ntp_parser.c" /* yacc.c:1646 */ +#line 2934 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 214: -#line 1142 "ntp_parser.y" /* yacc.c:1646 */ + case 217: +#line 1168 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2878 "ntp_parser.c" /* yacc.c:1646 */ +#line 2943 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 215: -#line 1147 "ntp_parser.y" /* yacc.c:1646 */ + case 218: +#line 1173 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2887 "ntp_parser.c" /* yacc.c:1646 */ +#line 2952 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 216: -#line 1155 "ntp_parser.y" /* yacc.c:1646 */ + case 219: +#line 1181 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2893 "ntp_parser.c" /* yacc.c:1646 */ +#line 2958 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 229: -#line 1180 "ntp_parser.y" /* yacc.c:1646 */ + case 232: +#line 1206 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2904 "ntp_parser.c" /* yacc.c:1646 */ +#line 2969 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 230: -#line 1187 "ntp_parser.y" /* yacc.c:1646 */ + case 233: +#line 1213 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2915 "ntp_parser.c" /* yacc.c:1646 */ +#line 2980 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 231: -#line 1194 "ntp_parser.y" /* yacc.c:1646 */ + case 234: +#line 1220 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2926 "ntp_parser.c" /* yacc.c:1646 */ +#line 2991 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 232: -#line 1201 "ntp_parser.y" /* yacc.c:1646 */ + case 235: +#line 1227 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { char error_text[64]; attr_val *av; @@ -2942,11 +3007,11 @@ yyreduce: yyerror(error_text); } } -#line 2946 "ntp_parser.c" /* yacc.c:1646 */ +#line 3011 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 233: -#line 1217 "ntp_parser.y" /* yacc.c:1646 */ + case 236: +#line 1243 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (!lex_from_file()) { YYFREE((yyvsp[-1].String)); /* avoid leak */ @@ -2965,68 +3030,104 @@ yyreduce: } YYFREE((yyvsp[-1].String)); /* avoid leak */ } -#line 2969 "ntp_parser.c" /* yacc.c:1646 */ +#line 3034 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 234: -#line 1236 "ntp_parser.y" /* yacc.c:1646 */ + case 237: +#line 1262 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { + attr_val *av; + + av = create_attr_sval((yyvsp[-2].Integer), (yyvsp[-1].String)); + av->flag = (yyvsp[0].Integer); + APPEND_G_FIFO(cfgt.vars, av); + } +#line 3046 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 238: +#line 1270 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { lex_flush_stack(); } -#line 2975 "ntp_parser.c" /* yacc.c:1646 */ +#line 3052 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 235: -#line 1238 "ntp_parser.y" /* yacc.c:1646 */ + case 239: +#line 1272 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { /* see drift_parm below for actions */ } -#line 2981 "ntp_parser.c" /* yacc.c:1646 */ +#line 3058 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 236: -#line 1240 "ntp_parser.y" /* yacc.c:1646 */ + case 240: +#line 1274 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); } -#line 2987 "ntp_parser.c" /* yacc.c:1646 */ +#line 3064 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 237: -#line 1242 "ntp_parser.y" /* yacc.c:1646 */ + case 241: +#line 1276 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); } -#line 2993 "ntp_parser.c" /* yacc.c:1646 */ +#line 3070 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 238: -#line 1244 "ntp_parser.y" /* yacc.c:1646 */ + case 242: +#line 1278 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { CONCAT_G_FIFOS(cfgt.pollskewlist, (yyvsp[0].Attr_val_fifo)); } +#line 3076 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 243: +#line 1280 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); } -#line 2999 "ntp_parser.c" /* yacc.c:1646 */ +#line 3082 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 239: -#line 1246 "ntp_parser.y" /* yacc.c:1646 */ + case 244: +#line 1282 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { addr_opts_node *aon; aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.trap, aon); } -#line 3010 "ntp_parser.c" /* yacc.c:1646 */ +#line 3093 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 240: -#line 1253 "ntp_parser.y" /* yacc.c:1646 */ + case 245: +#line 1289 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); } -#line 3016 "ntp_parser.c" /* yacc.c:1646 */ +#line 3099 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 245: -#line 1268 "ntp_parser.y" /* yacc.c:1646 */ + case 250: +#line 1304 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { #ifndef LEAP_SMEAR yyerror("Built without LEAP_SMEAR support."); #endif } -#line 3026 "ntp_parser.c" /* yacc.c:1646 */ +#line 3109 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; case 251: -#line 1288 "ntp_parser.y" /* yacc.c:1646 */ +#line 1313 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Integer) = FALSE; } +#line 3115 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 252: +#line 1315 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Integer) = TRUE; } +#line 3121 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 253: +#line 1317 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Integer) = TRUE; } +#line 3127 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 258: +#line 1332 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { attr_val *av; @@ -3037,11 +3138,11 @@ yyreduce: yyerror("driftfile remote configuration ignored"); } } -#line 3041 "ntp_parser.c" /* yacc.c:1646 */ +#line 3142 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 252: -#line 1299 "ntp_parser.y" /* yacc.c:1646 */ + case 259: +#line 1343 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { attr_val *av; @@ -3058,11 +3159,11 @@ yyreduce: yyerror("driftfile remote configuration ignored"); } } -#line 3062 "ntp_parser.c" /* yacc.c:1646 */ +#line 3163 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 253: -#line 1316 "ntp_parser.y" /* yacc.c:1646 */ + case 260: +#line 1360 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if (lex_from_file()) { attr_val *av; @@ -3072,71 +3173,122 @@ yyreduce: yyerror("driftfile remote configuration ignored"); } } -#line 3076 "ntp_parser.c" /* yacc.c:1646 */ +#line 3177 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 261: +#line 1373 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val_fifo) = NULL; } +#line 3183 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 254: -#line 1329 "ntp_parser.y" /* yacc.c:1646 */ + case 262: +#line 1375 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val_fifo) = append_gen_fifo((yyvsp[-1].Attr_val_fifo), (yyvsp[0].Attr_val)); } +#line 3189 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 263: +#line 1380 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { + if ((yyvsp[-2].Integer) < 0 || (yyvsp[0].Integer) < 0) { + /* bad numbers */ + yyerror("pollskewlist: skew values must be >=0"); + destroy_attr_val((yyvsp[-3].Attr_val)); + (yyvsp[-3].Attr_val) = NULL; + } else if ((yyvsp[-3].Attr_val) == NULL) { + yyerror("pollskewlist: poll value must be 3-17, inclusive"); + } else if ((yyvsp[-3].Attr_val)->attr <= 0) { + /* process default range */ + (yyvsp[-3].Attr_val)->value.r.first = (yyvsp[-2].Integer); + (yyvsp[-3].Attr_val)->value.r.last = (yyvsp[0].Integer); + } else if ((yyvsp[-2].Integer) < (1 << ((yyvsp[-3].Attr_val)->attr - 1)) && (yyvsp[0].Integer) < (1 << ((yyvsp[-3].Attr_val)->attr - 1))) { + (yyvsp[-3].Attr_val)->value.r.first = (yyvsp[-2].Integer); + (yyvsp[-3].Attr_val)->value.r.last = (yyvsp[0].Integer); + } else { + yyerror("pollskewlist: randomization limit must be <= half the poll interval"); + destroy_attr_val((yyvsp[-3].Attr_val)); + (yyvsp[-3].Attr_val) = NULL; + } + (yyval.Attr_val) = (yyvsp[-3].Attr_val); + } +#line 3216 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 264: +#line 1405 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val) = ((yyvsp[0].Integer) >= 3 && (yyvsp[0].Integer) <= 17) ? create_attr_rval((yyvsp[0].Integer), 0, 0) : NULL; } +#line 3222 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 265: +#line 1406 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val) = create_attr_rval(-1, 0, 0); } +#line 3228 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ + break; + + case 266: +#line 1412 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); } -#line 3082 "ntp_parser.c" /* yacc.c:1646 */ +#line 3234 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 256: -#line 1335 "ntp_parser.y" /* yacc.c:1646 */ + case 268: +#line 1418 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = 0; } -#line 3088 "ntp_parser.c" /* yacc.c:1646 */ +#line 3240 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 257: -#line 1340 "ntp_parser.y" /* yacc.c:1646 */ + case 269: +#line 1423 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 3094 "ntp_parser.c" /* yacc.c:1646 */ +#line 3246 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 258: -#line 1342 "ntp_parser.y" /* yacc.c:1646 */ + case 270: +#line 1425 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3103 "ntp_parser.c" /* yacc.c:1646 */ +#line 3255 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 259: -#line 1350 "ntp_parser.y" /* yacc.c:1646 */ + case 271: +#line 1433 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 3109 "ntp_parser.c" /* yacc.c:1646 */ +#line 3261 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 260: -#line 1352 "ntp_parser.y" /* yacc.c:1646 */ + case 272: +#line 1435 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address)); destroy_address_node((yyvsp[0].Address_node)); } -#line 3118 "ntp_parser.c" /* yacc.c:1646 */ +#line 3270 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 261: -#line 1360 "ntp_parser.y" /* yacc.c:1646 */ + case 273: +#line 1443 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3127 "ntp_parser.c" /* yacc.c:1646 */ +#line 3279 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 262: -#line 1365 "ntp_parser.y" /* yacc.c:1646 */ + case 274: +#line 1448 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3136 "ntp_parser.c" /* yacc.c:1646 */ +#line 3288 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 263: -#line 1373 "ntp_parser.y" /* yacc.c:1646 */ + case 275: +#line 1456 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { char prefix; char * type; @@ -3158,141 +3310,141 @@ yyreduce: (yyval.Attr_val) = create_attr_sval(prefix, estrdup(type)); YYFREE((yyvsp[0].String)); } -#line 3162 "ntp_parser.c" /* yacc.c:1646 */ +#line 3314 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 264: -#line 1398 "ntp_parser.y" /* yacc.c:1646 */ + case 276: +#line 1481 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { nic_rule_node *nrn; nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer)); APPEND_G_FIFO(cfgt.nic_rules, nrn); } -#line 3173 "ntp_parser.c" /* yacc.c:1646 */ +#line 3325 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 265: -#line 1405 "ntp_parser.y" /* yacc.c:1646 */ + case 277: +#line 1488 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { nic_rule_node *nrn; nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer)); APPEND_G_FIFO(cfgt.nic_rules, nrn); } -#line 3184 "ntp_parser.c" /* yacc.c:1646 */ +#line 3336 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 275: -#line 1433 "ntp_parser.y" /* yacc.c:1646 */ + case 287: +#line 1516 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); } -#line 3190 "ntp_parser.c" /* yacc.c:1646 */ +#line 3342 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 276: -#line 1438 "ntp_parser.y" /* yacc.c:1646 */ + case 288: +#line 1521 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3199 "ntp_parser.c" /* yacc.c:1646 */ +#line 3351 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 277: -#line 1443 "ntp_parser.y" /* yacc.c:1646 */ + case 289: +#line 1526 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3208 "ntp_parser.c" /* yacc.c:1646 */ +#line 3360 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 285: -#line 1467 "ntp_parser.y" /* yacc.c:1646 */ + case 297: +#line 1550 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3217 "ntp_parser.c" /* yacc.c:1646 */ +#line 3369 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 286: -#line 1472 "ntp_parser.y" /* yacc.c:1646 */ + case 298: +#line 1555 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3226 "ntp_parser.c" /* yacc.c:1646 */ +#line 3378 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 287: -#line 1480 "ntp_parser.y" /* yacc.c:1646 */ + case 299: +#line 1563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3235 "ntp_parser.c" /* yacc.c:1646 */ +#line 3387 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 288: -#line 1485 "ntp_parser.y" /* yacc.c:1646 */ + case 300: +#line 1568 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3244 "ntp_parser.c" /* yacc.c:1646 */ +#line 3396 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 289: -#line 1493 "ntp_parser.y" /* yacc.c:1646 */ + case 301: +#line 1576 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); } -#line 3250 "ntp_parser.c" /* yacc.c:1646 */ +#line 3402 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 291: -#line 1499 "ntp_parser.y" /* yacc.c:1646 */ - { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); } -#line 3256 "ntp_parser.c" /* yacc.c:1646 */ + case 303: +#line 1582 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Attr_val) = create_attr_rval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); } +#line 3408 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 292: -#line 1504 "ntp_parser.y" /* yacc.c:1646 */ + case 304: +#line 1587 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.String_fifo) = (yyvsp[-1].String_fifo); APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String))); } -#line 3265 "ntp_parser.c" /* yacc.c:1646 */ +#line 3417 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 293: -#line 1509 "ntp_parser.y" /* yacc.c:1646 */ + case 305: +#line 1592 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.String_fifo) = NULL; APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String))); } -#line 3274 "ntp_parser.c" /* yacc.c:1646 */ +#line 3426 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 294: -#line 1517 "ntp_parser.y" /* yacc.c:1646 */ + case 306: +#line 1600 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_fifo) = (yyvsp[-1].Address_fifo); APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node)); } -#line 3283 "ntp_parser.c" /* yacc.c:1646 */ +#line 3435 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 295: -#line 1522 "ntp_parser.y" /* yacc.c:1646 */ + case 307: +#line 1605 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_fifo) = NULL; APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node)); } -#line 3292 "ntp_parser.c" /* yacc.c:1646 */ +#line 3444 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 296: -#line 1530 "ntp_parser.y" /* yacc.c:1646 */ + case 308: +#line 1613 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) { yyerror("Integer value is not boolean (0 or 1). Assuming 1"); @@ -3301,35 +3453,35 @@ yyreduce: (yyval.Integer) = (yyvsp[0].Integer); } } -#line 3305 "ntp_parser.c" /* yacc.c:1646 */ +#line 3457 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 297: -#line 1538 "ntp_parser.y" /* yacc.c:1646 */ + case 309: +#line 1621 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = 1; } -#line 3311 "ntp_parser.c" /* yacc.c:1646 */ +#line 3463 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 298: -#line 1539 "ntp_parser.y" /* yacc.c:1646 */ + case 310: +#line 1622 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = 0; } -#line 3317 "ntp_parser.c" /* yacc.c:1646 */ +#line 3469 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 299: -#line 1543 "ntp_parser.y" /* yacc.c:1646 */ + case 311: +#line 1626 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Double) = (double)(yyvsp[0].Integer); } -#line 3323 "ntp_parser.c" /* yacc.c:1646 */ +#line 3475 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 301: -#line 1549 "ntp_parser.y" /* yacc.c:1646 */ + case 313: +#line 1632 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = basedate_eval_string((yyvsp[0].String)); YYFREE((yyvsp[0].String)); } -#line 3329 "ntp_parser.c" /* yacc.c:1646 */ +#line 3481 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 302: -#line 1557 "ntp_parser.y" /* yacc.c:1646 */ + case 314: +#line 1640 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { sim_node *sn; @@ -3339,125 +3491,125 @@ yyreduce: /* Revert from ; to \n for end-of-command */ old_config_style = 1; } -#line 3343 "ntp_parser.c" /* yacc.c:1646 */ +#line 3495 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 303: -#line 1574 "ntp_parser.y" /* yacc.c:1646 */ + case 315: +#line 1657 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { old_config_style = 0; } -#line 3349 "ntp_parser.c" /* yacc.c:1646 */ +#line 3501 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 304: -#line 1579 "ntp_parser.y" /* yacc.c:1646 */ + case 316: +#line 1662 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3358 "ntp_parser.c" /* yacc.c:1646 */ +#line 3510 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 305: -#line 1584 "ntp_parser.y" /* yacc.c:1646 */ + case 317: +#line 1667 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3367 "ntp_parser.c" /* yacc.c:1646 */ +#line 3519 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 306: -#line 1592 "ntp_parser.y" /* yacc.c:1646 */ + case 318: +#line 1675 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); } -#line 3373 "ntp_parser.c" /* yacc.c:1646 */ +#line 3525 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 309: -#line 1602 "ntp_parser.y" /* yacc.c:1646 */ + case 321: +#line 1685 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo); APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server)); } -#line 3382 "ntp_parser.c" /* yacc.c:1646 */ +#line 3534 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 310: -#line 1607 "ntp_parser.y" /* yacc.c:1646 */ + case 322: +#line 1690 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server)); } -#line 3391 "ntp_parser.c" /* yacc.c:1646 */ +#line 3543 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 311: -#line 1615 "ntp_parser.y" /* yacc.c:1646 */ + case 323: +#line 1698 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[-4].Address_node), (yyvsp[-2].Double), (yyvsp[-1].Sim_script_fifo))); } -#line 3397 "ntp_parser.c" /* yacc.c:1646 */ +#line 3549 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 312: -#line 1620 "ntp_parser.y" /* yacc.c:1646 */ + case 324: +#line 1703 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Double) = (yyvsp[-1].Double); } -#line 3403 "ntp_parser.c" /* yacc.c:1646 */ +#line 3555 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 313: -#line 1625 "ntp_parser.y" /* yacc.c:1646 */ + case 325: +#line 1708 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = (yyvsp[0].Address_node); } -#line 3409 "ntp_parser.c" /* yacc.c:1646 */ +#line 3561 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 314: -#line 1630 "ntp_parser.y" /* yacc.c:1646 */ + case 326: +#line 1713 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo); APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script)); } -#line 3418 "ntp_parser.c" /* yacc.c:1646 */ +#line 3570 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 315: -#line 1635 "ntp_parser.y" /* yacc.c:1646 */ + case 327: +#line 1718 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script)); } -#line 3427 "ntp_parser.c" /* yacc.c:1646 */ +#line 3579 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 316: -#line 1643 "ntp_parser.y" /* yacc.c:1646 */ + case 328: +#line 1726 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); } -#line 3433 "ntp_parser.c" /* yacc.c:1646 */ +#line 3585 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 317: -#line 1648 "ntp_parser.y" /* yacc.c:1646 */ + case 329: +#line 1731 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3442 "ntp_parser.c" /* yacc.c:1646 */ +#line 3594 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 318: -#line 1653 "ntp_parser.y" /* yacc.c:1646 */ + case 330: +#line 1736 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3451 "ntp_parser.c" /* yacc.c:1646 */ +#line 3603 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; - case 319: -#line 1661 "ntp_parser.y" /* yacc.c:1646 */ + case 331: +#line 1744 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); } -#line 3457 "ntp_parser.c" /* yacc.c:1646 */ +#line 3609 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ break; -#line 3461 "ntp_parser.c" /* yacc.c:1646 */ +#line 3613 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3685,7 +3837,7 @@ yyreturn: #endif return yyresult; } -#line 1672 "ntp_parser.y" /* yacc.c:1906 */ +#line 1755 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */ void diff --git a/contrib/ntp/ntpd/ntp_parser.h b/contrib/ntp/ntpd/ntp_parser.h index e24b3f41c61da..d232a89a1ba4b 100644 --- a/contrib/ntp/ntpd/ntp_parser.h +++ b/contrib/ntp/ntpd/ntp_parser.h @@ -30,8 +30,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_YY_NTP_PARSER_H_INCLUDED -# define YY_YY_NTP_PARSER_H_INCLUDED +#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED +# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -64,187 +64,196 @@ extern int yydebug; T_Burst = 274, T_Calibrate = 275, T_Ceiling = 276, - T_Clockstats = 277, - T_Cohort = 278, - T_ControlKey = 279, - T_Crypto = 280, - T_Cryptostats = 281, - T_Ctl = 282, - T_Day = 283, - T_Default = 284, - T_Digest = 285, - T_Disable = 286, - T_Discard = 287, - T_Dispersion = 288, - T_Double = 289, - T_Driftfile = 290, - T_Drop = 291, - T_Dscp = 292, - T_Ellipsis = 293, - T_Enable = 294, - T_End = 295, - T_Epeer = 296, - T_False = 297, - T_File = 298, - T_Filegen = 299, - T_Filenum = 300, - T_Flag1 = 301, - T_Flag2 = 302, - T_Flag3 = 303, - T_Flag4 = 304, - T_Flake = 305, - T_Floor = 306, - T_Freq = 307, - T_Fudge = 308, - T_Host = 309, - T_Huffpuff = 310, - T_Iburst = 311, - T_Ident = 312, - T_Ignore = 313, - T_Incalloc = 314, - T_Incmem = 315, - T_Initalloc = 316, - T_Initmem = 317, - T_Includefile = 318, - T_Integer = 319, - T_Interface = 320, - T_Intrange = 321, - T_Io = 322, - T_Ippeerlimit = 323, - T_Ipv4 = 324, - T_Ipv4_flag = 325, - T_Ipv6 = 326, - T_Ipv6_flag = 327, - T_Kernel = 328, - T_Key = 329, - T_Keys = 330, - T_Keysdir = 331, - T_Kod = 332, - T_Mssntp = 333, - T_Leapfile = 334, - T_Leapsmearinterval = 335, - T_Limited = 336, - T_Link = 337, - T_Listen = 338, - T_Logconfig = 339, - T_Logfile = 340, - T_Loopstats = 341, - T_Lowpriotrap = 342, - T_Manycastclient = 343, - T_Manycastserver = 344, - T_Mask = 345, - T_Maxage = 346, - T_Maxclock = 347, - T_Maxdepth = 348, - T_Maxdist = 349, - T_Maxmem = 350, - T_Maxpoll = 351, - T_Mdnstries = 352, - T_Mem = 353, - T_Memlock = 354, - T_Minclock = 355, - T_Mindepth = 356, - T_Mindist = 357, - T_Minimum = 358, - T_Minpoll = 359, - T_Minsane = 360, - T_Mode = 361, - T_Mode7 = 362, - T_Monitor = 363, - T_Month = 364, - T_Mru = 365, - T_Multicastclient = 366, - T_Nic = 367, - T_Nolink = 368, - T_Nomodify = 369, - T_Nomrulist = 370, - T_None = 371, - T_Nonvolatile = 372, - T_Noepeer = 373, - T_Nopeer = 374, - T_Noquery = 375, - T_Noselect = 376, - T_Noserve = 377, - T_Notrap = 378, - T_Notrust = 379, - T_Ntp = 380, - T_Ntpport = 381, - T_NtpSignDsocket = 382, - T_Orphan = 383, - T_Orphanwait = 384, - T_PCEdigest = 385, - T_Panic = 386, - T_Peer = 387, - T_Peerstats = 388, - T_Phone = 389, - T_Pid = 390, - T_Pidfile = 391, - T_Pool = 392, - T_Port = 393, - T_Preempt = 394, - T_Prefer = 395, - T_Protostats = 396, - T_Pw = 397, - T_Randfile = 398, - T_Rawstats = 399, - T_Refid = 400, - T_Requestkey = 401, - T_Reset = 402, - T_Restrict = 403, - T_Revoke = 404, - T_Rlimit = 405, - T_Saveconfigdir = 406, - T_Server = 407, - T_Setvar = 408, - T_Source = 409, - T_Stacksize = 410, - T_Statistics = 411, - T_Stats = 412, - T_Statsdir = 413, - T_Step = 414, - T_Stepback = 415, - T_Stepfwd = 416, - T_Stepout = 417, - T_Stratum = 418, - T_String = 419, - T_Sys = 420, - T_Sysstats = 421, - T_Tick = 422, - T_Time1 = 423, - T_Time2 = 424, - T_Timer = 425, - T_Timingstats = 426, - T_Tinker = 427, - T_Tos = 428, - T_Trap = 429, - T_True = 430, - T_Trustedkey = 431, - T_Ttl = 432, - T_Type = 433, - T_U_int = 434, - T_UEcrypto = 435, - T_UEcryptonak = 436, - T_UEdigest = 437, - T_Unconfig = 438, - T_Unpeer = 439, - T_Version = 440, - T_WanderThreshold = 441, - T_Week = 442, - T_Wildcard = 443, - T_Xleave = 444, - T_Year = 445, - T_Flag = 446, - T_EOC = 447, - T_Simulate = 448, - T_Beep_Delay = 449, - T_Sim_Duration = 450, - T_Server_Offset = 451, - T_Duration = 452, - T_Freq_Offset = 453, - T_Wander = 454, - T_Jitter = 455, - T_Prop_Delay = 456, - T_Proc_Delay = 457 + T_Checkhash = 277, + T_Clockstats = 278, + T_Cohort = 279, + T_ControlKey = 280, + T_Crypto = 281, + T_Cryptostats = 282, + T_Ctl = 283, + T_Day = 284, + T_Default = 285, + T_Digest = 286, + T_Disable = 287, + T_Discard = 288, + T_Dispersion = 289, + T_Double = 290, + T_Driftfile = 291, + T_Drop = 292, + T_Dscp = 293, + T_Ellipsis = 294, + T_Enable = 295, + T_End = 296, + T_Epeer = 297, + T_False = 298, + T_File = 299, + T_Filegen = 300, + T_Filenum = 301, + T_Flag1 = 302, + T_Flag2 = 303, + T_Flag3 = 304, + T_Flag4 = 305, + T_Flake = 306, + T_Floor = 307, + T_Freq = 308, + T_Fudge = 309, + T_Fuzz = 310, + T_Host = 311, + T_Huffpuff = 312, + T_Iburst = 313, + T_Ident = 314, + T_Ignore = 315, + T_Ignorehash = 316, + T_Incalloc = 317, + T_Incmem = 318, + T_Initalloc = 319, + T_Initmem = 320, + T_Includefile = 321, + T_Integer = 322, + T_Interface = 323, + T_Intrange = 324, + T_Io = 325, + T_Ippeerlimit = 326, + T_Ipv4 = 327, + T_Ipv4_flag = 328, + T_Ipv6 = 329, + T_Ipv6_flag = 330, + T_Kernel = 331, + T_Key = 332, + T_Keys = 333, + T_Keysdir = 334, + T_Kod = 335, + T_Leapfile = 336, + T_Leapsmearinterval = 337, + T_Limited = 338, + T_Link = 339, + T_Listen = 340, + T_Logconfig = 341, + T_Logfile = 342, + T_Loopstats = 343, + T_Lowpriotrap = 344, + T_Manycastclient = 345, + T_Manycastserver = 346, + T_Mask = 347, + T_Maxage = 348, + T_Maxclock = 349, + T_Maxdepth = 350, + T_Maxdist = 351, + T_Maxmem = 352, + T_Maxpoll = 353, + T_Mdnstries = 354, + T_Mem = 355, + T_Memlock = 356, + T_Minclock = 357, + T_Mindepth = 358, + T_Mindist = 359, + T_Minimum = 360, + T_Minjitter = 361, + T_Minpoll = 362, + T_Minsane = 363, + T_Mode = 364, + T_Mode7 = 365, + T_Monitor = 366, + T_Month = 367, + T_Mru = 368, + T_Mssntp = 369, + T_Multicastclient = 370, + T_Nic = 371, + T_Nolink = 372, + T_Nomodify = 373, + T_Nomrulist = 374, + T_None = 375, + T_Nonvolatile = 376, + T_Noepeer = 377, + T_Nopeer = 378, + T_Noquery = 379, + T_Noselect = 380, + T_Noserve = 381, + T_Notrap = 382, + T_Notrust = 383, + T_Ntp = 384, + T_Ntpport = 385, + T_NtpSignDsocket = 386, + T_Orphan = 387, + T_Orphanwait = 388, + T_PCEdigest = 389, + T_Panic = 390, + T_Peer = 391, + T_Peerstats = 392, + T_Phone = 393, + T_Pid = 394, + T_Pidfile = 395, + T_Poll = 396, + T_PollSkewList = 397, + T_Pool = 398, + T_Port = 399, + T_Preempt = 400, + T_Prefer = 401, + T_Protostats = 402, + T_Pw = 403, + T_Randfile = 404, + T_Rawstats = 405, + T_Refid = 406, + T_Requestkey = 407, + T_Reset = 408, + T_Restrict = 409, + T_Revoke = 410, + T_Rlimit = 411, + T_Saveconfigdir = 412, + T_Server = 413, + T_Serverresponse = 414, + T_ServerresponseFuzz = 415, + T_Setvar = 416, + T_Source = 417, + T_Stacksize = 418, + T_Statistics = 419, + T_Stats = 420, + T_Statsdir = 421, + T_Step = 422, + T_Stepback = 423, + T_Stepfwd = 424, + T_Stepout = 425, + T_Stratum = 426, + T_String = 427, + T_Sys = 428, + T_Sysstats = 429, + T_Tick = 430, + T_Time1 = 431, + T_Time2 = 432, + T_Timer = 433, + T_Timingstats = 434, + T_Tinker = 435, + T_Tos = 436, + T_Trap = 437, + T_True = 438, + T_Trustedkey = 439, + T_Ttl = 440, + T_Type = 441, + T_U_int = 442, + T_UEcrypto = 443, + T_UEcryptonak = 444, + T_UEdigest = 445, + T_Unconfig = 446, + T_Unpeer = 447, + T_Version = 448, + T_WanderThreshold = 449, + T_Week = 450, + T_Wildcard = 451, + T_Xleave = 452, + T_Xmtnonce = 453, + T_Year = 454, + T_Flag = 455, + T_EOC = 456, + T_Simulate = 457, + T_Beep_Delay = 458, + T_Sim_Duration = 459, + T_Server_Offset = 460, + T_Duration = 461, + T_Freq_Offset = 462, + T_Wander = 463, + T_Jitter = 464, + T_Prop_Delay = 465, + T_Proc_Delay = 466 }; #endif /* Tokens. */ @@ -267,194 +276,203 @@ extern int yydebug; #define T_Burst 274 #define T_Calibrate 275 #define T_Ceiling 276 -#define T_Clockstats 277 -#define T_Cohort 278 -#define T_ControlKey 279 -#define T_Crypto 280 -#define T_Cryptostats 281 -#define T_Ctl 282 -#define T_Day 283 -#define T_Default 284 -#define T_Digest 285 -#define T_Disable 286 -#define T_Discard 287 -#define T_Dispersion 288 -#define T_Double 289 -#define T_Driftfile 290 -#define T_Drop 291 -#define T_Dscp 292 -#define T_Ellipsis 293 -#define T_Enable 294 -#define T_End 295 -#define T_Epeer 296 -#define T_False 297 -#define T_File 298 -#define T_Filegen 299 -#define T_Filenum 300 -#define T_Flag1 301 -#define T_Flag2 302 -#define T_Flag3 303 -#define T_Flag4 304 -#define T_Flake 305 -#define T_Floor 306 -#define T_Freq 307 -#define T_Fudge 308 -#define T_Host 309 -#define T_Huffpuff 310 -#define T_Iburst 311 -#define T_Ident 312 -#define T_Ignore 313 -#define T_Incalloc 314 -#define T_Incmem 315 -#define T_Initalloc 316 -#define T_Initmem 317 -#define T_Includefile 318 -#define T_Integer 319 -#define T_Interface 320 -#define T_Intrange 321 -#define T_Io 322 -#define T_Ippeerlimit 323 -#define T_Ipv4 324 -#define T_Ipv4_flag 325 -#define T_Ipv6 326 -#define T_Ipv6_flag 327 -#define T_Kernel 328 -#define T_Key 329 -#define T_Keys 330 -#define T_Keysdir 331 -#define T_Kod 332 -#define T_Mssntp 333 -#define T_Leapfile 334 -#define T_Leapsmearinterval 335 -#define T_Limited 336 -#define T_Link 337 -#define T_Listen 338 -#define T_Logconfig 339 -#define T_Logfile 340 -#define T_Loopstats 341 -#define T_Lowpriotrap 342 -#define T_Manycastclient 343 -#define T_Manycastserver 344 -#define T_Mask 345 -#define T_Maxage 346 -#define T_Maxclock 347 -#define T_Maxdepth 348 -#define T_Maxdist 349 -#define T_Maxmem 350 -#define T_Maxpoll 351 -#define T_Mdnstries 352 -#define T_Mem 353 -#define T_Memlock 354 -#define T_Minclock 355 -#define T_Mindepth 356 -#define T_Mindist 357 -#define T_Minimum 358 -#define T_Minpoll 359 -#define T_Minsane 360 -#define T_Mode 361 -#define T_Mode7 362 -#define T_Monitor 363 -#define T_Month 364 -#define T_Mru 365 -#define T_Multicastclient 366 -#define T_Nic 367 -#define T_Nolink 368 -#define T_Nomodify 369 -#define T_Nomrulist 370 -#define T_None 371 -#define T_Nonvolatile 372 -#define T_Noepeer 373 -#define T_Nopeer 374 -#define T_Noquery 375 -#define T_Noselect 376 -#define T_Noserve 377 -#define T_Notrap 378 -#define T_Notrust 379 -#define T_Ntp 380 -#define T_Ntpport 381 -#define T_NtpSignDsocket 382 -#define T_Orphan 383 -#define T_Orphanwait 384 -#define T_PCEdigest 385 -#define T_Panic 386 -#define T_Peer 387 -#define T_Peerstats 388 -#define T_Phone 389 -#define T_Pid 390 -#define T_Pidfile 391 -#define T_Pool 392 -#define T_Port 393 -#define T_Preempt 394 -#define T_Prefer 395 -#define T_Protostats 396 -#define T_Pw 397 -#define T_Randfile 398 -#define T_Rawstats 399 -#define T_Refid 400 -#define T_Requestkey 401 -#define T_Reset 402 -#define T_Restrict 403 -#define T_Revoke 404 -#define T_Rlimit 405 -#define T_Saveconfigdir 406 -#define T_Server 407 -#define T_Setvar 408 -#define T_Source 409 -#define T_Stacksize 410 -#define T_Statistics 411 -#define T_Stats 412 -#define T_Statsdir 413 -#define T_Step 414 -#define T_Stepback 415 -#define T_Stepfwd 416 -#define T_Stepout 417 -#define T_Stratum 418 -#define T_String 419 -#define T_Sys 420 -#define T_Sysstats 421 -#define T_Tick 422 -#define T_Time1 423 -#define T_Time2 424 -#define T_Timer 425 -#define T_Timingstats 426 -#define T_Tinker 427 -#define T_Tos 428 -#define T_Trap 429 -#define T_True 430 -#define T_Trustedkey 431 -#define T_Ttl 432 -#define T_Type 433 -#define T_U_int 434 -#define T_UEcrypto 435 -#define T_UEcryptonak 436 -#define T_UEdigest 437 -#define T_Unconfig 438 -#define T_Unpeer 439 -#define T_Version 440 -#define T_WanderThreshold 441 -#define T_Week 442 -#define T_Wildcard 443 -#define T_Xleave 444 -#define T_Year 445 -#define T_Flag 446 -#define T_EOC 447 -#define T_Simulate 448 -#define T_Beep_Delay 449 -#define T_Sim_Duration 450 -#define T_Server_Offset 451 -#define T_Duration 452 -#define T_Freq_Offset 453 -#define T_Wander 454 -#define T_Jitter 455 -#define T_Prop_Delay 456 -#define T_Proc_Delay 457 +#define T_Checkhash 277 +#define T_Clockstats 278 +#define T_Cohort 279 +#define T_ControlKey 280 +#define T_Crypto 281 +#define T_Cryptostats 282 +#define T_Ctl 283 +#define T_Day 284 +#define T_Default 285 +#define T_Digest 286 +#define T_Disable 287 +#define T_Discard 288 +#define T_Dispersion 289 +#define T_Double 290 +#define T_Driftfile 291 +#define T_Drop 292 +#define T_Dscp 293 +#define T_Ellipsis 294 +#define T_Enable 295 +#define T_End 296 +#define T_Epeer 297 +#define T_False 298 +#define T_File 299 +#define T_Filegen 300 +#define T_Filenum 301 +#define T_Flag1 302 +#define T_Flag2 303 +#define T_Flag3 304 +#define T_Flag4 305 +#define T_Flake 306 +#define T_Floor 307 +#define T_Freq 308 +#define T_Fudge 309 +#define T_Fuzz 310 +#define T_Host 311 +#define T_Huffpuff 312 +#define T_Iburst 313 +#define T_Ident 314 +#define T_Ignore 315 +#define T_Ignorehash 316 +#define T_Incalloc 317 +#define T_Incmem 318 +#define T_Initalloc 319 +#define T_Initmem 320 +#define T_Includefile 321 +#define T_Integer 322 +#define T_Interface 323 +#define T_Intrange 324 +#define T_Io 325 +#define T_Ippeerlimit 326 +#define T_Ipv4 327 +#define T_Ipv4_flag 328 +#define T_Ipv6 329 +#define T_Ipv6_flag 330 +#define T_Kernel 331 +#define T_Key 332 +#define T_Keys 333 +#define T_Keysdir 334 +#define T_Kod 335 +#define T_Leapfile 336 +#define T_Leapsmearinterval 337 +#define T_Limited 338 +#define T_Link 339 +#define T_Listen 340 +#define T_Logconfig 341 +#define T_Logfile 342 +#define T_Loopstats 343 +#define T_Lowpriotrap 344 +#define T_Manycastclient 345 +#define T_Manycastserver 346 +#define T_Mask 347 +#define T_Maxage 348 +#define T_Maxclock 349 +#define T_Maxdepth 350 +#define T_Maxdist 351 +#define T_Maxmem 352 +#define T_Maxpoll 353 +#define T_Mdnstries 354 +#define T_Mem 355 +#define T_Memlock 356 +#define T_Minclock 357 +#define T_Mindepth 358 +#define T_Mindist 359 +#define T_Minimum 360 +#define T_Minjitter 361 +#define T_Minpoll 362 +#define T_Minsane 363 +#define T_Mode 364 +#define T_Mode7 365 +#define T_Monitor 366 +#define T_Month 367 +#define T_Mru 368 +#define T_Mssntp 369 +#define T_Multicastclient 370 +#define T_Nic 371 +#define T_Nolink 372 +#define T_Nomodify 373 +#define T_Nomrulist 374 +#define T_None 375 +#define T_Nonvolatile 376 +#define T_Noepeer 377 +#define T_Nopeer 378 +#define T_Noquery 379 +#define T_Noselect 380 +#define T_Noserve 381 +#define T_Notrap 382 +#define T_Notrust 383 +#define T_Ntp 384 +#define T_Ntpport 385 +#define T_NtpSignDsocket 386 +#define T_Orphan 387 +#define T_Orphanwait 388 +#define T_PCEdigest 389 +#define T_Panic 390 +#define T_Peer 391 +#define T_Peerstats 392 +#define T_Phone 393 +#define T_Pid 394 +#define T_Pidfile 395 +#define T_Poll 396 +#define T_PollSkewList 397 +#define T_Pool 398 +#define T_Port 399 +#define T_Preempt 400 +#define T_Prefer 401 +#define T_Protostats 402 +#define T_Pw 403 +#define T_Randfile 404 +#define T_Rawstats 405 +#define T_Refid 406 +#define T_Requestkey 407 +#define T_Reset 408 +#define T_Restrict 409 +#define T_Revoke 410 +#define T_Rlimit 411 +#define T_Saveconfigdir 412 +#define T_Server 413 +#define T_Serverresponse 414 +#define T_ServerresponseFuzz 415 +#define T_Setvar 416 +#define T_Source 417 +#define T_Stacksize 418 +#define T_Statistics 419 +#define T_Stats 420 +#define T_Statsdir 421 +#define T_Step 422 +#define T_Stepback 423 +#define T_Stepfwd 424 +#define T_Stepout 425 +#define T_Stratum 426 +#define T_String 427 +#define T_Sys 428 +#define T_Sysstats 429 +#define T_Tick 430 +#define T_Time1 431 +#define T_Time2 432 +#define T_Timer 433 +#define T_Timingstats 434 +#define T_Tinker 435 +#define T_Tos 436 +#define T_Trap 437 +#define T_True 438 +#define T_Trustedkey 439 +#define T_Ttl 440 +#define T_Type 441 +#define T_U_int 442 +#define T_UEcrypto 443 +#define T_UEcryptonak 444 +#define T_UEdigest 445 +#define T_Unconfig 446 +#define T_Unpeer 447 +#define T_Version 448 +#define T_WanderThreshold 449 +#define T_Week 450 +#define T_Wildcard 451 +#define T_Xleave 452 +#define T_Xmtnonce 453 +#define T_Year 454 +#define T_Flag 455 +#define T_EOC 456 +#define T_Simulate 457 +#define T_Beep_Delay 458 +#define T_Sim_Duration 459 +#define T_Server_Offset 460 +#define T_Duration 461 +#define T_Freq_Offset 462 +#define T_Wander 463 +#define T_Jitter 464 +#define T_Prop_Delay 465 +#define T_Proc_Delay 466 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 52 "ntp_parser.y" /* yacc.c:1909 */ +#line 52 "../../ntpd/ntp_parser.y" /* yacc.c:1909 */ char * String; double Double; @@ -473,7 +491,7 @@ union YYSTYPE script_info * Sim_script; script_info_fifo * Sim_script_fifo; -#line 477 "ntp_parser.h" /* yacc.c:1909 */ +#line 495 "../../ntpd/ntp_parser.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; @@ -486,4 +504,4 @@ extern YYSTYPE yylval; int yyparse (void); -#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */ +#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */ diff --git a/contrib/ntp/ntpd/ntp_peer.c b/contrib/ntp/ntpd/ntp_peer.c index 71c0936833989..c1716ffe0d83b 100644 --- a/contrib/ntp/ntpd/ntp_peer.c +++ b/contrib/ntp/ntpd/ntp_peer.c @@ -844,11 +844,13 @@ newpeer( return NULL; } +#if 0 DPRINTF(1, ("newpeer(%s) found no existing and %d other associations\n", (hostname) ? hostname : stoa(srcadr), ip_count)); +#endif /* Check ippeerlimit wrt ip_count */ if (ippeerlimit > -1) { diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c index eb663515b8a4b..33e97ef9d9893 100644 --- a/contrib/ntp/ntpd/ntp_proto.c +++ b/contrib/ntp/ntpd/ntp_proto.c @@ -15,6 +15,7 @@ #include "ntp_control.h" #include "ntp_string.h" #include "ntp_leapsec.h" +#include "ntp_psl.h" #include "refidsmear.h" #include "lib_strbuf.h" @@ -31,6 +32,13 @@ # define BDELAY_DEFAULT (-0.050) #endif +#define SRVFUZ_SHIFT 6 /* 64 seconds */ +#define SRVRSP_FUZZ(x) \ + do { \ + x.l_uf &= 0; \ + x.l_ui &= ~((1 << SRVFUZ_SHIFT) - 1U); \ + } while(0) + /* * This macro defines the authentication state. If x is 1 authentication * is required; otherwise it is optional. @@ -79,6 +87,11 @@ nak_error_codes { #define POOL_SOLICIT_WINDOW 8 /* + * flag bits propagated from pool to individual peers + */ +#define POOL_FLAG_PMASK (FLAG_IBURST | FLAG_NOSELECT) + +/* * peer_select groups statistics for a peer used by clock_select() and * clock_cluster(). */ @@ -97,10 +110,16 @@ u_char sys_leap; /* system leap indicator, use set_sys_leap() to change this */ u_char xmt_leap; /* leap indicator sent in client requests, set up by set_sys_leap() */ u_char sys_stratum; /* system stratum */ s_char sys_precision; /* local clock precision (log2 s) */ -double sys_rootdelay; /* roundtrip delay to primary source */ -double sys_rootdisp; /* dispersion to primary source */ +double sys_rootdelay; /* roundtrip delay to root (primary source) */ +double sys_rootdisp; /* dispersion to root (primary source) */ +double prev_rootdisp; /* previous root dispersion */ +double p2_rootdisp; /* previous previous root dispersion */ u_int32 sys_refid; /* reference id (network byte order) */ l_fp sys_reftime; /* last update time */ +l_fp prev_reftime; /* previous sys_reftime */ +l_fp p2_reftime; /* previous previous sys_reftime */ +u_long prev_time; /* "current_time" when saved prev_time */ +u_long p2_time; /* previous prev_time */ struct peer *sys_peer; /* current peer */ #ifdef LEAP_SMEAR @@ -337,11 +356,18 @@ valid_NAK( /* * The ORIGIN must match, or this cannot be a valid NAK, either. */ + + if (FLAG_LOOPNONCE & peer->flags) { + myorg = &peer->nonce; + } else { + if (peer->flip > 0) { + myorg = &peer->borg; + } else { + myorg = &peer->aorg; + } + } + NTOHL_FP(&rpkt->org, &p_org); - if (peer->flip > 0) - myorg = &peer->borg; - else - myorg = &peer->aorg; if (L_ISZERO(&p_org) || L_ISZERO( myorg) || @@ -387,7 +413,7 @@ transmit( */ if (peer->cast_flags & (MDF_BCAST | MDF_MCAST)) { peer->outdate = current_time; - poll_update(peer, hpoll); + poll_update(peer, hpoll, 0); if (sys_leap != LEAP_NOTINSYNC) peer_xmit(peer); return; @@ -408,7 +434,7 @@ transmit( */ if (peer->cast_flags & MDF_ACAST) { peer->outdate = current_time; - poll_update(peer, hpoll); + poll_update(peer, hpoll, 0); if (peer->unreach > sys_beacon) { peer->unreach = 0; peer->ttl = 0; @@ -437,7 +463,7 @@ transmit( */ if (peer->cast_flags & MDF_POOL) { peer->outdate = current_time; - poll_update(peer, hpoll); + poll_update(peer, hpoll, 0); if ( (peer_associations <= 2 * sys_maxclock) && ( peer_associations < sys_maxclock || sys_survivors < sys_minclock)) @@ -549,7 +575,7 @@ transmit( /* * Do not transmit if in broadcast client mode. */ - poll_update(peer, hpoll); + poll_update(peer, hpoll, (peer->hmode == MODE_CLIENT)); if (peer->hmode != MODE_BCLIENT) peer_xmit(peer); @@ -640,31 +666,20 @@ receive( */ /* * Bogus port check is before anything, since it probably - * reveals a clogging attack. + * reveals a clogging attack. Likewise the mimimum packet size + * of 2 bytes (for mode 6/7) must be checked first. */ sys_received++; - if (0 == SRCPORT(&rbufp->recv_srcadr)) { + if (0 == SRCPORT(&rbufp->recv_srcadr) || rbufp->recv_length < 2) { sys_badlength++; - return; /* bogus port */ + return; /* bogus port / length */ } restrictions(&rbufp->recv_srcadr, &r4a); restrict_mask = r4a.rflags; pkt = &rbufp->recv_pkt; hisversion = PKT_VERSION(pkt->li_vn_mode); - hisleap = PKT_LEAP(pkt->li_vn_mode); hismode = (int)PKT_MODE(pkt->li_vn_mode); - hisstratum = PKT_TO_STRATUM(pkt->stratum); - DPRINTF(1, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s restrict %s org %#010x.%08x xmt %#010x.%08x\n", - current_time, stoa(&rbufp->dstadr->sin), - stoa(&rbufp->recv_srcadr), r4a.ippeerlimit, hismode, - build_iflags(rbufp->dstadr->flags), - build_rflags(restrict_mask), - ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf), - ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf))); - - /* See basic mode and broadcast checks, below */ - INSIST(0 != hisstratum); if (restrict_mask & RES_IGNORE) { DPRINTF(2, ("receive: drop: RES_IGNORE\n")); @@ -696,6 +711,30 @@ receive( return; /* no time serve */ } + + /* If we arrive here, we should have a standard NTP packet. We + * check that the minimum size is available and fetch some more + * items from the packet once we can be sure they are indeed + * there. + */ + if (rbufp->recv_length < LEN_PKT_NOMAC) { + sys_badlength++; + return; /* bogus length */ + } + + hisleap = PKT_LEAP(pkt->li_vn_mode); + hisstratum = PKT_TO_STRATUM(pkt->stratum); + INSIST(0 != hisstratum); /* paranoia check PKT_TO_STRATUM result */ + + DPRINTF(1, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s " + "restrict %s org %#010x.%08x xmt %#010x.%08x\n", + current_time, stoa(&rbufp->dstadr->sin), + stoa(&rbufp->recv_srcadr), r4a.ippeerlimit, hismode, + build_iflags(rbufp->dstadr->flags), + build_rflags(restrict_mask), + ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf), + ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf))); + /* * This is for testing. If restricted drop ten percent of * surviving packets. @@ -888,12 +927,13 @@ receive( } return; /* rate exceeded */ } - if (hismode == MODE_CLIENT) + if (hismode == MODE_CLIENT) { fast_xmit(rbufp, MODE_SERVER, skeyid, restrict_mask); - else + } else { fast_xmit(rbufp, MODE_ACTIVE, skeyid, restrict_mask); + } return; /* rate exceeded */ } restrict_mask &= ~RES_KOD; @@ -1250,9 +1290,11 @@ receive( if (AUTH(restrict_mask & RES_DONTTRUST, is_authentic)) { + /* Bug 3596: Do we want to fuzz the reftime? */ fast_xmit(rbufp, MODE_SERVER, skeyid, restrict_mask); } else if (is_authentic == AUTH_ERROR) { + /* Bug 3596: Do we want to fuzz the reftime? */ fast_xmit(rbufp, MODE_SERVER, 0, restrict_mask); sys_badauth++; @@ -1318,6 +1360,7 @@ receive( pkt->refid, rbufp->recv_length - MIN_V4_PKT_LEN, (u_char *)&pkt->exten); + /* Bug 3596: Do we want to fuzz the reftime? */ fast_xmit(rbufp, MODE_SERVER, skeyid, restrict_mask); } @@ -1386,8 +1429,8 @@ receive( peer = newpeer(&rbufp->recv_srcadr, NULL, rbufp->dstadr, r4a.ippeerlimit, MODE_CLIENT, hisversion, peer2->minpoll, peer2->maxpoll, - FLAG_PREEMPT | (FLAG_IBURST & peer2->flags), - MDF_UCAST | MDF_UCLNT, 0, skeyid, sys_ident); + (FLAG_PREEMPT | (POOL_FLAG_PMASK & peer2->flags)), + (MDF_UCAST | MDF_UCLNT), 0, skeyid, sys_ident); if (NULL == peer) { DPRINTF(2, ("receive: AM_MANYCAST drop: duplicate\n")); sys_declined++; @@ -1858,7 +1901,9 @@ receive( * packet is a replay. This prevents the bad guys from replaying * the most recent packet, authenticated or not. */ - } else if (L_ISEQU(&peer->xmt, &p_xmt)) { + } else if ( ((FLAG_LOOPNONCE & peer->flags) && L_ISEQU(&peer->nonce, &p_xmt)) + || (!(FLAG_LOOPNONCE & peer->flags) && L_ISEQU(&peer->xmt, &p_xmt)) + ) { DPRINTF(2, ("receive: drop: Duplicate xmit\n")); peer->flash |= TEST1; /* duplicate */ peer->oldpkt++; @@ -1958,6 +2003,10 @@ receive( * We have earlier asserted that hisstratum cannot be 0. * If hisstratum is STRATUM_UNSPEC, it means he's not sync'd. */ + + /* XXX: FLAG_LOOPNONCE */ + DEBUG_INSIST(0 == (FLAG_LOOPNONCE & peer->flags)); + } else if (peer->flip == 0) { if (0) { } else if (L_ISZERO(&p_org)) { @@ -1967,6 +2016,7 @@ receive( msyslog(LOG_INFO, "receive: BUG 3361: Clearing peer->aorg "); L_CLR(&peer->aorg); + /* Clear peer->nonce, too? */ #endif /**/ switch (hismode) { @@ -2020,6 +2070,7 @@ receive( } } else { L_CLR(&peer->aorg); + /* XXX: FLAG_LOOPNONCE */ } /* @@ -2193,7 +2244,7 @@ receive( peer->minpoll = peer->ppoll; peer->burst = peer->retry = 0; peer->throttle = (NTP_SHIFT + 1) * (1 << peer->minpoll); - poll_update(peer, pkt->ppoll); + poll_update(peer, pkt->ppoll, 0); return; /* kiss-o'-death */ } if (kissCode != NOKISS) { @@ -2383,9 +2434,17 @@ receive( /* * The dance is complete and the flash bits have been lit. Toss * the packet over the fence for processing, which may light up - * more flashers. + * more flashers. Leave if the packet is not good. */ process_packet(peer, pkt, rbufp->recv_length); + if (peer->flash & PKT_TEST_MASK) + return; + + /* [bug 3592] Update poll. Ideally this should not happen in a + * receive branch, but too much is going on here... at least we + * do it only if the packet was good! + */ + poll_update(peer, peer->hpoll, (peer->hmode == MODE_CLIENT)); /* * In interleaved mode update the state variables. Also adjust the @@ -2465,7 +2524,10 @@ process_packet( peer->seldisptoolarge++; DPRINTF(1, ("packet: flash header %04x\n", peer->flash)); - poll_update(peer, peer->hpoll); /* ppoll updated? */ + + /* ppoll updated? */ + /* XXX: Fuzz the poll? */ + poll_update(peer, peer->hpoll, (peer->hmode == MODE_CLIENT)); return; } @@ -2509,7 +2571,7 @@ process_packet( if (peer->burst > 0) peer->nextdate = current_time; } - poll_update(peer, peer->hpoll); + poll_update(peer, peer->hpoll, (peer->hmode == MODE_CLIENT)); /**/ @@ -2776,7 +2838,7 @@ clock_update( sys_poll = peer->minpoll; if (sys_poll > peer->maxpoll) sys_poll = peer->maxpoll; - poll_update(peer, sys_poll); + poll_update(peer, sys_poll, 0); sys_stratum = min(peer->stratum + 1, STRATUM_UNSPEC); if ( peer->stratum == STRATUM_REFCLOCK || peer->stratum == STRATUM_UNSPEC) @@ -2807,11 +2869,21 @@ clock_update( + clock_phi * (current_time - peer->update) + fabs(sys_offset); + p2_rootdisp = prev_rootdisp; + prev_rootdisp = sys_rootdisp; if (dtemp > sys_mindisp) sys_rootdisp = dtemp; else sys_rootdisp = sys_mindisp; + sys_rootdelay = peer->delay + peer->rootdelay; + + p2_reftime = prev_reftime; + p2_time = prev_time; + + prev_reftime = sys_reftime; + prev_time = current_time + 64 + (rand() & 0x3f); /* 64-127 s */ + sys_reftime = peer->dst; DPRINTF(1, ("clock_update: at %lu sample %lu associd %d\n", @@ -2856,7 +2928,11 @@ clock_update( sys_stratum = STRATUM_UNSPEC; memcpy(&sys_refid, "STEP", 4); sys_rootdelay = 0; + p2_rootdisp = 0; + prev_rootdisp = 0; sys_rootdisp = 0; + L_CLR(&p2_reftime); /* Should we clear p2_reftime? */ + L_CLR(&prev_reftime); /* Should we clear prev_reftime? */ L_CLR(&sys_reftime); sys_jitter = LOGTOD(sys_precision); leapsec_reset_frame(); @@ -2883,9 +2959,10 @@ clock_update( * first clock sync, send them home satisfied. */ #ifdef HAVE_WORKING_FORK - if (waitsync_fd_to_close != -1) { - close(waitsync_fd_to_close); - waitsync_fd_to_close = -1; + if (daemon_pipe[1] != -1) { + write(daemon_pipe[1], "S\n", 2); + close(daemon_pipe[1]); + daemon_pipe[1] = -1; DPRINTF(1, ("notified parent --wait-sync is done\n")); } #endif /* HAVE_WORKING_FORK */ @@ -2930,10 +3007,11 @@ clock_update( void poll_update( struct peer *peer, /* peer structure pointer */ - u_char mpoll + u_char mpoll, + u_char skewpoll ) { - u_long next, utemp; + u_long next, utemp, limit; u_char hpoll; /* @@ -2977,6 +3055,15 @@ poll_update( */ utemp = current_time + max(peer->throttle - (NTP_SHIFT - 1) * (1 << peer->minpoll), ntp_minpkt); + + /*[Bug 3592] avoid unlimited postpone of next poll */ + limit = (2u << hpoll); + if (limit > 64) + limit -= (limit >> 2); + limit += peer->outdate; + if (limit < current_time) + limit = current_time; + if (peer->burst > 0) { if (peer->nextdate > current_time) return; @@ -3022,6 +3109,29 @@ poll_update( next = ((0x1000UL | (ntp_random() & 0x0ff)) << hpoll) >> 12; next += peer->outdate; + /* XXX: bug3596: Deal with poll skew list? */ + if (skewpoll) { + psl_item psi; + + if (0 == get_pollskew(hpoll, &psi)) { + int sub = psi.sub; + int qty = psi.qty; + int msk = psi.msk; + int val; + + if ( 0 != sub + || 0 != qty) { + do { + val = ntp_random() & msk; + } while (val > qty); + + next -= sub; + next += val; + } + } else { + /* get_pollskew() already logged this */ + } + } if (next > utemp) peer->nextdate = next; else @@ -3029,6 +3139,13 @@ poll_update( if (peer->throttle > (1 << peer->minpoll)) peer->nextdate += ntp_minpkt; } + + /*[Bug 3592] avoid unlimited postpone of next poll */ + if (peer->nextdate > limit) { + DPRINTF(1, ("poll_update: clamp reached; limit %lu next %lu\n", + limit, peer->nextdate)); + peer->nextdate = limit; + } DPRINTF(2, ("poll_update: at %lu %s poll %d burst %d retry %d head %d early %lu next %lu\n", current_time, ntoa(&peer->srcadr), peer->hpoll, peer->burst, peer->retry, peer->throttle, @@ -3953,6 +4070,7 @@ peer_xmit( xpkt.refid = sys_refid; xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay)); xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp)); + /* Use sys_reftime for peer exchanges */ HTONL_FP(&sys_reftime, &xpkt.reftime); HTONL_FP(&peer->rec, &xpkt.org); HTONL_FP(&peer->dst, &xpkt.rec); @@ -4377,7 +4495,7 @@ leap_smear_add_offs( static void fast_xmit( struct recvbuf *rbufp, /* receive packet pointer */ - int xmode, /* receive mode */ + int xmode, /* receive mode */ /* XXX: HMS: really? */ keyid_t xkeyid, /* transmit key ID */ int flags /* restrict mask */ ) @@ -4408,8 +4526,8 @@ fast_xmit( /* * If this is a kiss-o'-death (KoD) packet, show leap * unsynchronized, stratum zero, reference ID the four-character - * kiss code and system root delay. Note we don't reveal the - * local time, so these packets can't be used for + * kiss code and (???) system root delay. Note we don't reveal + * the local time, so these packets can't be used for * synchronization. */ if (flags & RES_KOD) { @@ -4431,18 +4549,23 @@ fast_xmit( * This is a normal packet. Use the system variables. */ } else { + double this_rootdisp; + l_fp this_ref_time; + #ifdef LEAP_SMEAR /* * Make copies of the variables which can be affected by smearing. */ - l_fp this_ref_time; l_fp this_recv_time; #endif /* - * If we are inside the leap smear interval we add the current smear offset to - * the packet receive time, to the packet transmit time, and eventually to the - * reftime to make sure the reftime isn't later than the transmit/receive times. + * If we are inside the leap smear interval we add + * the current smear offset to: + * - the packet receive time, + * - the packet transmit time, + * - and eventually to the reftime to make sure the + * reftime isn't later than the transmit/receive times. */ xpkt.li_vn_mode = PKT_LI_VN_MODE(xmt_leap, PKT_VERSION(rpkt->li_vn_mode), xmode); @@ -4452,25 +4575,77 @@ fast_xmit( xpkt.precision = sys_precision; xpkt.refid = sys_refid; xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay)); - xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp)); + + /* + ** Server Response Fuzzing + ** + ** Which values do we want to use for reftime and rootdisp? + */ + + if ( MODE_SERVER == xmode + && RES_SRVRSPFUZ & flags) { + if (current_time < p2_time) { + this_ref_time = p2_reftime; + this_rootdisp = p2_rootdisp; + } else if (current_time < prev_time) { + this_ref_time = prev_reftime; + this_rootdisp = prev_rootdisp; + } else { + this_ref_time = sys_reftime; + this_rootdisp = sys_rootdisp; + } + + SRVRSP_FUZZ(this_ref_time); + } else { + this_ref_time = sys_reftime; + this_rootdisp = sys_rootdisp; + } + + /* + ** ROOT DISPERSION + */ + + xpkt.rootdisp = HTONS_FP(DTOUFP(this_rootdisp)); + + /* + ** REFTIME + */ #ifdef LEAP_SMEAR - this_ref_time = sys_reftime; if (leap_smear.in_progress) { + /* adjust the reftime by the same amount as the + * leap smear, as we don't want to risk the + * reftime being later than the transmit time. + */ leap_smear_add_offs(&this_ref_time, NULL); + } +#endif + + HTONL_FP(&this_ref_time, &xpkt.reftime); + + /* + ** REFID + */ + +#ifdef LEAP_SMEAR + if (leap_smear.in_progress) { xpkt.refid = convertLFPToRefID(leap_smear.offset); DPRINTF(2, ("fast_xmit: leap_smear.in_progress: refid %8x, smear %s\n", ntohl(xpkt.refid), lfptoa(&leap_smear.offset, 8) )); } - HTONL_FP(&this_ref_time, &xpkt.reftime); -#else - HTONL_FP(&sys_reftime, &xpkt.reftime); #endif + /* + ** ORIGIN + */ + xpkt.org = rpkt->xmt; + /* + ** RECEIVE + */ #ifdef LEAP_SMEAR this_recv_time = rbufp->recv_time; if (leap_smear.in_progress) @@ -4480,6 +4655,10 @@ fast_xmit( HTONL_FP(&rbufp->recv_time, &xpkt.rec); #endif + /* + ** TRANSMIT + */ + get_systime(&xmt_tx); #ifdef LEAP_SMEAR if (leap_smear.in_progress) @@ -4580,10 +4759,11 @@ pool_xmit( struct interface * lcladr; sockaddr_u * rmtadr; r4addr r4a; - int restrict_mask; + u_short restrict_mask; struct peer * p; l_fp xmt_tx; + DEBUG_REQUIRE(pool); if (NULL == pool->ai) { if (pool->addrs != NULL) { /* free() is used with copy_addrinfo_list() */ @@ -4635,10 +4815,28 @@ pool_xmit( xpkt.refid = sys_refid; xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay)); xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp)); + /* Bug 3596: What are the pros/cons of using sys_reftime here? */ HTONL_FP(&sys_reftime, &xpkt.reftime); + + /* HMS: the following is better done after the ntp_random() calls */ get_systime(&xmt_tx); pool->aorg = xmt_tx; - HTONL_FP(&xmt_tx, &xpkt.xmt); + + if (FLAG_LOOPNONCE & pool->flags) { + l_fp nonce; + + do { + nonce.l_ui = ntp_random(); + } while (0 == nonce.l_ui); + do { + nonce.l_uf = ntp_random(); + } while (0 == nonce.l_uf); + pool->nonce = nonce; + HTONL_FP(&nonce, &xpkt.xmt); + } else { + L_CLR(&pool->nonce); + HTONL_FP(&xmt_tx, &xpkt.xmt); + } sendpkt(rmtadr, lcladr, sys_ttl[(pool->ttl >= sys_ttlmax) ? sys_ttlmax : pool->ttl], &xpkt, LEN_PKT_NOMAC); diff --git a/contrib/ntp/ntpd/ntp_refclock.c b/contrib/ntp/ntpd/ntp_refclock.c index d109b7115793b..6a0861ed03bcb 100644 --- a/contrib/ntp/ntpd/ntp_refclock.c +++ b/contrib/ntp/ntpd/ntp_refclock.c @@ -12,6 +12,7 @@ #include "ntp_refclock.h" #include "ntp_stdlib.h" #include "ntp_assert.h" +#include "timespecops.h" #include <stdio.h> @@ -66,10 +67,81 @@ int cal_enable; /* enable refclock calibrate */ /* * Forward declarations */ -static int refclock_cmpl_fp (const void *, const void *); -static int refclock_sample (struct refclockproc *); -static int refclock_ioctl(int, u_int); +static int refclock_cmpl_fp (const void *, const void *); +static int refclock_sample (struct refclockproc *); +static int refclock_ioctl(int, u_int); +static void refclock_checkburst(struct peer *, struct refclockproc *); +/* circular buffer functions + * + * circular buffer management comes in two flovours: + * for powers of two, and all others. + */ + +#if MAXSTAGE & (MAXSTAGE - 1) + +static void clk_add_sample( + struct refclockproc * const pp, + double sv + ) +{ + pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; + if (pp->coderecv == pp->codeproc) + pp->codeproc = (pp->codeproc + 1) % MAXSTAGE; + pp->filter[pp->coderecv] = sv; +} + +static double clk_pop_sample( + struct refclockproc * const pp + ) +{ + if (pp->coderecv == pp->codeproc) + return 0; /* Maybe a NaN would be better? */ + pp->codeproc = (pp->codeproc + 1) % MAXSTAGE; + return pp->filter[pp->codeproc]; +} + +static inline u_int clk_cnt_sample( + struct refclockproc * const pp + ) +{ + u_int retv = pp->coderecv - pp->codeproc; + if (retv > MAXSTAGE) + retv += MAXSTAGE; + return retv; +} + +#else + +static inline void clk_add_sample( + struct refclockproc * const pp, + double sv + ) +{ + pp->coderecv = (pp->coderecv + 1) & (MAXSTAGE - 1); + if (pp->coderecv == pp->codeproc) + pp->codeproc = (pp->codeproc + 1) & (MAXSTAGE - 1); + pp->filter[pp->coderecv] = sv; +} + +static inline double clk_pop_sample( + struct refclockproc * const pp + ) +{ + if (pp->coderecv == pp->codeproc) + return 0; /* Maybe a NaN would be better? */ + pp->codeproc = (pp->codeproc + 1) & (MAXSTAGE - 1); + return pp->filter[pp->codeproc]; +} + +static inline u_int clk_cnt_sample( + struct refclockproc * const pp + ) +{ + return (pp->coderecv - pp->codeproc) & (MAXSTAGE - 1); +} + +#endif /* * refclock_report - note the occurance of an event @@ -328,9 +400,10 @@ refclock_transmit( } else { peer->burst--; } + peer->procptr->inpoll = TRUE; if (refclock_conf[clktype]->clock_poll != noentry) (refclock_conf[clktype]->clock_poll)(unit, peer); - poll_update(peer, peer->hpoll); + poll_update(peer, peer->hpoll, 0); } @@ -353,6 +426,65 @@ refclock_cmpl_fp( return 0; } +/* + * Get number of available samples + */ +int +refclock_samples_avail( + struct refclockproc const * pp + ) +{ + u_int na; + +# if MAXSTAGE & (MAXSTAGE - 1) + + na = pp->coderecv - pp->codeproc; + if (na > MAXSTAGE) + na += MAXSTAGE; + +# else + + na = (pp->coderecv - pp->codeproc) & (MAXSTAGE - 1); + +# endif + return na; +} + +/* + * Expire (remove) samples from the tail (oldest samples removed) + * + * Returns number of samples deleted + */ +int +refclock_samples_expire( + struct refclockproc * pp, + int nd + ) +{ + u_int na; + + if (nd <= 0) + return 0; + +# if MAXSTAGE & (MAXSTAGE - 1) + + na = pp->coderecv - pp->codeproc; + if (na > MAXSTAGE) + na += MAXSTAGE; + if ((u_int)nd < na) + nd = na; + pp->codeproc = (pp->codeproc + nd) % MAXSTAGE; + +# else + + na = (pp->coderecv - pp->codeproc) & (MAXSTAGE - 1); + if ((u_int)nd > na) + nd = (int)na; + pp->codeproc = (pp->codeproc + nd) & (MAXSTAGE - 1); + +# endif + return nd; +} /* * refclock_process_offset - update median filter @@ -376,7 +508,8 @@ refclock_process_offset( lftemp = lasttim; L_SUB(&lftemp, &lastrec); LFPTOD(&lftemp, doffset); - SAMPLE(doffset + fudge); + clk_add_sample(pp, doffset + fudge); + refclock_checkburst(pp->io.srcclock, pp); } @@ -388,7 +521,7 @@ refclock_process_offset( * seconds and milliseconds/microseconds to internal timestamp format, * then constructs a new entry in the median filter circular buffer. * Return success (1) if the data are correct and consistent with the - * converntional calendar. + * conventional calendar. * * Important for PPS users: Normally, the pp->lastrec is set to the * system time when the on-time character is received and the pp->year, @@ -409,7 +542,7 @@ refclock_process_f( * seconds and milliseconds/microseconds of the timecode. Use * clocktime() for the aggregate seconds and the msec/usec for * the fraction, when present. Note that this code relies on the - * filesystem time for the years and does not use the years of + * file system time for the years and does not use the years of * the timecode. */ if (!clocktime(pp->day, pp->hour, pp->minute, pp->second, GMT, @@ -457,11 +590,8 @@ refclock_sample( * anything if the buffer is empty. */ n = 0; - while (pp->codeproc != pp->coderecv) { - pp->codeproc = (pp->codeproc + 1) % MAXSTAGE; - off[n] = pp->filter[pp->codeproc]; - n++; - } + while (pp->codeproc != pp->coderecv) + off[n++] = clk_pop_sample(pp); if (n == 0) return (0); @@ -494,6 +624,20 @@ refclock_sample( } pp->offset /= m; pp->jitter = max(SQRT(pp->jitter / m), LOGTOD(sys_precision)); + + /* + * If the source has a jitter that cannot be estimated, because + * it is not statistic jitter, the source will be detected as + * falseticker sooner or later. Enforcing a minimal jitter value + * avoids a too low estimation while still detecting higher jitter. + * + * Note that this changes the refclock samples and ends up in the + * clock dispersion, not the clock jitter, despite being called + * jitter. To see the modified values, check the NTP clock variable + * "filtdisp", not "jitter". + */ + pp->jitter = max(pp->jitter, pp->fudgeminjitter); + #ifdef DEBUG if (debug) printf( @@ -532,6 +676,7 @@ refclock_receive( * filter. */ pp = peer->procptr; + pp->inpoll = FALSE; peer->leap = pp->leap; if (peer->leap == LEAP_NOTINSYNC) return; @@ -542,7 +687,7 @@ refclock_receive( report_event(PEVNT_REACH, peer, NULL); peer->timereachable = current_time; } - peer->reach |= 1; + peer->reach = (peer->reach << (peer->reach & 1)) | 1; peer->reftime = pp->lastref; peer->aorg = pp->lastrec; peer->rootdisp = pp->disp; @@ -1080,6 +1225,8 @@ refclock_control( pp->sloppyclockflag &= ~CLK_FLAG4; pp->sloppyclockflag |= in->flags & CLK_FLAG4; } + if (in->haveflags & CLK_HAVEMINJIT) + pp->fudgeminjitter = in->fudgeminjitter; } /* @@ -1104,6 +1251,9 @@ refclock_control( out->haveflags |= CLK_HAVEFLAG3; if (CLK_FLAG4 & out->flags) out->haveflags |= CLK_HAVEFLAG4; + out->fudgeminjitter = pp->fudgeminjitter; + if (0.0 != out->fudgeminjitter) + out->haveflags |= CLK_HAVEMINJIT; out->timereset = current_time - pp->timestarted; out->polls = pp->polls; @@ -1367,7 +1517,8 @@ refclock_pps( */ pp->lastrec.l_ui = (u_int32)ap->ts.tv_sec + JAN_1970; pp->lastrec.l_uf = (u_int32)(dtemp * FRAC); - SAMPLE(dcorr); + clk_add_sample(pp, dcorr); + refclock_checkburst(peer, pp); #ifdef DEBUG if (debug > 1) @@ -1377,4 +1528,245 @@ refclock_pps( return (1); } #endif /* HAVE_PPSAPI */ + + +/* + * ------------------------------------------------------------------- + * refclock_ppsaugment(...) -- correlate with PPS edge + * + * This function is used to correlate a receive time stamp with a PPS + * edge time stamp. It applies the necessary fudges and then tries to + * move the receive time stamp to the corresponding edge. This can warp + * into future, if a transmission delay of more than 500ms is not + * compensated with a corresponding fudge time2 value, because then the + * next PPS edge is nearer than the last. (Similiar to what the PPS ATOM + * driver does, but we deal with full time stamps here, not just phase + * shift information.) Likewise, a negative fudge time2 value must be + * used if the reference time stamp correlates with the *following* PPS + * pulse. + * + * Note that the receive time fudge value only needs to move the receive + * stamp near a PPS edge but that close proximity is not required; + * +/-100ms precision should be enough. But since the fudge value will + * probably also be used to compensate the transmission delay when no + * PPS edge can be related to the time stamp, it's best to get it as + * close as possible. + * + * It should also be noted that the typical use case is matching to the + * preceeding edge, as most units relate their sentences to the current + * second. + * + * The function returns FALSE if there is no correlation possible, TRUE + * otherwise. Reason for failures are: + * + * - no PPS/ATOM unit given + * - PPS stamp is stale (that is, the difference between the PPS stamp + * and the corrected time stamp would exceed two seconds) + * - The phase difference is too close to 0.5, and the decision wether + * to move up or down is too sensitive to noise. + * + * On output, the receive time stamp is updated with the 'fixed' receive + * time. + * ------------------------------------------------------------------- + */ + +int/*BOOL*/ +refclock_ppsaugment( + const struct refclock_atom * ap , /* for PPS io */ + l_fp * rcvtime , + double rcvfudge, /* i/o read fudge */ + double ppsfudge /* pps fudge */ + ) +{ + l_fp delta[1]; + +#ifdef HAVE_PPSAPI + + pps_info_t pps_info; + struct timespec timeout; + l_fp stamp[1]; + uint32_t phase; + + static const uint32_t s_plim_hi = UINT32_C(1932735284); + static const uint32_t s_plim_lo = UINT32_C(2362232013); + + /* fixup receive time in case we have to bail out early */ + DTOLFP(rcvfudge, delta); + L_SUB(rcvtime, delta); + + if (NULL == ap) + return FALSE; + + ZERO(timeout); + ZERO(pps_info); + + /* fetch PPS stamp from ATOM block */ + if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC, + &pps_info, &timeout) < 0) + return FALSE; /* can't get time stamps */ + + /* get last active PPS edge before receive */ + if (ap->pps_params.mode & PPS_CAPTUREASSERT) + timeout = pps_info.assert_timestamp; + else if (ap->pps_params.mode & PPS_CAPTURECLEAR) + timeout = pps_info.clear_timestamp; + else + return FALSE; /* WHICH edge, please?!? */ + + /* convert PPS stamp to l_fp and apply fudge */ + *stamp = tspec_stamp_to_lfp(timeout); + DTOLFP(ppsfudge, delta); + L_SUB(stamp, delta); + + /* Get difference between PPS stamp (--> yield) and receive time + * (--> base) + */ + *delta = *stamp; + L_SUB(delta, rcvtime); + + /* check if either the PPS or the STAMP is stale in relation + * to each other. Bail if it is so... + */ + phase = delta->l_ui; + if (phase >= 2 && phase < (uint32_t)-2) + return FALSE; /* PPS is stale, don't use it */ + + /* If the phase is too close to 0.5, the decision whether to + * move up or down is becoming noise sensitive. That is, we + * might amplify usec noise between samples into seconds with a + * simple threshold. This can be solved by a Schmitt Trigger + * characteristic, but that would also require additional state + * where we could remember previous decisions. Easier to play + * dead duck and wait for the conditions to become clear. + */ + phase = delta->l_uf; + if (phase > s_plim_hi && phase < s_plim_lo) + return FALSE; /* we're in the noise lock gap */ + + /* sign-extend fraction into seconds */ + delta->l_ui = UINT32_C(0) - ((phase >> 31) & 1); + /* add it up now */ + L_ADD(rcvtime, delta); + return TRUE; + +# else /* have no PPS support at all */ + + /* just fixup receive time and fail */ + UNUSED_ARG(ap); + UNUSED_ARG(ppsfudge); + + DTOLFP(rcvfudge, delta); + L_SUB(rcvtime, delta); + return FALSE; + +# endif +} + +/* + * ------------------------------------------------------------------- + * check if it makes sense to schedule an 'early' poll to get the clock + * up fast after start or longer signal dropout. + */ +static void +refclock_checkburst( + struct peer * peer, + struct refclockproc * pp + ) +{ + uint32_t limit; /* when we should poll */ + u_int needs; /* needed number of samples */ + + /* Paranoia: stop here if peer and clockproc don't match up. + * And when a poll is actually pending, we don't have to do + * anything, either. Likewise if the reach mask is full, of + * course, and if the filter has stabilized. + */ + if (pp->inpoll || (peer->procptr != pp) || + ((peer->reach == 0xFF) && (peer->disp <= MAXDISTANCE))) + return; + + /* If the next poll is soon enough, bail out, too: */ + limit = current_time + 1; + if (peer->nextdate <= limit) + return; + + /* Derive the number of samples needed from the popcount of the + * reach mask. With less samples available, we break away. + */ + needs = peer->reach; + needs -= (needs >> 1) & 0x55; + needs = (needs & 0x33) + ((needs >> 2) & 0x33); + needs = (needs + (needs >> 4)) & 0x0F; + if (needs > 6) + needs = 6; + else if (needs < 3) + needs = 3; + if (clk_cnt_sample(pp) < needs) + return; + + /* Get serious. Reduce the poll to minimum and schedule early. + * (Changing the peer poll is probably in vain, as it will be + * re-adjusted, but maybe some time the hint will work...) + */ + peer->hpoll = peer->minpoll; + peer->nextdate = limit; +} + +/* + * ------------------------------------------------------------------- + * Save the last timecode string, making sure it's properly truncated + * if necessary and NUL terminated in any case. + */ +void +refclock_save_lcode( + struct refclockproc * pp, + char const * tc, + size_t len + ) +{ + if (len == (size_t)-1) + len = strnlen(tc, sizeof(pp->a_lastcode) - 1); + else if (len >= sizeof(pp->a_lastcode)) + len = sizeof(pp->a_lastcode) - 1; + + pp->lencode = (u_short)len; + memcpy(pp->a_lastcode, tc, len); + pp->a_lastcode[len] = '\0'; +} + +/* format data into a_lastcode */ +void +refclock_vformat_lcode( + struct refclockproc * pp, + char const * fmt, + va_list va + ) +{ + long len; + + len = vsnprintf(pp->a_lastcode, sizeof(pp->a_lastcode), fmt, va); + if (len <= 0) + len = 0; + else if (len >= sizeof(pp->a_lastcode)) + len = sizeof(pp->a_lastcode) - 1; + + pp->lencode = (u_short)len; + pp->a_lastcode[len] = '\0'; + /* !note! the NUL byte is needed in case vsnprintf() really fails */ +} + +void +refclock_format_lcode( + struct refclockproc * pp, + char const * fmt, + ... + ) +{ + va_list va; + + va_start(va, fmt); + refclock_vformat_lcode(pp, fmt, va); + va_end(va); +} + #endif /* REFCLOCK */ diff --git a/contrib/ntp/ntpd/ntp_request.c b/contrib/ntp/ntpd/ntp_request.c index 53585088a67f6..bffdec5a9d1dd 100644 --- a/contrib/ntp/ntpd/ntp_request.c +++ b/contrib/ntp/ntpd/ntp_request.c @@ -841,7 +841,7 @@ peer_info ( pp = findexistingpeer(&addr, NULL, NULL, -1, 0, NULL); if (NULL == pp) continue; - if (IS_IPV6(srcadr)) { + if (IS_IPV6(&pp->srcadr)) { if (pp->dstadr) ip->dstadr6 = (MDF_BCAST == pp->cast_flags) @@ -1819,7 +1819,7 @@ do_restrict( bad = 0; while (items-- > 0 && !bad) { memcpy(&cr, datap, item_sz); - cr.flags = ntohs(cr.flags); + cr.flags = ntohs(cr.flags); /* XXX */ cr.mflags = ntohs(cr.mflags); if (~RESM_NTPONLY & cr.mflags) bad |= 1; @@ -1854,7 +1854,7 @@ do_restrict( while (items-- > 0) { memcpy(&cr, datap, item_sz); - cr.flags = ntohs(cr.flags); + cr.flags = ntohs(cr.flags); /* XXX: size */ cr.mflags = ntohs(cr.mflags); cr.ippeerlimit = ntohs(cr.ippeerlimit); if (client_v6_capable && cr.v6_flag) { diff --git a/contrib/ntp/ntpd/ntp_restrict.c b/contrib/ntp/ntpd/ntp_restrict.c index f3c1293425506..fe2935d9e071b 100644 --- a/contrib/ntp/ntpd/ntp_restrict.c +++ b/contrib/ntp/ntpd/ntp_restrict.c @@ -96,7 +96,7 @@ static restrict_u restrict_def6; * "restrict source ..." enabled knob and restriction bits. */ static int restrict_source_enabled; -static u_short restrict_source_rflags; +static u_int32 restrict_source_rflags; static u_short restrict_source_mflags; static short restrict_source_ippeerlimit; @@ -141,7 +141,7 @@ dump_restrict( inet_ntop(AF_INET, &sia, as, sizeof as); inet_ntop(AF_INET, &sim, ms, sizeof ms); } - mprintf("restrict node at %p: %s/%s count %d, rflags %05x, mflags %05x, ippeerlimit %d, expire %lu, next %p\n", + mprintf("restrict node at %p: %s/%s count %d, rflags %08x, mflags %04x, ippeerlimit %d, expire %lu, next %p\n", res, as, ms, res->count, res->rflags, res->mflags, res->ippeerlimit, res->expire, res->link); return; @@ -154,8 +154,6 @@ dump_restrict( void dump_restricts(void) { - int defaultv4_done = 0; - int defaultv6_done = 0; restrict_u * res; restrict_u * next; @@ -570,6 +568,7 @@ restrictions( r4a->rflags = match->rflags; r4a->ippeerlimit = match->ippeerlimit; } + return; } @@ -795,8 +794,8 @@ restrict_source( return; hack_restrict(RESTRICT_FLAGS, addr, &onesmask, - restrict_source_ippeerlimit, restrict_source_mflags, - restrict_source_rflags, expire); + restrict_source_ippeerlimit, + restrict_source_mflags, restrict_source_rflags, expire); DPRINTF(1, ("restrict_source: %s host restriction added\n", stoa(addr))); } diff --git a/contrib/ntp/ntpd/ntp_scanner.c b/contrib/ntp/ntpd/ntp_scanner.c index 42b83c84eec65..08c203c63e8ac 100644 --- a/contrib/ntp/ntpd/ntp_scanner.c +++ b/contrib/ntp/ntpd/ntp_scanner.c @@ -73,17 +73,26 @@ keyword( { size_t i; const char *text; + static char sbuf[64]; i = token - LOWEST_KEYWORD_ID; - if (i < COUNTOF(keyword_text)) - text = keyword_text[i]; - else - text = NULL; + switch (token) { + case T_ServerresponseFuzz: + text = "serverresponse fuzz"; + break; + + default: + if (i < COUNTOF(keyword_text)) { + text = keyword_text[i]; + } else { + snprintf(sbuf, sizeof sbuf, + "(keyword #%u not found)", token); + text = sbuf; + } + } - return (text != NULL) - ? text - : "(keyword not found)"; + return text; } diff --git a/contrib/ntp/ntpd/ntp_util.c b/contrib/ntp/ntpd/ntp_util.c index d8798de1286e2..11ca620172cd1 100644 --- a/contrib/ntp/ntpd/ntp_util.c +++ b/contrib/ntp/ntpd/ntp_util.c @@ -58,6 +58,7 @@ static char *key_file_name; /* keys file name */ static char *leapfile_name; /* leapseconds file name */ static struct stat leapfile_stat; /* leapseconds file stat() buffer */ static int /*BOOL*/have_leapfile = FALSE; +static int /*BOOL*/chck_leaphash = TRUE; char *stats_drift_file; /* frequency file name */ static char *stats_temp_file; /* temp frequency file name */ static double wander_resid; /* last frequency update */ @@ -87,7 +88,7 @@ static FILEGEN timingstats; /* * This controls whether stats are written to the fileset. Provided - * so that ntpdc can turn off stats when the file system fills up. + * so that ntpdc can turn off stats when the file system fills up. */ int stats_control; @@ -103,7 +104,7 @@ static void record_sys_stats(void); void ntpd_time_stepped(void); static void check_leap_expiration(int, uint32_t, const time_t*); -/* +/* * Prototypes */ #ifdef DEBUG @@ -287,15 +288,15 @@ write_stats(void) /* atomic */ #ifdef SYS_WINNT if (_unlink(stats_drift_file)) /* rename semantics differ under NT */ - msyslog(LOG_WARNING, - "Unable to remove prior drift file %s, %m", + msyslog(LOG_WARNING, + "Unable to remove prior drift file %s, %m", stats_drift_file); #endif /* SYS_WINNT */ #ifndef NO_RENAME if (rename(stats_temp_file, stats_drift_file)) - msyslog(LOG_WARNING, - "Unable to rename temp drift file %s to %s, %m", + msyslog(LOG_WARNING, + "Unable to rename temp drift file %s to %s, %m", stats_temp_file, stats_drift_file); #else /* we have no rename NFS of ftp in use */ @@ -329,7 +330,8 @@ write_stats(void) void stats_config( int item, - const char *invalue /* only one type so far */ + const char *invalue, /* only one type so far */ + int optflag ) { FILE *fp; @@ -385,7 +387,7 @@ stats_config( } else { value = newvalue; } -#else +#else value = invalue; #endif /* SYS_WINNT */ @@ -399,7 +401,7 @@ stats_config( break; stats_drift_file = erealloc(stats_drift_file, len + 1); - stats_temp_file = erealloc(stats_temp_file, + stats_temp_file = erealloc(stats_temp_file, len + sizeof(".TEMP")); memcpy(stats_drift_file, value, (size_t)(len+1)); memcpy(stats_temp_file, value, (size_t)len); @@ -414,7 +416,7 @@ stats_config( if (fscanf(fp, "%lf", &old_drift) != 1) { msyslog(LOG_ERR, - "format error frequency file %s", + "format error frequency file %s", stats_drift_file); fclose(fp); break; @@ -483,9 +485,11 @@ stats_config( leapfile_name = erealloc(leapfile_name, len + 1); memcpy(leapfile_name, value, len + 1); + chck_leaphash = optflag; if (leapsec_load_file( - leapfile_name, &leapfile_stat, TRUE, TRUE)) + leapfile_name, &leapfile_stat, + TRUE, TRUE, chck_leaphash)) { leap_signature_t lsig; @@ -892,11 +896,11 @@ check_leap_file( /* just do nothing if there is no leap file */ if ( ! (leapfile_name && *leapfile_name)) return; - + /* try to load leapfile, force it if no leapfile loaded yet */ if (leapsec_load_file( leapfile_name, &leapfile_stat, - !have_leapfile, is_daily_check)) + !have_leapfile, is_daily_check, chck_leaphash)) have_leapfile = TRUE; else if (!have_leapfile) return; @@ -921,7 +925,7 @@ check_leap_expiration( * level and frequency (once/hour or once/day, depending on the * state. */ - rc = leapsec_daystolive(ntptime, systime); + rc = leapsec_daystolive(ntptime, systime); if (rc == 0) { msyslog(LOG_WARNING, "%s ('%s'): will expire in less than one day", @@ -929,7 +933,7 @@ check_leap_expiration( } else if (is_daily_check && rc < 28) { if (rc < 0) msyslog(LOG_ERR, - "%s ('%s'): expired less than %d day%s ago", + "%s ('%s'): expired %d day%s ago", logPrefix, leapfile_name, -rc, (rc == -1 ? "" : "s")); else msyslog(LOG_WARNING, @@ -952,7 +956,7 @@ getauthkeys( len = strlen(keyfile); if (!len) return; - + #ifndef SYS_WINNT key_file_name = erealloc(key_file_name, len + 1); memcpy(key_file_name, keyfile, len + 1); diff --git a/contrib/ntp/ntpd/ntpd-opts.c b/contrib/ntp/ntpd/ntpd-opts.c index f07269d008b5d..e463b4b4822f8 100644 --- a/contrib/ntp/ntpd/ntpd-opts.c +++ b/contrib/ntp/ntpd/ntpd-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) * - * It has been AutoGen-ed February 20, 2019 at 09:56:15 AM by AutoGen 5.18.5 + * It has been AutoGen-ed March 3, 2020 at 05:40:30 PM by AutoGen 5.18.5 * From the definitions ntpd-opts.def * and the template file options * @@ -18,7 +18,7 @@ * The ntpd program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -75,8 +75,8 @@ extern FILE * option_usage_fp; * static const strings for ntpd options */ static char const ntpd_opt_strs[3132] = -/* 0 */ "ntpd 4.2.8p13\n" - "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n" +/* 0 */ "ntpd 4.2.8p14\n" + "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, 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" "can be seen at:\n" @@ -205,12 +205,12 @@ static char const ntpd_opt_strs[3132] = /* 2901 */ "output version information and exit\0" /* 2937 */ "version\0" /* 2945 */ "NTPD\0" -/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p13\n" +/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p14\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" "\t\t[ <server1> ... <serverN> ]\n\0" /* 3082 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 3116 */ "\n\0" -/* 3118 */ "ntpd 4.2.8p13"; +/* 3118 */ "ntpd 4.2.8p14"; /** * ipv4 option description with @@ -1529,8 +1529,8 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpdOptions.pzCopyright */ - puts(_("ntpd 4.2.8p13\n\ -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\ + puts(_("ntpd 4.2.8p14\n\ +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, 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\ can be seen at:\n")); @@ -1670,7 +1670,7 @@ implied warranty.\n")); puts(_("output version information and exit")); /* referenced via ntpdOptions.pzUsageTitle */ - puts(_("ntpd - NTP daemon program - Ver. 4.2.8p13\n\ + puts(_("ntpd - NTP daemon program - Ver. 4.2.8p14\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ \t\t[ <server1> ... <serverN> ]\n")); @@ -1678,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ puts(_("\n")); /* referenced via ntpdOptions.pzFullVersion */ - puts(_("ntpd 4.2.8p13")); + puts(_("ntpd 4.2.8p14")); /* referenced via ntpdOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpd/ntpd-opts.h b/contrib/ntp/ntpd/ntpd-opts.h index e7e8a608d119e..a2e1904003c0c 100644 --- a/contrib/ntp/ntpd/ntpd-opts.h +++ b/contrib/ntp/ntpd/ntpd-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.h) * - * It has been AutoGen-ed February 20, 2019 at 09:56:15 AM by AutoGen 5.18.5 + * It has been AutoGen-ed March 3, 2020 at 05:40:30 PM by AutoGen 5.18.5 * From the definitions ntpd-opts.def * and the template file options * @@ -18,7 +18,7 @@ * The ntpd program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -106,9 +106,9 @@ typedef enum { /** count of all options for ntpd */ #define OPTION_CT 38 /** ntpd version */ -#define NTPD_VERSION "4.2.8p13" +#define NTPD_VERSION "4.2.8p14" /** Full ntpd version text */ -#define NTPD_FULL_VERSION "ntpd 4.2.8p13" +#define NTPD_FULL_VERSION "ntpd 4.2.8p14" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/ntpd/ntpd.1ntpdman b/contrib/ntp/ntpd/ntpd.1ntpdman index 92d053e408738..675bd799bd905 100644 --- a/contrib/ntp/ntpd/ntpd.1ntpdman +++ b/contrib/ntp/ntpd/ntpd.1ntpdman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpd 1ntpdman "20 Feb 2019" "4.2.8p13" "User Commands" +.TH ntpd 1ntpdman "03 Mar 2020" "4.2.8p14" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:46 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:05 PM by AutoGen 5.18.5 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -979,7 +979,7 @@ RFC5908 .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH BUGS The diff --git a/contrib/ntp/ntpd/ntpd.1ntpdmdoc b/contrib/ntp/ntpd/ntpd.1ntpdmdoc index 962089892019a..8d06869e5afcd 100644 --- a/contrib/ntp/ntpd/ntpd.1ntpdmdoc +++ b/contrib/ntp/ntpd/ntpd.1ntpdmdoc @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTPD 1ntpdmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:37 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:55 PM by AutoGen 5.18.5 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -886,7 +886,7 @@ A snapshot of this documentation is available in HTML format in .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh BUGS The diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c index f02e8ceefd1f3..aac315c430daa 100644 --- a/contrib/ntp/ntpd/ntpd.c +++ b/contrib/ntp/ntpd/ntpd.c @@ -45,6 +45,9 @@ #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif +#ifdef HAVE_SYS_WAIT_H +# include <sys/wait.h> +#endif #include <stdio.h> #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> @@ -82,6 +85,10 @@ # include <sys/mman.h> #endif +#ifdef HAVE_SYSEXITS_H +# include <sysexits.h> +#endif + #ifdef HAVE_TERMIOS_H # include <termios.h> #endif @@ -154,6 +161,21 @@ DNSServiceRef mdns; #endif +/* In case 'sysexits.h' is unavailable, define some exit codes here: */ +#ifndef EX_SOFTWARE +# define EX_SOFTWARE 70 +#endif +#ifndef EX_OSERR +# define EX_OSERR 71 +#endif +#ifndef EX_IOERR +# define EX_IOERR 74 +#endif +#ifndef EX_PROTOCOL +#define EX_PROTOCOL 76 +#endif + + #ifdef HAVE_SETPGRP_0 # define ntp_setpgrp(x, y) setpgrp() #else @@ -192,6 +214,10 @@ int mdnsreg = FALSE; int mdnstries = 5; #endif /* HAVE_DNSREGISTRATION */ +#ifdef HAVE_LINUX_CAPABILITIES +int have_caps; /* runtime check whether capabilities work */ +#endif /* HAVE_LINUX_CAPABILITIES */ + #ifdef HAVE_DROPROOT int droproot; int root_dropped; @@ -205,7 +231,7 @@ struct passwd *pw; #endif /* HAVE_DROPROOT */ #ifdef HAVE_WORKING_FORK -int waitsync_fd_to_close = -1; /* -w/--wait-sync */ +int daemon_pipe[2] = { -1, -1 }; #endif /* @@ -235,7 +261,8 @@ static RETSIGTYPE finish (int); #endif #if !defined(SIM) && defined(HAVE_WORKING_FORK) -static int wait_child_sync_if (int, long); +static int wait_child_sync_if (int, unsigned long); +static int wait_child_exit_if (pid_t, int); #endif #if !defined(SIM) && !defined(SYS_WINNT) @@ -402,18 +429,16 @@ main( return ntpsim(argc, argv); } -#else /* !SIM follows */ -#ifdef NO_MAIN_ALLOWED +#elif defined(NO_MAIN_ALLOWED) CALL(ntpd,"ntpd",ntpdmain); -#else /* !NO_MAIN_ALLOWED follows */ -#ifndef SYS_WINNT +#elif !defined(SYS_WINNT) int main( int argc, char *argv[] ) { -#ifdef __FreeBSD__ +# ifdef __FreeBSD__ { /* * We Must disable ASLR stack gap on FreeBSD to avoid a @@ -424,12 +449,10 @@ main( pid_t my_pid = getpid(); procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); } -#endif +# endif return ntpdmain(argc, argv); } #endif /* !SYS_WINNT */ -#endif /* !NO_MAIN_ALLOWED */ -#endif /* !SIM */ #ifdef _AIX /* @@ -560,13 +583,13 @@ set_process_priority(void) # ifdef HAVE_WORKING_FORK static void detach_from_terminal( - int pipe_fds[2], + int pipe[2], long wait_sync, const char *logfilename ) { - int rc; - int exit_code; + pid_t cpid; + int exit_code; # if !defined(HAVE_SETSID) && !defined (HAVE_SETPGID) && defined(TIOCNOTTY) int fid; # endif @@ -574,16 +597,28 @@ detach_from_terminal( struct sigaction sa; # endif - rc = fork(); - if (-1 == rc) { - exit_code = (errno) ? errno : -1; - msyslog(LOG_ERR, "fork: %m"); - exit(exit_code); - } - if (rc > 0) { + cpid = fork(); + if (0 != cpid) { /* parent */ - exit_code = wait_child_sync_if(pipe_fds[0], - wait_sync); + if (-1 == cpid) { + msyslog(LOG_ERR, "fork: %m"); + exit_code = EX_OSERR; + } else { + close(pipe[1]); + pipe[1] = -1; + exit_code = wait_child_sync_if( + pipe[0], wait_sync); + DPRINTF(1, ("sync_if: rc=%d\n", exit_code)); + if (exit_code <= 0) { + /* probe daemon exit code -- wait for + * child process if we have an unexpected + * EOF on the monitor pipe. + */ + exit_code = wait_child_exit_if( + cpid, (exit_code < 0)); + DPRINTF(1, ("exit_if: rc=%d\n", exit_code)); + } + } exit(exit_code); } @@ -598,7 +633,8 @@ detach_from_terminal( syslog_file = NULL; syslogit = TRUE; } - close_all_except(waitsync_fd_to_close); + close_all_except(pipe[1]); + pipe[0] = -1; INSIST(0 == open("/dev/null", 0) && 1 == dup2(0, 1) \ && 2 == dup2(0, 2)); @@ -805,9 +841,6 @@ ntpdmain( # endif # if defined(HAVE_WORKING_FORK) long wait_sync = 0; - int pipe_fds[2]; - int rc; - int exit_code; # endif /* HAVE_WORKING_FORK*/ # ifdef SCO5_CLOCK int fd; @@ -873,9 +906,16 @@ ntpdmain( " %s", saved_argv[i]); cp += strlen(cp); } - msyslog(LOG_INFO, "%s", buf); + msyslog(LOG_NOTICE, "%s", buf); } + msyslog(LOG_NOTICE, "----------------------------------------------------"); + msyslog(LOG_NOTICE, "ntp-4 is maintained by Network Time Foundation,"); + msyslog(LOG_NOTICE, "Inc. (NTF), a non-profit 501(c)(3) public-benefit"); + msyslog(LOG_NOTICE, "corporation. Support and training for ntp-4 are"); + msyslog(LOG_NOTICE, "available at https://www.nwtime.org/support"); + msyslog(LOG_NOTICE, "----------------------------------------------------"); + /* * Install trap handlers to log errors and assertion failures. * Default handlers print to stderr which doesn't work if detached. @@ -950,27 +990,24 @@ ntpdmain( # endif # ifdef HAVE_WORKING_FORK - /* make sure the FDs are initialised */ - pipe_fds[0] = -1; - pipe_fds[1] = -1; - do { /* 'loop' once */ - if (!HAVE_OPT( WAIT_SYNC )) - break; + /* make sure the FDs are initialised + * + * note: if WAIT_SYNC is requested, we *have* to fork. This will + * overide any '-n' (nofork) or '-d' (debug) option presented on + * the command line! + */ + if (HAVE_OPT(WAIT_SYNC)) { wait_sync = OPT_VALUE_WAIT_SYNC; - if (wait_sync <= 0) { + if (wait_sync <= 0) wait_sync = 0; - break; - } - /* -w requires a fork() even with debug > 0 */ - nofork = FALSE; - if (pipe(pipe_fds)) { - exit_code = (errno) ? errno : -1; - msyslog(LOG_ERR, - "Pipe creation failed for --wait-sync: %m"); - exit(exit_code); - } - waitsync_fd_to_close = pipe_fds[1]; - } while (0); /* 'loop' once */ + else + nofork = FALSE; + } + if ( !nofork && pipe(daemon_pipe)) { + msyslog(LOG_ERR, + "Pipe creation failed for --wait-sync/daemon: %m"); + exit(EX_OSERR); + } # endif /* HAVE_WORKING_FORK */ init_lib(); @@ -996,12 +1033,11 @@ ntpdmain( /* * Detach us from the terminal. May need an #ifndef GIZMO. */ - if (!nofork) { - # ifdef HAVE_WORKING_FORK - detach_from_terminal(pipe_fds, wait_sync, logfilename); -# endif /* HAVE_WORKING_FORK */ + if (!nofork) { + detach_from_terminal(daemon_pipe, wait_sync, logfilename); } +# endif /* HAVE_WORKING_FORK */ # ifdef SCO5_CLOCK /* @@ -1146,12 +1182,33 @@ ntpdmain( report_event(EVNT_SYSRESTART, NULL, NULL); initializing = FALSE; +# ifdef HAVE_LINUX_CAPABILITIES + { + /* Check that setting capabilities actually works; we might be + * run on a kernel with disabled capabilities. We must not + * drop privileges in this case. + */ + cap_t caps; + caps = cap_from_text("cap_sys_time,cap_setuid,cap_setgid,cap_sys_chroot,cap_net_bind_service=pe"); + if ( ! caps) { + msyslog( LOG_ERR, "cap_from_text() failed: %m" ); + exit(-1); + } + have_caps = (cap_set_proc(caps) == 0); + cap_free(caps); /* caps not NULL here! */ + } +# endif /* HAVE_LINUX_CAPABILITIES */ + # ifdef HAVE_DROPROOT +# ifdef HAVE_LINUX_CAPABILITIES + if (droproot && have_caps) { +# else if (droproot) { +# endif /*HAVE_LINUX_CAPABILITIES*/ -#ifdef NEED_EARLY_FORK +# ifdef NEED_EARLY_FORK fork_nonchroot_worker(); -#endif +# endif /* Drop super-user privileges and chroot now if the OS supports this */ @@ -1387,28 +1444,28 @@ int scmp_sc[] = { } #endif /* LIBSECCOMP and KERN_SECCOMP */ -#ifdef SYS_WINNT +#if defined(SYS_WINNT) ntservice_isup(); -#endif +#elif defined(HAVE_WORKING_FORK) + if (daemon_pipe[1] != -1) { + write(daemon_pipe[1], "R\n", 2); + } +#endif /* HAVE_WORKING_FORK */ -# ifdef HAVE_IO_COMPLETION_PORT +# ifndef HAVE_IO_COMPLETION_PORT + BLOCK_IO_AND_ALARM(); + was_alarmed = FALSE; +# endif for (;;) { #if !defined(SIM) && defined(SIGDIE1) if (signalled) finish_safe(signo); #endif +# ifdef HAVE_IO_COMPLETION_PORT GetReceivedBuffers(); -# else /* normal I/O */ - - BLOCK_IO_AND_ALARM(); - was_alarmed = FALSE; - for (;;) { -#if !defined(SIM) && defined(SIGDIE1) - if (signalled) - finish_safe(signo); -#endif +# else /* normal I/O */ if (alarm_flag) { /* alarmed? */ was_alarmed = TRUE; alarm_flag = FALSE; @@ -1573,26 +1630,30 @@ finish( * wait_child_sync_if - implements parent side of -w/--wait-sync */ # ifdef HAVE_WORKING_FORK + static int wait_child_sync_if( - int pipe_read_fd, - long wait_sync + int pipe_read_fd, + unsigned long wait_sync ) { int rc; - int exit_code; + char ch; time_t wait_end_time; time_t cur_time; time_t wait_rem; fd_set readset; struct timeval wtimeout; - if (0 == wait_sync) - return 0; + /* we wait a bit for the child in *any* case, because on failure + * of the child we have to get and inspect the exit code! + */ + wait_end_time = time(NULL); + if (wait_sync) + wait_end_time += wait_sync; + else + wait_end_time += 30; - /* waitsync_fd_to_close used solely by child */ - close(waitsync_fd_to_close); - wait_end_time = time(NULL) + wait_sync; do { cur_time = time(NULL); wait_rem = (wait_end_time > cur_time) @@ -1607,10 +1668,9 @@ wait_child_sync_if( if (-1 == rc) { if (EINTR == errno) continue; - exit_code = (errno) ? errno : -1; msyslog(LOG_ERR, - "--wait-sync select failed: %m"); - return exit_code; + "daemon startup: select failed: %m"); + return EX_IOERR; } if (0 == rc) { /* @@ -1627,16 +1687,70 @@ wait_child_sync_if( NULL, &wtimeout); if (0 == rc) /* select() timeout */ break; - else /* readable */ + } + rc = read(pipe_read_fd, &ch, 1); + if (rc == 0) { + DPRINTF(2, ("daemon control: got EOF\n")); + return -1; /* unexpected EOF, check daemon */ + } else if (rc == 1) { + DPRINTF(2, ("daemon control: got '%c'\n", + (ch >= ' ' ? ch : '.'))); + if (ch == 'R' && !wait_sync) return 0; - } else /* readable */ - return 0; + if (ch == 'S' && wait_sync) + return 0; + } else { + DPRINTF(2, ("daemon control: read 1 char failed: %s\n", + strerror(errno))); + return EX_IOERR; + } } while (wait_rem > 0); - fprintf(stderr, "%s: -w/--wait-sync %ld timed out.\n", - progname, wait_sync); - return ETIMEDOUT; + if (wait_sync) { + fprintf(stderr, "%s: -w/--wait-sync %ld timed out.\n", + progname, wait_sync); + return EX_PROTOCOL; + } else { + fprintf(stderr, "%s: daemon startup monitoring timed out.\n", + progname); + return 0; + } +} + + +static int +wait_child_exit_if( + pid_t cpid, + int blocking + ) +{ +# ifdef HAVE_WAITPID + int rc = 0; + int wstatus; + if (cpid == waitpid(cpid, &wstatus, (blocking ? 0 : WNOHANG))) { + DPRINTF(1, ("child (pid=%d) dead now\n", cpid)); + if (WIFEXITED(wstatus)) { + rc = WEXITSTATUS(wstatus); + msyslog(LOG_ERR, "daemon child exited with code %d", + rc); + } else if (WIFSIGNALED(wstatus)) { + rc = EX_SOFTWARE; + msyslog(LOG_ERR, "daemon child died with signal %d", + WTERMSIG(wstatus)); + } else { + rc = EX_SOFTWARE; + msyslog(LOG_ERR, "daemon child died with unknown cause"); + } + } else { + DPRINTF(1, ("child (pid=%d) still alive\n", cpid)); + } + return rc; +# else + UNUSED_ARG(cpid); + return 0; +# endif } + # endif /* HAVE_WORKING_FORK */ diff --git a/contrib/ntp/ntpd/ntpd.html b/contrib/ntp/ntpd/ntpd.html index 50a3ac86808cb..4ac6127dda456 100644 --- a/contrib/ntp/ntpd/ntpd.html +++ b/contrib/ntp/ntpd/ntpd.html @@ -67,7 +67,7 @@ The program can operate in any of several modes, including client/server, symmetric and broadcast modes, and with both symmetric-key and public-key cryptography. </p> -<p>This document applies to version 4.2.8p13 of <code>ntpd</code>. +<p>This document applies to version 4.2.8p14 of <code>ntpd</code>. </p> <a name="SEC_Overview"></a> <h2 class="shortcontents-heading">Short Table of Contents</h2> @@ -309,7 +309,7 @@ used to select the program, defaulting to <samp>more</samp>. Both will exit with a status code of 0. </p> <div class="example"> -<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p12 +<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p14 Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \ [ <server1> ... <serverN> ] Flg Arg Option-Name Description @@ -331,7 +331,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]. -g no panicgate Allow the first adjustment to be Big - may appear multiple times -G no force-step-once Step any initial offset correction. - -i Str jaildir Jail directory + -i --- jaildir built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs -I Str interface Listen on an interface name or address - may appear multiple times -k Str keyfile path to symmetric keys @@ -354,7 +354,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]. -s Str statsdir Statistics file location -t Str trustedkey Trusted key number - may appear multiple times - -u Str user Run as userid (or userid:groupid) + -u --- user built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs -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 diff --git a/contrib/ntp/ntpd/ntpd.man.in b/contrib/ntp/ntpd/ntpd.man.in index ed5a2f0bb24f0..087af030cf208 100644 --- a/contrib/ntp/ntpd/ntpd.man.in +++ b/contrib/ntp/ntpd/ntpd.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpd @NTPD_MS@ "20 Feb 2019" "4.2.8p13" "User Commands" +.TH ntpd @NTPD_MS@ "03 Mar 2020" "4.2.8p14" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:46 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:41:05 PM by AutoGen 5.18.5 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -979,7 +979,7 @@ RFC5908 .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH BUGS The diff --git a/contrib/ntp/ntpd/ntpd.mdoc.in b/contrib/ntp/ntpd/ntpd.mdoc.in index 8e3d427999327..9f360073d3324 100644 --- a/contrib/ntp/ntpd/ntpd.mdoc.in +++ b/contrib/ntp/ntpd/ntpd.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 20 2019 +.Dd March 3 2020 .Dt NTPD @NTPD_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 20, 2019 at 09:56:37 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed March 3, 2020 at 05:40:55 PM by AutoGen 5.18.5 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -886,7 +886,7 @@ A snapshot of this documentation is available in HTML format in .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh BUGS The diff --git a/contrib/ntp/ntpd/psl0.conf b/contrib/ntp/ntpd/psl0.conf new file mode 100644 index 0000000000000..f8ce504afb672 --- /dev/null +++ b/contrib/ntp/ntpd/psl0.conf @@ -0,0 +1 @@ +pollskewlist default 0|0 diff --git a/contrib/ntp/ntpd/psl1.conf b/contrib/ntp/ntpd/psl1.conf new file mode 100644 index 0000000000000..6cf26b34f6cfb --- /dev/null +++ b/contrib/ntp/ntpd/psl1.conf @@ -0,0 +1 @@ +pollskewlist default 4|4 diff --git a/contrib/ntp/ntpd/psl2.conf b/contrib/ntp/ntpd/psl2.conf new file mode 100644 index 0000000000000..e6a3d9ec62b28 --- /dev/null +++ b/contrib/ntp/ntpd/psl2.conf @@ -0,0 +1 @@ +pollskewlist 3 3|3 4 4|4 default 5|5 diff --git a/contrib/ntp/ntpd/refclock_gpsdjson.c b/contrib/ntp/ntpd/refclock_gpsdjson.c index 78a4fc82fcc9d..0cb2fc408abbe 100644 --- a/contrib/ntp/ntpd/refclock_gpsdjson.c +++ b/contrib/ntp/ntpd/refclock_gpsdjson.c @@ -949,7 +949,7 @@ add_clock_sample( pp->lastref = stamp; if (pp->coderecv == pp->codeproc) refclock_report(peer, CEVNT_NOMINAL); - refclock_process_offset(pp, stamp, recvt, pp->fudgetime1); + refclock_process_offset(pp, stamp, recvt, 0.0); } /* ------------------------------------------------------------------ */ diff --git a/contrib/ntp/ntpd/refclock_jupiter.c b/contrib/ntp/ntpd/refclock_jupiter.c index 8d6cde2481a7b..815786a379860 100644 --- a/contrib/ntp/ntpd/refclock_jupiter.c +++ b/contrib/ntp/ntpd/refclock_jupiter.c @@ -35,6 +35,7 @@ # include <config.h> #endif +/* This clock *REQUIRES* the PPS API to be available */ #if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI) #include "ntpd.h" @@ -42,15 +43,15 @@ #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include "ntp_calendar.h" +#include "ntp_calgps.h" +#include "timespecops.h" #include <stdio.h> #include <ctype.h> #include "jupiter.h" - -#ifdef HAVE_PPSAPI -# include "ppsapi_timepps.h" -#endif +#include "ppsapi_timepps.h" #ifdef WORDS_BIGENDIAN #define getshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) @@ -108,23 +109,18 @@ */ struct instance { struct peer *peer; /* peer */ - u_int pollcnt; /* poll message counter */ - u_int polled; /* Hand in a time sample? */ -#ifdef HAVE_PPSAPI + pps_params_t pps_params; /* pps parameters */ pps_info_t pps_info; /* last pps data */ pps_handle_t pps_handle; /* pps handle */ - u_int assert; /* pps edge to use */ - u_int hardpps; /* enable kernel mode */ - struct timespec ts; /* last timestamp */ -#endif - l_fp limit; - u_int gpos_gweek; /* Current GPOS GPS week number */ - u_int gpos_sweek; /* Current GPOS GPS seconds into week */ - u_int gweek; /* current GPS week number */ - u_int32 lastsweek; /* last seconds into GPS week */ - time_t timecode; /* current ntp timecode */ - u_int32 stime; /* used to detect firmware bug */ + u_int assert; /* pps edge to use */ + u_int hardpps; /* enable kernel mode */ + l_fp rcv_pps; /* last pps timestamp */ + l_fp rcv_next; /* rcv time of next reftime */ + TGpsDatum ref_next; /* next GPS time stamp to use with PPS */ + TGpsDatum piv_next; /* pivot for week date unfolding */ + uint16_t piv_hold; /* TTL for pivot value */ + uint16_t rcvtout; /* receive timeout ticker */ int wantid; /* don't reconfig on channel id msg */ u_int moving; /* mobile platform? */ u_char sloppyclockflag; /* fudge flags */ @@ -135,28 +131,27 @@ struct instance { /* * Function prototypes */ -static void jupiter_canmsg (struct instance *, u_int); +static void jupiter_canmsg (struct instance * const, u_int); static u_short jupiter_cksum (u_short *, u_int); -static int jupiter_config (struct instance *); +static int jupiter_config (struct instance * const); static void jupiter_debug (struct peer *, const char *, const char *, ...) NTP_PRINTF(3, 4); -static const char * jupiter_parse_t (struct instance *, u_short *); -static const char * jupiter_parse_gpos (struct instance *, u_short *); -static void jupiter_platform (struct instance *, u_int); +static const char * jupiter_parse_t (struct instance * const, u_short *, l_fp); +static const char * jupiter_parse_gpos(struct instance * const, u_short *); +static void jupiter_platform(struct instance * const, u_int); static void jupiter_poll (int, struct peer *); static void jupiter_control (int, const struct refclockstat *, struct refclockstat *, struct peer *); -#ifdef HAVE_PPSAPI -static int jupiter_ppsapi (struct instance *); -static int jupiter_pps (struct instance *); -#endif /* HAVE_PPSAPI */ -static int jupiter_recv (struct instance *); -static void jupiter_receive (struct recvbuf *rbufp); -static void jupiter_reqmsg (struct instance *, u_int, u_int); -static void jupiter_reqonemsg(struct instance *, u_int); -static char * jupiter_send (struct instance *, struct jheader *); +static int jupiter_ppsapi (struct instance * const); +static int jupiter_pps (struct instance * const); +static int jupiter_recv (struct instance * const); +static void jupiter_receive (struct recvbuf * const rbufp); +static void jupiter_reqmsg (struct instance * const, u_int, u_int); +static void jupiter_reqonemsg(struct instance * const, u_int); +static char * jupiter_send (struct instance * const, struct jheader *); static void jupiter_shutdown(int, struct peer *); static int jupiter_start (int, struct peer *); +static void jupiter_ticker (int, struct peer *); /* * Transfer vector @@ -168,7 +163,7 @@ struct refclock refclock_jupiter = { jupiter_control, /* (clock control) */ noentry, /* (clock init) */ noentry, /* (clock buginfo) */ - NOFLAGS /* not used */ + jupiter_ticker /* 1HZ ticker */ }; /* @@ -180,8 +175,8 @@ jupiter_start( struct peer *peer ) { - struct refclockproc *pp; - struct instance *instance; + struct refclockproc * const pp = peer->procptr; + struct instance * up; int fd; char gpsdev[20]; @@ -197,9 +192,8 @@ jupiter_start( } /* Allocate unit structure */ - instance = emalloc_zero(sizeof(*instance)); - instance->peer = peer; - pp = peer->procptr; + up = emalloc_zero(sizeof(*up)); + up->peer = peer; pp->io.clock_recv = jupiter_receive; pp->io.srcclock = peer; pp->io.datalen = 0; @@ -207,10 +201,10 @@ jupiter_start( if (!io_addclock(&pp->io)) { close(fd); pp->io.fd = -1; - free(instance); + free(up); return (0); } - pp->unitptr = instance; + pp->unitptr = up; /* * Initialize miscellaneous variables @@ -219,26 +213,25 @@ jupiter_start( pp->clockdesc = DESCRIPTION; memcpy((char *)&pp->refid, REFID, 4); -#ifdef HAVE_PPSAPI - instance->assert = 1; - instance->hardpps = 0; + up->assert = 1; + up->hardpps = 0; /* * Start the PPSAPI interface if it is there. Default to use * the assert edge and do not enable the kernel hardpps. */ - if (time_pps_create(fd, &instance->pps_handle) < 0) { - instance->pps_handle = 0; + if (time_pps_create(fd, &up->pps_handle) < 0) { + up->pps_handle = 0; msyslog(LOG_ERR, "refclock_jupiter: time_pps_create failed: %m"); } - else if (!jupiter_ppsapi(instance)) + else if (!jupiter_ppsapi(up)) goto clean_up; -#endif /* HAVE_PPSAPI */ - + /* Ensure the receiver is properly configured */ - if (!jupiter_config(instance)) + if (!jupiter_config(up)) goto clean_up; + jupiter_pps(up); /* get current PPS state */ return (1); clean_up: @@ -253,112 +246,158 @@ clean_up: static void jupiter_shutdown(int unit, struct peer *peer) { - struct instance *instance; - struct refclockproc *pp; - - pp = peer->procptr; - instance = pp->unitptr; - if (!instance) + struct refclockproc * const pp = peer->procptr; + struct instance * const up = pp->unitptr; + + if (!up) return; -#ifdef HAVE_PPSAPI - if (instance->pps_handle) { - time_pps_destroy(instance->pps_handle); - instance->pps_handle = 0; + if (up->pps_handle) { + time_pps_destroy(up->pps_handle); + up->pps_handle = 0; } -#endif /* HAVE_PPSAPI */ if (pp->io.fd != -1) io_closeclock(&pp->io); - free(instance); + free(up); } /* * jupiter_config - Configure the receiver */ static int -jupiter_config(struct instance *instance) +jupiter_config(struct instance * const up) { - jupiter_debug(instance->peer, __func__, "init receiver"); + jupiter_debug(up->peer, __func__, "init receiver"); /* * Initialize the unit variables */ - instance->sloppyclockflag = instance->peer->procptr->sloppyclockflag; - instance->moving = !!(instance->sloppyclockflag & CLK_FLAG2); - if (instance->moving) - jupiter_debug(instance->peer, __func__, "mobile platform"); - - instance->pollcnt = 2; - instance->polled = 0; - instance->gpos_gweek = 0; - instance->gpos_sweek = 0; - instance->gweek = 0; - instance->lastsweek = 2 * WEEKSECS; - instance->timecode = 0; - instance->stime = 0; - instance->ssize = 0; + up->sloppyclockflag = up->peer->procptr->sloppyclockflag; + up->moving = !!(up->sloppyclockflag & CLK_FLAG2); + if (up->moving) + jupiter_debug(up->peer, __func__, "mobile platform"); + + ZERO(up->rcv_next); + ZERO(up->ref_next); + ZERO(up->piv_next); + up->ssize = 0; /* Stop outputting all messages */ - jupiter_canmsg(instance, JUPITER_ALL); + jupiter_canmsg(up, JUPITER_ALL); /* Request the receiver id so we can syslog the firmware version */ - jupiter_reqonemsg(instance, JUPITER_O_ID); + jupiter_reqonemsg(up, JUPITER_O_ID); /* Flag that this the id was requested (so we don't get called again) */ - instance->wantid = 1; + up->wantid = 1; /* Request perodic time mark pulse messages */ - jupiter_reqmsg(instance, JUPITER_O_PULSE, 1); + jupiter_reqmsg(up, JUPITER_O_PULSE, 1); /* Request perodic geodetic position status */ - jupiter_reqmsg(instance, JUPITER_O_GPOS, 1); + jupiter_reqmsg(up, JUPITER_O_GPOS, 1); /* Set application platform type */ - if (instance->moving) - jupiter_platform(instance, JUPITER_I_PLAT_MED); + if (up->moving) + jupiter_platform(up, JUPITER_I_PLAT_MED); else - jupiter_platform(instance, JUPITER_I_PLAT_LOW); + jupiter_platform(up, JUPITER_I_PLAT_LOW); return (1); } -#ifdef HAVE_PPSAPI +static void +jupiter_checkpps( + struct refclockproc * const pp, + struct instance * const up + ) +{ + l_fp tstamp, delta; + struct calendar cd; + + if (jupiter_pps(up) || !up->piv_next.weeks) + return; + + /* check delay between pulse message and pulse. */ + delta = up->rcv_pps; /* set by jupiter_pps() */ + L_SUB(&delta, &up->rcv_next); /* recv time pulse message */ + if (delta.l_ui != 0 || delta.l_uf >= 0xC0000000) { + up->ref_next.weeks = 0; /* consider as consumed... */ + return; + } + + pp->lastrec = up->rcv_pps; + tstamp = ntpfp_from_gpsdatum(&up->ref_next); + refclock_process_offset(pp, tstamp, up->rcv_pps, pp->fudgetime1); + up->rcvtout = 2; + + gpscal_to_calendar(&cd, &up->ref_next); + refclock_save_lcode(pp, ntpcal_iso8601std(NULL, 0, &cd), + (size_t)-1); + up->ref_next.weeks = 0; /* consumed... */ +} + +/* + * jupiter_ticker - process periodic checks + */ +static void +jupiter_ticker(int unit, struct peer *peer) +{ + struct refclockproc * const pp = peer->procptr; + struct instance * const up = pp->unitptr; + + if (!up) + return; + + /* check if we can add another sample now */ + jupiter_checkpps(pp, up); + + /* check the pivot update cycle */ + if (up->piv_hold && !--up->piv_hold) + ZERO(up->piv_next); + + if (up->rcvtout) + --up->rcvtout; + else if (pp->coderecv != pp->codeproc) + refclock_samples_expire(pp, 1); +} + /* * Initialize PPSAPI */ int jupiter_ppsapi( - struct instance *instance /* unit structure pointer */ + struct instance * const up /* unit structure pointer */ ) { int capability; - if (time_pps_getcap(instance->pps_handle, &capability) < 0) { + if (time_pps_getcap(up->pps_handle, &capability) < 0) { msyslog(LOG_ERR, "refclock_jupiter: time_pps_getcap failed: %m"); return (0); } - memset(&instance->pps_params, 0, sizeof(pps_params_t)); - if (!instance->assert) - instance->pps_params.mode = capability & PPS_CAPTURECLEAR; + memset(&up->pps_params, 0, sizeof(pps_params_t)); + if (!up->assert) + up->pps_params.mode = capability & PPS_CAPTURECLEAR; else - instance->pps_params.mode = capability & PPS_CAPTUREASSERT; - if (!(instance->pps_params.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR))) { + up->pps_params.mode = capability & PPS_CAPTUREASSERT; + if (!(up->pps_params.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR))) { msyslog(LOG_ERR, "refclock_jupiter: invalid capture edge %d", - instance->assert); + up->assert); return (0); } - instance->pps_params.mode |= PPS_TSFMT_TSPEC; - if (time_pps_setparams(instance->pps_handle, &instance->pps_params) < 0) { + up->pps_params.mode |= PPS_TSFMT_TSPEC; + if (time_pps_setparams(up->pps_handle, &up->pps_params) < 0) { msyslog(LOG_ERR, "refclock_jupiter: time_pps_setparams failed: %m"); return (0); } - if (instance->hardpps) { - if (time_pps_kcbind(instance->pps_handle, PPS_KC_HARDPPS, - instance->pps_params.mode & ~PPS_TSFMT_TSPEC, + if (up->hardpps) { + if (time_pps_kcbind(up->pps_handle, PPS_KC_HARDPPS, + up->pps_params.mode & ~PPS_TSFMT_TSPEC, PPS_TSFMT_TSPEC) < 0) { msyslog(LOG_ERR, "refclock_jupiter: time_pps_kcbind failed: %m"); @@ -366,15 +405,15 @@ jupiter_ppsapi( } hardpps_enable = 1; } -/* instance->peer->precision = PPS_PRECISION; */ +/* up->peer->precision = PPS_PRECISION; */ #if DEBUG if (debug) { - time_pps_getparams(instance->pps_handle, &instance->pps_params); - jupiter_debug(instance->peer, __func__, + time_pps_getparams(up->pps_handle, &up->pps_params); + jupiter_debug(up->peer, __func__, "pps capability 0x%x version %d mode 0x%x kern %d", - capability, instance->pps_params.api_version, - instance->pps_params.mode, instance->hardpps); + capability, up->pps_params.api_version, + up->pps_params.mode, up->hardpps); } #endif @@ -387,48 +426,44 @@ jupiter_ppsapi( * Return 0 on failure and 1 on success. */ static int -jupiter_pps(struct instance *instance) +jupiter_pps(struct instance * const up) { pps_info_t pps_info; struct timespec timeout, ts; - double dtemp; l_fp tstmp; /* * Convert the timespec nanoseconds field to ntp l_fp units. */ - if (instance->pps_handle == 0) + if (up->pps_handle == 0) return 1; timeout.tv_sec = 0; timeout.tv_nsec = 0; - memcpy(&pps_info, &instance->pps_info, sizeof(pps_info_t)); - if (time_pps_fetch(instance->pps_handle, PPS_TSFMT_TSPEC, &instance->pps_info, + memcpy(&pps_info, &up->pps_info, sizeof(pps_info_t)); + if (time_pps_fetch(up->pps_handle, PPS_TSFMT_TSPEC, &up->pps_info, &timeout) < 0) return 1; - if (instance->pps_params.mode & PPS_CAPTUREASSERT) { + if (up->pps_params.mode & PPS_CAPTUREASSERT) { if (pps_info.assert_sequence == - instance->pps_info.assert_sequence) + up->pps_info.assert_sequence) return 1; - ts = instance->pps_info.assert_timestamp; - } else if (instance->pps_params.mode & PPS_CAPTURECLEAR) { + ts = up->pps_info.assert_timestamp; + } else if (up->pps_params.mode & PPS_CAPTURECLEAR) { if (pps_info.clear_sequence == - instance->pps_info.clear_sequence) + up->pps_info.clear_sequence) return 1; - ts = instance->pps_info.clear_timestamp; + ts = up->pps_info.clear_timestamp; } else { return 1; } - if ((instance->ts.tv_sec == ts.tv_sec) && (instance->ts.tv_nsec == ts.tv_nsec)) + + tstmp = tspec_stamp_to_lfp(ts); + if (L_ISEQU(&tstmp, &up->rcv_pps)) return 1; - instance->ts = ts; - tstmp.l_ui = (u_int32)ts.tv_sec + JAN_1970; - dtemp = ts.tv_nsec * FRAC / 1e9; - tstmp.l_uf = (u_int32)dtemp; - instance->peer->procptr->lastrec = tstmp; + up->rcv_pps = tstmp; return 0; } -#endif /* HAVE_PPSAPI */ /* * jupiter_poll - jupiter watchdog routine @@ -436,37 +471,25 @@ jupiter_pps(struct instance *instance) static void jupiter_poll(int unit, struct peer *peer) { - struct instance *instance; - struct refclockproc *pp; + struct refclockproc * const pp = peer->procptr; + struct instance * const up = pp->unitptr; - pp = peer->procptr; - instance = pp->unitptr; - - /* - * You don't need to poll this clock. It puts out timecodes - * once per second. If asked for a timestamp, take note. - * The next time a timecode comes in, it will be fed back. - */ + pp->polls++; /* - * If we haven't had a response in a while, reset the receiver. + * If we have new samples since last poll, everything is fine. + * if not, blarb loudly. */ - if (instance->pollcnt > 0) { - instance->pollcnt--; + if (pp->coderecv != pp->codeproc) { + refclock_receive(peer); + refclock_report(peer, CEVNT_NOMINAL); } else { refclock_report(peer, CEVNT_TIMEOUT); /* Request the receiver id to trigger a reconfig */ - jupiter_reqonemsg(instance, JUPITER_O_ID); - instance->wantid = 0; + jupiter_reqonemsg(up, JUPITER_O_ID); + up->wantid = 0; } - - /* - * polled every 64 seconds. Ask jupiter_receive to hand in - * a timestamp. - */ - instance->polled = 1; - pp->polls++; } /* @@ -480,30 +503,21 @@ jupiter_control( struct peer *peer /* peer structure pointer */ ) { - struct refclockproc *pp; - struct instance *instance; + struct refclockproc * const pp = peer->procptr; + struct instance * const up = pp->unitptr; + u_char sloppyclockflag; - pp = peer->procptr; - instance = pp->unitptr; - - DTOLFP(pp->fudgetime2, &instance->limit); - /* Force positive value. */ - if (L_ISNEG(&instance->limit)) - L_NEG(&instance->limit); + up->assert = !(pp->sloppyclockflag & CLK_FLAG3); + jupiter_ppsapi(up); -#ifdef HAVE_PPSAPI - instance->assert = !(pp->sloppyclockflag & CLK_FLAG3); - jupiter_ppsapi(instance); -#endif /* HAVE_PPSAPI */ - - sloppyclockflag = instance->sloppyclockflag; - instance->sloppyclockflag = pp->sloppyclockflag; - if ((instance->sloppyclockflag & CLK_FLAG2) != + sloppyclockflag = up->sloppyclockflag; + up->sloppyclockflag = pp->sloppyclockflag; + if ((up->sloppyclockflag & CLK_FLAG2) != (sloppyclockflag & CLK_FLAG2)) { jupiter_debug(peer, __func__, "mode switch: reset receiver"); - jupiter_config(instance); + jupiter_config(up); return; } } @@ -513,49 +527,43 @@ jupiter_control( * Gag me! */ static void -jupiter_receive(struct recvbuf *rbufp) +jupiter_receive(struct recvbuf * const rbufp) { + struct peer * const peer = rbufp->recv_peer; + struct refclockproc * const pp = peer->procptr; + struct instance * const up = pp->unitptr; + size_t bpcnt; - int cc, size, ppsret; - time_t last_timecode; - u_int32 laststime; + int cc, size; const char *cp; u_char *bp; u_short *sp; struct jid *ip; struct jheader *hp; - struct peer *peer; - struct refclockproc *pp; - struct instance *instance; - l_fp tstamp; /* Initialize pointers and read the timecode and timestamp */ - peer = rbufp->recv_peer; - pp = peer->procptr; - instance = pp->unitptr; - bp = (u_char *)rbufp->recv_buffer; bpcnt = rbufp->recv_length; /* This shouldn't happen */ - if (bpcnt > sizeof(instance->sbuf) - instance->ssize) - bpcnt = sizeof(instance->sbuf) - instance->ssize; + if (bpcnt > sizeof(up->sbuf) - up->ssize) + bpcnt = sizeof(up->sbuf) - up->ssize; /* Append to input buffer */ - memcpy((u_char *)instance->sbuf + instance->ssize, bp, bpcnt); - instance->ssize += bpcnt; + memcpy((u_char *)up->sbuf + up->ssize, bp, bpcnt); + up->ssize += bpcnt; /* While there's at least a header and we parse an intact message */ - while (instance->ssize > (int)sizeof(*hp) && (cc = jupiter_recv(instance)) > 0) { - instance->pollcnt = 2; - - tstamp = rbufp->recv_time; - hp = (struct jheader *)instance->sbuf; + while (up->ssize > (int)sizeof(*hp) && (cc = jupiter_recv(up)) > 0) { + hp = (struct jheader *)up->sbuf; sp = (u_short *)(hp + 1); size = cc - sizeof(*hp); switch (getshort(hp->id)) { case JUPITER_O_PULSE: + /* first see if we can push another sample: */ + jupiter_checkpps(pp, up); + if (size != sizeof(struct jpulse)) { jupiter_debug(peer, __func__, "pulse: len %d != %u", @@ -563,87 +571,24 @@ jupiter_receive(struct recvbuf *rbufp) refclock_report(peer, CEVNT_BADREPLY); break; } - - /* - * There appears to be a firmware bug related - * to the pulse message; in addition to the one - * per second messages, we get an extra pulse + + /* Parse timecode (even when there's no pps) + * + * There appears to be a firmware bug related to + * the pulse message; in addition to the one per + * second messages, we get an extra pulse * message once an hour (on the anniversary of * the cold start). It seems to come 200 ms - * after the one requested. So if we've seen a - * pulse message in the last 210 ms, we skip - * this one. - */ - laststime = instance->stime; - instance->stime = DS2UI(((struct jpulse *)sp)->stime); - if (laststime != 0 && instance->stime - laststime <= 21) { - jupiter_debug(peer, __func__, - "avoided firmware bug (stime %.2f, laststime %.2f)", - (double)instance->stime * 0.01, (double)laststime * 0.01); - break; - } - - /* Retrieve pps timestamp */ - ppsret = jupiter_pps(instance); - - /* - * Add one second if msg received early - * (i.e. before limit, a.k.a. fudgetime2) in - * the second. + * after the one requested. + * + * But since we feed samples only when a new PPS + * pulse is found we can simply ignore that and + * aggregate/update any existing timing message. */ - L_SUB(&tstamp, &pp->lastrec); - if (!L_ISGEQ(&tstamp, &instance->limit)) - ++pp->lastrec.l_ui; - - /* Parse timecode (even when there's no pps) */ - last_timecode = instance->timecode; - if ((cp = jupiter_parse_t(instance, sp)) != NULL) { + if ((cp = jupiter_parse_t(up, sp, rbufp->recv_time)) != NULL) { jupiter_debug(peer, __func__, "pulse: %s", cp); - break; } - - /* Bail if we didn't get a pps timestamp */ - if (ppsret) - break; - - /* Bail if we don't have the last timecode yet */ - if (last_timecode == 0) - break; - - /* Add the new sample to a median filter */ - tstamp.l_ui = JAN_1970 + (u_int32)last_timecode; - tstamp.l_uf = 0; - - refclock_process_offset(pp, tstamp, pp->lastrec, pp->fudgetime1); - - /* - * The clock will blurt a timecode every second - * but we only want one when polled. If we - * havn't been polled, bail out. - */ - if (!instance->polled) - break; - instance->polled = 0; - - /* - * It's a live one! Remember this time. - */ - - pp->lastref = pp->lastrec; - refclock_receive(peer); - - /* - * If we get here - what we got from the clock is - * OK, so say so - */ - refclock_report(peer, CEVNT_NOMINAL); - - /* - * We have succeeded in answering the poll. - * Turn off the flag and return - */ - instance->polled = 0; break; case JUPITER_O_GPOS: @@ -655,7 +600,7 @@ jupiter_receive(struct recvbuf *rbufp) break; } - if ((cp = jupiter_parse_gpos(instance, sp)) != NULL) { + if ((cp = jupiter_parse_gpos(up, sp)) != NULL) { jupiter_debug(peer, __func__, "gpos: %s", cp); break; @@ -681,16 +626,16 @@ jupiter_receive(struct recvbuf *rbufp) msyslog(LOG_DEBUG, "jupiter_receive: %s chan ver %s, %s (%s)", ip->chans, ip->vers, ip->date, ip->opts); - if (instance->wantid) - instance->wantid = 0; + if (up->wantid) + up->wantid = 0; else { jupiter_debug(peer, __func__, "reset receiver"); - jupiter_config(instance); + jupiter_config(up); /* * Restore since jupiter_config() just * zeroed it */ - instance->ssize = cc; + up->ssize = cc; } break; @@ -699,144 +644,94 @@ jupiter_receive(struct recvbuf *rbufp) getshort(hp->id)); break; } - instance->ssize -= cc; - if (instance->ssize < 0) { + up->ssize -= cc; + if (up->ssize < 0) { fprintf(stderr, "jupiter_recv: negative ssize!\n"); abort(); - } else if (instance->ssize > 0) - memcpy(instance->sbuf, (u_char *)instance->sbuf + cc, instance->ssize); + } else if (up->ssize > 0) + memcpy(up->sbuf, (u_char *)up->sbuf + cc, up->ssize); } } static const char * -jupiter_parse_t(struct instance *instance, u_short *sp) +jupiter_parse_t( + struct instance * const up, + u_short * sp, + l_fp rcvtime + ) { - struct tm *tm; - char *cp; struct jpulse *jp; u_int32 sweek; - time_t last_timecode; u_short flags; - + l_fp fofs; + jp = (struct jpulse *)sp; + flags = getshort(jp->flags); + /* Toss if not designated "valid" by the gps. + * !!NOTE!! do *not* kill data received so far! + */ + if ((flags & JUPITER_O_PULSE_VALID) == 0) { + refclock_report(up->peer, CEVNT_BADTIME); + return ("time mark not valid"); + } + + up->rcv_next = rcvtime; /* remember when this happened */ + /* The timecode is presented as seconds into the current GPS week */ sweek = DS2UI(jp->sweek) % WEEKSECS; - + /* check if we have to apply the UTC offset ourselves */ + if ((flags & JUPITER_O_PULSE_UTC) == 0) { + struct timespec tofs; + tofs.tv_sec = getshort(jp->offs); + tofs.tv_nsec = DS2I(jp->offns); + fofs = tspec_intv_to_lfp(tofs); + L_NEG(&fofs); + } else { + ZERO(fofs); + } + /* * If we don't know the current GPS week, calculate it from the * current time. (It's too bad they didn't include this - * important value in the pulse message). We'd like to pick it - * up from one of the other messages like gpos or chan but they - * don't appear to be synchronous with time keeping and changes - * too soon (something like 10 seconds before the new GPS - * week). + * important value in the pulse message). + * + * So we pick the pivot value from the other messages like gpos + * or chan if we can. Of course, the PULSE message can be in UTC + * or GPS time scale, and the other messages are simply always + * GPS time. * - * If we already know the current GPS week, increment it when - * we wrap into a new week. + * But as long as the difference between the time stamps is less + * than a half week, the unfolding of a week time is unambigeous + * and well suited for the problem we have here. And we won't + * see *that* many leap seconds, ever. */ - if (instance->gweek == 0) { - if (!instance->gpos_gweek) { - return ("jupiter_parse_t: Unknown gweek"); - } - - instance->gweek = instance->gpos_gweek; - - /* - * Fix warps. GPOS has GPS time and PULSE has UTC. - * Plus, GPOS need not be completely in synch with - * the PPS signal. - */ - if (instance->gpos_sweek >= sweek) { - if ((instance->gpos_sweek - sweek) > WEEKSECS / 2) - ++instance->gweek; - } - else { - if ((sweek - instance->gpos_sweek) > WEEKSECS / 2) - --instance->gweek; - } - } - else if (sweek == 0 && instance->lastsweek == WEEKSECS - 1) { - ++instance->gweek; - jupiter_debug(instance->peer, __func__, - "NEW gps week %u", instance->gweek); - } - - /* - * See if the sweek stayed the same (this happens when there is - * no pps pulse). - * - * Otherwise, look for time warps: - * - * - we have stored at least one lastsweek and - * - the sweek didn't increase by one and - * - we didn't wrap to a new GPS week - * - * Then we warped. - */ - if (instance->lastsweek == sweek) - jupiter_debug(instance->peer, __func__, - "gps sweek not incrementing (%d)", - sweek); - else if (instance->lastsweek != 2 * WEEKSECS && - instance->lastsweek + 1 != sweek && - !(sweek == 0 && instance->lastsweek == WEEKSECS - 1)) - jupiter_debug(instance->peer, __func__, - "gps sweek jumped (was %d, now %d)", - instance->lastsweek, sweek); - instance->lastsweek = sweek; - - /* This timecode describes next pulse */ - last_timecode = instance->timecode; - instance->timecode = - GPS_EPOCH + (instance->gweek * WEEKSECS) + sweek; - - if (last_timecode == 0) - /* XXX debugging */ - jupiter_debug(instance->peer, __func__, - "UTC <none> (gweek/sweek %u/%u)", - instance->gweek, sweek); - else { - /* XXX debugging */ - tm = gmtime(&last_timecode); - cp = asctime(tm); - - jupiter_debug(instance->peer, __func__, - "UTC %.24s (gweek/sweek %u/%u)", - cp, instance->gweek, sweek); - - /* Billboard last_timecode (which is now the current time) */ - instance->peer->procptr->year = tm->tm_year + 1900; - instance->peer->procptr->day = tm->tm_yday + 1; - instance->peer->procptr->hour = tm->tm_hour; - instance->peer->procptr->minute = tm->tm_min; - instance->peer->procptr->second = tm->tm_sec; - } - - flags = getshort(jp->flags); - - /* Toss if not designated "valid" by the gps */ - if ((flags & JUPITER_O_PULSE_VALID) == 0) { - refclock_report(instance->peer, CEVNT_BADTIME); - return ("time mark not valid"); + if (up->piv_next.weeks) { + up->ref_next = gpscal_from_weektime2( + sweek, fofs, &up->piv_next); + up->piv_next = up->ref_next; + } else { + up->ref_next = gpscal_from_weektime1( + sweek, fofs, rcvtime); } + - /* We better be sync'ed to UTC... */ - if ((flags & JUPITER_O_PULSE_UTC) == 0) { - refclock_report(instance->peer, CEVNT_BADTIME); - return ("time mark not sync'ed to UTC"); - } return (NULL); } static const char * -jupiter_parse_gpos(struct instance *instance, u_short *sp) +jupiter_parse_gpos( + struct instance * const up, + u_short * sp + ) { struct jgpos *jg; - time_t t; - struct tm *tm; + struct calendar tref; char *cp; + struct timespec tofs; + uint16_t raw_week; + uint32_t raw_secs; jg = (struct jgpos *)sp; @@ -845,31 +740,22 @@ jupiter_parse_gpos(struct instance *instance, u_short *sp) * Solution not valid. Use caution and refuse * to determine GPS week from this message. */ - instance->gpos_gweek = 0; - instance->gpos_sweek = 0; return ("Navigation solution not valid"); } - instance->gpos_sweek = DS2UI(jg->sweek); - instance->gpos_gweek = basedate_expand_gpsweek(getshort(jg->gweek)); - - /* according to the protocol spec, the seconds-in-week cannot - * exceed the nominal value: Is it really necessary to normalise - * the seconds??? - */ - while(instance->gpos_sweek >= WEEKSECS) { - instance->gpos_sweek -= WEEKSECS; - ++instance->gpos_gweek; - } - instance->gweek = 0; - - t = GPS_EPOCH + (instance->gpos_gweek * WEEKSECS) + instance->gpos_sweek; - tm = gmtime(&t); - cp = asctime(tm); - - jupiter_debug(instance->peer, __func__, - "GPS %.24s (gweek/sweek %u/%u)", - cp, instance->gpos_gweek, instance->gpos_sweek); + raw_week = getshort(jg->gweek); + raw_secs = DS2UI(jg->sweek); + tofs.tv_sec = 0; + tofs.tv_nsec = DS2UI(jg->nsweek); + up->piv_next = gpscal_from_gpsweek(raw_week, raw_secs, + tspec_intv_to_lfp(tofs)); + up->piv_hold = 60; + + gpscal_to_calendar(&tref, &up->piv_next); + cp = ntpcal_iso8601std(NULL, 0, &tref); + jupiter_debug(up->peer, __func__, + "GPS %s (gweek/sweek %hu/%u)", + cp, (unsigned short)raw_week, (unsigned int)raw_secs); return (NULL); } @@ -906,7 +792,10 @@ jupiter_debug( /* Checksum and transmit a message to the Jupiter */ static char * -jupiter_send(struct instance *instance, struct jheader *hp) +jupiter_send( + struct instance * const up, + struct jheader * hp + ) { u_int len, size; ssize_t cc; @@ -923,7 +812,7 @@ jupiter_send(struct instance *instance, struct jheader *hp) size += (len + 1) * sizeof(u_short); } - if ((cc = write(instance->peer->procptr->io.fd, (char *)hp, size)) < 0) { + if ((cc = write(up->peer->procptr->io.fd, (char *)hp, size)) < 0) { msnprintf(errstr, sizeof(errstr), "write: %m"); return (errstr); } else if (cc != (int)size) { @@ -947,8 +836,11 @@ static struct { /* An interval of zero means to output on trigger */ static void -jupiter_reqmsg(struct instance *instance, u_int id, - u_int interval) +jupiter_reqmsg( + struct instance * const up, + u_int id, + u_int interval + ) { struct jheader *hp; struct jrequest *rp; @@ -959,8 +851,8 @@ jupiter_reqmsg(struct instance *instance, u_int id, rp = &reqmsg.jrequest; rp->trigger = putshort(interval == 0); rp->interval = putshort(interval); - if ((cp = jupiter_send(instance, hp)) != NULL) - jupiter_debug(instance->peer, __func__, "%u: %s", id, cp); + if ((cp = jupiter_send(up, hp)) != NULL) + jupiter_debug(up->peer, __func__, "%u: %s", id, cp); } /* Cancel periodic message output */ @@ -971,15 +863,18 @@ static struct jheader canmsg = { }; static void -jupiter_canmsg(struct instance *instance, u_int id) +jupiter_canmsg( + struct instance * const up, + u_int id + ) { struct jheader *hp; char *cp; hp = &canmsg; hp->id = putshort(id); - if ((cp = jupiter_send(instance, hp)) != NULL) - jupiter_debug(instance->peer, __func__, "%u: %s", id, cp); + if ((cp = jupiter_send(up, hp)) != NULL) + jupiter_debug(up->peer, __func__, "%u: %s", id, cp); } /* Request a single message output */ @@ -990,15 +885,18 @@ static struct jheader reqonemsg = { }; static void -jupiter_reqonemsg(struct instance *instance, u_int id) +jupiter_reqonemsg( + struct instance * const up, + u_int id + ) { struct jheader *hp; char *cp; hp = &reqonemsg; hp->id = putshort(id); - if ((cp = jupiter_send(instance, hp)) != NULL) - jupiter_debug(instance->peer, __func__, "%u: %s", id, cp); + if ((cp = jupiter_send(up, hp)) != NULL) + jupiter_debug(up->peer, __func__, "%u: %s", id, cp); } /* Set the platform dynamics */ @@ -1013,7 +911,10 @@ static struct { }; static void -jupiter_platform(struct instance *instance, u_int platform) +jupiter_platform( + struct instance * const up, + u_int platform + ) { struct jheader *hp; struct jplat *pp; @@ -1022,8 +923,8 @@ jupiter_platform(struct instance *instance, u_int platform) hp = &platmsg.jheader; pp = &platmsg.jplat; pp->platform = putshort(platform); - if ((cp = jupiter_send(instance, hp)) != NULL) - jupiter_debug(instance->peer, __func__, "%u: %s", platform, cp); + if ((cp = jupiter_send(up, hp)) != NULL) + jupiter_debug(up->peer, __func__, "%u: %s", platform, cp); } /* Checksum "len" shorts */ @@ -1042,7 +943,9 @@ jupiter_cksum(u_short *sp, u_int len) /* Return the size of the next message (or zero if we don't have it all yet) */ static int -jupiter_recv(struct instance *instance) +jupiter_recv( + struct instance * const up + ) { int n, len, size, cc; struct jheader *hp; @@ -1051,22 +954,22 @@ jupiter_recv(struct instance *instance) /* Must have at least a header's worth */ cc = sizeof(*hp); - size = instance->ssize; + size = up->ssize; if (size < cc) return (0); /* Search for the sync short if missing */ - sp = instance->sbuf; + sp = up->sbuf; hp = (struct jheader *)sp; if (getshort(hp->sync) != JUPITER_SYNC) { /* Wasn't at the front, sync up */ - jupiter_debug(instance->peer, __func__, "syncing"); + jupiter_debug(up->peer, __func__, "syncing"); bp = (u_char *)sp; n = size; while (n >= 2) { if (bp[0] != (JUPITER_SYNC & 0xff)) { /* - jupiter_debug(instance->peer, __func__, + jupiter_debug(up->peer, __func__, "{0x%x}", bp[0]); */ ++bp; @@ -1076,29 +979,29 @@ jupiter_recv(struct instance *instance) if (bp[1] == ((JUPITER_SYNC >> 8) & 0xff)) break; /* - jupiter_debug(instance->peer, __func__, + jupiter_debug(up->peer, __func__, "{0x%x 0x%x}", bp[0], bp[1]); */ bp += 2; n -= 2; } /* - jupiter_debug(instance->peer, __func__, "\n"); + jupiter_debug(up->peer, __func__, "\n"); */ /* Shuffle data to front of input buffer */ if (n > 0) memcpy(sp, bp, n); size = n; - instance->ssize = size; + up->ssize = size; if (size < cc || hp->sync != JUPITER_SYNC) return (0); } if (jupiter_cksum(sp, (cc / sizeof(u_short) - 1)) != getshort(hp->hsum)) { - jupiter_debug(instance->peer, __func__, "bad header checksum!"); + jupiter_debug(up->peer, __func__, "bad header checksum!"); /* This is drastic but checksum errors should be rare */ - instance->ssize = 0; + up->ssize = 0; return (0); } @@ -1113,10 +1016,10 @@ jupiter_recv(struct instance *instance) /* Check payload checksum */ sp = (u_short *)(hp + 1); if (jupiter_cksum(sp, len) != getshort(sp[len])) { - jupiter_debug(instance->peer, + jupiter_debug(up->peer, __func__, "bad payload checksum!"); /* This is drastic but checksum errors should be rare */ - instance->ssize = 0; + up->ssize = 0; return (0); } cc += n; diff --git a/contrib/ntp/ntpd/refclock_nmea.c b/contrib/ntp/ntpd/refclock_nmea.c index 19bdeeb3b6680..4fdadea61dffa 100644 --- a/contrib/ntp/ntpd/refclock_nmea.c +++ b/contrib/ntp/ntpd/refclock_nmea.c @@ -38,7 +38,7 @@ #include "ntp_unixtime.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" -#include "ntp_calendar.h" +#include "ntp_calgps.h" #include "timespecops.h" #ifdef HAVE_PPSAPI @@ -67,33 +67,34 @@ * GPS sentences other than RMC (the default) may be enabled by setting * the relevent bits of 'mode' in the server configuration line * server 127.127.20.x mode X - * + * * bit 0 - enables RMC (1) * bit 1 - enables GGA (2) * bit 2 - enables GLL (4) * bit 3 - enables ZDA (8) - Standard Time & Date - * bit 3 - enables ZDG (8) - Accord GPS Clock's custom sentence with GPS time + * bit 3 - enables ZDG (8) - Accord GPS Clock's custom sentence with GPS time * very close to standard ZDA - * + * * Multiple sentences may be selected except when ZDG/ZDA is selected. * * bit 4/5/6 - selects the baudrate for serial port : - * 0 for 4800 (default) - * 1 for 9600 - * 2 for 19200 - * 3 for 38400 - * 4 for 57600 - * 5 for 115200 + * 0 for 4800 (default) + * 1 for 9600 + * 2 for 19200 + * 3 for 38400 + * 4 for 57600 + * 5 for 115200 */ #define NMEA_MESSAGE_MASK 0x0000FF0FU #define NMEA_BAUDRATE_MASK 0x00000070U #define NMEA_BAUDRATE_SHIFT 4 -#define NMEA_DELAYMEAS_MASK 0x80 +#define NMEA_DELAYMEAS_MASK 0x00000080U #define NMEA_EXTLOG_MASK 0x00010000U -#define NMEA_DATETRUST_MASK 0x02000000U +#define NMEA_QUIETPPS_MASK 0x00020000U +#define NMEA_DATETRUST_MASK 0x00040000U -#define NMEA_PROTO_IDLEN 5 /* tag name must be at least 5 chars */ +#define NMEA_PROTO_IDLEN 4 /* tag name must be at least 4 chars */ #define NMEA_PROTO_MINLEN 6 /* min chars in sentence, excluding CS */ #define NMEA_PROTO_MAXLEN 80 /* max chars in sentence, excluding CS */ #define NMEA_PROTO_FIELDS 32 /* not official; limit on fields per record */ @@ -110,24 +111,24 @@ * $GPRMC,232418.19,A,3513.8386,S,14900.7853,E,00.0,000.0,121199,12.,E*77 * * Defining GPZDA to support Standard Time & Date - * sentence. The sentence has the following format - * + * sentence. The sentence has the following format + * * $--ZDA,HHMMSS.SS,DD,MM,YYYY,TH,TM,*CS<CR><LF> * - * Apart from the familiar fields, + * Apart from the familiar fields, * 'TH' Time zone Hours * 'TM' Time zone Minutes * - * Defining GPZDG to support Accord GPS Clock's custom NMEA - * sentence. The sentence has the following format - * + * Defining GPZDG to support Accord GPS Clock's custom NMEA + * sentence. The sentence has the following format + * * $GPZDG,HHMMSS.S,DD,MM,YYYY,AA.BB,V*CS<CR><LF> * * It contains the GPS timestamp valid for next PPS pulse. - * Apart from the familiar fields, - * 'AA.BB' denotes the signal strength( should be < 05.00 ) - * 'V' denotes the GPS sync status : - * '0' indicates INVALID time, + * Apart from the familiar fields, + * 'AA.BB' denotes the signal strength( should be < 05.00 ) + * 'V' denotes the GPS sync status : + * '0' indicates INVALID time, * '1' indicates accuracy of +/-20 ms * '2' indicates accuracy of +/-100 ns * @@ -151,6 +152,8 @@ #define SPEED232 B4800 /* uart speed (4800 bps) */ #define PRECISION (-9) /* precision assumed (about 2 ms) */ #define PPS_PRECISION (-20) /* precision assumed (about 1 us) */ +#define DATE_HOLD 16 /* seconds to hold on provided GPS date */ +#define DATE_HLIM 4 /* when do we take ANY date format */ #define REFID "GPS\0" /* reference id */ #define DESCRIPTION "NMEA GPS Clock" /* who we are */ #ifndef O_NOCTTY @@ -181,7 +184,8 @@ */ #define NMEA_GPZDG 4 #define NMEA_PGRMF 5 -#define NMEA_ARRAY_SIZE (NMEA_PGRMF + 1) +#define NMEA_PUBX04 6 +#define NMEA_ARRAY_SIZE (NMEA_PUBX04 + 1) /* * Sentence selection mode bits @@ -191,6 +195,7 @@ #define USE_GPGLL 0x00000004u #define USE_GPZDA 0x00000008u #define USE_PGRMF 0x00000100u +#define USE_PUBX04 0x00000200u /* mapping from sentence index to controlling mode bit */ static const u_int32 sentence_mode[NMEA_ARRAY_SIZE] = @@ -200,7 +205,8 @@ static const u_int32 sentence_mode[NMEA_ARRAY_SIZE] = USE_GPGLL, USE_GPZDA, USE_GPZDA, - USE_PGRMF + USE_PGRMF, + USE_PUBX04 }; /* date formats we support */ @@ -209,6 +215,15 @@ enum date_fmt { DATE_3_DDMMYYYY /* use 3 fields with 4-digit year */ }; +/* date type */ +enum date_type { + DTYP_NONE, + DTYP_Y2D, /* 2-digit year */ + DTYP_W10B, /* 10-bit week in GPS epoch */ + DTYP_Y4D, /* 4-digit (full) year */ + DTYP_WEXT /* extended week in GPS epoch */ +}; + /* results for 'field_init()' * * Note: If a checksum is present, the checksum test must pass OK or the @@ -222,18 +237,22 @@ enum date_fmt { /* * Unit control structure */ +struct refclock_atom; +typedef struct refclock_atom TAtomUnit; typedef struct { -#ifdef HAVE_PPSAPI - struct refclock_atom atom; /* PPSAPI structure */ - int ppsapi_fd; /* fd used with PPSAPI */ - u_char ppsapi_tried; /* attempt PPSAPI once */ - u_char ppsapi_lit; /* time_pps_create() worked */ - u_char ppsapi_gate; /* system is on PPS */ -#endif /* HAVE_PPSAPI */ - u_char gps_time; /* use GPS time, not UTC */ - u_short century_cache; /* cached current century */ - l_fp last_reftime; /* last processed reference stamp */ - short epoch_warp; /* last epoch warp, for logging */ +# ifdef HAVE_PPSAPI + TAtomUnit atom; /* PPSAPI structure */ + int ppsapi_fd; /* fd used with PPSAPI */ + u_char ppsapi_tried; /* attempt PPSAPI once */ + u_char ppsapi_lit; /* time_pps_create() worked */ +# endif /* HAVE_PPSAPI */ + uint16_t rcvtout; /* one-shot for sample expiration */ + u_char ppsapi_gate; /* system is on PPS */ + u_char gps_time; /* use GPS time, not UTC */ + l_fp last_reftime; /* last processed reference stamp */ + TNtpDatum last_gpsdate; /* last processed split date/time */ + u_short hold_gpsdate; /* validity ticker for above */ + u_short type_gpsdate; /* date info type for above */ /* tally stats, reset each poll cycle */ struct { @@ -243,10 +262,14 @@ typedef struct { u_int malformed; /* Bad checksum, invalid date or time */ u_int filtered; /* mode bits, not GPZDG, same second */ u_int pps_used; - } + } tally; /* per sentence checksum seen flag */ - u_char cksum_type[NMEA_ARRAY_SIZE]; + u_char cksum_type[NMEA_ARRAY_SIZE]; + + /* line assembly buffer (NMEAD support) */ + u_short lb_len; + char lb_buf[BMAX]; /* assembly buffer */ } nmea_unit; /* @@ -260,34 +283,15 @@ typedef struct { } nmea_data; /* - * NMEA gps week/time information - * This record contains the number of weeks since 1980-01-06 modulo - * 1024, the seconds elapsed since start of the week, and the number of - * leap seconds that are the difference between GPS and UTC time scale. - */ -typedef struct { - u_int32 wt_time; /* seconds since weekstart */ - u_short wt_week; /* week number */ - short wt_leap; /* leap seconds */ -} gps_weektm; - -/* - * The GPS week time scale starts on Sunday, 1980-01-06. We need the - * rata die number of this day. - */ -#ifndef DAY_GPS_STARTS -#define DAY_GPS_STARTS 722820 -#endif - -/* * Function prototypes */ -static void nmea_init (void); static int nmea_start (int, struct peer *); static void nmea_shutdown (int, struct peer *); static void nmea_receive (struct recvbuf *); static void nmea_poll (int, struct peer *); +static void nmea_procrec (struct peer *, l_fp); #ifdef HAVE_PPSAPI +static double tabsdiffd (l_fp, l_fp); static void nmea_control (int, const struct refclockstat *, struct refclockstat *, struct peer *); #define NMEA_CONTROL nmea_control @@ -302,26 +306,17 @@ static char * field_parse (nmea_data * data, int fn); static void field_wipe (nmea_data * data, ...); static u_char parse_qual (nmea_data * data, int idx, char tag, int inv); -static int parse_time (struct calendar * jd, long * nsec, +static int parse_time (TCivilDate * jd, l_fp * fofs, nmea_data *, int idx); -static int parse_date (struct calendar *jd, nmea_data*, +static int parse_date (TCivilDate * jd, nmea_data *, int idx, enum date_fmt fmt); -static int parse_weekdata (gps_weektm *, nmea_data *, +static int parse_gpsw (TGpsDatum *, nmea_data *, int weekidx, int timeidx, int leapidx); -/* calendar / date helpers */ -static int unfold_day (struct calendar * jd, u_int32 rec_ui); -static int unfold_century (struct calendar * jd, u_int32 rec_ui); -static int gpsfix_century (struct calendar * jd, const gps_weektm * wd, - u_short * ccentury); -static l_fp eval_gps_time (struct peer * peer, const struct calendar * gpst, - const struct timespec * gpso, const l_fp * xrecv); static int nmead_open (const char * device); -static void save_ltc (struct refclockproc * const, const char * const, - size_t); /* - * If we want the driver to ouput sentences, too: re-enable the send + * If we want the driver to output sentences, too: re-enable the send * support functions by defining NMEA_WRITE_SUPPORT to non-zero... */ #if NMEA_WRITE_SUPPORT @@ -335,9 +330,6 @@ extern int async_write(int, const void *, unsigned int); #endif /* NMEA_WRITE_SUPPORT */ -static int32_t g_gpsMinBase; -static int32_t g_gpsMinYear; - /* * ------------------------------------------------------------------- * Transfer vector @@ -348,45 +340,11 @@ struct refclock refclock_nmea = { nmea_shutdown, /* shut down driver */ nmea_poll, /* transmit poll message */ NMEA_CONTROL, /* fudge control */ - nmea_init, /* initialize driver */ + noentry, /* initialize driver */ noentry, /* buginfo */ nmea_timer /* called once per second */ }; -/* - * ------------------------------------------------------------------- - * nmea_init - initialise data - * - * calculates a few runtime constants that cannot be made compile time - * constants. - * ------------------------------------------------------------------- - */ -static void -nmea_init(void) -{ - struct calendar date; - - /* - calculate min. base value for GPS epoch & century unfolding - * This assumes that the build system was roughly in sync with - * the world, and that really synchronising to a time before the - * program was created would be unsafe or insane. If the build - * date cannot be stablished, at least use the start of GPS - * (1980-01-06) as minimum, because GPS can surely NOT - * synchronise beyond it's own big bang. We add a little safety - * margin for the fuzziness of the build date, which is in an - * undefined time zone. */ - if (ntpcal_get_build_date(&date)) - g_gpsMinBase = ntpcal_date_to_rd(&date) - 2; - else - g_gpsMinBase = 0; - - if (g_gpsMinBase < DAY_GPS_STARTS) - g_gpsMinBase = DAY_GPS_STARTS; - - ntpcal_rd_to_date(&date, g_gpsMinBase); - g_gpsMinYear = date.year; - g_gpsMinBase -= DAY_NTP_STARTS; -} /* * ------------------------------------------------------------------- @@ -432,18 +390,18 @@ nmea_start( baudrate = B38400; baudtext = "38400"; break; -#ifdef B57600 +# ifdef B57600 case 4: baudrate = B57600; baudtext = "57600"; break; -#endif -#ifdef B115200 +# endif +# ifdef B115200 case 5: baudrate = B115200; baudtext = "115200"; break; -#endif +# endif default: baudrate = SPEED232; baudtext = "4800 (fallback)"; @@ -458,11 +416,12 @@ nmea_start( pp->io.datalen = 0; /* force change detection on first valid message */ memset(&up->last_reftime, 0xFF, sizeof(up->last_reftime)); + memset(&up->last_gpsdate, 0x00, sizeof(up->last_gpsdate)); /* force checksum on GPRMC, see below */ up->cksum_type[NMEA_GPRMC] = CHECK_CSVALID; -#ifdef HAVE_PPSAPI +# ifdef HAVE_PPSAPI up->ppsapi_fd = -1; -#endif +# endif /* HAVE_PPSAPI */ ZERO(up->tally); /* Initialize miscellaneous variables */ @@ -490,11 +449,10 @@ nmea_start( return io_addclock(&pp->io) != 0; } - /* * ------------------------------------------------------------------- * nmea_shutdown - shut down a GPS clock - * + * * NOTE this routine is called after nmea_start() returns failure, * as well as during a normal shutdown due to ntpq :config unpeer. * ------------------------------------------------------------------- @@ -511,12 +469,12 @@ nmea_shutdown( UNUSED_ARG(unit); if (up != NULL) { -#ifdef HAVE_PPSAPI +# ifdef HAVE_PPSAPI if (up->ppsapi_lit) time_pps_destroy(up->atom.handle); if (up->ppsapi_tried && up->ppsapi_fd != pp->io.fd) close(up->ppsapi_fd); -#endif +# endif free(up); } pp->unitptr = (caddr_t)NULL; @@ -544,7 +502,7 @@ nmea_control( char device[32]; size_t devlen; - + UNUSED_ARG(in_st); UNUSED_ARG(out_st); @@ -570,7 +528,7 @@ nmea_control( refnumtoa(&peer->srcadr)); } if (-1 == up->ppsapi_fd) - up->ppsapi_fd = pp->io.fd; + up->ppsapi_fd = pp->io.fd; if (refclock_ppsapi(up->ppsapi_fd, &up->atom)) { /* use the PPS API for our own purposes now. */ up->ppsapi_lit = refclock_params( @@ -580,10 +538,10 @@ nmea_control( time_pps_destroy(up->atom.handle); msyslog(LOG_WARNING, "%s set PPSAPI params fails", - refnumtoa(&peer->srcadr)); + refnumtoa(&peer->srcadr)); } /* note: the PPS I/O handle remains valid until - * flag1 is cleared or the clock is shut down. + * flag1 is cleared or the clock is shut down. */ } else { msyslog(LOG_WARNING, @@ -593,7 +551,7 @@ nmea_control( } /* shut down PPS API if activated */ - if (!(CLK_FLAG1 & pp->sloppyclockflag) && up->ppsapi_tried) { + if ( !(CLK_FLAG1 & pp->sloppyclockflag) && up->ppsapi_tried) { /* shutdown PPS API */ if (up->ppsapi_lit) time_pps_destroy(up->atom.handle); @@ -612,18 +570,20 @@ nmea_control( peer->precision = PRECISION; } } -#endif /* HAVE_PPSAPI */ +#endif /* HAVE_PPSAPI */ /* * ------------------------------------------------------------------- * nmea_timer - called once per second - * this only polls (older?) Oncore devices now * * Usually 'nmea_receive()' can get a timestamp every second, but at * least one Motorola unit needs prompting each time. Doing so in * 'nmea_poll()' gives only one sample per poll cycle, which actually * defeats the purpose of the median filter. Polling once per second * seems a much better idea. + * + * Also takes care of sample expiration if the receiver fails to + * provide new input data. * ------------------------------------------------------------------- */ static void @@ -632,138 +592,36 @@ nmea_timer( struct peer * peer ) { -#if NMEA_WRITE_SUPPORT - struct refclockproc * const pp = peer->procptr; + nmea_unit * const up = (nmea_unit *)pp->unitptr; UNUSED_ARG(unit); +# if NMEA_WRITE_SUPPORT + if (-1 != pp->io.fd) /* any mode bits to evaluate here? */ gps_send(pp->io.fd, "$PMOTG,RMC,0000*1D\r\n", peer); -#else - - UNUSED_ARG(unit); - UNUSED_ARG(peer); - -#endif /* NMEA_WRITE_SUPPORT */ -} -#ifdef HAVE_PPSAPI -/* - * ------------------------------------------------------------------- - * refclock_ppsrelate(...) -- correlate with PPS edge - * - * This function is used to correlate a receive time stamp and a - * reference time with a PPS edge time stamp. It applies the necessary - * fudges (fudge1 for PPS, fudge2 for receive time) and then tries to - * move the receive time stamp to the corresponding edge. This can warp - * into future, if a transmission delay of more than 500ms is not - * compensated with a corresponding fudge time2 value, because then the - * next PPS edge is nearer than the last. (Similiar to what the PPS ATOM - * driver does, but we deal with full time stamps here, not just phase - * shift information.) Likewise, a negative fudge time2 value must be - * used if the reference time stamp correlates with the *following* PPS - * pulse. - * - * Note that the receive time fudge value only needs to move the receive - * stamp near a PPS edge but that close proximity is not required; - * +/-100ms precision should be enough. But since the fudge value will - * probably also be used to compensate the transmission delay when no - * PPS edge can be related to the time stamp, it's best to get it as - * close as possible. - * - * It should also be noted that the typical use case is matching to the - * preceeding edge, as most units relate their sentences to the current - * second. - * - * The function returns PPS_RELATE_NONE (0) if no PPS edge correlation - * can be fixed; PPS_RELATE_EDGE (1) when a PPS edge could be fixed, but - * the distance to the reference time stamp is too big (exceeds - * +/-400ms) and the ATOM driver PLL cannot be used to fix the phase; - * and PPS_RELATE_PHASE (2) when the ATOM driver PLL code can be used. - * - * On output, the receive time stamp is replaced with the corresponding - * PPS edge time if a fix could be made; the PPS fudge is updated to - * reflect the proper fudge time to apply. (This implies that - * 'refclock_process_offset()' must be used!) - * ------------------------------------------------------------------- - */ -#define PPS_RELATE_NONE 0 /* no pps correlation possible */ -#define PPS_RELATE_EDGE 1 /* recv time fixed, no phase lock */ -#define PPS_RELATE_PHASE 2 /* recv time fixed, phase lock ok */ +# endif /* NMEA_WRITE_SUPPORT */ + + /* receive timeout occurred? */ + if (up->rcvtout) { + --up->rcvtout; + } else if (pp->codeproc != pp->coderecv) { + /* expire one (the oldest) sample, if any */ + refclock_samples_expire(pp, 1); + /* reset message assembly buffer */ + up->lb_buf[0] = '\0'; + up->lb_len = 0; + } -static int -refclock_ppsrelate( - const struct refclockproc * pp , /* for sanity */ - const struct refclock_atom * ap , /* for PPS io */ - const l_fp * reftime , - l_fp * rd_stamp, /* i/o read stamp */ - double pp_fudge, /* pps fudge */ - double * rd_fudge /* i/o read fudge */ - ) -{ - pps_info_t pps_info; - struct timespec timeout; - l_fp pp_stamp, pp_delta; - double delta, idelta; - - if (pp->leap == LEAP_NOTINSYNC) - return PPS_RELATE_NONE; /* clock is insane, no chance */ - - ZERO(timeout); - ZERO(pps_info); - if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC, - &pps_info, &timeout) < 0) - return PPS_RELATE_NONE; /* can't get time stamps */ - - /* get last active PPS edge before receive */ - if (ap->pps_params.mode & PPS_CAPTUREASSERT) - timeout = pps_info.assert_timestamp; - else if (ap->pps_params.mode & PPS_CAPTURECLEAR) - timeout = pps_info.clear_timestamp; - else - return PPS_RELATE_NONE; /* WHICH edge, please?!? */ - - /* get delta between receive time and PPS time */ - pp_stamp = tspec_stamp_to_lfp(timeout); - pp_delta = *rd_stamp; - L_SUB(&pp_delta, &pp_stamp); - LFPTOD(&pp_delta, delta); - delta += pp_fudge - *rd_fudge; - if (fabs(delta) > 1.5) - return PPS_RELATE_NONE; /* PPS timeout control */ - - /* eventually warp edges, check phase */ - idelta = floor(delta + 0.5); - pp_fudge -= idelta; - delta -= idelta; - if (fabs(delta) > 0.45) - return PPS_RELATE_NONE; /* dead band control */ - - /* we actually have a PPS edge to relate with! */ - *rd_stamp = pp_stamp; - *rd_fudge = pp_fudge; - - /* if whole system out-of-sync, do not try to PLL */ - if (sys_leap == LEAP_NOTINSYNC) - return PPS_RELATE_EDGE; /* cannot PLL with atom code */ - - /* check against reftime if ATOM PLL can be used */ - pp_delta = *reftime; - L_SUB(&pp_delta, &pp_stamp); - LFPTOD(&pp_delta, delta); - delta += pp_fudge; - if (fabs(delta) > 0.45) - return PPS_RELATE_EDGE; /* cannot PLL with atom code */ - - /* all checks passed, gets an AAA rating here! */ - return PPS_RELATE_PHASE; /* can PLL with atom code */ + if (up->hold_gpsdate && (--up->hold_gpsdate < DATE_HLIM)) + up->type_gpsdate = DTYP_NONE; } -#endif /* HAVE_PPSAPI */ /* * ------------------------------------------------------------------- - * nmea_receive - receive data from the serial interface + * nmea_procrec - receive data from the serial interface * * This is the workhorse for NMEA data evaluation: * @@ -771,61 +629,64 @@ refclock_ppsrelate( * NMEA sentences * + it checks whether a sentence is known and to be used * + it parses the time and date data from the NMEA data string and - * augments the missing bits. (century in dat, whole date, ...) + * augments the missing bits. (century in date, whole date, ...) * + it rejects data that is not from the first accepted sentence in a * burst * + it eventually replaces the receive time with the PPS edge time. * + it feeds the data to the internal processing stages. + * + * This function assumes a non-empty line in the unit line buffer. * ------------------------------------------------------------------- */ static void -nmea_receive( - struct recvbuf * rbufp +nmea_procrec( + struct peer * const peer, + l_fp rd_timestamp ) { - /* declare & init control structure ptrs */ - struct peer * const peer = rbufp->recv_peer; + /* declare & init control structure pointers */ struct refclockproc * const pp = peer->procptr; nmea_unit * const up = (nmea_unit*)pp->unitptr; /* Use these variables to hold data until we decide its worth keeping */ nmea_data rdata; - char rd_lastcode[BMAX]; - l_fp rd_timestamp, rd_reftime; - int rd_lencode; - double rd_fudge; + l_fp rd_reftime; /* working stuff */ - struct calendar date; /* to keep & convert the time stamp */ - struct timespec tofs; /* offset to full-second reftime */ - gps_weektm gpsw; /* week time storage */ + TCivilDate date; /* to keep & convert the time stamp */ + TGpsDatum wgps; /* week time storage */ + TNtpDatum dntp; + l_fp tofs; /* offset to full-second reftime */ /* results of sentence/date/time parsing */ u_char sentence; /* sentence tag */ int checkres; + int warp; /* warp to GPS base date */ char * cp; - int rc_date; - int rc_time; + int rc_date, rc_time; + u_short rc_dtyp; +# ifdef HAVE_PPSAPI + int withpps = 0; +# endif /* HAVE_PPSAPI */ /* make sure data has defined pristine state */ ZERO(tofs); ZERO(date); - ZERO(gpsw); + ZERO(wgps); + ZERO(dntp); - /* - * Read the timecode and timestamp, then initialise field + /* + * Read the timecode and timestamp, then initialize field * processing. The <CR><LF> at the NMEA line end is translated * to <LF><LF> by the terminal input routines on most systems, * and this gives us one spurious empty read per record which we * better ignore silently. */ - rd_lencode = refclock_gtlin(rbufp, rd_lastcode, - sizeof(rd_lastcode), &rd_timestamp); - checkres = field_init(&rdata, rd_lastcode, rd_lencode); + checkres = field_init(&rdata, up->lb_buf, up->lb_len); switch (checkres) { case CHECK_INVALID: DPRINTF(1, ("%s invalid data: '%s'\n", - refnumtoa(&peer->srcadr), rd_lastcode)); + refnumtoa(&peer->srcadr), up->lb_buf)); refclock_report(peer, CEVNT_BADREPLY); return; @@ -834,13 +695,13 @@ nmea_receive( default: DPRINTF(1, ("%s gpsread: %d '%s'\n", - refnumtoa(&peer->srcadr), rd_lencode, - rd_lastcode)); + refnumtoa(&peer->srcadr), up->lb_len, + up->lb_buf)); break; } up->tally.total++; - /* + /* * --> below this point we have a valid NMEA sentence <-- * * Check sentence name. Skip first 2 chars (talker ID) in most @@ -859,8 +720,10 @@ nmea_receive( sentence = NMEA_GPZDA; else if (strncmp(cp + 2, "ZDG,", 4) == 0) sentence = NMEA_GPZDG; - else if (strncmp(cp, "PGRMF,", 6) == 0) + else if (strncmp(cp, "PGRMF,", 6) == 0) sentence = NMEA_PGRMF; + else if (strncmp(cp, "PUBX,04,", 8) == 0) + sentence = NMEA_PUBX04; else return; /* not something we know about */ @@ -868,10 +731,10 @@ nmea_receive( if (peer->ttl & NMEA_DELAYMEAS_MASK) { mprintf_clock_stats(&peer->srcadr, "delay %0.6f %.*s", ldexp(rd_timestamp.l_uf, -32), - (int)(strchr(rd_lastcode, ',') - rd_lastcode), - rd_lastcode); + (int)(strchr(up->lb_buf, ',') - up->lb_buf), + up->lb_buf); } - + /* See if I want to process this message type */ if ((peer->ttl & NMEA_MESSAGE_MASK) && !(peer->ttl & sentence_mode[sentence])) { @@ -879,7 +742,7 @@ nmea_receive( return; } - /* + /* * make sure it came in clean * * Apparently, older NMEA specifications (which are expensive) @@ -900,7 +763,7 @@ nmea_receive( up->cksum_type[sentence] = (u_char)checkres; } else { DPRINTF(1, ("%s checksum missing: '%s'\n", - refnumtoa(&peer->srcadr), rd_lastcode)); + refnumtoa(&peer->srcadr), up->lb_buf)); refclock_report(peer, CEVNT_BADREPLY); up->tally.malformed++; return; @@ -910,185 +773,317 @@ nmea_receive( * $GPZDG provides GPS time not UTC, and the two mix poorly. * Once have processed a $GPZDG, do not process any further UTC * sentences (all but $GPZDG currently). - */ - if (up->gps_time && NMEA_GPZDG != sentence) { - up->tally.filtered++; - return; + */ + if (sentence == NMEA_GPZDG) { + if (!up->gps_time) { + msyslog(LOG_INFO, + "%s using GPS time as if it were UTC", + refnumtoa(&peer->srcadr)); + up->gps_time = 1; + } + } else { + if (up->gps_time) { + up->tally.filtered++; + return; + } } DPRINTF(1, ("%s processing %d bytes, timecode '%s'\n", - refnumtoa(&peer->srcadr), rd_lencode, rd_lastcode)); + refnumtoa(&peer->srcadr), up->lb_len, up->lb_buf)); /* * Grab fields depending on clock string type and possibly wipe * sensitive data from the last timecode. */ - switch (sentence) { + rc_date = -1; /* assume we have to do day-time mapping */ + rc_dtyp = DTYP_NONE; + switch (sentence) { case NMEA_GPRMC: /* Check quality byte, fetch data & time */ - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1); + rc_time = parse_time(&date, &tofs, &rdata, 1); pp->leap = parse_qual(&rdata, 2, 'A', 0); - rc_date = parse_date(&date, &rdata, 9, DATE_1_DDMMYY) - && unfold_century(&date, rd_timestamp.l_ui); - if (CLK_FLAG4 & pp->sloppyclockflag) + if (up->type_gpsdate <= DTYP_Y2D) { + rc_date = parse_date(&date, &rdata, 9, DATE_1_DDMMYY); + rc_dtyp = DTYP_Y2D; + } + if (CLK_FLAG4 & pp->sloppyclockflag) field_wipe(&rdata, 3, 4, 5, 6, -1); break; case NMEA_GPGGA: /* Check quality byte, fetch time only */ - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1); + rc_time = parse_time(&date, &tofs, &rdata, 1); pp->leap = parse_qual(&rdata, 6, '0', 1); - rc_date = unfold_day(&date, rd_timestamp.l_ui); if (CLK_FLAG4 & pp->sloppyclockflag) field_wipe(&rdata, 2, 4, -1); break; case NMEA_GPGLL: /* Check quality byte, fetch time only */ - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 5); + rc_time = parse_time(&date, &tofs, &rdata, 5); pp->leap = parse_qual(&rdata, 6, 'A', 0); - rc_date = unfold_day(&date, rd_timestamp.l_ui); if (CLK_FLAG4 & pp->sloppyclockflag) field_wipe(&rdata, 1, 3, -1); break; - + case NMEA_GPZDA: /* No quality. Assume best, fetch time & full date */ - pp->leap = LEAP_NOWARNING; - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1); - rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY); + rc_time = parse_time(&date, &tofs, &rdata, 1); + if (up->type_gpsdate <= DTYP_Y4D) { + rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY); + rc_dtyp = DTYP_Y4D; + } break; case NMEA_GPZDG: /* Check quality byte, fetch time & full date */ - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1); - rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY); + rc_time = parse_time(&date, &tofs, &rdata, 1); pp->leap = parse_qual(&rdata, 4, '0', 1); - tofs.tv_sec = -1; /* GPZDG is following second */ + --tofs.l_ui; /* GPZDG gives *following* second */ + if (up->type_gpsdate <= DTYP_Y4D) { + rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY); + rc_dtyp = DTYP_Y4D; + } break; case NMEA_PGRMF: - /* get date, time, qualifier and GPS weektime. We need - * date and time-of-day for the century fix, so we read - * them first. - */ - rc_date = parse_weekdata(&gpsw, &rdata, 1, 2, 5) - && parse_date(&date, &rdata, 3, DATE_1_DDMMYY); - rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 4); - pp->leap = parse_qual(&rdata, 11, '0', 1); - rc_date = rc_date - && gpsfix_century(&date, &gpsw, &up->century_cache); + /* get time, qualifier and GPS weektime. */ + rc_time = parse_time(&date, &tofs, &rdata, 4); + if (up->type_gpsdate <= DTYP_W10B) { + rc_date = parse_gpsw(&wgps, &rdata, 1, 2, 5); + rc_dtyp = DTYP_W10B; + } + pp->leap = parse_qual(&rdata, 11, '0', 1); if (CLK_FLAG4 & pp->sloppyclockflag) field_wipe(&rdata, 6, 8, -1); break; - + + case NMEA_PUBX04: + /* PUBX,04 is peculiar. The UTC time-of-week is the *internal* + * time base, which is not exactly on par with the fix time. + */ + rc_time = parse_time(&date, &tofs, &rdata, 2); + if (up->type_gpsdate <= DTYP_WEXT) { + rc_date = parse_gpsw(&wgps, &rdata, 5, 4, -1); + rc_dtyp = DTYP_WEXT; + } + break; + default: INVARIANT(0); /* Coverity 97123 */ return; } + /* check clock sanity; [bug 2143] */ + if (pp->leap == LEAP_NOTINSYNC) { /* no good status? */ + checkres = CEVNT_PROP; + up->tally.rejected++; + } /* Check sanity of time-of-day. */ - if (rc_time == 0) { /* no time or conversion error? */ + else if (rc_time == 0) { /* no time or conversion error? */ checkres = CEVNT_BADTIME; up->tally.malformed++; } /* Check sanity of date. */ - else if (rc_date == 0) {/* no date or conversion error? */ + else if (rc_date == 0) { /* no date or conversion error? */ checkres = CEVNT_BADDATE; up->tally.malformed++; } - /* check clock sanity; [bug 2143] */ - else if (pp->leap == LEAP_NOTINSYNC) { /* no good status? */ - checkres = CEVNT_BADREPLY; - up->tally.rejected++; - } - else + else { checkres = -1; + } if (checkres != -1) { - save_ltc(pp, rd_lastcode, rd_lencode); + refclock_save_lcode(pp, up->lb_buf, up->lb_len); refclock_report(peer, checkres); return; } - DPRINTF(1, ("%s effective timecode: %04u-%02u-%02u %02d:%02d:%02d\n", - refnumtoa(&peer->srcadr), - date.year, date.month, date.monthday, - date.hour, date.minute, date.second)); + /* See if we can augment the receive time stamp. If not, apply + * fudge time 2 to the receive time stamp directly. + */ +# ifdef HAVE_PPSAPI + if (up->ppsapi_lit && pp->leap != LEAP_NOTINSYNC) + withpps = refclock_ppsaugment( + &up->atom, &rd_timestamp, + pp->fudgetime2, pp->fudgetime1); + else +# endif /* HAVE_PPSAPI */ + rd_timestamp = ntpfp_with_fudge( + rd_timestamp, pp->fudgetime2); + + /* set the GPS base date, if possible */ + warp = !(peer->ttl & NMEA_DATETRUST_MASK); + if (rc_dtyp != DTYP_NONE) { + DPRINTF(1, ("%s saving date, type=%hu\n", + refnumtoa(&peer->srcadr), rc_dtyp)); + switch (rc_dtyp) { + case DTYP_W10B: + up->last_gpsdate = gpsntp_from_gpscal_ex( + &wgps, (warp = TRUE)); + break; + case DTYP_WEXT: + up->last_gpsdate = gpsntp_from_gpscal_ex( + &wgps, warp); + break; + default: + up->last_gpsdate = gpsntp_from_calendar_ex( + &date, tofs, warp); + break; + } + up->type_gpsdate = rc_dtyp; + up->hold_gpsdate = DATE_HOLD; + } + /* now convert and possibly extend/expand the time stamp. */ + if (up->hold_gpsdate) { /* time of day, based */ + dntp = gpsntp_from_daytime2_ex( + &date, tofs, &up->last_gpsdate, warp); + } else { /* time of day, floating */ + dntp = gpsntp_from_daytime1_ex( + &date, tofs, rd_timestamp, warp); + } - /* Check if we must enter GPS time mode; log so if we do */ - if (!up->gps_time && (sentence == NMEA_GPZDG)) { - msyslog(LOG_INFO, "%s using GPS time as if it were UTC", - refnumtoa(&peer->srcadr)); - up->gps_time = 1; + if (debug) { + /* debug print time stamp */ + gpsntp_to_calendar(&date, &dntp); +# ifdef HAVE_PPSAPI + DPRINTF(1, ("%s effective timecode: %s (%s PPS)\n", + refnumtoa(&peer->srcadr), + ntpcal_iso8601std(NULL, 0, &date), + (withpps ? "with" : "without"))); +# else /* ?HAVE_PPSAPI */ + DPRINTF(1, ("%s effective timecode: %s\n", + refnumtoa(&peer->srcadr), + ntpcal_iso8601std(NULL, 0, &date))); +# endif /* !HAVE_PPSAPI */ } - - /* - * Get the reference time stamp from the calendar buffer. + + /* Get the reference time stamp from the calendar buffer. * Process the new sample in the median filter and determine the * timecode timestamp, but only if the PPS is not in control. * Discard sentence if reference time did not change. */ - rd_reftime = eval_gps_time(peer, &date, &tofs, &rd_timestamp); + rd_reftime = ntpfp_from_ntpdatum(&dntp); if (L_ISEQU(&up->last_reftime, &rd_reftime)) { /* Do not touch pp->a_lastcode on purpose! */ up->tally.filtered++; return; } up->last_reftime = rd_reftime; - rd_fudge = pp->fudgetime2; DPRINTF(1, ("%s using '%s'\n", - refnumtoa(&peer->srcadr), rd_lastcode)); + refnumtoa(&peer->srcadr), up->lb_buf)); /* Data will be accepted. Update stats & log data. */ up->tally.accepted++; - save_ltc(pp, rd_lastcode, rd_lencode); + refclock_save_lcode(pp, up->lb_buf, up->lb_len); pp->lastrec = rd_timestamp; -#ifdef HAVE_PPSAPI - /* - * If we have PPS running, we try to associate the sentence - * with the last active edge of the PPS signal. + /* If we have PPS augmented receive time, we *must* have a + * working PPS source and we must set the flags accordingly. */ - if (up->ppsapi_lit) - switch (refclock_ppsrelate( - pp, &up->atom, &rd_reftime, &rd_timestamp, - pp->fudgetime1, &rd_fudge)) - { - case PPS_RELATE_PHASE: - up->ppsapi_gate = TRUE; - peer->precision = PPS_PRECISION; - peer->flags |= FLAG_PPS; +# ifdef HAVE_PPSAPI + if (withpps) { + up->ppsapi_gate = TRUE; + peer->precision = PPS_PRECISION; + if (tabsdiffd(rd_reftime, rd_timestamp) < 0.5) { + if ( ! (peer->ttl & NMEA_QUIETPPS_MASK)) + peer->flags |= FLAG_PPS; DPRINTF(2, ("%s PPS_RELATE_PHASE\n", refnumtoa(&peer->srcadr))); up->tally.pps_used++; - break; - - case PPS_RELATE_EDGE: - up->ppsapi_gate = TRUE; - peer->precision = PPS_PRECISION; + } else { DPRINTF(2, ("%s PPS_RELATE_EDGE\n", refnumtoa(&peer->srcadr))); - break; - - case PPS_RELATE_NONE: - default: - /* - * Resetting precision and PPS flag is done in - * 'nmea_poll', since it might be a glitch. But - * at the end of the poll cycle we know... - */ - DPRINTF(2, ("%s PPS_RELATE_NONE\n", - refnumtoa(&peer->srcadr))); - break; } -#endif /* HAVE_PPSAPI */ - - refclock_process_offset(pp, rd_reftime, rd_timestamp, rd_fudge); + /* !Note! 'FLAG_PPS' is reset in 'nmea_poll()' */ + } +# endif /* HAVE_PPSAPI */ + /* Whether the receive time stamp is PPS-augmented or not, + * the proper fudge offset is already applied. There's no + * residual fudge to process. + */ + refclock_process_offset(pp, rd_reftime, rd_timestamp, 0.0); + up->rcvtout = 2; } +/* + * ------------------------------------------------------------------- + * nmea_receive - receive data from the serial interface + * + * With serial IO only, a single call to 'refclock_gtlin()' to get the + * string would suffice to get the NMEA data. When using NMEAD, this + * does unfortunately no longer hold, since TCP is stream oriented and + * not line oriented, and there's no one to do the line-splitting work + * of the TTY driver in line/cooked mode. + * + * So we have to do this manually here, and we have to live with the + * fact that there could be more than one sentence in a receive buffer. + * Likewise, there can be partial messages on either end. (Strictly + * speaking, a receive buffer could also contain just a single fragment, + * though that's unlikely.) + * + * We deal with that by scanning the input buffer, copying bytes from + * the receive buffer to the assembly buffer as we go and calling the + * record processor every time we hit a CR/LF, provided the resulting + * line is not empty. Any leftovers are kept for the next round. + * + * Note: When used with a serial data stream, there's no change to the + * previous line-oriented input: One line is copied to the buffer and + * processed per call. Only with NMEAD the behavior changes, and the + * timing is badly affected unless a PPS channel is also associated with + * the clock instance. TCP leaves us nothing to improve on here. + * ------------------------------------------------------------------- + */ +static void +nmea_receive( + struct recvbuf * rbufp + ) +{ + /* declare & init control structure pointers */ + struct peer * const peer = rbufp->recv_peer; + struct refclockproc * const pp = peer->procptr; + nmea_unit * const up = (nmea_unit*)pp->unitptr; + + const char *sp, *se; + char *dp, *de; + + /* paranoia check: */ + if (up->lb_len >= sizeof(up->lb_buf)) + up->lb_len = 0; + + /* pick up last assembly position; leave room for NUL */ + dp = up->lb_buf + up->lb_len; + de = up->lb_buf + sizeof(up->lb_buf) - 1; + /* set up input range */ + sp = (const char *)rbufp->recv_buffer; + se = sp + rbufp->recv_length; + + /* walk over the input data, dropping parity bits and control + * chars as we go, and calling the record processor for each + * complete non-empty line. + */ + while (sp != se) { + char ch = (*sp++ & 0x7f); + if (dp == up->lb_buf) { + if (ch == '$') + *dp++ = ch; + } else if (dp > de) { + dp = up->lb_buf; + } else if (ch == '\n' || ch == '\r') { + *dp = '\0'; + up->lb_len = (int)(dp - up->lb_buf); + dp = up->lb_buf; + nmea_procrec(peer, rbufp->recv_time); + } else if (ch >= 0x20 && ch < 0x7f) { + *dp++ = ch; + } + } + /* update state to keep for next round */ + *dp = '\0'; + up->lb_len = (int)(dp - up->lb_buf); +} /* * ------------------------------------------------------------------- @@ -1109,12 +1104,12 @@ nmea_poll( { struct refclockproc * const pp = peer->procptr; nmea_unit * const up = (nmea_unit *)pp->unitptr; - + /* * Process median filter samples. If none received, declare a * timeout and keep going. */ -#ifdef HAVE_PPSAPI +# ifdef HAVE_PPSAPI /* * If we don't have PPS pulses and time stamps, turn PPS down * for now. @@ -1125,20 +1120,25 @@ nmea_poll( } else { up->ppsapi_gate = FALSE; } -#endif /* HAVE_PPSAPI */ +# endif /* HAVE_PPSAPI */ /* * If the median filter is empty, claim a timeout. Else process * the input data and keep the stats going. */ if (pp->coderecv == pp->codeproc) { - refclock_report(peer, CEVNT_TIMEOUT); + peer->flags &= ~FLAG_PPS; + if (pp->currentstatus < CEVNT_TIMEOUT) + refclock_report(peer, CEVNT_TIMEOUT); + memset(&up->last_gpsdate, 0, sizeof(up->last_gpsdate)); } else { pp->polls++; pp->lastref = pp->lastrec; refclock_receive(peer); + if (pp->currentstatus > CEVNT_NOMINAL) + refclock_report(peer, CEVNT_NOMINAL); } - + /* * If extended logging is required, write the tally stats to the * clockstats file; otherwise just do a normal clock stats @@ -1160,26 +1160,6 @@ nmea_poll( ZERO(up->tally); } -/* - * ------------------------------------------------------------------- - * Save the last timecode string, making sure it's properly truncated - * if necessary and NUL terminated in any case. - */ -static void -save_ltc( - struct refclockproc * const pp, - const char * const tc, - size_t len - ) -{ - if (len >= sizeof(pp->a_lastcode)) - len = sizeof(pp->a_lastcode) - 1; - pp->lencode = (u_short)len; - memcpy(pp->a_lastcode, tc, len); - pp->a_lastcode[len] = '\0'; -} - - #if NMEA_WRITE_SUPPORT /* * ------------------------------------------------------------------- @@ -1257,8 +1237,8 @@ gps_send( * $GPVTG,089.0,T,,,15.2,N,,*7F * * Some other constraints: - * + The field name must at least 5 upcase characters or digits and must - * start with a character. + * + The field name must be at least 5 upcase characters or digits and + * must start with a character. * + The checksum (if present) must be uppercase hex digits. * + The length of a sentence is limited to 80 characters (not including * the final CR/LF nor the checksum, but including the leading '$') @@ -1284,7 +1264,7 @@ field_init( u_char cs_r; /* checksum remote given */ char * eptr; /* buffer end end pointer */ char tmp; /* char buffer */ - + cs_l = 0; cs_r = 0; /* some basic input constraints */ @@ -1292,8 +1272,8 @@ field_init( dlen = 0; eptr = cptr + dlen; *eptr = '\0'; - - /* load data context */ + + /* load data context */ data->base = cptr; data->cptr = cptr; data->cidx = 0; @@ -1315,7 +1295,7 @@ field_init( data->base++; data->cptr++; data->blen--; - + /* -*- field name: '[A-Z][A-Z0-9]{4,},' */ if (*cptr < 'A' || *cptr > 'Z') return CHECK_INVALID; @@ -1330,7 +1310,7 @@ field_init( /* -*- data: '[^*]*' */ while (*cptr && *cptr != '*') cs_l ^= *cptr++; - + /* -*- checksum field: (\*[0-9A-F]{2})?$ */ if (*cptr == '\0') return CHECK_VALID; @@ -1386,7 +1366,7 @@ field_parse( * ------------------------------------------------------------------- * Wipe (that is, overwrite with '_') data fields and the checksum in * the last timecode. The list of field indices is given as integers - * in a varargs list, preferrably in ascending order, in any case + * in a varargs list, preferably in ascending order, in any case * terminated by a negative field index. * * A maximum number of 8 fields can be overwritten at once to guard @@ -1412,7 +1392,7 @@ field_wipe( int fcnt; /* safeguard against runaway arglist */ int fidx; /* field to nuke, or -1 for checksum */ char * cp; /* overwrite destination */ - + fcnt = 8; cp = NULL; va_start(va, data); @@ -1429,14 +1409,205 @@ field_wipe( if ('.' != *cp) *cp = '_'; } while (fcnt-- && fidx >= 0); - va_end(va); + va_end(va); } /* * ------------------------------------------------------------------- * PARSING HELPERS * ------------------------------------------------------------------- + */ +typedef unsigned char const UCC; + +static char const * const s_eof_chars = ",*\r\n"; + +static int field_length(UCC *cp, unsigned int nfields) +{ + char const * ep = (char const*)cp; + ep = strpbrk(ep, s_eof_chars); + if (ep && nfields) + while (--nfields && ep && *ep == ',') + ep = strpbrk(ep + 1, s_eof_chars); + return (ep) + ? (int)((UCC*)ep - cp) + : (int)strlen((char const*)cp); +} + +/* /[,*\r\n]/ --> skip */ +static int _parse_eof(UCC *cp, UCC ** ep) +{ + int rc = (strchr(s_eof_chars, *(char const*)cp) != NULL); + *ep = cp + rc; + return rc; +} + +/* /,/ --> skip */ +static int _parse_sep(UCC *cp, UCC ** ep) +{ + int rc = (*cp == ','); + *ep = cp + rc; + return rc; +} + +/* /[[:digit:]]{2}/ --> uint16_t */ +static int _parse_num2d(UCC *cp, UCC ** ep, uint16_t *into) +{ + int rc = FALSE; + + if (isdigit(cp[0]) && isdigit(cp[1])) { + *into = (cp[0] - '0') * 10 + (cp[1] - '0'); + cp += 2; + rc = TRUE; + } + *ep = cp; + return rc; +} + +/* /[[:digit:]]+/ --> uint16_t */ +static int _parse_u16(UCC *cp, UCC **ep, uint16_t *into, unsigned int ndig) +{ + uint16_t num = 0; + int rc = FALSE; + if (isdigit(*cp) && ndig) { + rc = TRUE; + do + num = (num * 10) + (*cp - '0'); + while (isdigit(*++cp) && --ndig); + *into = num; + } + *ep = cp; + return rc; +} + +/* /[[:digit:]]+/ --> uint32_t */ +static int _parse_u32(UCC *cp, UCC **ep, uint32_t *into, unsigned int ndig) +{ + uint32_t num = 0; + int rc = FALSE; + if (isdigit(*cp) && ndig) { + rc = TRUE; + do + num = (num * 10) + (*cp - '0'); + while (isdigit(*++cp) && --ndig); + *into = num; + } + *ep = cp; + return rc; +} + +/* /(\.[[:digit:]]*)?/ --> l_fp{0, f} + * read fractional seconds, convert to l_fp * + * Only the first 9 decimal digits are evaluated; any excess is parsed + * away but silently ignored. (--> truncation to 1 nanosecond) + */ +static int _parse_frac(UCC *cp, UCC **ep, l_fp *into) +{ + static const uint32_t powtab[10] = { + 0, + 100000000, 10000000, 1000000, + 100000, 10000, 1000, + 100, 10, 1 + }; + + struct timespec ts; + ZERO(ts); + if (*cp == '.') { + uint32_t fval = 0; + UCC * sp = cp + 1; + if (_parse_u32(sp, &cp, &fval, 9)) + ts.tv_nsec = fval * powtab[(size_t)(cp - sp)]; + while (isdigit(*cp)) + ++cp; + } + + *ep = cp; + *into = tspec_intv_to_lfp(ts); + return TRUE; +} + +/* /[[:digit:]]{6}/ --> time-of-day + * parses a number string representing 'HHMMSS' + */ +static int _parse_time(UCC *cp, UCC ** ep, TCivilDate *into) +{ + uint16_t s, m, h; + int rc; + UCC * xp = cp; + + rc = _parse_num2d(cp, &cp, &h) && (h < 24) + && _parse_num2d(cp, &cp, &m) && (m < 60) + && _parse_num2d(cp, &cp, &s) && (s < 61); /* leap seconds! */ + + if (rc) { + into->hour = (uint8_t)h; + into->minute = (uint8_t)m; + into->second = (uint8_t)s; + *ep = cp; + } else { + *ep = xp; + DPRINTF(1, ("nmea: invalid time code: '%.*s'\n", + field_length(xp, 1), xp)); + } + return rc; +} + +/* /[[:digit:]]{6}/ --> civil date + * parses a number string representing 'ddmmyy' + */ +static int _parse_date1(UCC *cp, UCC **ep, TCivilDate *into) +{ + unsigned short d, m, y; + int rc; + UCC * xp = cp; + + rc = _parse_num2d(cp, &cp, &d) && (d - 1 < 31) + && _parse_num2d(cp, &cp, &m) && (m - 1 < 12) + && _parse_num2d(cp, &cp, &y) + && _parse_eof(cp, ep); + if (rc) { + into->monthday = (uint8_t )d; + into->month = (uint8_t )m; + into->year = (uint16_t)y; + *ep = cp; + } else { + *ep = xp; + DPRINTF(1, ("nmea: invalid date code: '%.*s'\n", + field_length(xp, 1), xp)); + } + return rc; +} + +/* /[[:digit:]]+,[[:digit:]]+,[[:digit:]]+/ --> civil date + * parses three successive numeric fields as date: day,month,year + */ +static int _parse_date3(UCC *cp, UCC **ep, TCivilDate *into) +{ + uint16_t d, m, y; + int rc; + UCC * xp = cp; + + rc = _parse_u16(cp, &cp, &d, 2) && (d - 1 < 31) + && _parse_sep(cp, &cp) + && _parse_u16(cp, &cp, &m, 2) && (m - 1 < 12) + && _parse_sep(cp, &cp) + && _parse_u16(cp, &cp, &y, 4) && (y > 1980) + && _parse_eof(cp, ep); + if (rc) { + into->monthday = (uint8_t )d; + into->month = (uint8_t )m; + into->year = (uint16_t)y; + *ep = cp; + } else { + *ep = xp; + DPRINTF(1, ("nmea: invalid date code: '%.*s'\n", + field_length(xp, 3), xp)); + } + return rc; +} + +/* + * ------------------------------------------------------------------- * Check sync status * * If the character at the data field start matches the tag value, @@ -1453,12 +1624,11 @@ parse_qual( int inv ) { - static const u_char table[2] = - { LEAP_NOTINSYNC, LEAP_NOWARNING }; - char * dp; + static const u_char table[2] = { + LEAP_NOTINSYNC, LEAP_NOWARNING }; + + char * dp = field_parse(rd, idx); - dp = field_parse(rd, idx); - return table[ *dp && ((*dp == tag) == !inv) ]; } @@ -1472,48 +1642,16 @@ parse_qual( static int parse_time( struct calendar * jd, /* result calendar pointer */ - long * ns, /* storage for nsec fraction */ + l_fp * fofs, /* storage for nsec fraction */ nmea_data * rd, int idx ) { - static const unsigned long weight[4] = { - 0, 100000000, 10000000, 1000000 - }; - - int rc; - u_int h; - u_int m; - u_int s; - int p1; - int p2; - u_long f; - char * dp; - - dp = field_parse(rd, idx); - rc = sscanf(dp, "%2u%2u%2u%n.%3lu%n", &h, &m, &s, &p1, &f, &p2); - if (rc < 3 || p1 != 6) { - DPRINTF(1, ("nmea: invalid time code: '%.6s'\n", dp)); - return FALSE; - } - - /* value sanity check */ - if (h > 23 || m > 59 || s > 60) { - DPRINTF(1, ("nmea: invalid time spec %02u:%02u:%02u\n", - h, m, s)); - return FALSE; - } + UCC * dp = (UCC*)field_parse(rd, idx); - jd->hour = (u_char)h; - jd->minute = (u_char)m; - jd->second = (u_char)s; - /* if we have a fraction, scale it up to nanoseconds. */ - if (rc == 4) - *ns = f * weight[p2 - p1 - 1]; - else - *ns = 0; - - return TRUE; + return _parse_time(dp, &dp, jd) + && _parse_frac(dp, &dp, fofs) + && _parse_eof (dp, &dp); } /* @@ -1534,52 +1672,18 @@ parse_date( enum date_fmt fmt ) { - int rc; - u_int y; - u_int m; - u_int d; - int p; - char * dp; - - dp = field_parse(rd, idx); - switch (fmt) { + UCC * dp = (UCC*)field_parse(rd, idx); + switch (fmt) { case DATE_1_DDMMYY: - rc = sscanf(dp, "%2u%2u%2u%n", &d, &m, &y, &p); - if (rc != 3 || p != 6) { - DPRINTF(1, ("nmea: invalid date code: '%.6s'\n", - dp)); - return FALSE; - } - break; - + return _parse_date1(dp, &dp, jd); case DATE_3_DDMMYYYY: - rc = sscanf(dp, "%2u,%2u,%4u%n", &d, &m, &y, &p); - if (rc != 3 || p != 10) { - DPRINTF(1, ("nmea: invalid date code: '%.10s'\n", - dp)); - return FALSE; - } - break; - + return _parse_date3(dp, &dp, jd); default: DPRINTF(1, ("nmea: invalid parse format: %d\n", fmt)); - return FALSE; - } - - /* value sanity check */ - if (d < 1 || d > 31 || m < 1 || m > 12) { - DPRINTF(1, ("nmea: invalid date spec (YMD) %04u:%02u:%02u\n", - y, m, d)); - return FALSE; + break; } - - /* store results */ - jd->monthday = (u_char)d; - jd->month = (u_char)m; - jd->year = (u_short)y; - - return TRUE; + return FALSE; } /* @@ -1592,283 +1696,56 @@ parse_date( * ------------------------------------------------------------------- */ static int -parse_weekdata( - gps_weektm * wd, - nmea_data * rd, +parse_gpsw( + TGpsDatum * wd, + nmea_data * rd, int weekidx, int timeidx, int leapidx ) { - u_long secs; - int fcnt; - - /* parse fields and count success */ - fcnt = sscanf(field_parse(rd, weekidx), "%hu", &wd->wt_week); - fcnt += sscanf(field_parse(rd, timeidx), "%lu", &secs); - fcnt += sscanf(field_parse(rd, leapidx), "%hd", &wd->wt_leap); - if (fcnt != 3 || wd->wt_week >= 1024 || secs >= 7*SECSPERDAY) { - DPRINTF(1, ("nmea: parse_weekdata: invalid weektime spec\n")); - return FALSE; + uint32_t secs; + uint16_t week, leap = 0; + l_fp fofs; + int rc; + + UCC * dpw = (UCC*)field_parse(rd, weekidx); + UCC * dps = (UCC*)field_parse(rd, timeidx); + + rc = _parse_u16 (dpw, &dpw, &week, 5) + && _parse_eof (dpw, &dpw) + && _parse_u32 (dps, &dps, &secs, 9) + && _parse_frac(dps, &dps, &fofs) + && _parse_eof (dps, &dps) + && (secs < 7*SECSPERDAY); + if (rc && leapidx > 0) { + UCC * dpl = (UCC*)field_parse(rd, leapidx); + rc = _parse_u16 (dpl, &dpl, &leap, 5) + && _parse_eof (dpl, &dpl); } - wd->wt_time = (u_int32)secs; - - return TRUE; -} - -/* - * ------------------------------------------------------------------- - * funny calendar-oriented stuff -- perhaps a bit hard to grok. - * ------------------------------------------------------------------- - * - * Unfold a time-of-day (seconds since midnight) around the current - * system time in a manner that guarantees an absolute difference of - * less than 12hrs. - * - * This function is used for NMEA sentences that contain no date - * information. This requires the system clock to be in +/-12hrs - * around the true time, or the clock will synchronize the system 1day - * off if not augmented with a time sources that also provide the - * necessary date information. - * - * The function updates the calendar structure it also uses as - * input to fetch the time from. - * - * returns 1 on success, 0 on failure - * ------------------------------------------------------------------- - */ -static int -unfold_day( - struct calendar * jd, - u_int32 rec_ui - ) -{ - vint64 rec_qw; - ntpcal_split rec_ds; - - /* - * basically this is the peridiodic extension of the receive - * time - 12hrs to the time-of-day with a period of 1 day. - * But we would have to execute this in 64bit arithmetic, and we - * cannot assume we can do this; therefore this is done - * in split representation. - */ - rec_qw = ntpcal_ntp_to_ntp(rec_ui - SECSPERDAY/2, NULL); - rec_ds = ntpcal_daysplit(&rec_qw); - rec_ds.lo = ntpcal_periodic_extend(rec_ds.lo, - ntpcal_date_to_daysec(jd), - SECSPERDAY); - rec_ds.hi += ntpcal_daysec_to_date(jd, rec_ds.lo); - return (ntpcal_rd_to_date(jd, rec_ds.hi + DAY_NTP_STARTS) >= 0); -} - -/* - * ------------------------------------------------------------------- - * A 2-digit year is expanded into full year spec around the year found - * in 'jd->year'. This should be in +79/-19 years around the system time, - * or the result will be off by 100 years. The assymetric behaviour was - * chosen to enable inital sync for systems that do not have a - * battery-backup clock and start with a date that is typically years in - * the past. - * - * Since the GPS epoch starts at 1980-01-06, the resulting year will be - * not be before 1980 in any case. - * - * returns 1 on success, 0 on failure - * ------------------------------------------------------------------- - */ -static int -unfold_century( - struct calendar * jd, - u_int32 rec_ui - ) -{ - struct calendar rec; - int32 baseyear; - - ntpcal_ntp_to_date(&rec, rec_ui, NULL); - baseyear = rec.year - 20; - if (baseyear < g_gpsMinYear) - baseyear = g_gpsMinYear; - jd->year = (u_short)ntpcal_periodic_extend(baseyear, jd->year, - 100); - - return ((baseyear <= jd->year) && (baseyear + 100 > jd->year)); -} - -/* - * ------------------------------------------------------------------- - * A 2-digit year is expanded into a full year spec by correlation with - * a GPS week number and the current leap second count. - * - * The GPS week time scale counts weeks since Sunday, 1980-01-06, modulo - * 1024 and seconds since start of the week. The GPS time scale is based - * on international atomic time (TAI), so the leap second difference to - * UTC is also needed for a proper conversion. - * - * A brute-force analysis (that is, test for every date) shows that a - * wrong assignment of the century can not happen between the years 1900 - * to 2399 when comparing the week signatures for different - * centuries. (I *think* that will not happen for 400*1024 years, but I - * have no valid proof. -*-perlinger@ntp.org-*-) - * - * This function is bound to to work between years 1980 and 2399 - * (inclusive), which should suffice for now ;-) - * - * Note: This function needs a full date&time spec on input due to the - * necessary leap second corrections! - * - * returns 1 on success, 0 on failure - * ------------------------------------------------------------------- - */ -static int -gpsfix_century( - struct calendar * jd, - const gps_weektm * wd, - u_short * century - ) -{ - int32 days; - int32 doff; - u_short week; - u_short year; - int loop; - - /* Get day offset. Assumes that the input time is in range and - * that the leap seconds do not shift more than +/-1 day. - */ - doff = ntpcal_date_to_daysec(jd) + wd->wt_leap; - doff = (doff >= SECSPERDAY) - (doff < 0); - - /* - * Loop over centuries to get a match, starting with the last - * successful one. (Or with the 19th century if the cached value - * is out of range...) - */ - year = jd->year % 100; - for (loop = 5; loop > 0; loop--,(*century)++) { - if (*century < 19 || *century >= 24) - *century = 19; - /* Get days and week in GPS epoch */ - jd->year = year + *century * 100; - days = ntpcal_date_to_rd(jd) - DAY_GPS_STARTS + doff; - week = (days / 7) % 1024; - if (days >= 0 && wd->wt_week == week) - return TRUE; /* matched... */ + if (rc) { + fofs.l_ui -= leap; + *wd = gpscal_from_gpsweek(week, secs, fofs); + } else { + DPRINTF(1, ("nmea: parse_gpsw: invalid weektime spec\n")); } - - jd->year = year; - return FALSE; /* match failed... */ + return rc; } -/* - * ------------------------------------------------------------------- - * And now the final execise: Considering the fact that many (most?) - * GPS receivers cannot handle a GPS epoch wrap well, we try to - * compensate for that problem by unwrapping a GPS epoch around the - * receive stamp. Another execise in periodic unfolding, of course, - * but with enough points to take care of. - * - * Note: The integral part of 'tofs' is intended to handle small(!) - * systematic offsets, as -1 for handling $GPZDG, which gives the - * following second. (sigh...) The absolute value shall be less than a - * day (86400 seconds). - * ------------------------------------------------------------------- - */ -static l_fp -eval_gps_time( - struct peer * peer, /* for logging etc */ - const struct calendar * gpst, /* GPS time stamp */ - const struct timespec * tofs, /* GPS frac second & offset */ - const l_fp * xrecv /* receive time stamp */ + +#ifdef HAVE_PPSAPI +static double +tabsdiffd( + l_fp t1, + l_fp t2 ) { - struct refclockproc * const pp = peer->procptr; - nmea_unit * const up = (nmea_unit *)pp->unitptr; - - l_fp retv; - - /* components of calculation */ - int32_t rcv_sec, rcv_day; /* receive ToD and day */ - int32_t gps_sec, gps_day; /* GPS ToD and day in NTP epoch */ - int32_t adj_day, weeks; /* adjusted GPS day and week shift */ - - /* some temporaries to shuffle data */ - vint64 vi64; - ntpcal_split rs64; - - /* evaluate time stamp from receiver. */ - gps_sec = ntpcal_date_to_daysec(gpst); - gps_day = ntpcal_date_to_rd(gpst) - DAY_NTP_STARTS; - - /* merge in fractional offset */ - retv = tspec_intv_to_lfp(*tofs); - gps_sec += retv.l_i; - - /* If we fully trust the GPS receiver, just combine days and - * seconds and be done. */ - if (peer->ttl & NMEA_DATETRUST_MASK) { - retv.l_ui = ntpcal_dayjoin(gps_day, gps_sec).D_s.lo; - return retv; - } - - /* So we do not trust the GPS receiver to deliver a correct date - * due to the GPS epoch changes. We map the date from the - * receiver into the +/-512 week interval around the receive - * time in that case. This would be a tad easier with 64bit - * calculations, but again, we restrict the code to 32bit ops - * when possible. */ - - /* - make sure the GPS fractional day is normalised - * Applying the offset value might have put us slightly over the - * edge of the allowed range for seconds-of-day. Doing a full - * division with floor correction is overkill here; a simple - * addition or subtraction step is sufficient. Using WHILE loops - * gives the right result even if the offset exceeds one day, - * which is NOT what it's intented for! */ - while (gps_sec >= SECSPERDAY) { - gps_sec -= SECSPERDAY; - gps_day += 1; - } - while (gps_sec < 0) { - gps_sec += SECSPERDAY; - gps_day -= 1; - } - - /* - get unfold base: day of full recv time - 512 weeks */ - vi64 = ntpcal_ntp_to_ntp(xrecv->l_ui, NULL); - rs64 = ntpcal_daysplit(&vi64); - rcv_sec = rs64.lo; - rcv_day = rs64.hi - 512 * 7; - - /* - take the fractional days into account - * If the fractional day of the GPS time is smaller than the - * fractional day of the receive time, we shift the base day for - * the unfold by 1. */ - if ( gps_sec < rcv_sec - || (gps_sec == rcv_sec && retv.l_uf < xrecv->l_uf)) - rcv_day += 1; - - /* - don't warp ahead of GPS invention! */ - if (rcv_day < g_gpsMinBase) - rcv_day = g_gpsMinBase; - - /* - let the magic happen: */ - adj_day = ntpcal_periodic_extend(rcv_day, gps_day, 1024*7); - - /* - check if we should log a GPS epoch warp */ - weeks = (adj_day - gps_day) / 7; - if (weeks != up->epoch_warp) { - up->epoch_warp = weeks; - LOGIF(CLOCKINFO, (LOG_INFO, - "%s Changed GPS epoch warp to %d weeks", - refnumtoa(&peer->srcadr), weeks)); - } - - /* - build result and be done */ - retv.l_ui = ntpcal_dayjoin(adj_day, gps_sec).D_s.lo; - return retv; + double dd; + L_SUB(&t1, &t2); + LFPTOD(&t1, dd); + return fabs(dd); } +#endif /* HAVE_PPSAPI */ /* * =================================================================== @@ -1896,8 +1773,8 @@ nmead_open( ) { int fd = -1; /* result file descriptor */ - -#ifdef HAVE_READLINK + +# ifdef HAVE_READLINK char host[80]; /* link target buffer */ char * port; /* port name or number */ int rc; /* result code (several)*/ @@ -1907,7 +1784,7 @@ nmead_open( struct addrinfo *ai; /* result scan ptr */ fd = -1; - + /* try to read as link, make sure no overflow occurs */ rc = readlink(device, host, sizeof(host)); if ((size_t)rc >= sizeof(host)) @@ -1919,7 +1796,7 @@ nmead_open( if (!port) return fd; /* not 'host:port' syntax ? */ *port++ = '\0'; /* put in separator */ - + /* get address infos and try to open socket * * This getaddrinfo() is naughty in ntpd's nonblocking main @@ -1933,7 +1810,7 @@ nmead_open( ai_hint.ai_socktype = SOCK_STREAM; if (getaddrinfo(host, port, &ai_hint, &ai_list)) return fd; - + for (ai = ai_list; ai && (fd == -1); ai = ai->ai_next) { sh = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); @@ -1946,9 +1823,11 @@ nmead_open( close(sh); } freeaddrinfo(ai_list); -#else + if (fd != -1) + make_socket_nonblocking(fd); +# else fd = -1; -#endif +# endif return fd; } diff --git a/contrib/ntp/ntpd/refclock_oncore.c b/contrib/ntp/ntpd/refclock_oncore.c index 2c82caeb68c6a..17c8cbf294abc 100644 --- a/contrib/ntp/ntpd/refclock_oncore.c +++ b/contrib/ntp/ntpd/refclock_oncore.c @@ -162,6 +162,7 @@ #include "ntp_unixtime.h" #include "ntp_refclock.h" #include "ntp_calendar.h" +#include "ntp_calgps.h" #include "ntp_stdlib.h" #include <stdio.h> @@ -388,6 +389,7 @@ static void oncore_set_traim (struct instance *); static void oncore_shmem_get_3D (struct instance *); static void oncore_ss (struct instance *); static int oncore_wait_almanac (struct instance *); +static void oncore_feed_clockproc (struct instance *); static void oncore_msg_any (struct instance *, u_char *, size_t, int); static void oncore_msg_Adef (struct instance *, u_char *, size_t); @@ -1872,12 +1874,16 @@ oncore_get_timestamp( /* and some things I dont understand (magic ntp things) */ +#if 1 + oncore_feed_clockproc(instance); +#else if (!refclock_process(instance->pp)) { - refclock_report(instance->peer, CEVNT_BADTIME); + refclock_report(peer, CEVNT_BADTIME); peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */ return; } - +#endif + oncore_log(instance, LOG_INFO, Msg); /* this is long message above */ instance->pollcnt = 2; @@ -4036,6 +4042,52 @@ oncore_wait_almanac( } +static void +oncore_feed_clockproc( + struct instance * instance + ) +{ + struct peer * const peer = instance->peer; + struct refclockproc * const pp = instance->pp; + + TCivilDate cd; /* calendar date + time */ + TGpsDatum gd; /* GPS datum, remapped into NTP epoch */ + l_fp fp; /* the reference time in NTP format */ + + if (pp->year >= 1980) { + /* There are oncore receivers that run in a fixed + * (possibly shifted) GPS era and fold back into that + * era on every GPS week rollover. + * + * We do not trust the date we get and remap to a GPS + * era defined by the GPS base date (derived from the + * build time stamp or a 'tos basedate' config option. + */ + ZERO(fp); /* has a zero to begin with */ + ZERO(cd); /* month == monthday == 0 -> use year+yearday */ + cd.year = pp->year; + cd.yearday = pp->day; + cd.hour = pp->hour; + cd.minute = pp->minute; + cd.second = pp->second; + + /* the magic happens in the next line: */ + gd = gpscal_from_calendar(&cd, fp); /* fp should be zero here */ + + /* To avoid the trouble the day-of-year calculations in + * 'refclock_process()' can cause we feed the time + * stamps we have now directly. This also saves us two + * full calendar calendar conversion cycles. + */ + fp = ntpfp_from_gpsdatum(&gd); + refclock_process_offset(pp, fp, pp->lastrec, pp->fudgetime1); + } else { + /* This is obviously a bad date/time... */ + refclock_report(peer, CEVNT_BADDATE); + peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */ + return; + } +} static void oncore_log ( diff --git a/contrib/ntp/ntpd/refclock_palisade.c b/contrib/ntp/ntpd/refclock_palisade.c index d69ce9400e686..e698d72cc5219 100644 --- a/contrib/ntp/ntpd/refclock_palisade.c +++ b/contrib/ntp/ntpd/refclock_palisade.c @@ -65,6 +65,10 @@ * * 30/08/09: Added support for Trimble Acutime Gold Receiver. * Fernando P. Hauscarriaga (fernandoph@iar.unlp.edu.ar) + * + * 21/04/18: Added support for Resolution devices. + * + * 03/09/19: Added support for ACE III & Copernicus II. */ #ifdef HAVE_CONFIG_H @@ -114,6 +118,9 @@ static int decode_date(struct refclockproc *pp, const char *cp); #define CLK_THUNDERBOLT 2 /* Trimble Thunderbolt GPS Receiver */ #define CLK_ACUTIME 3 /* Trimble Acutime Gold */ #define CLK_ACUTIMEB 4 /* Trimble Actutime Gold Port B */ +#define CLK_RESOLUTION 5 /* Trimble Resolution Receivers */ +#define CLK_ACE 6 /* Trimble ACE III */ +#define CLK_COPERNICUS 7 /* Trimble Copernicus II */ int praecis_msg; static void praecis_parse(struct recvbuf *rbufp, struct peer *peer); @@ -122,7 +129,6 @@ static void praecis_parse(struct recvbuf *rbufp, struct peer *peer); * They are taken from Markus Prosch */ -#ifdef PALISADE_SENDCMD_RESURRECTED /* * sendcmd - Build data packet for sending */ @@ -136,7 +142,6 @@ sendcmd ( *(buffer->data + 1) = (unsigned char)c; buffer->size = 2; } -#endif /* PALISADE_SENDCMD_RESURRECTED */ /* * sendsupercmd - Build super data packet for sending @@ -255,6 +260,37 @@ init_acutime ( } /* + * init_resolution - Prepares Resolution receiver to be used with NTP + */ +static void +init_resolution ( + int fd + ) +{ + struct packettx tx; + + tx.size = 0; + tx.data = (u_char *) emalloc(100); + + /* set UTC time */ + sendsupercmd (&tx, 0x8E, 0xA2); + sendbyte (&tx, 0x3); + sendetx (&tx, fd); + + /* squelch PPS output unless locked to at least one satellite */ + sendsupercmd (&tx, 0x8E, 0x4E); + sendbyte (&tx, 0x3); + sendetx (&tx, fd); + + /* activate packets 0x8F-AB and 0x8F-AC */ + sendsupercmd (&tx, 0x8E, 0xA5); + sendint (&tx, 0x5); + sendetx (&tx, fd); + + free(tx.data); +} + +/* * palisade_start - open the devices and initialize data for processing */ static int @@ -274,7 +310,9 @@ palisade_start ( /* * Open serial port. */ - fd = refclock_open(gpsdev, SPEED232, LDISC_RAW); + u_int speed; + speed = (CLK_TYPE(peer) == CLK_COPERNICUS) ? SPEED232COP : SPEED232; + fd = refclock_open(gpsdev, speed, LDISC_RAW); if (fd <= 0) { #ifdef DEBUG printf("Palisade(%d) start: open %s failed\n", unit, gpsdev); @@ -321,6 +359,25 @@ palisade_start ( msyslog(LOG_NOTICE, "Palisade(%d) Acutime Gold mode enabled" ,unit); break; + case CLK_RESOLUTION: + msyslog(LOG_NOTICE, "Palisade(%d) Resolution mode enabled" + ,unit); + tio.c_cflag = (CS8|CLOCAL|CREAD|PARENB|PARODD); + break; + case CLK_ACE: + msyslog(LOG_NOTICE, "Palisade(%d) ACE III mode enabled" + ,unit); + tio.c_cflag = (CS8|CLOCAL|CREAD|PARENB|PARODD); + break; + case CLK_COPERNICUS: + msyslog(LOG_NOTICE, "Palisade(%d) Copernicus II mode enabled" + ,unit); + /* Must use ORing/ANDing to set/clear c_cflag bits otherwise + CBAUD gets set back to 0. This ought to be an issue for + the other modes above but it seems that the baud rate + defaults to 9600 if CBAUD gets set to 0. */ + tio.c_cflag &= ~(PARENB|PARODD); + break; default: msyslog(LOG_NOTICE, "Palisade(%d) mode unknown",unit); break; @@ -371,6 +428,8 @@ palisade_start ( init_thunderbolt(fd); if (up->type == CLK_ACUTIME) init_acutime(fd); + if (up->type == CLK_RESOLUTION) + init_resolution(fd); return 1; } @@ -483,6 +542,9 @@ TSIP_decode ( double secfrac; unsigned short event = 0; int mmday; + long tow; + uint16_t wn; + int GPS_UTC_Offset; struct palisade_unit *up; struct refclockproc *pp; @@ -496,7 +558,12 @@ TSIP_decode ( * proper format, declare bad format and exit. */ - if ((up->type != CLK_THUNDERBOLT) & (up->type != CLK_ACUTIME)){ + if ((up->type != CLK_THUNDERBOLT) && + (up->type != CLK_ACUTIME ) && + (up->type != CLK_RESOLUTION ) && + (up->type != CLK_ACE ) && + (up->type != CLK_COPERNICUS ) ) + { if ((up->rpt_buf[0] == (char) 0x41) || (up->rpt_buf[0] == (char) 0x46) || (up->rpt_buf[0] == (char) 0x54) || @@ -513,7 +580,7 @@ TSIP_decode ( } /* - * We cast both to u_char to as 0x8f uses the sign bit on a char + * We cast both to u_char as 0x8f uses the sign bit on a char */ if ((u_char) up->rpt_buf[0] == (u_char) 0x8f) { /* @@ -525,8 +592,6 @@ TSIP_decode ( return 0; switch (mb(0) & 0xff) { - int GPS_UTC_Offset; - long tow; case PACKET_8F0B: @@ -839,11 +904,70 @@ TSIP_decode ( #ifdef DEBUG printf("GPS TOW: %ld\n", (long)getlong((u_char *) &mb(0))); printf("GPS WN: %d\n", getint((u_char *) &mb(4))); - printf("GPS UTC-GPS Offser: %ld\n", (long)getlong((u_char *) &mb(6))); + printf("GPS UTC-GPS Offset: %ld\n", (long)getlong((u_char *) &mb(6))); #endif return 0; } + /* GPS time packet for ACE III or Copernicus II receiver */ + else if ((up->rpt_buf[0] == PACKET_41) && + ((up->type == CLK_ACE) || (up->type == CLK_COPERNICUS))) { +#ifdef DEBUG + if ((debug > 1) && (up->type == CLK_ACE)) + printf("TSIP_decode: Packet 0x41 seen in ACE III mode\n"); + if ((debug > 1) && (up->type == CLK_COPERNICUS)) + printf("TSIP_decode: Packet 0x41 seen in Copernicus II mode\n"); +#endif + if (up->rpt_cnt != LENCODE_41) { /* check length */ + refclock_report(peer, CEVNT_BADREPLY); + up->polled = -1; +#ifdef DEBUG + printf("TSIP_decode: unit %d: bad packet %02x len %d\n", + up->unit, up->rpt_buf[0] & 0xff, up->rpt_cnt); +#endif + return 0; + } + if (up->polled <= 0) + return 0; + tow = (long)getsingle((u_char *) &mb(0)); + wn = (uint16_t)getint((u_char *) &mb(4)); + GPS_UTC_Offset = (int)getsingle((u_char *) &mb(6)); + if (GPS_UTC_Offset == 0){ /* Check UTC Offset */ +#ifdef DEBUG + printf("TSIP_decode: UTC Offset Unknown\n"); +#endif + refclock_report(peer, CEVNT_BADREPLY); + up->polled = -1; + return 0; + } + /* Get date & time from WN & ToW minus offset */ + TCivilDate cd; + TGpsDatum wd; + l_fp ugo; /* UTC-GPS offset, negative number */ + ugo.Ul_i.Xl_i = (int32_t)-GPS_UTC_Offset; + ugo.l_uf = 0; + wd = gpscal_from_gpsweek((wn % 1024), (int32_t)tow, ugo); + gpscal_to_calendar(&cd, &wd); + pp->year = cd.year; + pp->day = cd.yearday; + pp->hour = cd.hour; + pp->minute = cd.minute; + pp->second = cd.second; + pp->nsec = 0; + pp->leap = LEAP_NOWARNING; +#ifdef DEBUG + if (debug > 1) { + printf("GPS TOW: %ld\n", tow); + printf("GPS WN: %d\n", wn); + printf("GPS UTC-GPS Offset: %d\n", GPS_UTC_Offset); + printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d ", + up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, pp->second, + pp->nsec, cd.month, cd.monthday, pp->year); + } +#endif + return 1; + } + /* Health Status for Acutime Receiver */ else if ((up->rpt_buf[0] == PACKET_46) & (up->type == CLK_ACUTIME)) { #ifdef DEBUG @@ -854,7 +978,7 @@ TSIP_decode ( printf ("Doing Position Fixes\n"); break; case 0x01: - printf ("Do no have GPS time yet\n"); + printf ("Do not have GPS time yet\n"); break; case 0x03: printf ("PDOP is too high\n"); @@ -899,6 +1023,73 @@ TSIP_decode ( return 0; } } + + /* Health Status for Copernicus II Receiver */ + else if ((up->rpt_buf[0] == PACKET_46) && (up->type == CLK_COPERNICUS)) { +#ifdef DEBUG + if (debug > 1) + /* Status Codes */ + switch (mb(0)) { + case 0x00: + printf ("Doing Position Fixes\n"); + break; + case 0x01: + printf ("Do not have GPS time yet\n"); + break; + case 0x03: + printf ("PDOP is too high\n"); + break; + case 0x04: + printf("The Chosen satellite is unusable\n"); + break; + case 0x08: + printf ("No usable satellites\n"); + break; + case 0x09: + printf ("Only 1 usable satellite\n"); + break; + case 0x0A: + printf ("Only 2 usable satellites\n"); + break; + case 0x0B: + printf ("Only 3 usable satellites\n"); + break; + } +#endif + /* Error Codes */ + if ((mb(1) & 0x3E) != 0) { /* Don't regard bits 0 and 6 as errors */ + refclock_report(peer, CEVNT_BADTIME); + up->polled = -1; +#ifdef DEBUG + if (debug > 1) { + if ((mb(1) & 0x18) == 0x08) + printf ("Antenna feed line fault (open)\n"); + if ((mb(1) & 0x18) == 0x18) + printf ("Antenna feed line fault (short)\n"); + } +#endif + } + return 0; + } + + /* Other packets output by ACE III & Copernicus II Receivers, dropped silently */ + else if (((up->rpt_buf[0] == (char) 0x4A) || + (up->rpt_buf[0] == (char) 0x4B) || + (up->rpt_buf[0] == (char) 0x56) || + (up->rpt_buf[0] == (char) 0x5F) || + (up->rpt_buf[0] == (char) 0x6D) || + (up->rpt_buf[0] == (char) 0x82) || + (up->rpt_buf[0] == (char) 0x84)) && + ((up->type == CLK_ACE) || (up->type == CLK_COPERNICUS))) { +#ifdef DEBUG + if ((debug > 1) && (up->type == CLK_ACE)) + printf("TSIP_decode: Packet 0x%2x seen in ACE III mode\n", (up->rpt_buf[0] & 0XFF)); + if ((debug > 1) && (up->type == CLK_COPERNICUS)) + printf("TSIP_decode: Packet 0x%2x seen in Copernicus II mode\n", (up->rpt_buf[0] & 0XFF)); +#endif + return 0; + } + else if (up->rpt_buf[0] == 0x54) return 0; @@ -1188,9 +1379,19 @@ HW_poll ( { int x; /* state before & after RTS set */ struct palisade_unit *up; + struct packettx tx; up = pp->unitptr; + if (up->type == CLK_ACE) { + /* Poll by sending a 0x21 command */ + tx.size = 0; + tx.data = (u_char *) emalloc(100); + sendcmd (&tx, 0x21); + sendetx (&tx, pp->io.fd); + free(tx.data); + } else { + /* read the current status, so we put things back right */ if (ioctl(pp->io.fd, TIOCMGET, &x) < 0) { DPRINTF(1, ("Palisade HW_poll: unit %d: GET %m\n", @@ -1219,9 +1420,12 @@ HW_poll ( x &= ~TIOCM_RTS; /* turn off RTS */ + } /* (up->type != CLK_ACE) */ + /* poll timestamp */ get_systime(&pp->lastrec); + if (up->type != CLK_ACE) { if (ioctl(pp->io.fd, TIOCMSET, &x) == -1) { #ifdef DEBUG if (debug) @@ -1232,6 +1436,7 @@ HW_poll ( up->unit); return -1; } + } return 0; } @@ -1298,6 +1503,31 @@ getlong( return (int32)(u_int32)ntohl(u32); } +/* + * copy/swap a big-endian 32-bit single-precision floating point into a host 32-bit int + */ +static int32 +getsingle( + u_char *bp + ) +{ + u_int32 mantissa; + int8_t exponent; + uint8_t sign, exp_field; + int32 res; + + memcpy(&mantissa, bp, sizeof(mantissa)); + mantissa = ((u_int32)ntohl(mantissa) & 0x7FFFFF) | 0x800000; + exp_field = ((uint8_t)bp[0] << 1) + ((uint8_t)bp[1] >> 7); + exponent = (int8_t)exp_field - 127; + sign = ((uint8_t)bp[0] >> 7); + if (exponent > 23) + res = (int32)(mantissa << (exponent - 23)); + else + res = (int32)(mantissa >> (23 - exponent)); + return sign ? -res : res; +} + #else /* REFCLOCK && CLOCK_PALISADE*/ int refclock_palisade_c_notempty; #endif diff --git a/contrib/ntp/ntpd/refclock_palisade.h b/contrib/ntp/ntpd/refclock_palisade.h index 3782a5eb92c77..22dd3681386ed 100644 --- a/contrib/ntp/ntpd/refclock_palisade.h +++ b/contrib/ntp/ntpd/refclock_palisade.h @@ -82,6 +82,7 @@ #include "ntp_control.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" +#include "ntp_calgps.h" #include "ntp_stdlib.h" /* @@ -98,6 +99,7 @@ */ #define DEVICE "/dev/palisade%d" /* device name and unit */ #define SPEED232 B9600 /* uart speed (9600 baud) */ +#define SPEED232COP B38400 /* uart speed for Copernicus II (38400 baud) */ /* * TSIP Report Definitions @@ -108,6 +110,8 @@ #define LENCODE_8FAC 68 /* Length of Thunderbolt 8F-AC Position Packet*/ #define LENCODE_8FAB 17 /* Length of Thunderbolt Primary Timing Packet*/ +#define LENCODE_41 10 /* Length of Copernicus II GPS Time Packet*/ + /* Allowed Sub-Packet ID's */ #define PACKET_8F0B 0x0B #define PACKET_NTP 0xAD @@ -187,11 +191,10 @@ long HW_poll (struct refclockproc *); static double getdbl (u_char *); static short getint (u_char *); static int32 getlong (u_char *); +static int32 getsingle (u_char *); -#ifdef PALISADE_SENDCMD_RESURRECTED static void sendcmd (struct packettx *buffer, int c); -#endif static void sendsupercmd (struct packettx *buffer, int c1, int c2); static void sendbyte (struct packettx *buffer, int b); static void sendint (struct packettx *buffer, int a); diff --git a/contrib/ntp/ntpd/refclock_parse.c b/contrib/ntp/ntpd/refclock_parse.c index 9f5b0d7129f8c..b4a65b80377fb 100644 --- a/contrib/ntp/ntpd/refclock_parse.c +++ b/contrib/ntp/ntpd/refclock_parse.c @@ -3069,6 +3069,7 @@ parse_start( parse->generic->fudgetime2 = 0.0; parse->ppsphaseadjust = parse->generic->fudgetime2; + parse->generic->fudgeminjitter = 0.0; parse->generic->clockdesc = parse->parse_type->cl_description; @@ -3424,6 +3425,8 @@ parse_ctl( #endif } } + + parse->generic->fudgeminjitter = in->fudgeminjitter; } } diff --git a/contrib/ntp/ntpd/refclock_zyfer.c b/contrib/ntp/ntpd/refclock_zyfer.c index 7b79da32c97e9..8f9f0aad08dcc 100644 --- a/contrib/ntp/ntpd/refclock_zyfer.c +++ b/contrib/ntp/ntpd/refclock_zyfer.c @@ -15,6 +15,7 @@ #include "ntp_refclock.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" +#include "ntp_calgps.h" #include <stdio.h> #include <ctype.h> @@ -211,6 +212,10 @@ zyfer_receive( int omode; /* Operation mode */ u_char *p; + TCivilDate tsdoy; + TNtpDatum tsntp; + l_fp tfrac; + peer = rbufp->recv_peer; pp = peer->procptr; up = pp->unitptr; @@ -283,10 +288,22 @@ zyfer_receive( return; } - if (!refclock_process(pp)) { - refclock_report(peer, CEVNT_BADTIME); - return; - } + /* treat GPS input as subject to era warps */ + ZERO(tsdoy); + ZERO(tfrac); + + tsdoy.year = pp->year; + tsdoy.yearday = pp->day; + tsdoy.hour = pp->hour; + tsdoy.minute = pp->minute; + tsdoy.second = pp->second; + + /* note: We kept 'month' and 'monthday' zero above. That forces + * day-of-year based calculation now: + */ + tsntp = gpsntp_from_calendar(&tsdoy, tfrac); + tfrac = ntpfp_from_ntpdatum(&tsntp); + refclock_process_offset(pp, tfrac, pp->lastrec, pp->fudgetime1); /* * Good place for record_clock_stats() |