Module Name: src
Committed By: kardel
Date: Sat Aug 28 15:42:46 UTC 2010
Modified Files:
src/external/bsd/ntp: Makefile
src/external/bsd/ntp/bin: Makefile Makefile.inc
src/external/bsd/ntp/bin/ntp-keygen: Makefile
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/bin/ntpdate: Makefile
src/external/bsd/ntp/bin/ntpdc: Makefile
src/external/bsd/ntp/bin/ntpq: Makefile
src/external/bsd/ntp/bin/ntptime: Makefile
Added Files:
src/external/bsd/ntp/bin/ntpdate: ntpdate.8
src/external/bsd/ntp/bin/ntptime: ntptime.8
src/external/bsd/ntp/bin/ntptrace: Makefile ntptrace.8 ntptrace.awk
src/external/bsd/ntp/bin/sntp: Makefile
src/external/bsd/ntp/html: Makefile
Log Message:
add installation of manual pages, html files and up to now missing commands
(sntp, ntptrace)
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/Makefile \
src/external/bsd/ntp/bin/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntp-keygen/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpdate/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntpdate/ntpdate.8
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpdc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpq/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntptime/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntptime/ntptime.8
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntptrace/Makefile \
src/external/bsd/ntp/bin/ntptrace/ntptrace.8 \
src/external/bsd/ntp/bin/ntptrace/ntptrace.awk
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/sntp/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/html/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/ntp/Makefile
diff -u src/external/bsd/ntp/Makefile:1.1 src/external/bsd/ntp/Makefile:1.2
--- src/external/bsd/ntp/Makefile:1.1 Sun Dec 13 17:13:49 2009
+++ src/external/bsd/ntp/Makefile Sat Aug 28 15:42:46 2010
@@ -1,5 +1,5 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:49 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
-SUBDIR+= lib .WAIT bin
+SUBDIR+= lib .WAIT bin html
.include <bsd.subdir.mk>
Index: src/external/bsd/ntp/bin/Makefile
diff -u src/external/bsd/ntp/bin/Makefile:1.1 src/external/bsd/ntp/bin/Makefile:1.2
--- src/external/bsd/ntp/bin/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/Makefile Sat Aug 28 15:42:46 2010
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
-SUBDIR= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime
+SUBDIR= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime ntptrace sntp
.if ("${MKCRYPTO}" != "no")
SUBDIR+= ntp-keygen
Index: src/external/bsd/ntp/bin/Makefile.inc
diff -u src/external/bsd/ntp/bin/Makefile.inc:1.1 src/external/bsd/ntp/bin/Makefile.inc:1.2
--- src/external/bsd/ntp/bin/Makefile.inc:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/Makefile.inc Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile.inc,v 1.2 2010/08/28 15:42:46 kardel Exp $
.include "../Makefile.inc"
Index: src/external/bsd/ntp/bin/ntp-keygen/Makefile
diff -u src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.1 src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.2
--- src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntp-keygen/Makefile Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
NOGCCERROR=yes
@@ -6,7 +6,7 @@
PROG= ntp-keygen
-MAN=
+MAN= ntp-keygen.8
BINDIR= /usr/sbin
SRCS= ntp-keygen-opts.c \
@@ -23,4 +23,7 @@
.PATH: ${DIST}
+ntp-keygen.8: ntp-keygen.1
+ @cp $? $@
+
.include <bsd.prog.mk>
Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.1 src/external/bsd/ntp/bin/ntpd/Makefile:1.2
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntpd/Makefile Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
NOGCCERROR=yes
@@ -6,8 +6,7 @@
PROG= ntpd
-MAN=
-#MAN= named.8 lwresd.8 named.conf.5
+MAN= ntpd.8
BINDIR= /usr/sbin
SRCS= cmd_args.c \
@@ -86,4 +85,7 @@
.PATH: ${DIST}
+ntpd.8: ntpd.1
+ @cp $? $@
+
.include <bsd.prog.mk>
Index: src/external/bsd/ntp/bin/ntpdate/Makefile
diff -u src/external/bsd/ntp/bin/ntpdate/Makefile:1.1 src/external/bsd/ntp/bin/ntpdate/Makefile:1.2
--- src/external/bsd/ntp/bin/ntpdate/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntpdate/Makefile Sat Aug 28 15:42:46 2010
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
.include <bsd.own.mk>
PROG= ntpdate
-MAN=
+MAN= ntpdate.8
BINDIR= /usr/sbin
SRCS= ntpdate.c
Index: src/external/bsd/ntp/bin/ntpdc/Makefile
diff -u src/external/bsd/ntp/bin/ntpdc/Makefile:1.1 src/external/bsd/ntp/bin/ntpdc/Makefile:1.2
--- src/external/bsd/ntp/bin/ntpdc/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntpdc/Makefile Sat Aug 28 15:42:45 2010
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:45 kardel Exp $
.include <bsd.own.mk>
PROG= ntpdc
-MAN=
+MAN= ntpdc.8
BINDIR= /usr/sbin
SRCS= ntpdc.c \
@@ -22,4 +22,7 @@
.PATH: ${DIST}
+ntpdc.8: ntpdc.1
+ @cp $? $@
+
.include <bsd.prog.mk>
Index: src/external/bsd/ntp/bin/ntpq/Makefile
diff -u src/external/bsd/ntp/bin/ntpq/Makefile:1.1 src/external/bsd/ntp/bin/ntpq/Makefile:1.2
--- src/external/bsd/ntp/bin/ntpq/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntpq/Makefile Sat Aug 28 15:42:45 2010
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:45 kardel Exp $
# NOGCCERROR=yes
.include <bsd.own.mk>
PROG= ntpq
-MAN=
+MAN= ntpq.8
BINDIR= /usr/sbin
SRCS= ntpq.c \
@@ -23,4 +23,7 @@
.PATH: ${DIST}
+ntpq.8: ntpq.1
+ @cp $? $@
+
.include <bsd.prog.mk>
Index: src/external/bsd/ntp/bin/ntptime/Makefile
diff -u src/external/bsd/ntp/bin/ntptime/Makefile:1.1 src/external/bsd/ntp/bin/ntptime/Makefile:1.2
--- src/external/bsd/ntp/bin/ntptime/Makefile:1.1 Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntptime/Makefile Sat Aug 28 15:42:45 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/28 15:42:45 kardel Exp $
NOGCCERROR=yes
@@ -6,7 +6,7 @@
PROG= ntptime
-MAN=
+MAN= ntptime.8
BINDIR= /usr/sbin
SRCS= ntptime.c
Added files:
Index: src/external/bsd/ntp/bin/ntpdate/ntpdate.8
diff -u /dev/null src/external/bsd/ntp/bin/ntpdate/ntpdate.8:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntpdate/ntpdate.8 Sat Aug 28 15:42:46 2010
@@ -0,0 +1,203 @@
+.\" $NetBSD: ntpdate.8,v 1.1 2010/08/28 15:42:46 kardel Exp $
+.\" Converted from HTML to mandoc by ntp-html2mdoc.pl
+.\"
+.Dd January 28, 2010
+.Dt NTPDATE 8
+.Os
+.Sh NAME
+.Nm ntpdate
+.Nd set the date and time via NTP
+.Sh SYNOPSIS
+.Nm
+.Op Fl bBdoqsuv
+.Op Fl a Ar key
+.Op Fl e Ar authdelay
+.Op Fl k Ar keyfile
+.Op Fl o Ar version
+.Op Fl p Ar samples
+.Op Fl t Ar timeout
+.Op Ar server ...
+.Sh DESCRIPTION
+.Nm
+sets the local date and time by polling the Network Time
+Protocol (NTP) server(s) given as the
+.Ar server
+arguments to determine
+the correct time. It must be run as root on the local host. A number of
+samples are obtained from each of the servers specified and a subset of
+the NTP clock filter and selection algorithms are applied to select the
+best of these. Note that the accuracy and reliability of
+.Nm
+depends on the number of servers, the number of polls each time it is run
+and the interval between runs.
+.Pp
+.Nm
+can be run manually as necessary to set the host clock,
+or it can be run from the host startup script to set the clock at boot
+time. This is useful in some cases to set the clock initially before starting
+the NTP daemon
+.Pa ntpd .
+It is also possible to run
+.Nm
+from a
+.Pa cron
+script. However, it is important to note that
+.Nm
+with contrived
+.Pa cron
+scripts is no substitute for the NTP daemon,
+which uses sophisticated algorithms to maximize accuracy and reliability
+while minimizing resource use. Finally, since
+.Nm
+does not
+discipline the host clock frequency as does
+.Pa ntpd ,
+the accuracy
+using
+.Nm
+is limited.
+.Pp
+Time adjustments are made by
+.Nm
+in one of two ways. If
+.Nm
+determines the clock is in error more than 0.5 second
+it will simply step the time by calling the system
+.Xr settimeofday 2
+routine. If the error is less than 0.5 seconds, it will slew the time by
+calling the system
+.Xr adjtime 2
+routine. The latter technique is
+less disruptive and more accurate when the error is small, and works quite
+well when
+.Nm
+is run by
+.Pa cron
+every hour or two.
+.Pp
+.Nm
+will decline to set the date if an NTP server daemon
+(e.g.,
+.Pa ntpd
+) is running on the same host. When running
+.Nm
+on a regular basis from
+.Pa cron
+as an alternative to running a daemon,
+doing so once every hour or two will result in precise enough timekeeping
+to avoid stepping the clock.
+.Pp
+If NetInfo support is compiled into
+.Nm ,
+then the
+.Pa server
+argument is optional if
+.Nm
+can find a time
+server in the NetInfo configuration for
+.Pa ntpd
+.
+.Sh COMMAND LINE OPTIONS
+.Bl -tag -width indent
+.It Fl a Ar key
+Enable the authentication function and specify the key identifier to be
+used for authentication as the argument
+.Ar key
+.Nm .
+The
+keys and key identifiers must match in both the client and server key files.
+The default is to disable the authentication function.
+.It Fl B
+Force the time to always be slewed using the adjtime() system call, even
+if the measured offset is greater than +-128 ms. The default is to step
+the time using settimeofday() if the offset is greater than +-128 ms. Note
+that, if the offset is much greater than +-128 ms in this case, that it
+can take a long time (hours) to slew the clock to the correct value. During
+this time. the host should not be used to synchronize clients.
+.It Fl b
+Force the time to be stepped using the settimeofday() system call, rather
+than slewed (default) using the adjtime() system call. This option should
+be used when called from a startup file at boot time.
+.It Fl d
+Enable the debugging mode, in which
+.Nm
+will go through all
+the steps, but not adjust the local clock. Information useful for general
+debugging will also be printed.
+.It Fl e Ar authdelay
+Specify the processing delay to perform an authentication function as the
+value
+.Ar authdelay
+, in seconds and fraction (see
+.Pa ntpd
+for
+details). This number is usually small enough to be negligible for most
+purposes, though specifying a value may improve timekeeping on very slow
+CPU's.
+.It Fl k Ar keyfile
+Specify the path for the authentication key file as the string
+.Ar keyfile
+.
+The default is
+.Pa /etc/ntp.keys .
+This file should be in the format
+described in
+.Pa ntpd
+.
+.It Fl o Ar version
+Specify the NTP version for outgoing packets as the integer
+.Ar version
+,
+which can be 1 or 2. The default is 3. This allows
+.Nm
+to
+be used with older NTP versions.
+.It Fl p Ar samples
+Specify the number of samples to be acquired from each server as the integer
+.Ar samples
+, with values from 1 to 8 inclusive. The default is 4.
+.It Fl q
+Query only - don't set the clock.
+.It Fl s
+Divert logging output from the standard output (default) to the system
+.Pa syslog
+facility. This is designed primarily for convenience of
+.Pa cron
+scripts.
+.It Fl t Ar timeout
+Specify the maximum time waiting for a server response as the value
+.Ar timeout
+,
+in seconds and fraction. The value is rounded to a multiple of 0.2 seconds.
+The default is 1 second, a value suitable for polling across a LAN.
+.It Fl u
+Direct
+.Nm
+to use an unprivileged port for outgoing packets.
+This is most useful when behind a firewall that blocks incoming traffic
+to privileged ports, and you want to synchronise with hosts beyond the
+firewall. Note that the
+.Fl d
+option always uses unprivileged ports.
+.It Fl v
+Be verbose. This option will cause
+.Nm
+'s version identification
+string to be logged.
+.El
+.Sh FILES
+.Bl -tag -width /etc/ntp.keys -compact
+.It Pa /etc/ntp.keys
+encryption keys used by
+.Nm .
+.El
+.Sh AUTHORS
+David L. Mills ([email protected])
+.Sh BUGS
+The slew adjustment is actually 50% larger than the measured offset, since
+this (it is argued) will tend to keep a badly drifting clock more accurate.
+This is probably not a good idea and may cause a troubling hunt for some
+values of the kernel variables
+.Pa tick
+and
+.Pa tickadj .
Index: src/external/bsd/ntp/bin/ntptime/ntptime.8
diff -u /dev/null src/external/bsd/ntp/bin/ntptime/ntptime.8:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntptime/ntptime.8 Sat Aug 28 15:42:45 2010
@@ -0,0 +1,59 @@
+.\" $NetBSD: ntptime.8,v 1.1 2010/08/28 15:42:45 kardel Exp $
+.\" Converted from HTML to mandoc by ntp-html2mdoc.pl
+.\"
+.Dd March 29, 2000
+.Dt NTPTIME 8
+.Os
+.Sh NAME
+.Nm ntptime
+.Nd read kernel time variables
+.Sh SYNOPSIS
+.Nm
+.Op Fl chr
+.Op Fl e Ar est_error
+.Op Fl f Ar frequency
+.Op Fl m Ar max_error
+.Op Fl o Ar offset
+.Op Fl s Ar status
+.Op Fl t Ar time_constant
+.Sh DESCRIPTION
+This program is useful only with special kernels described in the
+.%T "A Kernel Model for Precision Timekeeping"
+page in
+.Pa /usr/share/doc/html/ntp/kern.html .
+It reads and displays
+time-related kernel variables using the
+.Xr ntp_gettime 2
+system call.
+A similar display can be obtained using the
+.Nm ntpdc
+program and
+.Pa kerninfo
+command.
+.Sh OPTIONS
+.Bl -tag -width indent
+.It Fl c
+Display the execution time of
+.Nm
+itself.
+.It Fl e Ar est_error
+Specify estimated error, in microseconds.
+.It Fl f Ar frequency
+Specify frequency offset, in parts per million.
+.It Fl h
+Display times in Unix timeval format. Default is NTP format.
+.It Fl l
+Specify the leap bits as a code from 0 to 3.
+.It Fl m Ar max_error
+Display help information.
+.It Fl o Ar offset
+Specify clock offset, in microseconds.
+.It Fl r
+Display Unix and NTP times in raw format.
+.It Fl s Ar status
+Specify clock status. Better know what you are doing.
+.It Fl t Ar time_constant
+Specify time constant, an integer in the range 0-4.
+.El
+.Sh AUTHORS
+David L. Mills ([email protected])
Index: src/external/bsd/ntp/bin/ntptrace/Makefile
diff -u /dev/null src/external/bsd/ntp/bin/ntptrace/Makefile:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntptrace/Makefile Sat Aug 28 15:42:45 2010
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.1 2010/08/28 15:42:45 kardel Exp $
+
+MAN= ntptrace.8
+BINDIR= /usr/sbin
+SCRIPTS=ntptrace.awk
+
+.include <bsd.prog.mk>
Index: src/external/bsd/ntp/bin/ntptrace/ntptrace.8
diff -u /dev/null src/external/bsd/ntp/bin/ntptrace/ntptrace.8:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntptrace/ntptrace.8 Sat Aug 28 15:42:45 2010
@@ -0,0 +1,61 @@
+.\" $NetBSD: ntptrace.8,v 1.1 2010/08/28 15:42:45 kardel Exp $
+.\" Converted from HTML to mandoc by ntp-html2mdoc.pl
+.\"
+.Dd March 29, 2000
+.Dt NTPTRACE 8
+.Os
+.Sh NAME
+.Nm ntptrace
+.Nd "trace a chain of NTP servers back to the primary source"
+.Sh SYNOPSIS
+.Nm
+.Op Fl vdn
+.Op Fl r Ar retries
+.Op Fl t Ar timeout
+.Op Ar server
+.Sh DESCRIPTION
+.Nm
+determines where a given Network Time Protocol (NTP)
+server gets its time from, and follows the chain of NTP servers back to
+their master time source. If given no arguments, it starts with
+.Pa localhost .
+Here is an example of the output from
+.Nm :
+.Pp
+.nf
+% ntptrace
+localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784
+usndh.edu: stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.fi
+.Pp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+.Nm
+;
+this is why it is not always zero for
+.Pa localhost
+), the host synchronization
+distance, and (only for stratum-1 servers) the reference clock ID. All
+times are given in seconds. Note that the stratum is the server hop count
+to the primary source, while the synchronization distance is the estimated
+error relative to the primary source. These terms are precisely defined
+in RFC-1305.
+.Sh OPTIONS
+.Bl -tag -width indent
+.It Fl d
+Turns on some debugging output.
+.It Fl n
+Turns off the printing of host names; instead, host IP addresses are given.
+This may be useful if a nameserver is down.
+.It Fl r Ar retries
+Sets the number of retransmission attempts for each host (default = 5).
+.It Fl t Ar timeout
+Sets the retransmission timeout (in seconds) (default = 2).
+.It Fl v
+Prints verbose information about the NTP servers.
+.El
+.Sh AUTHORS
+David L. Mills ([email protected])
+.Sh BUGS
+This program makes no attempt to improve accuracy by doing multiple samples.
Index: src/external/bsd/ntp/bin/ntptrace/ntptrace.awk
diff -u /dev/null src/external/bsd/ntp/bin/ntptrace/ntptrace.awk:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntptrace/ntptrace.awk Sat Aug 28 15:42:45 2010
@@ -0,0 +1,131 @@
+#!/bin/sh
+
+/usr/bin/awk '
+#
+# Based on a perl script by
+# John Hay -- [email protected] / [email protected]
+#
+# awk version by Frederick Bruckman <[email protected]>
+
+
+function usage() {
+ print "usage: ntptrace [-nv] [-r retries] [host]"
+ exit 1
+}
+
+function getargs( command, i, argc, argv, done) {
+ host = "localhost."
+ retries = 1
+
+ command = "getopt nr:v"
+ for (i = 2; i <= ARGC; i++)
+ command = command " " ARGV[i-1]
+ command | getline
+ argc = split($0, argv)
+ for (i = 1; i <= argc; i++) {
+ if (argv[i] == "-n") use_numeric = 1
+ if (argv[i] == "-v") do_verbose = 1
+ if (argv[i] == "-r") retries = argv[++i]
+ if (done == 1) host = argv[i]
+ if (argv[i] == "--") done = 1
+ }
+
+ if (retries != retries + 0)
+ usage()
+}
+
+function do_one_server( command, i, nvars, vars, stratum, peer, offset,
+ rootdelay, rootdispersion, refid, srcadr) {
+ rootdelay = 0
+ rootdispersion = 0
+ srcadr = ""
+ stratum = 255
+
+ command = "ntpq -n -c rv " host
+ while (command | getline) {
+ gsub(/,/,"")
+ nvars = split($0, vars)
+ for (i = 1; i <= nvars; i++) {
+ if (vars[i] ~ /stratum=/) {
+ stratum = vars[i]
+ sub(/stratum=/, "", stratum)
+ }
+ if (vars[i] ~ /peer=/) {
+ peer = vars[i]
+ sub(/peer=/, "", peer)
+ }
+ if (vars[i] ~ /offset=/) {
+ offset = vars[i]
+ sub(/offset=/, "", offset)
+ }
+ if (vars[i] ~ /phase=/) {
+ offset = vars[i]
+ sub(/phase=/, "", offset)
+ }
+ if (vars[i] ~ /rootdelay=/) {
+ rootdelay = vars[i]
+ sub(/rootdelay=/, "", rootdelay)
+ }
+ if (vars[i] ~ /rootdispersion=/) {
+ rootdispersion = vars[i]
+ sub(/rootdispersion=/, "", rootdispersion)
+ }
+ if (vars[i] ~ /refid=/) {
+ refid = vars[i]
+ sub(/refid=/, "", refid)
+ }
+ }
+ }
+
+ if (stratum == 255)
+ exit 1
+
+ offset = offset / 1000
+ syncdistance = (rootdispersion + (rootdelay / 2)) / 1000
+
+ printf("%s: stratum %d, offset %f, synch distance %f",
+ dhost(host), stratum, offset, syncdistance)
+ if (stratum == 1) printf(", refid '\''%s'\''", refid)
+ printf("\n")
+
+ if (stratum == 0 || stratum == 1 || stratum == 16)
+ exit 0
+ if (refid ~ /127\.127\.[0-9]{1,3}\.[0-9]{1,3}/)
+ exit 0
+
+ command = "ntpq -n -c '\''pstat " peer "'\'' " host
+ while (command | getline) {
+ gsub(/,/,"")
+ nvars = split($0, vars)
+ for (i = 1; i <= nvars; i++) {
+ if (vars[i] ~ /srcadr=/) {
+ srcadr = vars[i]
+ sub(/srcadr=/, "", srcadr)
+ }
+ }
+ }
+
+ if (srcadr ~ /127\.127\.[0-9]{1,3}\.[0-9]{1,3}/ || srcadr == "")
+ exit 0
+
+ host = srcadr
+ do_one_server()
+}
+
+function dhost(myhost, command) {
+ command = "host " myhost
+ while (command | getline) {
+ if (use_numeric) {
+ if (/address/) return $NF
+ } else {
+ if (/pointer/) return $NF
+ }
+ }
+ return myhost
+}
+
+BEGIN {
+ getargs()
+ do_one_server()
+}
+' $@
Index: src/external/bsd/ntp/bin/sntp/Makefile
diff -u /dev/null src/external/bsd/ntp/bin/sntp/Makefile:1.1
--- /dev/null Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/sntp/Makefile Sat Aug 28 15:42:45 2010
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2010/08/28 15:42:45 kardel Exp $
+
+WARNS?= 1 # XXX -Wshadow -Wsign-compare -Wcast-qual
+
+USE_FORT?= yes # network client/server
+
+PROG= sntp
+MAN= sntp.1
+SRCS= crypto.c kod_management.c log.c main.c networking.c sntp-opts.c utilities.c
+BINDIR= /usr/sbin
+
+.include "${.CURDIR}/../Makefile.inc"
+
+DIST=${IDIST}/sntp
+
+CPPFLAGS+=-I${IDIST}/sntp -I${IDIST}/libopts
+
+.PATH: ${DIST}
+
+.include <bsd.own.mk>
+
+CPPFLAGS+= -DLOCKNAME=\"/var/run/sntp.pid\"
+CPPFLAGS+= -DSAVENAME=\"/var/db/sntp.state\"
+LDADD+= -lm -L${LIBISC} -liscntp
+DPADD+= ${LIBM}
+
+.include <bsd.prog.mk>
Index: src/external/bsd/ntp/html/Makefile
diff -u /dev/null src/external/bsd/ntp/html/Makefile:1.1
--- /dev/null Sat Aug 28 15:42:47 2010
+++ src/external/bsd/ntp/html/Makefile Sat Aug 28 15:42:45 2010
@@ -0,0 +1,139 @@
+# $NetBSD: Makefile,v 1.1 2010/08/28 15:42:45 kardel Exp $
+
+.include <bsd.own.mk>
+.include "${.CURDIR}/../Makefile.inc"
+
+.PATH: ${IDIST}/html
+
+.if ${MKDOC} != "no"
+NTP_DOCFILES= \
+ accopt.html \
+ assoc.html \
+ audio.html \
+ authopt.html \
+ bugs.html \
+ build.html \
+ clockopt.html \
+ comdex.html \
+ config.html \
+ confopt.html \
+ copyright.html \
+ debug.html \
+ decode.html \
+ drivers/driver1.html \
+ drivers/driver2.html \
+ drivers/driver3.html \
+ drivers/driver4.html \
+ drivers/driver5.html \
+ drivers/driver6.html \
+ drivers/driver7.html \
+ drivers/driver8.html \
+ drivers/driver9.html \
+ drivers/driver10.html \
+ drivers/driver11.html \
+ drivers/driver12.html \
+ drivers/driver16.html \
+ drivers/driver18.html \
+ drivers/driver19.html \
+ drivers/driver20.html \
+ drivers/driver22.html \
+ drivers/driver26.html \
+ drivers/driver27.html \
+ drivers/driver28.html \
+ drivers/driver29.html \
+ drivers/driver30.html \
+ drivers/driver31.html \
+ drivers/driver32.html \
+ drivers/driver33.html \
+ drivers/driver34.html \
+ drivers/driver35.html \
+ drivers/driver36.html \
+ drivers/driver37.html \
+ drivers/driver38.html \
+ drivers/driver39.html \
+ drivers/driver40.html \
+ drivers/driver42.html \
+ drivers/driver43.html \
+ drivers/driver44.html \
+ drivers/mx4200data.html \
+ drivers/oncore-shmem.html \
+ drivers/scripts/footer.txt \
+ drivers/scripts/style.css \
+ drivers/tf582_4.html \
+ extern.html \
+ gadget.html \
+ hints.html \
+ howto.html \
+ index.html \
+ kern.html \
+ kernpps.html \
+ keygen.html \
+ manyopt.html \
+ miscopt.html \
+ monopt.html \
+ msyslog.html \
+ ntp_conf.html \
+ ntpd.html \
+ ntpdate.html \
+ ntpdc.html \
+ ntpdsim.html \
+ ntpdsim_new.html \
+ ntpq.html \
+ ntptime.html \
+ ntptrace.html \
+ parsedata.html \
+ parsenew.html \
+ pps.html \
+ prefer.html \
+ quick.html \
+ rate.html \
+ rdebug.html \
+ refclock.html \
+ release.html \
+ scripts/accopt.txt \
+ scripts/audio.txt \
+ scripts/authopt.txt \
+ scripts/clockopt.txt \
+ scripts/command.txt \
+ scripts/config.txt \
+ scripts/confopt.txt \
+ scripts/external.txt \
+ scripts/footer.txt \
+ scripts/install.txt \
+ scripts/manual.txt \
+ scripts/misc.txt \
+ scripts/miscopt.txt \
+ scripts/monopt.txt \
+ scripts/refclock.txt \
+ scripts/style.css \
+ sitemap.html \
+ sntp.html \
+ tickadj.html \
+ xleave.html
+
+.for F in ${NTP_DOCFILES:O:u}
+_FDIR:= ntp/${F:H} # subdir
+_FDIR:= ${_FDIR:S,/.$,,} # remove trivial directory
+_FNAME:= ${F:T} # name override
+_F:= ${DESTDIR}${HTMLDOCDIR}/${_FDIR}/${_FNAME} # installed path
+_FILE:= ${F}
+
+.if ${MKUPDATE} == "no"
+${_F}! ${_FILE} __fileinstall # install rule
+.if !defined(BUILD) && !make(all) && !make(${_FILE})
+${_F}! .MADE # no build at install
+.endif
+.else
+${_F}: ${_FILE} __fileinstall # install rule
+.if !defined(BUILD) && !make(all) && !make(${_FILE})
+${_F}: .MADE # no build at install
+.endif
+.endif
+
+filesinstall:: ${_F}
+.PRECIOUS: ${_F} # keep if install fails
+.endfor
+
+.endif
+
+.include <bsd.prog.mk>