Virgin import of ntpd 4.0.98f
This commit is contained in:
commit
c0b746e5e8
151
contrib/ntp/COPYRIGHT
Normal file
151
contrib/ntp/COPYRIGHT
Normal file
@ -0,0 +1,151 @@
|
||||
This file is automatically generated from html/copyright.htm
|
||||
|
||||
Copyright Notice
|
||||
|
||||
[INLINE] "Clone me," says Dolly sheepishly
|
||||
_________________________________________________________________
|
||||
|
||||
The following copyright notice applies to all files collectively
|
||||
called the Network Time Protocol Version 4 Distribution. Unless
|
||||
specifically declared otherwise in an individual file, this notice
|
||||
applies as if the text was explicitly included in the file.
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Copyright (c) David L. Mills 1992-1999 *
|
||||
* *
|
||||
* Permission to use, copy, modify, and distribute this software and *
|
||||
* its documentation for any purpose and without fee is hereby *
|
||||
* granted, provided that the above copyright notice appears in all *
|
||||
* copies and that both the copyright notice and this permission *
|
||||
* notice appear in supporting documentation, and that the name *
|
||||
* University of Delaware not be used in advertising or publicity *
|
||||
* pertaining to distribution of the software without specific, *
|
||||
* written prior permission. The University of Delaware makes no *
|
||||
* representations about the suitability this software for any *
|
||||
* purpose. It is provided "as is" without express or implied *
|
||||
* warranty. *
|
||||
**********************************************************************/
|
||||
|
||||
The following individuals contributed in part to the Network Time
|
||||
Protocol Distribution Version 4 and are acknowledged as authors of
|
||||
this work.
|
||||
1. [1]Mark Andrews <marka@syd.dms.csiro.au> Leitch atomic clock
|
||||
controller
|
||||
2. [2]Viraj Bais <vbais@mailman1.intel.com> and [3]Clayton Kirkwood
|
||||
<kirkwood@striderfm.intel.com> port to WindowsNT 3.5
|
||||
3. [4]Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
|
||||
4. [5]Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver,
|
||||
Trimble PARSE support
|
||||
5. [6]Steve Clift <clift@ml.csiro.au> OMEGA clock driver
|
||||
6. [7]Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and help
|
||||
with target configuration
|
||||
7. [8]Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux port
|
||||
8. [9]John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
|
||||
9. [10]Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for
|
||||
NTP Version 2 as specified in RFC-1119
|
||||
10. [11]Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
|
||||
11. [12]Mike Iglesias <iglesias@uci.edu> DEC Alpha port
|
||||
12. [13]Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
|
||||
13. [14]Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping
|
||||
overhaul
|
||||
14. [15]William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX
|
||||
modifications, HPUX modifications
|
||||
15. [16]Dave Katz <dkatz@cisco.com> RS/6000 AIX port
|
||||
16. [17]Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock,
|
||||
Maganavox GPS clock driver
|
||||
17. [18]George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
|
||||
18. [19]Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
|
||||
19. [20]Derek Mulcahy <derek@toybox.demon.co.uk> and [21]Damon
|
||||
Hart-Davis <d@hd.org> ARCRON MSF clock driver
|
||||
20. [22]Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation
|
||||
code for Version 3 as specified in RFC-1305
|
||||
21. [23]David L. Mills <mills@udel.edu> Version 4 foundation,
|
||||
Spectractom WWVB, Austron GPS, Arbiter GPS, CHU, Heath, ATOM,
|
||||
ACTS, KSI/Odetics, IRIG clock drivers; PPS support; precision
|
||||
kernel; NTPv4 changes
|
||||
22. [24]Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
|
||||
23. [25]Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
|
||||
24. [26]Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
|
||||
25. [27]Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de>
|
||||
monitoring/trap scripts, statistics file handling
|
||||
26. [28]Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
|
||||
27. [29]Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
|
||||
28. [30]Frank Kardel [31]<Frank.Kardel@informatik.uni-erlangen.de>
|
||||
PARSE <GENERIC> driver (14 reference clocks), STREAMS modules for
|
||||
PARSE, support scripts, syslog cleanup
|
||||
29. [32]Ray Schnitzler <schnitz@unipress.com> Unixware1 port
|
||||
30. [33]Michael Shields <shields@tembel.org> USNO clock driver
|
||||
31. [34]Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock
|
||||
driver
|
||||
32. [35]Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure
|
||||
makeover
|
||||
33. [36]Kenneth Stone <ken@sdd.hp.com> HP-UX port
|
||||
34. [37]Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast support
|
||||
35. [38]Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock
|
||||
driver
|
||||
36. [39]Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic
|
||||
TrueTime clock driver
|
||||
37. [40]Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and
|
||||
validated HTML documents according to the HTML DTD
|
||||
38. [41]Greg Brackley <greg.brackley@bigfoot.com> Major rework of
|
||||
WINNT port. Clean up recvbuf and iosignal code into separate
|
||||
modules.
|
||||
39. [42]Sven Dietrich <sven_dietrich@trimble.com> Palisade reference
|
||||
clock driver, NT adj. residuals, integrated Greg's Winnt port.
|
||||
40. [43]Wilfredo Sánchez <wsanchez@apple.com> added support for
|
||||
NetInfo
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
[44][LINK]
|
||||
|
||||
|
||||
[45]David L. Mills <mills@udel.edu>
|
||||
|
||||
References
|
||||
|
||||
1. mailto: marka@syd.dms.csiro.au
|
||||
2. mailto: vbais@mailman1.intel.co
|
||||
3. mailto: kirkwood@striderfm.intel.com
|
||||
4. mailto: karl@owl.HQ.ileaf.com
|
||||
5. mailto: Piete.Brooks@cl.cam.ac.uk
|
||||
6. mailto: clift@ml.csiro.au
|
||||
7. mailto:casey@csc.co.za
|
||||
8. mailto: duwe@immd4.informatik.uni-erlangen.de
|
||||
9. mailto: dundas@salt.jpl.nasa.gov
|
||||
10. mailto: dennis@mrbill.canet.ca
|
||||
11. mailto: glenn@herald.usask.ca
|
||||
12. mailto: iglesias@uci.edu
|
||||
13. mailto: jagubox.gsfc.nasa.gov
|
||||
14. mailto: jbj@chatham.usdesign.com
|
||||
15. mailto: jones@hermes.chpc.utexas.edu
|
||||
16. mailto: dkatz@cisco.com
|
||||
17. mailto: leres@ee.lbl.gov
|
||||
18. mailto: lindholm@ucs.ubc.ca
|
||||
19. mailto: louie@ni.umd.edu
|
||||
20. mailto: derek@toybox.demon.co.uk
|
||||
21. mailto: d@hd.org
|
||||
22. mailto: thorinn@diku.dk
|
||||
23. mailto: mills@udel.edu
|
||||
24. mailto: moeller@gwdgv1.dnet.gwdg.de
|
||||
25. mailto: mogul@pa.dec.com
|
||||
26. mailto: tmoore@fievel.daytonoh.ncr.com
|
||||
27. mailto: Rainer.Pruy@informatik.uni-erlangen.de
|
||||
28. mailto: dirce@zk3.dec.com
|
||||
29. mailto: mrapple@quack.kfu.com
|
||||
30. http://www4.informatik.uni-erlangen.de/~kardel
|
||||
31. mailto: Frank.Kardel@informatik.uni-erlangen.de
|
||||
32. mailto: schnitz@unipress.com
|
||||
33. mailto: shields@tembel.org
|
||||
34. mailto: pebbles.jpl.nasa.gov
|
||||
35. mailto: harlan@pfcs.com
|
||||
36. mailto: ken@sdd.hp.com
|
||||
37. mailto: ajit@ee.udel.edu
|
||||
38. mailto: tsuruoka@nc.fukuoka-u.ac.jp
|
||||
39. mailto: vixie@vix.com
|
||||
40. mailto: Ulrich.Windl@rz.uni-regensburg.de
|
||||
41. mailto: greg.brackley@bigfoot.com
|
||||
42. mailto: Sven_Dietrich@trimble.COM
|
||||
43. mailto: wsanchez@apple.com
|
||||
44. file://localhost/backroom/ntp4/html/index.htm
|
||||
45. mailto:mills@udel.edu
|
2737
contrib/ntp/ChangeLog
Normal file
2737
contrib/ntp/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
178
contrib/ntp/INSTALL
Normal file
178
contrib/ntp/INSTALL
Normal file
@ -0,0 +1,178 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic *nix installation instructions.
|
||||
|
||||
For Windows/NT, please see ports/winnt.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes a while. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
95
contrib/ntp/Makefile.am
Normal file
95
contrib/ntp/Makefile.am
Normal file
@ -0,0 +1,95 @@
|
||||
#AUTOMAKE_OPTIONS = foreign dist-tarZ #distdir=$(PACKAGE)$(VERSION)
|
||||
#AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ no-dependencies
|
||||
AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ
|
||||
|
||||
SUBDIRS = \
|
||||
scripts \
|
||||
include \
|
||||
libntp \
|
||||
libparse \
|
||||
librsaref \
|
||||
ntpd \
|
||||
ntpdate \
|
||||
ntpdc \
|
||||
ntpq \
|
||||
ntptrace \
|
||||
parseutil \
|
||||
adjtimed \
|
||||
clockstuff \
|
||||
kernel \
|
||||
util
|
||||
|
||||
EXTRA_DIST = ChangeLog COPYRIGHT NEWS README.cvs README.des README.hackers TODO WHERE-TO-START acconfig.h config.guess config.h.in config.sub excludes install-sh dot.emacs build NOTES.y2kfixes readme.y2kfixes results.y2kfixes
|
||||
#ETAGS_ARGS = $(srcdir)/Makefile.am $(srcdir)/configure.in
|
||||
ETAGS_ARGS = Makefile.am configure.in acconfig.h
|
||||
|
||||
# DIST_CPDIRS = conf html scripts
|
||||
# DIST_MKDIRS = adjtime clockstuff kernel libparse ppsclock
|
||||
#DIST_HOOK_DIRS = conf html patches ports scripts
|
||||
# HMS: make ports be the last directory...
|
||||
DIST_HOOK_DIRS = conf html scripts ports
|
||||
|
||||
BUILT_SOURCES = $(srcdir)/COPYRIGHT
|
||||
|
||||
$(srcdir)/COPYRIGHT: html/copyright.htm
|
||||
( echo "This file is automatically generated from html/copyright.htm" ; lynx -dump $(srcdir)/html/copyright.htm ) > $(srcdir)/COPYRIGHT.new && mv $(srcdir)/COPYRIGHT.new $(srcdir)/COPYRIGHT
|
||||
|
||||
# local-dist: dist-tarZ
|
||||
|
||||
dist-hook:
|
||||
-for i in $(DIST_HOOK_DIRS); do \
|
||||
mkdir $(distdir)/$$i ; \
|
||||
cp -rp $(srcdir)/$$i $(distdir) ; \
|
||||
done ; \
|
||||
find $(distdir) -type d -name CVS -exec rm -rf '{}' \; ; \
|
||||
# find $(distdir)/html -name '*.htm' -exec dos2unix {} {} \; ; \
|
||||
# cp -rp $(srcdir)/include/winnt $(distdir)/include
|
||||
|
||||
dist-export: distdir
|
||||
rm $(distdir)/libntp/authdes.c
|
||||
cp $(distdir)/libntp/authdes.c.export $(distdir)/libntp/authdes.c
|
||||
chmod -R a+r $(distdir)
|
||||
mv $(distdir) $(distdir)-export
|
||||
$(TAR) chozf $(distdir)-export.tar.gz $(distdir)-export
|
||||
rm -rf $(distdir)-export
|
||||
|
||||
Makefile: .warning
|
||||
|
||||
CVO=`$(srcdir)/config.guess`
|
||||
|
||||
.buildcvo:
|
||||
echo "$(CVO)" > .buildcvo
|
||||
|
||||
.checkcvo: .buildcvo FRC.checkcvo
|
||||
@if [ "`cat .buildcvo`" != "$(CVO)" ];then \
|
||||
echo "This directory was configured for `cat .buildcvo`"; \
|
||||
echo "but this machine is a $(CVO)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
BHOST=`(hostname || uname -n)`
|
||||
|
||||
.buildhost:
|
||||
echo "$(BHOST)" > .buildhost
|
||||
|
||||
.checkhost: .buildhost FRC.checkhost
|
||||
@if [ "`cat .buildhost`" != "$(BHOST)" ];then \
|
||||
echo "Built on `cat .buildhost` but this is $(BHOST)"; \
|
||||
echo " "; \
|
||||
fi
|
||||
|
||||
.warning:
|
||||
@echo "Compiling with GCC now generates lots of new warnings."
|
||||
@echo " "
|
||||
@echo "Don't be concerned. They're just warnings."
|
||||
@echo " "
|
||||
@echo "Don't send bug reports about the warnings, either."
|
||||
@echo " "
|
||||
@echo "Feel free to send patches that fix these warnings, though."
|
||||
@echo " "
|
||||
@sleep 1
|
||||
@touch .warning
|
||||
|
||||
FRC.distwarn FRC.checkcvo FRC.checkhost:
|
||||
|
||||
dot.emacs: FRC.distwarn
|
490
contrib/ntp/Makefile.in
Normal file
490
contrib/ntp/Makefile.in
Normal file
@ -0,0 +1,490 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_alias = @build_alias@
|
||||
build_triplet = @build@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AMTAR = @AMTAR@
|
||||
AMTARFLAGS = @AMTARFLAGS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHUTEST = @CHUTEST@
|
||||
CLKTEST = @CLKTEST@
|
||||
CPP = @CPP@
|
||||
DCFD = @DCFD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBPARSE = @LIBPARSE@
|
||||
LIBRSAREF = @LIBRSAREF@
|
||||
LN_S = @LN_S@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAKE_ADJTIMED = @MAKE_ADJTIMED@
|
||||
MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
|
||||
MAKE_LIBPARSE = @MAKE_LIBPARSE@
|
||||
MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
|
||||
MAKE_LIBRSAREF = @MAKE_LIBRSAREF@
|
||||
MAKE_NTPTIME = @MAKE_NTPTIME@
|
||||
MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
|
||||
MAKE_TICKADJ = @MAKE_TICKADJ@
|
||||
PACKAGE = @PACKAGE@
|
||||
PATH_SH = @PATH_SH@
|
||||
PROPDELAY = @PROPDELAY@
|
||||
RANLIB = @RANLIB@
|
||||
RSAREF = @RSAREF@
|
||||
TESTDCF = @TESTDCF@
|
||||
U = @U@
|
||||
VERSION = @VERSION@
|
||||
|
||||
#AUTOMAKE_OPTIONS = foreign dist-tarZ #distdir=$(PACKAGE)$(VERSION)
|
||||
#AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ no-dependencies
|
||||
|
||||
|
||||
AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ
|
||||
|
||||
SUBDIRS = \
|
||||
scripts \
|
||||
include \
|
||||
libntp \
|
||||
libparse \
|
||||
librsaref \
|
||||
ntpd \
|
||||
ntpdate \
|
||||
ntpdc \
|
||||
ntpq \
|
||||
ntptrace \
|
||||
parseutil \
|
||||
adjtimed \
|
||||
clockstuff \
|
||||
kernel \
|
||||
util
|
||||
|
||||
|
||||
EXTRA_DIST = ChangeLog COPYRIGHT NEWS README.cvs README.des README.hackers TODO WHERE-TO-START acconfig.h config.guess config.h.in config.sub excludes install-sh dot.emacs build NOTES.y2kfixes readme.y2kfixes results.y2kfixes
|
||||
#ETAGS_ARGS = $(srcdir)/Makefile.am $(srcdir)/configure.in
|
||||
ETAGS_ARGS = Makefile.am configure.in acconfig.h
|
||||
|
||||
# DIST_CPDIRS = conf html scripts
|
||||
# DIST_MKDIRS = adjtime clockstuff kernel libparse ppsclock
|
||||
#DIST_HOOK_DIRS = conf html patches ports scripts
|
||||
# HMS: make ports be the last directory...
|
||||
DIST_HOOK_DIRS = conf html scripts ports
|
||||
|
||||
BUILT_SOURCES = $(srcdir)/COPYRIGHT
|
||||
|
||||
CVO = `$(srcdir)/config.guess`
|
||||
|
||||
BHOST = `(hostname || uname -n)`
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
DIST_COMMON = README ./stamp-h.in ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure configure.in install-sh missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h stamp-hT
|
||||
@echo timestamp > stamp-hT 2> /dev/null
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@mv stamp-hT stamp-h
|
||||
$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/./stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/./stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
|
||||
@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
|
||||
-rm -rf $(distdir)
|
||||
dist-tarZ: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | compress -c > $(distdir).tar.Z
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | compress -c > $(distdir).tar.Z
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile config.h
|
||||
all-redirect: all-recursive-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-recursive uninstall-recursive install-data-recursive \
|
||||
uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all install-strip \
|
||||
installdirs-am installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
|
||||
$(srcdir)/COPYRIGHT: html/copyright.htm
|
||||
( echo "This file is automatically generated from html/copyright.htm" ; lynx -dump $(srcdir)/html/copyright.htm ) > $(srcdir)/COPYRIGHT.new && mv $(srcdir)/COPYRIGHT.new $(srcdir)/COPYRIGHT
|
||||
|
||||
# local-dist: dist-tarZ
|
||||
|
||||
dist-hook:
|
||||
-for i in $(DIST_HOOK_DIRS); do \
|
||||
mkdir $(distdir)/$$i ; \
|
||||
cp -rp $(srcdir)/$$i $(distdir) ; \
|
||||
done ; \
|
||||
find $(distdir) -type d -name CVS -exec rm -rf '{}' \; ; \
|
||||
# find $(distdir)/html -name '*.htm' -exec dos2unix {} {} \; ; \
|
||||
# cp -rp $(srcdir)/include/winnt $(distdir)/include
|
||||
|
||||
dist-export: distdir
|
||||
rm $(distdir)/libntp/authdes.c
|
||||
cp $(distdir)/libntp/authdes.c.export $(distdir)/libntp/authdes.c
|
||||
chmod -R a+r $(distdir)
|
||||
mv $(distdir) $(distdir)-export
|
||||
$(TAR) chozf $(distdir)-export.tar.gz $(distdir)-export
|
||||
rm -rf $(distdir)-export
|
||||
|
||||
Makefile: .warning
|
||||
|
||||
.buildcvo:
|
||||
echo "$(CVO)" > .buildcvo
|
||||
|
||||
.checkcvo: .buildcvo FRC.checkcvo
|
||||
@if [ "`cat .buildcvo`" != "$(CVO)" ];then \
|
||||
echo "This directory was configured for `cat .buildcvo`"; \
|
||||
echo "but this machine is a $(CVO)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.buildhost:
|
||||
echo "$(BHOST)" > .buildhost
|
||||
|
||||
.checkhost: .buildhost FRC.checkhost
|
||||
@if [ "`cat .buildhost`" != "$(BHOST)" ];then \
|
||||
echo "Built on `cat .buildhost` but this is $(BHOST)"; \
|
||||
echo " "; \
|
||||
fi
|
||||
|
||||
.warning:
|
||||
@echo "Compiling with GCC now generates lots of new warnings."
|
||||
@echo " "
|
||||
@echo "Don't be concerned. They're just warnings."
|
||||
@echo " "
|
||||
@echo "Don't send bug reports about the warnings, either."
|
||||
@echo " "
|
||||
@echo "Feel free to send patches that fix these warnings, though."
|
||||
@echo " "
|
||||
@sleep 1
|
||||
@touch .warning
|
||||
|
||||
FRC.distwarn FRC.checkcvo FRC.checkhost:
|
||||
|
||||
dot.emacs: FRC.distwarn
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
83
contrib/ntp/NEWS
Normal file
83
contrib/ntp/NEWS
Normal file
@ -0,0 +1,83 @@
|
||||
(4.0.98)
|
||||
* Solaris kernel FLL bug is fixed in 106541-07
|
||||
* Bug/lint cleanup
|
||||
* PPS cleanup
|
||||
* ReliantUNIX patches
|
||||
* NetInfo support
|
||||
* Ultralink driver
|
||||
* Trimble OEM Ace-II support
|
||||
* DCF77 power choices
|
||||
* Oncore improvements
|
||||
(4.0.97)
|
||||
* NT patches
|
||||
* AIX,SunOS,IRIX portability
|
||||
* NeXT portability
|
||||
* ntptimeset utility added
|
||||
* cygwin portability patches
|
||||
(4.0.96)
|
||||
* -lnsl, -lsocket, -lgen configuration patches
|
||||
* Y2K patches from AT&T
|
||||
* Linux portability cruft
|
||||
(4.0.95)
|
||||
* NT port cleanup/replacement
|
||||
* a few portability fixes
|
||||
* VARITEXT Parse clock added
|
||||
(4.0.94)
|
||||
* PPS updates (including ntp.config options)
|
||||
* Lose the old DES stuff in favor of the (optional) RSAREF stuff
|
||||
* html cleanup/updates
|
||||
* numerous drivers cleaned up
|
||||
* numerous portability patches and code cleanup
|
||||
(4.0.93)
|
||||
* Oncore refclock needs PPS or one of two ioctls.
|
||||
* Don't make ntptime under Linux. It doesn't compile for too many folks.
|
||||
* Autokey cleanup
|
||||
* ReliantUnix patches
|
||||
* html cleanup
|
||||
* tickadj cleanup
|
||||
* PARSE cleanup
|
||||
* IRIX -n32 cleanup
|
||||
* byte order cleanup
|
||||
* ntptrace improvements and patches
|
||||
* ntpdc improvements and patches
|
||||
* PPS cleanup
|
||||
* mx4200 cleanup
|
||||
* New clock state machine
|
||||
* SCO cleanup
|
||||
* Skip alias interfaces
|
||||
(4.0.92)
|
||||
* chronolog and dumbclock refclocks
|
||||
* SCO updates
|
||||
* Cleanup/bugfixes
|
||||
* Y2K patches
|
||||
* Updated palisade driver
|
||||
* Plug memory leak
|
||||
* wharton kernel clock
|
||||
* Oncore clock upgrades
|
||||
* NMEA clock improvements
|
||||
* PPS improvements
|
||||
* AIX portability patches
|
||||
(4.0.91)
|
||||
* New ONCORE driver
|
||||
* New MX4200 driver
|
||||
* Palisade improvements
|
||||
* config file bugfixes and problem reporting
|
||||
* autoconf upgrade and cleanup
|
||||
* HP-UX, IRIX lint cleanup
|
||||
* AIX portability patches
|
||||
* NT cleanup
|
||||
(4.0.90)
|
||||
* Nanoseconds
|
||||
* New palisade driver
|
||||
* New Oncore driver
|
||||
(4.0.73)
|
||||
* README.hackers added
|
||||
* PARSE driver is working again
|
||||
* Solaris 2.6 has nasty kernel bugs. DO NOT enable pll!
|
||||
* DES is out of the distribution.
|
||||
(4.0.72)
|
||||
* K&R C compiling should work again.
|
||||
* IRIG patches.
|
||||
* MX4200 driver patches.
|
||||
* Jupiter driver added.
|
||||
* Palisade driver added. Needs work (ANSI, ntoh/hton, sizeof double, ???)
|
107
contrib/ntp/NOTES.y2kfixes
Normal file
107
contrib/ntp/NOTES.y2kfixes
Normal file
@ -0,0 +1,107 @@
|
||||
Name of the Application: xntp
|
||||
|
||||
Version Number: 4.0.91
|
||||
|
||||
Download Size: 4541953 bytes
|
||||
|
||||
Downloaded from: http://www.eecis.udel.edu/~ntp/
|
||||
|
||||
Operating Systems Supported: many
|
||||
|
||||
Operating Systems Tested: unix
|
||||
|
||||
Testing
|
||||
|
||||
Dates tested (CPU clock set)
|
||||
|
||||
1999-12-31
|
||||
2000-01-01
|
||||
2000-02-29
|
||||
|
||||
Critical fragments of code tested with other dates by special
|
||||
algorithms.
|
||||
|
||||
Hardware Platform: Sun Sparc
|
||||
|
||||
OS: Solaris 2.6
|
||||
|
||||
Compiler: gcc
|
||||
|
||||
Version: 2.8.1
|
||||
|
||||
Repairs: 9
|
||||
|
||||
No. of files Repaired: 13
|
||||
|
||||
|
||||
Compilation of Patches Required: yes
|
||||
|
||||
Results Description:
|
||||
|
||||
1) Tested suspicious code.
|
||||
|
||||
2) Repaired problem code and added documentation to ntp.h.
|
||||
|
||||
3) Verified ntpd works on critical Y2K dates.
|
||||
|
||||
|
||||
Comments:
|
||||
|
||||
1) Errors were found in improper use of tm_year within struct tm,
|
||||
calculations that did not support year 2000 as a leap year
|
||||
(it truly is, despite any unchanged comments remaining in
|
||||
the NTP source), and some incorrect date calculations, while
|
||||
not traditional Y2K errors, would break in the year 2000.
|
||||
|
||||
2) include/ntpd.h
|
||||
Added some definitions and documentation about the right way
|
||||
of doing things. Definitions used by most, if not all, of
|
||||
the Y2K repairs.
|
||||
|
||||
Cautions:
|
||||
|
||||
1) Some of the Y2K repairs were to reference clock drivers that
|
||||
we did not have the local hardware to test. While I believe
|
||||
the changes are sound, they really need to be tested.
|
||||
This includes:
|
||||
|
||||
refclock_arc.c
|
||||
refclock_heath.c
|
||||
refclock_hpgps.c
|
||||
|
||||
Also, parseutil/dcfd.c is another hardware dependent module that
|
||||
was repaired without live testing.
|
||||
|
||||
Non-Y2K Problems Observed:
|
||||
|
||||
1) Inconsistent casts of variables containing time values may
|
||||
make expansion to 64 bit integer values in a portable manner
|
||||
difficult.
|
||||
|
||||
2) libntp/caltontp.c:
|
||||
Has logic I believe will fail starting in year 2100 or so.
|
||||
Left unchanged/untested as it works well beyond basic NTP 2036
|
||||
limit checked by check_y2k.c.
|
||||
If NTP is implemented on 64-bit machines, this should be fixed
|
||||
|
||||
3) ntpd/refclock_acts.c:
|
||||
ACTS time format has changed somewhat since the code was written.
|
||||
In particular the '*' '#' character switch no longer occurs...
|
||||
only '*' is typed.
|
||||
|
||||
NOTE: Author (falsely) stated Y2K is NOT a leap year when it
|
||||
really is.
|
||||
|
||||
TRUTH: ACTS will go beyond Y2K: it uses FourDigitYear % 100 values
|
||||
for year so year 2000 will revert to "00".
|
||||
|
||||
|
||||
4) ntpd/refclock_oncore.c
|
||||
Some very strange logic in manipulating year values:
|
||||
1122 instance->pp->year = buf[6]*256+buf[7];
|
||||
Multiply by 256????
|
||||
|
||||
Response from PHK:
|
||||
The entire protocol is binary, the year is a 16 bit quantity
|
||||
which according to the manual can have the range 1998-2018.
|
||||
|
152
contrib/ntp/README
Normal file
152
contrib/ntp/README
Normal file
@ -0,0 +1,152 @@
|
||||
The ntp Distribution Base Directory
|
||||
|
||||
This directory and its subdirectories contain the Network Time Protocol
|
||||
Version 4 (NTP) distribution for Unix and Windows/NT systems. This release
|
||||
may still work on VxWorks, too.
|
||||
|
||||
The contents of the base directory are given in this file. The contents of
|
||||
subdirectories are given in the README files in each subdirectory.
|
||||
|
||||
A complete explanation of the configure, compile and install process, as
|
||||
well as setting up an NTP subnet, is in the HTML pages in the ./html/
|
||||
directory. For more information on NTP and how to get a working setup,
|
||||
read WHERE-TO-START.
|
||||
|
||||
For Windows/NT, visit html/hints/winnt .
|
||||
|
||||
The base directory ./ contains the autoconfiguation files, source
|
||||
directories and related stuff:
|
||||
|
||||
COPYRIGHT Excerpt from the HTML file ./html/copyright.html. This file
|
||||
specifies copyright conditions, together with a list of
|
||||
major authors and electric addresses.
|
||||
|
||||
INSTALL Generic installation instructions for autoconf-based programs.
|
||||
Unless you really know what you are doing, you should read the
|
||||
directions in the HTML pages, starting with ./html/index.htm.
|
||||
|
||||
NEWS What's new in this release.
|
||||
|
||||
README This file.
|
||||
|
||||
README.cvs Instructions for folks who use the CVS-repository
|
||||
version of NTP.
|
||||
|
||||
README.des If you *need* DES support.
|
||||
|
||||
README.hackers Notes to folks who want to hack on the code.
|
||||
|
||||
TODO List of items the NTP developers are working on.
|
||||
|
||||
WHERE-TO-START Hints on what to read in order to get a working
|
||||
configuration.
|
||||
|
||||
Makefile.am Automake file configuration file. Edit only if you have the
|
||||
GNU automake and autoconf utilities installed.
|
||||
|
||||
Makefile.in Autoconf make file template for Unix.
|
||||
|
||||
acconfig.h Autoconf template header file. Edit only if you
|
||||
have the GNU automake and autoconf utilities installed.
|
||||
|
||||
adjtimed Directory containing the sources for the adjtime daemon
|
||||
for HP/UX systems prior to HP-UX 10.0.
|
||||
|
||||
authstuff Directory containing sources for miscellaneous programs
|
||||
to test, calibrate and certify the cryptographic
|
||||
mechanisms for DES and MD5 based authentication. These
|
||||
programs do not include the cryptographic routines
|
||||
themselves, so are free of U.S. export restrictions.
|
||||
|
||||
build A script to build the distribution in A.`config.guess`
|
||||
subdirectory (more or less).
|
||||
|
||||
clockstuff Directory containing sources for miscellaneous programs
|
||||
to test certain auxiliary programs used with some kernel
|
||||
configurations, together with a program to calculate
|
||||
propagation delays for use with radio clocks and
|
||||
national time dissemination services such as WWV/WWVH,
|
||||
WWVB and CHU.
|
||||
|
||||
conf Directory containing a motley collection of
|
||||
configuration files for various systems. For example only.
|
||||
|
||||
config.guess Script used to identify the machine architecture and
|
||||
operating system.
|
||||
|
||||
config.h.in Configuration file generated automatically from
|
||||
configure.in. Do not edit.
|
||||
|
||||
configure Script used to configure the distribution. See the HTML pages
|
||||
(./html/index.htm) for a complete description of the options
|
||||
available.
|
||||
|
||||
configure.in Master configuration template. Edit only if you have the
|
||||
GNU automake and autoconf utilities installed.
|
||||
|
||||
dot.emacs C-mode indentation rules for code "Just the way Dave likes it".
|
||||
|
||||
flock_build (UDel only) Build the distribution on a number of
|
||||
different platforms.
|
||||
|
||||
html Directory containing a complete set of documentation on
|
||||
building and configuring a NTP server or client. The
|
||||
documentation is in the form of HTML files suitable for
|
||||
browsing and contains links to additional documentation
|
||||
at various web sites. If a browser is unavailable, an
|
||||
ordinary text editor can be used.
|
||||
|
||||
include Directory containing include header files used by most
|
||||
programs in the distribution.
|
||||
|
||||
install-sh Script to install a program, script or data file.
|
||||
|
||||
kernel Directory containing sources for kernel programs such as
|
||||
line disciplines and STREAMS modules used with the CHU
|
||||
decoder and precision PPS signals.
|
||||
|
||||
libntp Directory containing library source code used by most
|
||||
programs in the distribution.
|
||||
|
||||
librsaref Staging directory for RSAREF.
|
||||
|
||||
ntp_update Update an NTP CVS tree.
|
||||
|
||||
ntpdate Directory containing sources for a program to set the
|
||||
local machine time from one or more remote machines
|
||||
running NTP. Operates like rdate, but much more accurate.
|
||||
|
||||
ntpq Directory containing sources for a utility program to
|
||||
query local and remote NTP peers for state variables and
|
||||
related timekeeping information. This program conforms
|
||||
to Appendix A of the NTP Version 3 Specification RFC 1305.
|
||||
|
||||
ntptrace Directory containing sources for a utility program that
|
||||
can be used to reveal the chain of NTP peers from a
|
||||
designated peer to the primary server at the root of the
|
||||
timekeeping subnet.
|
||||
|
||||
parse Directory containing files belonging to the generic
|
||||
parse reference clock driver. For reasonably simple
|
||||
clocks it is possible to get away with about 3-4Kb of
|
||||
code. additionally the SunOS 4.x/Solaris 5.3 streams
|
||||
module for parse squats here.
|
||||
|
||||
patches Directory containing patches already applied to this
|
||||
distribution. These are included for record and to help
|
||||
in possible porting problems.
|
||||
|
||||
scripts Directory containing scripts to build the configuration
|
||||
files in this directory and then the makefiles used in
|
||||
various dependent directories. the subdirectories
|
||||
monitoring and support hold various perl and shell
|
||||
scripts for visualizing synchronization and daemon startup.
|
||||
|
||||
stamp.h.in Configuration file generated automatically from configure.in.
|
||||
Do not edit.
|
||||
|
||||
util Directory containing sources for various utility and
|
||||
testing programs.
|
||||
|
||||
David L. Mills (mills@udel.edu)
|
||||
21 June 1998
|
24
contrib/ntp/README.cvs
Normal file
24
contrib/ntp/README.cvs
Normal file
@ -0,0 +1,24 @@
|
||||
To get the NTP distribution via anonymous CVS:
|
||||
|
||||
cvs -d :pserver:anoncvs@www.ntp.org:/cvs/ntp login
|
||||
|
||||
the password is: anoncvs
|
||||
|
||||
cvs -d :pserver:anoncvs@www.ntp.org:/cvs/ntp co ntp
|
||||
|
||||
after which the "ntp_update" script in the top-level of the tree should
|
||||
keep things in synch and properly timestamped.
|
||||
|
||||
There are some mailing lists for the NTP CVS distribution. For more
|
||||
information, send a message to <majordomo@ntp.org> with the "lists" in
|
||||
the body of the message.
|
||||
|
||||
If you get NTP via CVS, you will need to build the release using GNU make
|
||||
and gcc.
|
||||
|
||||
You can then "make dist" to build a release tarball that does not require
|
||||
GNU make or gcc.
|
||||
|
||||
The reason GNU make and gcc are required is because the repository version
|
||||
of NTP does not have the make dependencies built-in. These dependencies
|
||||
are created dynamically, and this dynamic process requires GNU make and gcc.
|
20
contrib/ntp/README.des
Normal file
20
contrib/ntp/README.des
Normal file
@ -0,0 +1,20 @@
|
||||
If you want DES support in ntp:
|
||||
|
||||
- Use MD5 instead:
|
||||
- - convert your DES keys to MD5 by changing the 'A', 'N' or 'S' to 'M'
|
||||
|
||||
If you *need* DES support:
|
||||
|
||||
- first see if you can simply "want" DES support instead
|
||||
- Get RSAREF or RSAEURO (or a reasonable facsimile thereof)
|
||||
- - Unpack it in the top-level source directory of the NTP distribution
|
||||
(You should see directories like ports, rsaref2, scripts)
|
||||
|
||||
When you run configure, the Right Thing will happen.
|
||||
|
||||
Be advised that the RSA DES code is not quite as portable os one might
|
||||
wish for. In particular, DES under NTP will only work between machines
|
||||
of the same "endianness".
|
||||
|
||||
Dave would prefer that new/alternative encryption schemes follow the
|
||||
RSA API.
|
25
contrib/ntp/README.hackers
Normal file
25
contrib/ntp/README.hackers
Normal file
@ -0,0 +1,25 @@
|
||||
Notes to hackers.
|
||||
|
||||
---
|
||||
|
||||
Dave likes this code indented formatted in a consistent way.
|
||||
The file "dot.emacs" has the emacs C-mode indentation style that Dave likes.
|
||||
|
||||
---
|
||||
|
||||
NTP4 uses ANSI C. Some folks are blessed with a pre-ansi C compiler. We
|
||||
support them by using "ansi2knr" in the Makefiles, which is automatically
|
||||
detected and selected by the configure process.
|
||||
|
||||
For ansi2knr to work, we MUST define functions as follows:
|
||||
|
||||
type stuff
|
||||
function_name ( actual parameters )
|
||||
|
||||
While the whitespace is optional, the function name MUST start at column 0.
|
||||
|
||||
---
|
||||
|
||||
We'd like to see *all* system function declarations live in include/l_stdlib.h
|
||||
and NEVER appear in the .c files.
|
||||
|
126
contrib/ntp/TODO
Normal file
126
contrib/ntp/TODO
Normal file
@ -0,0 +1,126 @@
|
||||
|
||||
*** IF YOU CAN HELP FIX ANY OF THESE THINGS, PLEASE DO! ***
|
||||
|
||||
970711: Look Real Hard at changing the key stuff from u_long to u_int32.
|
||||
|
||||
970711: Make sure it's safe to convert proto_config's 2nd argument from
|
||||
u_long to u_int32. Watch "set" in ntp_request.c:setclr_flags().
|
||||
|
||||
970318: in hourly_stats(?), squawk if the magnitude of the drift is,
|
||||
say, >400.
|
||||
|
||||
970301: Implement the utmp/wtmp timestamping on time steps.
|
||||
|
||||
970210: Find a way to dump the current configuration to either syslog or
|
||||
a file.
|
||||
|
||||
CPP macros we need to handle:
|
||||
|
||||
SUN_3_3_STINKS (this will be easy to handle if anybody still needs it)
|
||||
|
||||
Problems that need to be fixed:
|
||||
|
||||
- Get rid of the old SYS_* macros:
|
||||
(It's worth noting that any code that would have been "enabled" by any
|
||||
of these macros has not been used since 5.83, and there have been very
|
||||
few complaints...)
|
||||
|
||||
SYS_44BSD:
|
||||
authstuff/md5driver.c
|
||||
|
||||
SYS_BSDI:
|
||||
authstuff/md5driver.c
|
||||
|
||||
SYS_DECOSF1:
|
||||
util/ntptime.c
|
||||
|
||||
SYS_DOMAINOS:
|
||||
parseutil/dcfd.c
|
||||
xntpd/ntpd.c
|
||||
|
||||
SYS_HPUX:
|
||||
kernel/sys/ppsclock.h
|
||||
ntpdate/ntpdate.c
|
||||
ntptrace/ntptrace.c
|
||||
|
||||
SYS_PTX:
|
||||
libntp/machines.c
|
||||
|
||||
SYS_SOLARIS:
|
||||
libparse/parse.c
|
||||
libparse/clk_trimtsip.c
|
||||
xntpd/ntp_io.c
|
||||
xntpd/ntp_refclock.c
|
||||
xntpd/ntpd.c
|
||||
|
||||
SYS_SUNOS4:
|
||||
libparse/parse.c
|
||||
libparse/clk_trimsip.c
|
||||
|
||||
SYS_WINNT:
|
||||
include/ntp.h
|
||||
include/ntp_fp.h
|
||||
include/ntp_if.h
|
||||
include/ntp_machine.h
|
||||
include/ntp_select.h
|
||||
include/ntp_syslog.h
|
||||
include/ntp_unixtime.h
|
||||
include/ntpd.h
|
||||
libntp/libntp.mak
|
||||
libntp/machines.c
|
||||
libntp/mexit.c
|
||||
libntp/msyslog.c
|
||||
libntp/systime.c
|
||||
ntpdate/ntpdate.c
|
||||
ntpdate/ntpdate.mak
|
||||
ntpq/ntpq.c
|
||||
ntpq/ntpq.mak
|
||||
ntpq/ntpq_ops.c
|
||||
ntptrace/ntptrace.c
|
||||
ntptrace/ntptrace.mak
|
||||
xntpd/ntp_config.c
|
||||
xntpd/ntp_filegen.c
|
||||
xntpd/ntp_intres.c
|
||||
xntpd/ntp_io.c
|
||||
xntpd/ntp_loopfilter.c
|
||||
xntpd/ntp_peer.c
|
||||
xntpd/ntp_proto.c
|
||||
xntpd/ntp_refclock.c
|
||||
xntpd/ntp_timer.c
|
||||
xntpd/ntp_unixclock.c
|
||||
xntpd/ntp_util.c
|
||||
xntpd/ntpd.c
|
||||
xntpd/xntpd.mak
|
||||
xntpdc/ntpdc.c
|
||||
xntpdc/xntpdc.mak
|
||||
|
||||
- config.guess might need help to identify:
|
||||
|
||||
Fujitsu's UXP --enable-adjtime-is-accurate
|
||||
--enable-step-slew
|
||||
|
||||
Unixware --enable-adjtime-is-accurate
|
||||
--enable-tick=10000
|
||||
--enable-tickadj=80
|
||||
--enable-udp-wildcard
|
||||
--disable-step-slew
|
||||
|
||||
DomainOS --enable-adjtime-is-accurate
|
||||
--disable-kmem
|
||||
--enable-tick=1000000
|
||||
|
||||
OpenVMS --enable-slew-always
|
||||
--enable-hourly-todr-sync
|
||||
|
||||
Is adjtime accurate on ALL sysv4* machines?
|
||||
Can we identify DomainOS with *-apollo-* ?
|
||||
Do we catch all Unixware machines with *-univel-sysv* ?
|
||||
|
||||
- How can we test if UDP_WILDCARD_DELIVERY should be used?
|
||||
|
||||
- Combine enable-step-slew and enable-ntpdate-step
|
||||
|
||||
- Make sure enable-hourly-todr-sync is always disabled
|
||||
What about NextStep and OpenVMS, where hourly TODR sync used to be enabled?
|
||||
|
||||
- Check dcfd.c for variables that need to be volatile.
|
41
contrib/ntp/WHERE-TO-START
Normal file
41
contrib/ntp/WHERE-TO-START
Normal file
@ -0,0 +1,41 @@
|
||||
The Network Time Protocol (NTP) Version 4 Distribution
|
||||
|
||||
This is a distribution of the Network Time Protocol (NTP) Version 4
|
||||
sources and documentation. NTP can be used by Unix, DEC VMS and
|
||||
Microsoft Windows NT platforms to synchronize the computer clock to
|
||||
external sources of time, such as other NTP time servers or a local
|
||||
radio clock. The daemon included in this distribution can operate as a
|
||||
server, a client, or a relay from a set of servers to a dependent client
|
||||
population on a local net. This distribution includes the daemon itself,
|
||||
plus utility programs and supporting documentation.
|
||||
|
||||
You are welcome to the lot, with due consideration of the copyright
|
||||
information in the COPYRIGHT file. You are also invited to contribute
|
||||
bugfixes and drivers for new and exotic radios, telephones and sundials.
|
||||
This distribution is normally available by anonymous ftp as the
|
||||
compressed tar archive ntp-<version>.tar.Z in the pub/ntp directory on
|
||||
louie.udel.edu and <version> is the version number. The current version
|
||||
number can be found on the NTP web page <http://www.eecis.udel.edu/~ntp>.
|
||||
|
||||
A considerable amount of documentation, including build instructions,
|
||||
configuration advice, program usage and miscellaneous information is
|
||||
included in the ./html directory of this distribution. The intended
|
||||
access method is using a web browser such as netscape; however, the
|
||||
pages have been formatted so that viewing with an ordinary text editor
|
||||
is practical. Start the browser on the ./html/index.htm page, which
|
||||
contains additional instructions and hotlinks to the remaining pages.
|
||||
Some hotlinks for the larger documents, such as related technical
|
||||
memoranda, reports and papers, lead to other web sites where this
|
||||
information is stashed. We apologize for the inconvenience this may
|
||||
cause for users without Internet and World Wide Web access.
|
||||
|
||||
If you are an old hand and just want to build the distribution, you
|
||||
might find the INSTALL file a useful shortcut. A descriptive list of all
|
||||
files in the base directory of this distribution is in the README file.
|
||||
A list of "significant" changes for the release is in the NEWS file.
|
||||
|
||||
If you're interested in helping us test pre-release versions of ntpd,
|
||||
please look in <ftp://louie.udel.edu/pub/ntp/testing/>.
|
||||
|
||||
David L. Mills (mills@udel.edu)
|
||||
21 June 1998
|
457
contrib/ntp/acconfig.h
Normal file
457
contrib/ntp/acconfig.h
Normal file
@ -0,0 +1,457 @@
|
||||
/* Package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version */
|
||||
#undef VERSION
|
||||
|
||||
/* debugging code */
|
||||
#undef DEBUG
|
||||
|
||||
/* Minutes per DST adjustment */
|
||||
#undef DSTMINUTES
|
||||
|
||||
/* MD5 authentication */
|
||||
#undef MD5
|
||||
|
||||
/* DES authentication (COCOM only) */
|
||||
#undef DES
|
||||
|
||||
/* time_t */
|
||||
#undef time_t
|
||||
|
||||
/* reference clock interface */
|
||||
#undef REFCLOCK
|
||||
|
||||
/* Audio CHU? */
|
||||
#undef AUDIO_CHU
|
||||
|
||||
/* ACTS modem service */
|
||||
#undef CLOCK_ACTS
|
||||
|
||||
/* Arbiter 1088A/B GPS receiver */
|
||||
#undef CLOCK_ARBITER
|
||||
|
||||
/* DHD19970505: ARCRON support. */
|
||||
#undef CLOCK_ARCRON_MSF
|
||||
|
||||
/* Austron 2200A/2201A GPS receiver */
|
||||
#undef CLOCK_AS2201
|
||||
|
||||
/* PPS interface */
|
||||
#undef CLOCK_ATOM
|
||||
|
||||
/* PPS auxiliary interface for ATOM */
|
||||
#undef PPS_SAMPLE
|
||||
|
||||
/* Datum/Bancomm bc635/VME interface */
|
||||
#undef CLOCK_BANC
|
||||
|
||||
/* ELV/DCF7000 clock */
|
||||
#undef CLOCK_DCF7000
|
||||
|
||||
/* HOPF 6021 clock */
|
||||
#undef CLOCK_HOPF6021
|
||||
|
||||
/* Meinberg clocks */
|
||||
#undef CLOCK_MEINBERG
|
||||
|
||||
/* DCF77 raw time code */
|
||||
#undef CLOCK_RAWDCF
|
||||
|
||||
/* RCC 8000 clock */
|
||||
#undef CLOCK_RCC8000
|
||||
|
||||
/* Schmid DCF77 clock */
|
||||
#undef CLOCK_SCHMID
|
||||
|
||||
/* Trimble GPS receiver/TAIP protocol */
|
||||
#undef CLOCK_TRIMTAIP
|
||||
|
||||
/* Trimble GPS receiver/TSIP protocol */
|
||||
#undef CLOCK_TRIMTSIP
|
||||
|
||||
/* WHARTON 400A Series protocol */
|
||||
#undef CLOCK_WHARTON_400A
|
||||
|
||||
/* VARITEXT protocol */
|
||||
#undef CLOCK_VARITEXT
|
||||
|
||||
/* Diems Computime Radio Clock */
|
||||
#undef CLOCK_COMPUTIME
|
||||
|
||||
/* Datum Programmable Time System */
|
||||
#undef CLOCK_DATUM
|
||||
|
||||
/* TrueTime GPS receiver/VME interface */
|
||||
#undef CLOCK_GPSVME
|
||||
|
||||
/* Heath GC-1000 WWV/WWVH receiver */
|
||||
#undef CLOCK_HEATH
|
||||
|
||||
/* HP 58503A GPS receiver */
|
||||
#undef CLOCK_HPGPS
|
||||
|
||||
/* Sun IRIG audio decoder */
|
||||
#undef CLOCK_IRIG
|
||||
|
||||
/* Rockwell Jupiter GPS clock */
|
||||
#undef CLOCK_JUPITER
|
||||
|
||||
/* Leitch CSD 5300 Master Clock System Driver */
|
||||
#undef CLOCK_LEITCH
|
||||
|
||||
/* local clock reference */
|
||||
#undef CLOCK_LOCAL
|
||||
|
||||
/* EES M201 MSF receiver */
|
||||
#undef CLOCK_MSFEES
|
||||
|
||||
/* Magnavox MX4200 GPS receiver */
|
||||
#undef CLOCK_MX4200
|
||||
|
||||
/* NMEA GPS receiver */
|
||||
#undef CLOCK_NMEA
|
||||
|
||||
/* Palisade clock */
|
||||
#undef CLOCK_PALISADE
|
||||
|
||||
/* PARSE driver interface */
|
||||
#undef CLOCK_PARSE
|
||||
|
||||
/* PARSE kernel PLL PPS support */
|
||||
#undef PPS_SYNC
|
||||
|
||||
/* PCL 720 clock support */
|
||||
#undef CLOCK_PPS720
|
||||
|
||||
/* PST/Traconex 1020 WWV/WWVH receiver */
|
||||
#undef CLOCK_PST
|
||||
|
||||
/* PTB modem service */
|
||||
#undef CLOCK_PTBACTS
|
||||
|
||||
/* clock thru shared memory */
|
||||
#undef CLOCK_SHM
|
||||
|
||||
/* Motorola UT Oncore GPS */
|
||||
#undef CLOCK_ONCORE
|
||||
|
||||
/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
|
||||
#undef CLOCK_TPRO
|
||||
|
||||
/* TRAK 8810 GPS receiver */
|
||||
#undef CLOCK_TRAK
|
||||
|
||||
/* Kinemetrics/TrueTime receivers */
|
||||
#undef CLOCK_TRUETIME
|
||||
|
||||
/* USNO modem service */
|
||||
#undef CLOCK_USNO
|
||||
|
||||
/* Spectracom 8170/Netclock/2 WWVB receiver */
|
||||
#undef CLOCK_WWVB
|
||||
|
||||
/* Ultralink M320 WWVB receiver */
|
||||
#undef CLOCK_ULINK
|
||||
|
||||
/* Chronolog K-series WWVB receiver */
|
||||
#undef CLOCK_CHRONOLOG
|
||||
|
||||
/* Dumb generic hh:mm:ss local clock */
|
||||
#undef CLOCK_DUMBCLOCK
|
||||
|
||||
/* define if we need to declare int errno; */
|
||||
#undef DECL_ERRNO
|
||||
|
||||
/* define if we may declare int h_errno; */
|
||||
#undef DECL_H_ERRNO
|
||||
|
||||
/* define if it's OK to declare char *sys_errlist[]; */
|
||||
#undef CHAR_SYS_ERRLIST
|
||||
|
||||
/* define if it's OK to declare int syscall P((int, struct timeval *, struct timeval *)); */
|
||||
#undef DECL_SYSCALL
|
||||
|
||||
/* define if we have syscall is buggy (Solaris 2.4) */
|
||||
#undef SYSCALL_BUG
|
||||
|
||||
/* Do we need extra room for SO_RCVBUF? (HPUX <8) */
|
||||
#undef NEED_RCVBUF_SLOP
|
||||
|
||||
/* Should we open the broadcast socket? */
|
||||
#undef OPEN_BCAST_SOCKET
|
||||
|
||||
/* Do we want the HPUX FindConfig()? */
|
||||
#undef NEED_HPUX_FINDCONFIG
|
||||
|
||||
/* canonical system (cpu-vendor-os) string */
|
||||
#undef STR_SYSTEM
|
||||
|
||||
/* define if NetInfo support is available */
|
||||
#undef HAVE_NETINFO
|
||||
|
||||
/* define if [gs]ettimeofday() only takes 1 argument */
|
||||
#undef SYSV_TIMEOFDAY
|
||||
|
||||
/* define if struct sockaddr has sa_len */
|
||||
#undef HAVE_SA_LEN_IN_STRUCT_SOCKADDR
|
||||
|
||||
/* define if struct clockinfo has hz */
|
||||
#undef HAVE_HZ_IN_STRUCT_CLOCKINFO
|
||||
|
||||
/* define if struct sigaction has sa_sigaction */
|
||||
#undef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION
|
||||
|
||||
/* define if struct clockinfo has tickadj */
|
||||
#undef HAVE_TICKADJ_IN_STRUCT_CLOCKINFO
|
||||
|
||||
/* define if struct ntptimeval uses time.tv_nsec instead of time.tv_usec */
|
||||
#undef HAVE_TV_NSEC_IN_NTPTIMEVAL
|
||||
|
||||
/* Does a system header defind struct ppsclockev? */
|
||||
#undef HAVE_STRUCT_PPSCLOCKEV
|
||||
|
||||
/* define if function prototypes are OK */
|
||||
#undef HAVE_PROTOTYPES
|
||||
|
||||
/* define if setpgrp takes 0 arguments */
|
||||
#undef HAVE_SETPGRP_0
|
||||
|
||||
/* hardwire a value for tick? */
|
||||
#undef PRESET_TICK
|
||||
|
||||
/* hardwire a value for tickadj? */
|
||||
#undef PRESET_TICKADJ
|
||||
|
||||
/* is adjtime() accurate? */
|
||||
#undef ADJTIME_IS_ACCURATE
|
||||
|
||||
/* should we NOT read /dev/kmem? */
|
||||
#undef NOKMEM
|
||||
|
||||
/* use UDP Wildcard Delivery? */
|
||||
#undef UDP_WILDCARD_DELIVERY
|
||||
|
||||
/* always slew the clock? */
|
||||
#undef SLEWALWAYS
|
||||
|
||||
/* step, then slew the clock? */
|
||||
#undef STEP_SLEW
|
||||
|
||||
/* force ntpdate to step the clock if !defined(STEP_SLEW) ? */
|
||||
#undef FORCE_NTPDATE_STEP
|
||||
|
||||
/* synch TODR hourly? */
|
||||
#undef DOSYNCTODR
|
||||
|
||||
/* do we set process groups with -pid? */
|
||||
#undef UDP_BACKWARDS_SETOWN
|
||||
|
||||
/* must we have a CTTY for fsetown? */
|
||||
#undef USE_FSETOWNCTTY
|
||||
|
||||
/* can we use SIGIO for tcp and udp IO? */
|
||||
#undef HAVE_SIGNALED_IO
|
||||
|
||||
/* can we use SIGPOLL for UDP? */
|
||||
#undef USE_UDP_SIGPOLL
|
||||
|
||||
/* can we use SIGPOLL for tty IO? */
|
||||
#undef USE_TTY_SIGPOLL
|
||||
|
||||
/* should we use clock_settime()? */
|
||||
#undef USE_CLOCK_SETTIME
|
||||
|
||||
/* do we want the CHU driver? */
|
||||
#undef CLOCK_CHU
|
||||
|
||||
/* do we have the ppsclock streams module? */
|
||||
#undef PPS
|
||||
|
||||
/* do we have the tty_clk line discipline/streams module? */
|
||||
#undef TTYCLK
|
||||
|
||||
/* does the kernel support precision time discipline? */
|
||||
#undef KERNEL_PLL
|
||||
|
||||
/* does the kernel support multicasting IP? */
|
||||
#undef MCAST
|
||||
|
||||
/* do we have ntp_{adj,get}time in libc? */
|
||||
#undef NTP_SYSCALLS_LIBC
|
||||
|
||||
/* do we have ntp_{adj,get}time in the kernel? */
|
||||
#undef NTP_SYSCALLS_STD
|
||||
|
||||
/* do we have STREAMS/TLI? (Can we replace this with HAVE_SYS_STROPTS_H? */
|
||||
#undef STREAMS_TLI
|
||||
|
||||
/* do we need an s_char typedef? */
|
||||
#undef NEED_S_CHAR_TYPEDEF
|
||||
|
||||
/* include the GDT Surveying code? */
|
||||
#undef GDT_SURVEYING
|
||||
|
||||
/* does SIOCGIFCONF return size in the buffer? */
|
||||
#undef SIZE_RETURNED_IN_BUFFER
|
||||
|
||||
/* what is the name of TICK in the kernel? */
|
||||
#undef K_TICK_NAME
|
||||
|
||||
/* Is K_TICK_NAME (nsec_per_tick, for example) in nanoseconds? */
|
||||
#undef TICK_NANO
|
||||
|
||||
/* what is the name of TICKADJ in the kernel? */
|
||||
#undef K_TICKADJ_NAME
|
||||
|
||||
/* Is K_TICKADJ_NAME (hrestime_adj, for example) in nanoseconds? */
|
||||
#undef TICKADJ_NANO
|
||||
|
||||
/* what is (probably) the name of DOSYNCTODR in the kernel? */
|
||||
#undef K_DOSYNCTODR_NAME
|
||||
|
||||
/* what is (probably) the name of NOPRINTF in the kernel? */
|
||||
#undef K_NOPRINTF_NAME
|
||||
|
||||
/* do we need HPUX adjtime() library support? */
|
||||
#undef NEED_HPUX_ADJTIME
|
||||
|
||||
/* Might nlist() values require an extra level of indirection (AIX)? */
|
||||
#undef NLIST_EXTRA_INDIRECTION
|
||||
|
||||
/* Should we recommend a minimum value for tickadj? */
|
||||
#undef MIN_REC_TICKADJ
|
||||
|
||||
/* Is there a problem using PARENB and IGNPAR (IRIX)? */
|
||||
#undef NO_PARENB_IGNPAR
|
||||
|
||||
/* Should we not IGNPAR (Linux)? */
|
||||
#undef RAWDCF_NO_IGNPAR
|
||||
|
||||
/* Does the compiler like "volatile"? */
|
||||
#undef volatile
|
||||
|
||||
/* Does qsort expect to work on "void *" stuff? */
|
||||
#undef QSORT_USES_VOID_P
|
||||
|
||||
/* What is the fallback value for HZ? */
|
||||
#undef DEFAULT_HZ
|
||||
|
||||
/* Do we need to override the system's idea of HZ? */
|
||||
#undef OVERRIDE_HZ
|
||||
|
||||
/* Do we want the SCO clock hacks? */
|
||||
#undef SCO5_CLOCK
|
||||
|
||||
/* Do we want the ReliantUNIX clock hacks? */
|
||||
#undef RELIANTUNIX_CLOCK
|
||||
|
||||
/* Does the kernel have an FLL bug? */
|
||||
#undef KERNEL_FLL_BUG
|
||||
|
||||
/* Define if you have the TIOCGPPSEV ioctl (Solaris) */
|
||||
#undef HAVE_TIOCGPPSEV
|
||||
|
||||
/* Define if you have the TIOCSPPS ioctl (Solaris) */
|
||||
#undef HAVE_TIOCSPPS
|
||||
|
||||
/* Define if you have the CIOGETEV ioctl (SunOS, Linux) */
|
||||
#undef HAVE_CIOGETEV
|
||||
|
||||
/* Define if you have the TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, and ASYNC_PPS_CD_NEG ioctls (linux) */
|
||||
#undef HAVE_TIO_SERIAL_STUFF
|
||||
|
||||
/* Define if you use struct timespec rather than struct timeval (time in ns rather than us) */
|
||||
#undef HAVE_TIMESPEC
|
||||
|
||||
/* Define if you have the interface in the Draft RFC */
|
||||
#undef HAVE_PPSAPI
|
||||
|
||||
/* Do we need to #define _SVID3 when we #include <termios.h>? */
|
||||
#undef TERMIOS_NEEDS__SVID3
|
||||
|
||||
/***/
|
||||
|
||||
/* Which way should we declare... */
|
||||
|
||||
/* adjtime()? */
|
||||
#undef DECL_ADJTIME_0
|
||||
|
||||
/* bcopy()? */
|
||||
#undef DECL_BCOPY_0
|
||||
|
||||
/* bzero()? */
|
||||
#undef DECL_BZERO_0
|
||||
|
||||
/* cfset[io]speed()? */
|
||||
#undef DECL_CFSETISPEED_0
|
||||
|
||||
/* ioctl()? */
|
||||
#undef DECL_IOCTL_0
|
||||
|
||||
/* IPC? (bind, connect, recvfrom, sendto, setsockopt, socket) */
|
||||
#undef DECL_IPC_0
|
||||
|
||||
/* memmove()? */
|
||||
#undef DECL_MEMMOVE_0
|
||||
|
||||
/* memset()? */
|
||||
#undef DECL_MEMSET_0
|
||||
|
||||
/* mkstemp()? */
|
||||
#undef DECL_MKSTEMP_0
|
||||
|
||||
/* mktemp()? */
|
||||
#undef DECL_MKTEMP_0
|
||||
|
||||
/* mrand48()? */
|
||||
#undef DECL_MRAND48_0
|
||||
|
||||
/* nlist()? */
|
||||
#undef DECL_NLIST_0
|
||||
|
||||
/* plock()? */
|
||||
#undef DECL_PLOCK_0
|
||||
|
||||
/* rename()? */
|
||||
#undef DECL_RENAME_0
|
||||
|
||||
/* select()? */
|
||||
#undef DECL_SELECT_0
|
||||
|
||||
/* setitimer()? */
|
||||
#undef DECL_SETITIMER_0
|
||||
|
||||
/* setpriority()? */
|
||||
#undef DECL_SETPRIORITY_0
|
||||
#undef DECL_SETPRIORITY_1
|
||||
|
||||
/* sigvec()? */
|
||||
#undef DECL_SIGVEC_0
|
||||
|
||||
/* srand48()? */
|
||||
#undef DECL_SRAND48_0
|
||||
|
||||
/* stdio stuff? */
|
||||
#undef DECL_STDIO_0
|
||||
|
||||
/* stime()? */
|
||||
#undef DECL_STIME_0
|
||||
|
||||
/* strtol()? */
|
||||
#undef DECL_STRTOL_0
|
||||
|
||||
/* syslog() stuff? */
|
||||
#undef DECL_SYSLOG_0
|
||||
|
||||
/* time()? */
|
||||
#undef DECL_TIME_0
|
||||
|
||||
/* [gs]ettimeofday()? */
|
||||
#undef DECL_TIMEOFDAY_0
|
||||
|
||||
/* tolower()? */
|
||||
#undef DECL_TOLOWER_0
|
||||
|
||||
/* toupper()? */
|
||||
#undef DECL_TOUPPER_0
|
253
contrib/ntp/aclocal.m4
vendored
Normal file
253
contrib/ntp/aclocal.m4
vendored
Normal file
@ -0,0 +1,253 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
dnl We require 2.13 because we rely on SHELL being computed by configure.
|
||||
AC_PREREQ([2.13])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
dnl We check for tar when the user configures the end package.
|
||||
dnl This is sad, since we only need this for "dist". However,
|
||||
dnl there's no other good way to do it. We prefer GNU tar if
|
||||
dnl we can find it. If we can't find a tar, it doesn't really matter.
|
||||
AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
|
||||
AMTARFLAGS=
|
||||
if test -n "$AMTAR"; then
|
||||
if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
|
||||
dnl We have GNU tar.
|
||||
AMTARFLAGS=o
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(AMTARFLAGS)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_C_PROTOTYPES,
|
||||
[AC_REQUIRE([AM_PROG_CC_STDC])
|
||||
AC_REQUIRE([AC_PROG_CPP])
|
||||
AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$am_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
|
||||
U= ANSI2KNR=
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
U=_ ANSI2KNR=./ansi2knr
|
||||
# Ensure some checks needed by ansi2knr itself.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(string.h)
|
||||
fi
|
||||
AC_SUBST(U)dnl
|
||||
AC_SUBST(ANSI2KNR)dnl
|
||||
])
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
# @defmac AC_PROG_CC_STDC
|
||||
# @maindex PROG_CC_STDC
|
||||
# @ovindex CC
|
||||
# If the C compiler in not in ANSI C mode by default, try to add an option
|
||||
# to output variable @code{CC} to make it so. This macro tries various
|
||||
# options that select ANSI C on some system or another. It considers the
|
||||
# compiler to be in ANSI C mode if it handles function prototypes correctly.
|
||||
#
|
||||
# If you use this macro, you should check after calling it whether the C
|
||||
# compiler has been set to accept ANSI C; if not, the shell variable
|
||||
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
||||
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
||||
# program @code{ansi2knr}, which comes with Ghostscript.
|
||||
# @end defmac
|
||||
|
||||
AC_DEFUN(AM_PROG_CC_STDC,
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_BEFORE([$0], [AC_C_INLINE])
|
||||
AC_BEFORE([$0], [AC_C_CONST])
|
||||
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
|
||||
dnl a magic option to avoid problems with ANSI preprocessor commands
|
||||
dnl like #elif.
|
||||
dnl FIXME: can't do this because then AC_AIX won't work due to a
|
||||
dnl circular dependency.
|
||||
dnl AC_BEFORE([$0], [AC_PROG_CPP])
|
||||
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
||||
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
||||
[am_cv_prog_cc_stdc=no
|
||||
ac_save_CC="$CC"
|
||||
# Don't try gcc -ansi; that turns off useful extensions and
|
||||
# breaks some systems' header files.
|
||||
# AIX -qlanglvl=ansi
|
||||
# Ultrix and OSF/1 -std1
|
||||
# HP-UX 10.20 and later -Ae
|
||||
# HP-UX older versions -Aa -D_HPUX_SOURCE
|
||||
# SVR4 -Xc -D__EXTENSIONS__
|
||||
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
|
||||
do
|
||||
CC="$ac_save_CC $ac_arg"
|
||||
AC_TRY_COMPILE(
|
||||
[#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
|
||||
struct buf { int x; };
|
||||
FILE * (*rcsopen) (struct buf *, struct stat *, int);
|
||||
static char *e (p, i)
|
||||
char **p;
|
||||
int i;
|
||||
{
|
||||
return p[i];
|
||||
}
|
||||
static char *f (char * (*g) (char **, int), char **p, ...)
|
||||
{
|
||||
char *s;
|
||||
va_list v;
|
||||
va_start (v,p);
|
||||
s = g (p, va_arg (v,int));
|
||||
va_end (v);
|
||||
return s;
|
||||
}
|
||||
int test (int i, double x);
|
||||
struct s1 {int (*f) (int a);};
|
||||
struct s2 {int (*f) (double a);};
|
||||
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
|
||||
int argc;
|
||||
char **argv;
|
||||
], [
|
||||
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
|
||||
],
|
||||
[am_cv_prog_cc_stdc="$ac_arg"; break])
|
||||
done
|
||||
CC="$ac_save_CC"
|
||||
])
|
||||
if test -z "$am_cv_prog_cc_stdc"; then
|
||||
AC_MSG_RESULT([none needed])
|
||||
else
|
||||
AC_MSG_RESULT($am_cv_prog_cc_stdc)
|
||||
fi
|
||||
case "x$am_cv_prog_cc_stdc" in
|
||||
x|xno) ;;
|
||||
*) CC="$CC $am_cv_prog_cc_stdc" ;;
|
||||
esac
|
||||
])
|
||||
|
8
contrib/ntp/adjtimed/Makefile.am
Normal file
8
contrib/ntp/adjtimed/Makefile.am
Normal file
@ -0,0 +1,8 @@
|
||||
#AUTOMAKE_OPTIONS = ../ansi2knr #no-dependencies
|
||||
AUTOMAKE_OPTIONS = ../util/ansi2knr
|
||||
bin_PROGRAMS = @MAKE_ADJTIMED@
|
||||
EXTRA_PROGRAMS = adjtimed
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
LDADD = ../libntp/libntp.a
|
||||
#EXTRA_DIST = TAGS
|
||||
ETAGS_ARGS = Makefile.am
|
334
contrib/ntp/adjtimed/Makefile.in
Normal file
334
contrib/ntp/adjtimed/Makefile.in
Normal file
@ -0,0 +1,334 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_alias = @build_alias@
|
||||
build_triplet = @build@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AMTAR = @AMTAR@
|
||||
AMTARFLAGS = @AMTARFLAGS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHUTEST = @CHUTEST@
|
||||
CLKTEST = @CLKTEST@
|
||||
CPP = @CPP@
|
||||
DCFD = @DCFD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBPARSE = @LIBPARSE@
|
||||
LIBRSAREF = @LIBRSAREF@
|
||||
LN_S = @LN_S@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAKE_ADJTIMED = @MAKE_ADJTIMED@
|
||||
MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
|
||||
MAKE_LIBPARSE = @MAKE_LIBPARSE@
|
||||
MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
|
||||
MAKE_LIBRSAREF = @MAKE_LIBRSAREF@
|
||||
MAKE_NTPTIME = @MAKE_NTPTIME@
|
||||
MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
|
||||
MAKE_TICKADJ = @MAKE_TICKADJ@
|
||||
PACKAGE = @PACKAGE@
|
||||
PATH_SH = @PATH_SH@
|
||||
PROPDELAY = @PROPDELAY@
|
||||
RANLIB = @RANLIB@
|
||||
RSAREF = @RSAREF@
|
||||
TESTDCF = @TESTDCF@
|
||||
U = @U@
|
||||
VERSION = @VERSION@
|
||||
|
||||
#AUTOMAKE_OPTIONS = ../ansi2knr #no-dependencies
|
||||
|
||||
|
||||
AUTOMAKE_OPTIONS = ../util/ansi2knr
|
||||
bin_PROGRAMS = @MAKE_ADJTIMED@
|
||||
EXTRA_PROGRAMS = adjtimed
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
LDADD = ../libntp/libntp.a
|
||||
#EXTRA_DIST = TAGS
|
||||
ETAGS_ARGS = Makefile.am
|
||||
subdir = adjtimed
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ANSI2KNR = ../util/ansi2knr
|
||||
adjtimed_SOURCES = adjtimed.c
|
||||
adjtimed_OBJECTS = adjtimed$U.o
|
||||
adjtimed_LDADD = $(LDADD)
|
||||
adjtimed_DEPENDENCIES = ../libntp/libntp.a
|
||||
adjtimed_LDFLAGS =
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = adjtimed.c
|
||||
DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
GZIP_ENV = --best
|
||||
SOURCES = adjtimed.c
|
||||
OBJECTS = adjtimed$U.o
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps adjtimed/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
|
||||
echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
|
||||
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$f; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
../util/ansi2knr: ../util/ansi2knr.o
|
||||
cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
|
||||
|
||||
../util/ansi2knr.o:
|
||||
cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o
|
||||
|
||||
|
||||
mostlyclean-kr:
|
||||
-rm -f *_.c
|
||||
|
||||
clean-kr:
|
||||
|
||||
distclean-kr:
|
||||
|
||||
maintainer-clean-kr:
|
||||
adjtimed$U.o:
|
||||
|
||||
adjtimed: $(adjtimed_OBJECTS) $(adjtimed_DEPENDENCIES)
|
||||
@rm -f adjtimed
|
||||
$(LINK) $(adjtimed_LDFLAGS) $(adjtimed_OBJECTS) $(adjtimed_LDADD) $(LIBS)
|
||||
adjtimed_.c: adjtimed.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/adjtimed.c; then echo $(srcdir)/adjtimed.c; else echo adjtimed.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > adjtimed_.c
|
||||
adjtimed_.o : $(ANSI2KNR)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
adjtimed.o adjtimed.lo: adjtimed.c ../include/ntp_syslog.h \
|
||||
../include/ntp_stdlib.h ../include/ntp_types.h \
|
||||
../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
|
||||
../include/ntp_string.h ../include/l_stdlib.h \
|
||||
../include/adjtime.h
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-binPROGRAMS
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-kr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
|
||||
distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-kr \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
22
contrib/ntp/adjtimed/README
Normal file
22
contrib/ntp/adjtimed/README
Normal file
@ -0,0 +1,22 @@
|
||||
------------------------------------------------------------------------------
|
||||
The adjtimed daemon emulates the BSD adjtime(2) system call. The
|
||||
adjtime() routine communicates with this daemon via SYSV messages.
|
||||
|
||||
The emulation uses an undocumented kernel variable (as of 6.0/2.0
|
||||
and later releases) and as such it cannot be guaranteed to work in
|
||||
future HP-UX releases. Perhaps HP-UX will have a real adjtime(2)
|
||||
system call in the future.
|
||||
|
||||
Author: Tai Jin (tai@sde.hp.com)
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
IMPORTANT NOTE: This stuff must be compiled with no optimization !!
|
||||
|
||||
NOTE: This code is known to work as of 8.0 on s300's, s700's and s800's.
|
||||
PLEASE do not modify it unless you have access to kernel sources
|
||||
and fully understand the implications of any changes you are making.
|
||||
One person already has trashed adjtimed by making it do "the right
|
||||
thing". This is not an exact replacement for BSD adjtime(2), don't
|
||||
try to make it into one.
|
||||
|
||||
-- Ken
|
491
contrib/ntp/adjtimed/adjtimed.c
Normal file
491
contrib/ntp/adjtimed/adjtimed.c
Normal file
@ -0,0 +1,491 @@
|
||||
/*************************************************************************/
|
||||
/* (c) Copyright Tai Jin, 1988. All Rights Reserved. */
|
||||
/* Hewlett-Packard Laboratories. */
|
||||
/* */
|
||||
/* Permission is hereby granted for unlimited modification, use, and */
|
||||
/* distribution. This software is made available with no warranty of */
|
||||
/* any kind, express or implied. This copyright notice must remain */
|
||||
/* intact in all versions of this software. */
|
||||
/* */
|
||||
/* The author would appreciate it if any bug fixes and enhancements were */
|
||||
/* to be sent back to him for incorporation into future versions of this */
|
||||
/* software. Please send changes to tai@iag.hp.com or ken@sdd.hp.com. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef lint
|
||||
static char RCSid[] = "adjtimed.c,v 3.1 1993/07/06 01:04:45 jbj Exp";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Adjust time daemon.
|
||||
* This daemon adjusts the rate of the system clock a la BSD's adjtime().
|
||||
* The adjtime() routine uses SYSV messages to communicate with this daemon.
|
||||
*
|
||||
* Caveat: This emulation uses an undocumented kernel variable. As such, it
|
||||
* cannot be guaranteed to work in future HP-UX releases. Fortunately,
|
||||
* it will no longer be needed in HPUX 10.01 and later.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/lock.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <nlist.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ntp_syslog.h"
|
||||
#include "ntp_stdlib.h"
|
||||
|
||||
#include "adjtime.h"
|
||||
|
||||
double atof (const char *);
|
||||
|
||||
int InitClockRate (void);
|
||||
int AdjustClockRate (register struct timeval *delta, register struct timeval *olddelta);
|
||||
long GetClockRate (void);
|
||||
int SetClockRate (long);
|
||||
void ResetClockRate (void);
|
||||
void Cleanup (void);
|
||||
void Exit (int);
|
||||
|
||||
#define MILLION 1000000L
|
||||
|
||||
/* emacs cc-mode goes nuts if we split the next line... */
|
||||
#define tvtod(tv) ((double)tv.tv_sec + ((double)tv.tv_usec / (double)MILLION))
|
||||
|
||||
char *progname = NULL;
|
||||
int verbose = 0;
|
||||
int sysdebug = 0;
|
||||
static int mqid;
|
||||
static double oldrate = 0.0;
|
||||
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
{
|
||||
struct timeval remains;
|
||||
struct sigvec vec;
|
||||
MsgBuf msg;
|
||||
char ch;
|
||||
int nofork = 0;
|
||||
int fd;
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
#ifdef LOG_LOCAL6
|
||||
openlog("adjtimed", LOG_PID, LOG_LOCAL6);
|
||||
#else
|
||||
openlog("adjtimed", LOG_PID);
|
||||
#endif
|
||||
|
||||
while ((ch = ntp_getopt(argc, argv, "hkrvdfp:")) != EOF) {
|
||||
switch (ch) {
|
||||
case 'k':
|
||||
case 'r':
|
||||
if ((mqid = msgget(KEY, 0)) != -1) {
|
||||
if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) {
|
||||
msyslog(LOG_ERR, "remove old message queue: %m");
|
||||
perror("adjtimed: remove old message queue");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (ch == 'k')
|
||||
exit(0);
|
||||
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
++verbose, nofork = 1;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
++sysdebug;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
nofork = 1;
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
fputs("adjtimed: -p option ignored\n", stderr);
|
||||
break;
|
||||
|
||||
default:
|
||||
puts("usage: adjtimed -hkrvdf");
|
||||
puts("-h\thelp");
|
||||
puts("-k\tkill existing adjtimed, if any");
|
||||
puts("-r\trestart (kills existing adjtimed, if any)");
|
||||
puts("-v\tdebug output (repeat for more output)");
|
||||
puts("-d\tsyslog output (repeat for more output)");
|
||||
puts("-f\tno fork");
|
||||
msyslog(LOG_ERR, "usage error");
|
||||
exit(1);
|
||||
} /* switch */
|
||||
} /* while */
|
||||
|
||||
if (!nofork) {
|
||||
switch (fork()) {
|
||||
case 0:
|
||||
close(fileno(stdin));
|
||||
close(fileno(stdout));
|
||||
close(fileno(stderr));
|
||||
|
||||
#ifdef TIOCNOTTY
|
||||
if ((fd = open("/dev/tty")) != -1) {
|
||||
ioctl(fd, TIOCNOTTY, 0);
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
setpgrp();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case -1:
|
||||
msyslog(LOG_ERR, "fork: %m");
|
||||
perror("adjtimed: fork");
|
||||
exit(1);
|
||||
|
||||
default:
|
||||
exit(0);
|
||||
} /* switch */
|
||||
} /* if */
|
||||
|
||||
if (nofork) {
|
||||
setvbuf(stdout, NULL, _IONBF, BUFSIZ);
|
||||
setvbuf(stderr, NULL, _IONBF, BUFSIZ);
|
||||
}
|
||||
|
||||
msyslog(LOG_INFO, "started");
|
||||
if (verbose) printf("adjtimed: started\n");
|
||||
|
||||
if (InitClockRate() == -1)
|
||||
Exit(2);
|
||||
|
||||
(void)signal(SIGHUP, SIG_IGN);
|
||||
(void)signal(SIGINT, SIG_IGN);
|
||||
(void)signal(SIGQUIT, SIG_IGN);
|
||||
(void)signal(SIGTERM, Cleanup);
|
||||
|
||||
vec.sv_handler = ResetClockRate;
|
||||
vec.sv_flags = 0;
|
||||
vec.sv_mask = ~0;
|
||||
sigvector(SIGALRM, &vec, (struct sigvec *)0);
|
||||
|
||||
if (msgget(KEY, IPC_CREAT|IPC_EXCL) == -1) {
|
||||
if (errno == EEXIST) {
|
||||
msyslog(LOG_ERR, "message queue already exists, use -r to remove it");
|
||||
fputs("adjtimed: message queue already exists, use -r to remove it\n",
|
||||
stderr);
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
msyslog(LOG_ERR, "create message queue: %m");
|
||||
perror("adjtimed: create message queue");
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
if ((mqid = msgget(KEY, 0)) == -1) {
|
||||
msyslog(LOG_ERR, "get message queue id: %m");
|
||||
perror("adjtimed: get message queue id");
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
/* Lock process in memory to improve response time */
|
||||
if (plock(PROCLOCK)) {
|
||||
msyslog(LOG_ERR, "plock: %m");
|
||||
perror("adjtimed: plock");
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
/* Also raise process priority.
|
||||
* If we do not get run when we want, this leads to bad timekeeping
|
||||
* and "Previous time adjustment didn't complete" gripes from xntpd.
|
||||
*/
|
||||
if (nice(-10) == -1) {
|
||||
msyslog(LOG_ERR, "nice: %m");
|
||||
perror("adjtimed: nice");
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) {
|
||||
if (errno == EINTR) continue;
|
||||
msyslog(LOG_ERR, "read message: %m");
|
||||
perror("adjtimed: read message");
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
switch (msg.msgb.code) {
|
||||
case DELTA1:
|
||||
case DELTA2:
|
||||
AdjustClockRate(&msg.msgb.tv, &remains);
|
||||
|
||||
if (msg.msgb.code == DELTA2) {
|
||||
msg.msgb.tv = remains;
|
||||
msg.msgb.mtype = SERVER;
|
||||
|
||||
while (msgsnd(mqid, &msg.msgp, MSGSIZE, 0) == -1) {
|
||||
if (errno == EINTR) continue;
|
||||
msyslog(LOG_ERR, "send message: %m");
|
||||
perror("adjtimed: send message");
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
if (remains.tv_sec + remains.tv_usec != 0L) {
|
||||
if (verbose) {
|
||||
printf("adjtimed: previous correction remaining %.6fs\n",
|
||||
tvtod(remains));
|
||||
}
|
||||
if (sysdebug) {
|
||||
msyslog(LOG_INFO, "previous correction remaining %.6fs",
|
||||
tvtod(remains));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "adjtimed: unknown message code %d\n", msg.msgb.code);
|
||||
msyslog(LOG_ERR, "unknown message code %d", msg.msgb.code);
|
||||
} /* switch */
|
||||
} /* loop */
|
||||
} /* main */
|
||||
|
||||
/*
|
||||
* Default clock rate (old_tick).
|
||||
*/
|
||||
#define DEFAULT_RATE (MILLION / HZ)
|
||||
#define UNKNOWN_RATE 0L
|
||||
#define TICK_ADJ 5 /* standard adjustment rate, microsec/tick */
|
||||
|
||||
static long default_rate = DEFAULT_RATE;
|
||||
static long tick_rate = HZ; /* ticks per sec */
|
||||
static long slew_rate = TICK_ADJ * HZ; /* in microsec/sec */
|
||||
|
||||
int
|
||||
AdjustClockRate(
|
||||
register struct timeval *delta,
|
||||
register struct timeval *olddelta
|
||||
)
|
||||
{
|
||||
register long rate, dt, leftover;
|
||||
struct itimerval period, remains;
|
||||
|
||||
dt = (delta->tv_sec * MILLION) + delta->tv_usec;
|
||||
|
||||
if (verbose)
|
||||
printf("adjtimed: new correction %.6fs\n", (double)dt / (double)MILLION);
|
||||
if (sysdebug)
|
||||
msyslog(LOG_INFO, "new correction %.6fs", (double)dt / (double)MILLION);
|
||||
if (verbose > 2) printf("adjtimed: leftover %ldus\n", leftover);
|
||||
if (sysdebug > 2) msyslog(LOG_INFO, "leftover %ldus", leftover);
|
||||
rate = dt;
|
||||
|
||||
/*
|
||||
* Apply a slew rate of slew_rate over a period of dt/slew_rate seconds.
|
||||
*/
|
||||
if (dt > 0) {
|
||||
rate = slew_rate;
|
||||
} else {
|
||||
rate = -slew_rate;
|
||||
dt = -dt;
|
||||
}
|
||||
period.it_value.tv_sec = dt / slew_rate;
|
||||
period.it_value.tv_usec = (dt % slew_rate) * (MILLION / slew_rate);
|
||||
/*
|
||||
* Note: we assume the kernel will convert the specified period into ticks
|
||||
* using the modified clock rate rather than an assumed nominal clock rate,
|
||||
* and therefore will generate the timer interrupt after the specified
|
||||
* number of true seconds, not skewed seconds.
|
||||
*/
|
||||
|
||||
if (verbose > 1)
|
||||
printf("adjtimed: will be complete in %lds %ldus\n",
|
||||
period.it_value.tv_sec, period.it_value.tv_usec);
|
||||
if (sysdebug > 1)
|
||||
msyslog(LOG_INFO, "will be complete in %lds %ldus",
|
||||
period.it_value.tv_sec, period.it_value.tv_usec);
|
||||
/*
|
||||
* adjust the clock rate
|
||||
*/
|
||||
if (dt) {
|
||||
if (SetClockRate((rate / tick_rate) + default_rate) == -1) {
|
||||
msyslog(LOG_ERR, "set clock rate: %m");
|
||||
perror("adjtimed: set clock rate");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* start the timer
|
||||
* (do this after changing the rate because the period has been rounded down)
|
||||
*/
|
||||
period.it_interval.tv_sec = period.it_interval.tv_usec = 0L;
|
||||
setitimer(ITIMER_REAL, &period, &remains);
|
||||
/*
|
||||
* return old delta
|
||||
*/
|
||||
if (olddelta) {
|
||||
dt = ((remains.it_value.tv_sec * MILLION) + remains.it_value.tv_usec) *
|
||||
oldrate;
|
||||
olddelta->tv_sec = dt / MILLION;
|
||||
olddelta->tv_usec = dt - (olddelta->tv_sec * MILLION);
|
||||
}
|
||||
|
||||
oldrate = (double)rate / (double)MILLION;
|
||||
return(0);
|
||||
} /* AdjustClockRate */
|
||||
|
||||
static struct nlist nl[] = {
|
||||
#ifdef __hp9000s800
|
||||
#ifdef PRE7_0
|
||||
{ "tick" },
|
||||
#else
|
||||
{ "old_tick" },
|
||||
#endif
|
||||
#else
|
||||
{ "_old_tick" },
|
||||
#endif
|
||||
{ "" }
|
||||
};
|
||||
|
||||
static int kmem;
|
||||
|
||||
/*
|
||||
* The return value is the clock rate in old_tick units or -1 if error.
|
||||
*/
|
||||
long
|
||||
GetClockRate(void)
|
||||
{
|
||||
long rate, mask;
|
||||
|
||||
if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L)
|
||||
return (-1L);
|
||||
|
||||
mask = sigblock(sigmask(SIGALRM));
|
||||
|
||||
if (read(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate))
|
||||
rate = UNKNOWN_RATE;
|
||||
|
||||
sigsetmask(mask);
|
||||
return (rate);
|
||||
} /* GetClockRate */
|
||||
|
||||
/*
|
||||
* The argument is the new rate in old_tick units.
|
||||
*/
|
||||
int
|
||||
SetClockRate(
|
||||
long rate
|
||||
)
|
||||
{
|
||||
long mask;
|
||||
|
||||
if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L)
|
||||
return (-1);
|
||||
|
||||
mask = sigblock(sigmask(SIGALRM));
|
||||
|
||||
if (write(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate)) {
|
||||
sigsetmask(mask);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
sigsetmask(mask);
|
||||
|
||||
if (rate != default_rate) {
|
||||
if (verbose > 3) {
|
||||
printf("adjtimed: clock rate (%lu) %ldus/s\n", rate,
|
||||
(rate - default_rate) * tick_rate);
|
||||
}
|
||||
if (sysdebug > 3) {
|
||||
msyslog(LOG_INFO, "clock rate (%lu) %ldus/s", rate,
|
||||
(rate - default_rate) * tick_rate);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
} /* SetClockRate */
|
||||
|
||||
int
|
||||
InitClockRate(void)
|
||||
{
|
||||
if ((kmem = open("/dev/kmem", O_RDWR)) == -1) {
|
||||
msyslog(LOG_ERR, "open(/dev/kmem): %m");
|
||||
perror("adjtimed: open(/dev/kmem)");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
nlist("/hp-ux", nl);
|
||||
|
||||
if (nl[0].n_type == 0) {
|
||||
fputs("adjtimed: /hp-ux has no symbol table\n", stderr);
|
||||
msyslog(LOG_ERR, "/hp-ux has no symbol table");
|
||||
return (-1);
|
||||
}
|
||||
/*
|
||||
* Set the default to the system's original value
|
||||
*/
|
||||
default_rate = GetClockRate();
|
||||
if (default_rate == UNKNOWN_RATE) default_rate = DEFAULT_RATE;
|
||||
tick_rate = (MILLION / default_rate);
|
||||
slew_rate = TICK_ADJ * tick_rate;
|
||||
fprintf(stderr,"default_rate=%ld, tick_rate=%ld, slew_rate=%ld\n",default_rate,tick_rate,slew_rate);
|
||||
|
||||
return (0);
|
||||
} /* InitClockRate */
|
||||
|
||||
/*
|
||||
* Reset the clock rate to the default value.
|
||||
*/
|
||||
void
|
||||
ResetClockRate(void)
|
||||
{
|
||||
struct itimerval it;
|
||||
|
||||
it.it_value.tv_sec = it.it_value.tv_usec = 0L;
|
||||
setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
|
||||
|
||||
if (verbose > 2) puts("adjtimed: resetting the clock");
|
||||
if (sysdebug > 2) msyslog(LOG_INFO, "resetting the clock");
|
||||
|
||||
if (GetClockRate() != default_rate) {
|
||||
if (SetClockRate(default_rate) == -1) {
|
||||
msyslog(LOG_ERR, "set clock rate: %m");
|
||||
perror("adjtimed: set clock rate");
|
||||
}
|
||||
}
|
||||
|
||||
oldrate = 0.0;
|
||||
} /* ResetClockRate */
|
||||
|
||||
void
|
||||
Cleanup(void)
|
||||
{
|
||||
ResetClockRate();
|
||||
|
||||
if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) {
|
||||
if (errno != EINVAL) {
|
||||
msyslog(LOG_ERR, "remove message queue: %m");
|
||||
perror("adjtimed: remove message queue");
|
||||
}
|
||||
}
|
||||
|
||||
Exit(2);
|
||||
} /* Cleanup */
|
||||
|
||||
void
|
||||
Exit(status)
|
||||
int status;
|
||||
{
|
||||
msyslog(LOG_ERR, "terminated");
|
||||
closelog();
|
||||
if (kmem != -1) close(kmem);
|
||||
exit(status);
|
||||
} /* Exit */
|
66
contrib/ntp/build
Executable file
66
contrib/ntp/build
Executable file
@ -0,0 +1,66 @@
|
||||
#! /bin/sh
|
||||
|
||||
LOGF=make.log
|
||||
case "$1" in
|
||||
-l) LOG=1
|
||||
shift
|
||||
;;
|
||||
*) LOG=0
|
||||
;;
|
||||
esac
|
||||
|
||||
CONFIG_ARGS="$@"
|
||||
|
||||
IAM=`hostname || uname -n`
|
||||
|
||||
#set -e
|
||||
#set -x
|
||||
|
||||
CVO=`./config.guess`
|
||||
case "$CVO" in
|
||||
*-*-*) ;;
|
||||
*) echo "config.guess returned <$CVO>, which makes no sense to me."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
MYNAME=`IFS=. ; set $IAM ; echo $1`
|
||||
|
||||
case "$IAM" in
|
||||
*.udel.edu)
|
||||
BDIR=A.$MYNAME
|
||||
;;
|
||||
*)
|
||||
BDIR=A.$CVO
|
||||
;;
|
||||
esac
|
||||
|
||||
CCSUF=""
|
||||
|
||||
case "$CC" in
|
||||
'') ;;
|
||||
*) CCSUF="-$CC"
|
||||
;;
|
||||
esac
|
||||
|
||||
BDIR="$BDIR$CCSUF"
|
||||
|
||||
[ -d "$BDIR" ] || mkdir $BDIR
|
||||
[ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
|
||||
[ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost
|
||||
|
||||
cd $BDIR
|
||||
|
||||
(
|
||||
cp /dev/null $LOGF
|
||||
|
||||
[ -f config.status ] || ../configure $CONFIG_ARGS
|
||||
|
||||
case "$MAKE" in
|
||||
'') make && make check
|
||||
;;
|
||||
*) $MAKE && $MAKE check
|
||||
;;
|
||||
esac
|
||||
) >> $LOGF 2>&1
|
||||
|
16
contrib/ntp/clockstuff/Makefile.am
Normal file
16
contrib/ntp/clockstuff/Makefile.am
Normal file
@ -0,0 +1,16 @@
|
||||
#AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
|
||||
AUTOMAKE_OPTIONS = ../util/ansi2knr
|
||||
noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@
|
||||
EXTRA_PROGRAMS = propdelay chutest clktest
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
# We need -lm (and perhaps $(COMPAT) for propdelay, -lntp for {chu,clk}test
|
||||
propdelay_LDADD = -lm
|
||||
chutest_LDADD = ../libntp/libntp.a
|
||||
clktest_LDADD = ../libntp/libntp.a
|
||||
ETAGS_ARGS = Makefile.am
|
||||
#EXTRA_DIST = TAGS
|
||||
|
||||
chutest: ../libntp/libntp.a
|
||||
|
||||
clktest: ../libntp/libntp.a
|
342
contrib/ntp/clockstuff/Makefile.in
Normal file
342
contrib/ntp/clockstuff/Makefile.in
Normal file
@ -0,0 +1,342 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_alias = @build_alias@
|
||||
build_triplet = @build@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AMTAR = @AMTAR@
|
||||
AMTARFLAGS = @AMTARFLAGS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHUTEST = @CHUTEST@
|
||||
CLKTEST = @CLKTEST@
|
||||
CPP = @CPP@
|
||||
DCFD = @DCFD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBPARSE = @LIBPARSE@
|
||||
LIBRSAREF = @LIBRSAREF@
|
||||
LN_S = @LN_S@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAKE_ADJTIMED = @MAKE_ADJTIMED@
|
||||
MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
|
||||
MAKE_LIBPARSE = @MAKE_LIBPARSE@
|
||||
MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
|
||||
MAKE_LIBRSAREF = @MAKE_LIBRSAREF@
|
||||
MAKE_NTPTIME = @MAKE_NTPTIME@
|
||||
MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
|
||||
MAKE_TICKADJ = @MAKE_TICKADJ@
|
||||
PACKAGE = @PACKAGE@
|
||||
PATH_SH = @PATH_SH@
|
||||
PROPDELAY = @PROPDELAY@
|
||||
RANLIB = @RANLIB@
|
||||
RSAREF = @RSAREF@
|
||||
TESTDCF = @TESTDCF@
|
||||
U = @U@
|
||||
VERSION = @VERSION@
|
||||
|
||||
#AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
|
||||
|
||||
|
||||
AUTOMAKE_OPTIONS = ../util/ansi2knr
|
||||
noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@
|
||||
EXTRA_PROGRAMS = propdelay chutest clktest
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
# We need -lm (and perhaps $(COMPAT) for propdelay, -lntp for {chu,clk}test
|
||||
propdelay_LDADD = -lm
|
||||
chutest_LDADD = ../libntp/libntp.a
|
||||
clktest_LDADD = ../libntp/libntp.a
|
||||
ETAGS_ARGS = Makefile.am
|
||||
subdir = clockstuff
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ANSI2KNR = ../util/ansi2knr
|
||||
chutest_SOURCES = chutest.c
|
||||
chutest_OBJECTS = chutest$U.o
|
||||
chutest_DEPENDENCIES = ../libntp/libntp.a
|
||||
chutest_LDFLAGS =
|
||||
clktest_SOURCES = clktest.c
|
||||
clktest_OBJECTS = clktest$U.o
|
||||
clktest_DEPENDENCIES = ../libntp/libntp.a
|
||||
clktest_LDFLAGS =
|
||||
propdelay_SOURCES = propdelay.c
|
||||
propdelay_OBJECTS = propdelay$U.o
|
||||
propdelay_DEPENDENCIES =
|
||||
propdelay_LDFLAGS =
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = chutest.c clktest.c propdelay.c
|
||||
DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
GZIP_ENV = --best
|
||||
SOURCES = chutest.c clktest.c propdelay.c
|
||||
OBJECTS = chutest$U.o clktest$U.o propdelay$U.o
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps clockstuff/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-noinstPROGRAMS:
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
|
||||
distclean-noinstPROGRAMS:
|
||||
|
||||
maintainer-clean-noinstPROGRAMS:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
../util/ansi2knr: ../util/ansi2knr.o
|
||||
cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
|
||||
|
||||
../util/ansi2knr.o:
|
||||
cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o
|
||||
|
||||
|
||||
mostlyclean-kr:
|
||||
-rm -f *_.c
|
||||
|
||||
clean-kr:
|
||||
|
||||
distclean-kr:
|
||||
|
||||
maintainer-clean-kr:
|
||||
chutest$U.o:
|
||||
clktest$U.o:
|
||||
propdelay$U.o:
|
||||
|
||||
propdelay: $(propdelay_OBJECTS) $(propdelay_DEPENDENCIES)
|
||||
@rm -f propdelay
|
||||
$(LINK) $(propdelay_LDFLAGS) $(propdelay_OBJECTS) $(propdelay_LDADD) $(LIBS)
|
||||
chutest_.c: chutest.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chutest.c; then echo $(srcdir)/chutest.c; else echo chutest.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > chutest_.c
|
||||
clktest_.c: clktest.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clktest.c; then echo $(srcdir)/clktest.c; else echo clktest.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > clktest_.c
|
||||
propdelay_.c: propdelay.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/propdelay.c; then echo $(srcdir)/propdelay.c; else echo propdelay.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > propdelay_.c
|
||||
chutest_.o clktest_.o propdelay_.o : $(ANSI2KNR)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
${AWK:-awk} ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
chutest.o chutest.lo: chutest.c ../include/ntp_fp.h \
|
||||
../include/ntp_types.h ../include/ntp_machine.h ../config.h \
|
||||
../include/ntp_proto.h ../include/ntp.h \
|
||||
../include/ntp_unixtime.h
|
||||
clktest.o clktest.lo: clktest.c ../include/ntp_fp.h \
|
||||
../include/ntp_types.h ../include/ntp_machine.h ../config.h \
|
||||
../include/ntp_proto.h ../include/ntp.h \
|
||||
../include/ntp_unixtime.h
|
||||
propdelay.o propdelay.lo: propdelay.c ../include/ntp_stdlib.h \
|
||||
../include/ntp_types.h ../include/ntp_machine.h ../config.h \
|
||||
../include/ntp_proto.h ../include/ntp_string.h \
|
||||
../include/l_stdlib.h
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-kr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-noinstPROGRAMS clean-compile clean-kr clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-kr \
|
||||
distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-kr \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
|
||||
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
#EXTRA_DIST = TAGS
|
||||
|
||||
chutest: ../libntp/libntp.a
|
||||
|
||||
clktest: ../libntp/libntp.a
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
31
contrib/ntp/clockstuff/README
Normal file
31
contrib/ntp/clockstuff/README
Normal file
@ -0,0 +1,31 @@
|
||||
README file for directory ./clockstuff of the NTP Version 4 distribution
|
||||
|
||||
This directory contains the sources for utility programs designed to
|
||||
support radio clocks. The chutest.c and clktest.c are desgined to
|
||||
test the chu_clk and tty_clk line disciplines and STREAMS modules in
|
||||
the ../kernel directory.
|
||||
|
||||
These files have been modified to work with either the line disciplines
|
||||
or the STREAMS modules. Be sure to define -DSTREAM if appropriate.
|
||||
|
||||
These are random bits of things written to help with clocks. You can
|
||||
make things in here by typing one or more of:
|
||||
|
||||
make propdelay (or `make')
|
||||
make chutest
|
||||
make clktest
|
||||
|
||||
Propdelay computes high frequency propagation delays, given the
|
||||
longitude and latitude of the transmitter and receiver. Use
|
||||
this for WWV/H and CHU. Don't use it for WWVB (the computation
|
||||
is easier for that).
|
||||
|
||||
Chutest can be used to input and process data from a CHU modem
|
||||
attached to a serial port. It will use the CHU line discipline
|
||||
(if installed), or raw mode otherwise. This was used to test
|
||||
out the initial reduction algorithms, and may not be up to date.
|
||||
|
||||
Clktest can be used to test the clock line discipline (CLKLDISC,
|
||||
it must be available), and to take a look at radio clocks attached to a
|
||||
serial port.
|
||||
|
816
contrib/ntp/clockstuff/chutest.c
Normal file
816
contrib/ntp/clockstuff/chutest.c
Normal file
@ -0,0 +1,816 @@
|
||||
/* chutest.c,v 3.1 1993/07/06 01:05:21 jbj Exp
|
||||
* chutest - test the CHU clock
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/file.h>
|
||||
#include <sgtty.h>
|
||||
|
||||
#include "../include/ntp_fp.h"
|
||||
#include "../include/ntp.h"
|
||||
#include "../include/ntp_unixtime.h"
|
||||
|
||||
#ifdef CHULDISC
|
||||
#ifdef STREAM
|
||||
# ifdef HAVE_SYS_CHUDEFS_H
|
||||
#include <sys/chudefs.h>
|
||||
#endif
|
||||
#include <stropts.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CHULDISC
|
||||
# ifdef HAVE_SYS_CHUDEFS_H
|
||||
#include <sys/chudefs.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CHULDISC
|
||||
#ifndef STREAM
|
||||
#define NCHUCHARS (10)
|
||||
|
||||
struct chucode {
|
||||
u_char codechars[NCHUCHARS]; /* code characters */
|
||||
u_char ncodechars; /* number of code characters */
|
||||
u_char chustatus; /* not used currently */
|
||||
struct timeval codetimes[NCHUCHARS]; /* arrival times */
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
|
||||
|
||||
char *progname;
|
||||
int debug;
|
||||
|
||||
int dofilter = 0; /* set to 1 when we should run filter algorithm */
|
||||
int showtimes = 0; /* set to 1 when we should show char arrival times */
|
||||
int doprocess = 0; /* set to 1 when we do processing analogous to driver */
|
||||
#ifdef CHULDISC
|
||||
int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
|
||||
#endif
|
||||
|
||||
struct timeval lasttv;
|
||||
struct chucode chudata;
|
||||
|
||||
extern u_long ustotslo[];
|
||||
extern u_long ustotsmid[];
|
||||
extern u_long ustotshi[];
|
||||
|
||||
/*
|
||||
* main - parse arguments and handle options
|
||||
*/
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
void init_chu();
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = ntp_getopt(argc, argv, "cdfpt")) != EOF)
|
||||
switch (c) {
|
||||
case 'c':
|
||||
#ifdef STREAM
|
||||
usechuldisc = 1;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CHULDISC
|
||||
usechuldisc = 1;
|
||||
break;
|
||||
#endif
|
||||
#ifndef STREAM
|
||||
#ifndef CHULDISC
|
||||
(void) fprintf(stderr,
|
||||
"%s: CHU line discipline not available on this machine\n",
|
||||
progname);
|
||||
exit(2);
|
||||
#endif
|
||||
#endif
|
||||
case 'd':
|
||||
++debug;
|
||||
break;
|
||||
case 'f':
|
||||
dofilter = 1;
|
||||
break;
|
||||
case 'p':
|
||||
doprocess = 1;
|
||||
case 't':
|
||||
showtimes = 1;
|
||||
break;
|
||||
default:
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || ntp_optind+1 != argc) {
|
||||
#ifdef STREAM
|
||||
(void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
|
||||
progname);
|
||||
#endif
|
||||
#ifdef CHULDISC
|
||||
(void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
|
||||
progname);
|
||||
#endif
|
||||
#ifndef STREAM
|
||||
#ifndef CHULDISC
|
||||
(void) fprintf(stderr, "usage: %s [-cdft] tty_device\n",
|
||||
progname);
|
||||
#endif
|
||||
#endif
|
||||
exit(2);
|
||||
}
|
||||
|
||||
(void) gettimeofday(&lasttv, (struct timezone *)0);
|
||||
c = openterm(argv[ntp_optind]);
|
||||
init_chu();
|
||||
#ifdef STREAM
|
||||
if (usechuldisc)
|
||||
process_ldisc(c);
|
||||
else
|
||||
#endif
|
||||
#ifdef CHULDISC
|
||||
if (usechuldisc)
|
||||
process_ldisc(c);
|
||||
else
|
||||
#endif
|
||||
process_raw(c);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* openterm - open a port to the CHU clock
|
||||
*/
|
||||
int
|
||||
openterm(
|
||||
char *dev
|
||||
)
|
||||
{
|
||||
int s;
|
||||
struct sgttyb ttyb;
|
||||
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Doing open...");
|
||||
if ((s = open(dev, O_RDONLY, 0777)) < 0)
|
||||
error("open(%s)", dev, "");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "open okay\n");
|
||||
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Setting exclusive use...");
|
||||
if (ioctl(s, TIOCEXCL, (char *)0) < 0)
|
||||
error("ioctl(TIOCEXCL)", "", "");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "done\n");
|
||||
|
||||
ttyb.sg_ispeed = ttyb.sg_ospeed = B300;
|
||||
ttyb.sg_erase = ttyb.sg_kill = 0;
|
||||
ttyb.sg_flags = EVENP|ODDP|RAW;
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Setting baud rate et al...");
|
||||
if (ioctl(s, TIOCSETP, (char *)&ttyb) < 0)
|
||||
error("ioctl(TIOCSETP, raw)", "", "");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "done\n");
|
||||
|
||||
#ifdef CHULDISC
|
||||
if (usechuldisc) {
|
||||
int ldisc;
|
||||
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Switching to CHU ldisc...");
|
||||
ldisc = CHULDISC;
|
||||
if (ioctl(s, TIOCSETD, (char *)&ldisc) < 0)
|
||||
error("ioctl(TIOCSETD, CHULDISC)", "", "");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "okay\n");
|
||||
}
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
if (usechuldisc) {
|
||||
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Poping off streams...");
|
||||
while (ioctl(s, I_POP, 0) >=0) ;
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "okay\n");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "Pushing CHU stream...");
|
||||
if (ioctl(s, I_PUSH, "chu") < 0)
|
||||
error("ioctl(I_PUSH, \"chu\")", "", "");
|
||||
if (debug)
|
||||
(void) fprintf(stderr, "okay\n");
|
||||
}
|
||||
#endif
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* process_raw - process characters in raw mode
|
||||
*/
|
||||
int
|
||||
process_raw(
|
||||
int s
|
||||
)
|
||||
{
|
||||
u_char c;
|
||||
int n;
|
||||
struct timeval tv;
|
||||
struct timeval difftv;
|
||||
|
||||
while ((n = read(s, &c, sizeof(char))) > 0) {
|
||||
(void) gettimeofday(&tv, (struct timezone *)0);
|
||||
if (dofilter)
|
||||
raw_filter((unsigned int)c, &tv);
|
||||
else {
|
||||
difftv.tv_sec = tv.tv_sec - lasttv.tv_sec;
|
||||
difftv.tv_usec = tv.tv_usec - lasttv.tv_usec;
|
||||
if (difftv.tv_usec < 0) {
|
||||
difftv.tv_sec--;
|
||||
difftv.tv_usec += 1000000;
|
||||
}
|
||||
(void) printf("%02x\t%lu.%06lu\t%lu.%06lu\n",
|
||||
c, tv.tv_sec, tv.tv_usec, difftv.tv_sec,
|
||||
difftv.tv_usec);
|
||||
lasttv = tv;
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 0) {
|
||||
(void) fprintf(stderr, "%s: zero returned on read\n", progname);
|
||||
exit(1);
|
||||
} else
|
||||
error("read()", "", "");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* raw_filter - run the line discipline filter over raw data
|
||||
*/
|
||||
int
|
||||
raw_filter(
|
||||
unsigned int c,
|
||||
struct timeval *tv
|
||||
)
|
||||
{
|
||||
static struct timeval diffs[10] = { 0 };
|
||||
struct timeval diff;
|
||||
l_fp ts;
|
||||
void chufilter();
|
||||
|
||||
if ((c & 0xf) > 9 || ((c>>4)&0xf) > 9) {
|
||||
if (debug)
|
||||
(void) fprintf(stderr,
|
||||
"character %02x failed BCD test\n");
|
||||
chudata.ncodechars = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (chudata.ncodechars > 0) {
|
||||
diff.tv_sec = tv->tv_sec
|
||||
- chudata.codetimes[chudata.ncodechars].tv_sec;
|
||||
diff.tv_usec = tv->tv_usec
|
||||
- chudata.codetimes[chudata.ncodechars].tv_usec;
|
||||
if (diff.tv_usec < 0) {
|
||||
diff.tv_sec--;
|
||||
diff.tv_usec += 1000000;
|
||||
} /*
|
||||
if (diff.tv_sec != 0 || diff.tv_usec > 900000) {
|
||||
if (debug)
|
||||
(void) fprintf(stderr,
|
||||
"character %02x failed time test\n");
|
||||
chudata.ncodechars = 0;
|
||||
return;
|
||||
} */
|
||||
}
|
||||
|
||||
chudata.codechars[chudata.ncodechars] = c;
|
||||
chudata.codetimes[chudata.ncodechars] = *tv;
|
||||
if (chudata.ncodechars > 0)
|
||||
diffs[chudata.ncodechars] = diff;
|
||||
if (++chudata.ncodechars == 10) {
|
||||
if (doprocess) {
|
||||
TVTOTS(&chudata.codetimes[NCHUCHARS-1], &ts);
|
||||
ts.l_ui += JAN_1970;
|
||||
chufilter(&chudata, &chudata.codetimes[NCHUCHARS-1]);
|
||||
} else {
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < chudata.ncodechars; i++) {
|
||||
(void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n",
|
||||
chudata.codechars[i] & 0xf,
|
||||
(chudata.codechars[i] >>4 ) & 0xf,
|
||||
chudata.codetimes[i].tv_sec,
|
||||
chudata.codetimes[i].tv_usec,
|
||||
diffs[i].tv_sec, diffs[i].tv_usec);
|
||||
}
|
||||
}
|
||||
chudata.ncodechars = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* #ifdef CHULDISC*/
|
||||
/*
|
||||
* process_ldisc - process line discipline
|
||||
*/
|
||||
int
|
||||
process_ldisc(
|
||||
int s
|
||||
)
|
||||
{
|
||||
struct chucode chu;
|
||||
int n;
|
||||
register int i;
|
||||
struct timeval diff;
|
||||
l_fp ts;
|
||||
void chufilter();
|
||||
|
||||
while ((n = read(s, (char *)&chu, sizeof chu)) > 0) {
|
||||
if (n != sizeof chu) {
|
||||
(void) fprintf(stderr, "Expected %d, got %d\n",
|
||||
sizeof chu, n);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (doprocess) {
|
||||
TVTOTS(&chu.codetimes[NCHUCHARS-1], &ts);
|
||||
ts.l_ui += JAN_1970;
|
||||
chufilter(&chu, &ts);
|
||||
} else {
|
||||
for (i = 0; i < NCHUCHARS; i++) {
|
||||
if (i == 0)
|
||||
diff.tv_sec = diff.tv_usec = 0;
|
||||
else {
|
||||
diff.tv_sec = chu.codetimes[i].tv_sec
|
||||
- chu.codetimes[i-1].tv_sec;
|
||||
diff.tv_usec = chu.codetimes[i].tv_usec
|
||||
- chu.codetimes[i-1].tv_usec;
|
||||
if (diff.tv_usec < 0) {
|
||||
diff.tv_sec--;
|
||||
diff.tv_usec += 1000000;
|
||||
}
|
||||
}
|
||||
(void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n",
|
||||
chu.codechars[i] & 0xf, (chu.codechars[i]>>4)&0xf,
|
||||
chu.codetimes[i].tv_sec, chu.codetimes[i].tv_usec,
|
||||
diff.tv_sec, diff.tv_usec);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n == 0) {
|
||||
(void) fprintf(stderr, "%s: zero returned on read\n", progname);
|
||||
exit(1);
|
||||
} else
|
||||
error("read()", "", "");
|
||||
}
|
||||
/*#endif*/
|
||||
|
||||
|
||||
/*
|
||||
* error - print an error message
|
||||
*/
|
||||
void
|
||||
error(
|
||||
char *fmt,
|
||||
char *s1,
|
||||
char *s2
|
||||
)
|
||||
{
|
||||
(void) fprintf(stderr, "%s: ", progname);
|
||||
(void) fprintf(stderr, fmt, s1, s2);
|
||||
(void) fprintf(stderr, ": ");
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Definitions
|
||||
*/
|
||||
#define MAXUNITS 4 /* maximum number of CHU units permitted */
|
||||
#define CHUDEV "/dev/chu%d" /* device we open. %d is unit number */
|
||||
#define NCHUCODES 9 /* expect 9 CHU codes per minute */
|
||||
|
||||
/*
|
||||
* When CHU is operating optimally we want the primary clock distance
|
||||
* to come out at 300 ms. Thus, peer.distance in the CHU peer structure
|
||||
* is set to 290 ms and we compute delays which are at least 10 ms long.
|
||||
* The following are 290 ms and 10 ms expressed in u_fp format
|
||||
*/
|
||||
#define CHUDISTANCE 0x00004a3d
|
||||
#define CHUBASEDELAY 0x0000028f
|
||||
|
||||
/*
|
||||
* To compute a quality for the estimate (a pseudo delay) we add a
|
||||
* fixed 10 ms for each missing code in the minute and add to this
|
||||
* the sum of the differences between the remaining offsets and the
|
||||
* estimated sample offset.
|
||||
*/
|
||||
#define CHUDELAYPENALTY 0x0000028f
|
||||
|
||||
/*
|
||||
* Other constant stuff
|
||||
*/
|
||||
#define CHUPRECISION (-9) /* what the heck */
|
||||
#define CHUREFID "CHU\0"
|
||||
|
||||
/*
|
||||
* Default fudge factors
|
||||
*/
|
||||
#define DEFPROPDELAY 0x00624dd3 /* 0.0015 seconds, 1.5 ms */
|
||||
#define DEFFILTFUDGE 0x000d1b71 /* 0.0002 seconds, 200 us */
|
||||
|
||||
/*
|
||||
* Hacks to avoid excercising the multiplier. I have no pride.
|
||||
*/
|
||||
#define MULBY10(x) (((x)<<3) + ((x)<<1))
|
||||
#define MULBY60(x) (((x)<<6) - ((x)<<2)) /* watch overflow */
|
||||
#define MULBY24(x) (((x)<<4) + ((x)<<3))
|
||||
|
||||
/*
|
||||
* Constants for use when multiplying by 0.1. ZEROPTONE is 0.1
|
||||
* as an l_fp fraction, NZPOBITS is the number of significant bits
|
||||
* in ZEROPTONE.
|
||||
*/
|
||||
#define ZEROPTONE 0x1999999a
|
||||
#define NZPOBITS 29
|
||||
|
||||
/*
|
||||
* The CHU table. This gives the expected time of arrival of each
|
||||
* character after the on-time second and is computed as follows:
|
||||
* The CHU time code is sent at 300 bps. Your average UART will
|
||||
* synchronize at the edge of the start bit and will consider the
|
||||
* character complete at the center of the first stop bit, i.e.
|
||||
* 0.031667 ms later. Thus the expected time of each interrupt
|
||||
* is the start bit time plus 0.031667 seconds. These times are
|
||||
* in chutable[]. To this we add such things as propagation delay
|
||||
* and delay fudge factor.
|
||||
*/
|
||||
#define CHARDELAY 0x081b4e80
|
||||
|
||||
static u_long chutable[NCHUCHARS] = {
|
||||
0x2147ae14 + CHARDELAY, /* 0.130 (exactly) */
|
||||
0x2ac08312 + CHARDELAY, /* 0.167 (exactly) */
|
||||
0x34395810 + CHARDELAY, /* 0.204 (exactly) */
|
||||
0x3db22d0e + CHARDELAY, /* 0.241 (exactly) */
|
||||
0x472b020c + CHARDELAY, /* 0.278 (exactly) */
|
||||
0x50a3d70a + CHARDELAY, /* 0.315 (exactly) */
|
||||
0x5a1cac08 + CHARDELAY, /* 0.352 (exactly) */
|
||||
0x63958106 + CHARDELAY, /* 0.389 (exactly) */
|
||||
0x6d0e5604 + CHARDELAY, /* 0.426 (exactly) */
|
||||
0x76872b02 + CHARDELAY, /* 0.463 (exactly) */
|
||||
};
|
||||
|
||||
/*
|
||||
* Keep the fudge factors separately so they can be set even
|
||||
* when no clock is configured.
|
||||
*/
|
||||
static l_fp propagation_delay;
|
||||
static l_fp fudgefactor;
|
||||
static l_fp offset_fudge;
|
||||
|
||||
/*
|
||||
* We keep track of the start of the year, watching for changes.
|
||||
* We also keep track of whether the year is a leap year or not.
|
||||
* All because stupid CHU doesn't include the year in the time code.
|
||||
*/
|
||||
static u_long yearstart;
|
||||
|
||||
/*
|
||||
* Imported from the timer module
|
||||
*/
|
||||
extern u_long current_time;
|
||||
extern struct event timerqueue[];
|
||||
|
||||
/*
|
||||
* Time conversion tables imported from the library
|
||||
*/
|
||||
extern u_long ustotslo[];
|
||||
extern u_long ustotsmid[];
|
||||
extern u_long ustotshi[];
|
||||
|
||||
|
||||
/*
|
||||
* init_chu - initialize internal chu driver data
|
||||
*/
|
||||
void
|
||||
init_chu(void)
|
||||
{
|
||||
|
||||
/*
|
||||
* Initialize fudge factors to default.
|
||||
*/
|
||||
propagation_delay.l_ui = 0;
|
||||
propagation_delay.l_uf = DEFPROPDELAY;
|
||||
fudgefactor.l_ui = 0;
|
||||
fudgefactor.l_uf = DEFFILTFUDGE;
|
||||
offset_fudge = propagation_delay;
|
||||
L_ADD(&offset_fudge, &fudgefactor);
|
||||
|
||||
yearstart = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
chufilter(
|
||||
struct chucode *chuc,
|
||||
l_fp *rtime
|
||||
)
|
||||
{
|
||||
register int i;
|
||||
register u_long date_ui;
|
||||
register u_long tmp;
|
||||
register u_char *code;
|
||||
int isneg;
|
||||
int imin;
|
||||
int imax;
|
||||
u_long reftime;
|
||||
l_fp off[NCHUCHARS];
|
||||
l_fp ts;
|
||||
int day, hour, minute, second;
|
||||
static u_char lastcode[NCHUCHARS];
|
||||
extern u_long calyearstart();
|
||||
extern char *mfptoa();
|
||||
void chu_process();
|
||||
extern char *prettydate();
|
||||
|
||||
/*
|
||||
* We'll skip the checks made in the kernel, but assume they've
|
||||
* been done. This means that all characters are BCD and
|
||||
* the intercharacter spacing isn't unreasonable.
|
||||
*/
|
||||
|
||||
/*
|
||||
* print the code
|
||||
*/
|
||||
for (i = 0; i < NCHUCHARS; i++)
|
||||
printf("%c%c", (chuc->codechars[i] & 0xf) + '0',
|
||||
((chuc->codechars[i]>>4) & 0xf) + '0');
|
||||
printf("\n");
|
||||
|
||||
/*
|
||||
* Format check. Make sure the two halves match.
|
||||
*/
|
||||
for (i = 0; i < NCHUCHARS/2; i++)
|
||||
if (chuc->codechars[i] != chuc->codechars[i+(NCHUCHARS/2)]) {
|
||||
(void) printf("Bad format, halves don't match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Break out the code into the BCD nibbles. Only need to fiddle
|
||||
* with the first half since both are identical. Note the first
|
||||
* BCD character is the low order nibble, the second the high order.
|
||||
*/
|
||||
code = lastcode;
|
||||
for (i = 0; i < NCHUCHARS/2; i++) {
|
||||
*code++ = chuc->codechars[i] & 0xf;
|
||||
*code++ = (chuc->codechars[i] >> 4) & 0xf;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the first nibble isn't a 6, we're up the creek
|
||||
*/
|
||||
code = lastcode;
|
||||
if (*code++ != 6) {
|
||||
(void) printf("Bad format, no 6 at start\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Collect the day, the hour, the minute and the second.
|
||||
*/
|
||||
day = *code++;
|
||||
day = MULBY10(day) + *code++;
|
||||
day = MULBY10(day) + *code++;
|
||||
hour = *code++;
|
||||
hour = MULBY10(hour) + *code++;
|
||||
minute = *code++;
|
||||
minute = MULBY10(minute) + *code++;
|
||||
second = *code++;
|
||||
second = MULBY10(second) + *code++;
|
||||
|
||||
/*
|
||||
* Sanity check the day and time. Note that this
|
||||
* only occurs on the 31st through the 39th second
|
||||
* of the minute.
|
||||
*/
|
||||
if (day < 1 || day > 366
|
||||
|| hour > 23 || minute > 59
|
||||
|| second < 31 || second > 39) {
|
||||
(void) printf("Failed date sanity check: %d %d %d %d\n",
|
||||
day, hour, minute, second);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute seconds into the year.
|
||||
*/
|
||||
tmp = (u_long)(MULBY24((day-1)) + hour); /* hours */
|
||||
tmp = MULBY60(tmp) + (u_long)minute; /* minutes */
|
||||
tmp = MULBY60(tmp) + (u_long)second; /* seconds */
|
||||
|
||||
/*
|
||||
* Now the fun begins. We demand that the received time code
|
||||
* be within CLOCK_WAYTOOBIG of the receive timestamp, but
|
||||
* there is uncertainty about the year the timestamp is in.
|
||||
* Use the current year start for the first check, this should
|
||||
* work most of the time.
|
||||
*/
|
||||
date_ui = tmp + yearstart;
|
||||
if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG)
|
||||
&& date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG))
|
||||
goto codeokay; /* looks good */
|
||||
|
||||
/*
|
||||
* Trouble. Next check is to see if the year rolled over and, if
|
||||
* so, try again with the new year's start.
|
||||
*/
|
||||
date_ui = calyearstart(rtime->l_ui);
|
||||
if (date_ui != yearstart) {
|
||||
yearstart = date_ui;
|
||||
date_ui += tmp;
|
||||
(void) printf("time %u, code %u, difference %d\n",
|
||||
date_ui, rtime->l_ui, (long)date_ui-(long)rtime->l_ui);
|
||||
if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG)
|
||||
&& date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG))
|
||||
goto codeokay; /* okay this time */
|
||||
}
|
||||
|
||||
ts.l_uf = 0;
|
||||
ts.l_ui = yearstart;
|
||||
printf("yearstart %s\n", prettydate(&ts));
|
||||
printf("received %s\n", prettydate(rtime));
|
||||
ts.l_ui = date_ui;
|
||||
printf("date_ui %s\n", prettydate(&ts));
|
||||
|
||||
/*
|
||||
* Here we know the year start matches the current system
|
||||
* time. One remaining possibility is that the time code
|
||||
* is in the year previous to that of the system time. This
|
||||
* is only worth checking if the receive timestamp is less
|
||||
* than CLOCK_WAYTOOBIG seconds into the new year.
|
||||
*/
|
||||
if ((rtime->l_ui - yearstart) < CLOCK_WAYTOOBIG) {
|
||||
date_ui = tmp + calyearstart(yearstart - CLOCK_WAYTOOBIG);
|
||||
if ((rtime->l_ui - date_ui) < CLOCK_WAYTOOBIG)
|
||||
goto codeokay;
|
||||
}
|
||||
|
||||
/*
|
||||
* One last possibility is that the time stamp is in the year
|
||||
* following the year the system is in. Try this one before
|
||||
* giving up.
|
||||
*/
|
||||
date_ui = tmp + calyearstart(yearstart + (400*24*60*60)); /* 400 days */
|
||||
if ((date_ui - rtime->l_ui) >= CLOCK_WAYTOOBIG) {
|
||||
printf("Date hopelessly off\n");
|
||||
return; /* hopeless, let it sync to other peers */
|
||||
}
|
||||
|
||||
codeokay:
|
||||
reftime = date_ui;
|
||||
/*
|
||||
* We've now got the integral seconds part of the time code (we hope).
|
||||
* The fractional part comes from the table. We next compute
|
||||
* the offsets for each character.
|
||||
*/
|
||||
for (i = 0; i < NCHUCHARS; i++) {
|
||||
register u_long tmp2;
|
||||
|
||||
off[i].l_ui = date_ui;
|
||||
off[i].l_uf = chutable[i];
|
||||
tmp = chuc->codetimes[i].tv_sec + JAN_1970;
|
||||
TVUTOTSF(chuc->codetimes[i].tv_usec, tmp2);
|
||||
M_SUB(off[i].l_ui, off[i].l_uf, tmp, tmp2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Here is a *big* problem. What one would normally
|
||||
* do here on a machine with lots of clock bits (say
|
||||
* a Vax or the gizmo board) is pick the most positive
|
||||
* offset and the estimate, since this is the one that
|
||||
* is most likely suffered the smallest interrupt delay.
|
||||
* The trouble is that the low order clock bit on an IBM
|
||||
* RT, which is the machine I had in mind when doing this,
|
||||
* ticks at just under the millisecond mark. This isn't
|
||||
* precise enough. What we can do to improve this is to
|
||||
* average all 10 samples and rely on the second level
|
||||
* filtering to pick the least delayed estimate. Trouble
|
||||
* is, this means we have to divide a 64 bit fixed point
|
||||
* number by 10, a procedure which really sucks. Oh, well.
|
||||
* First compute the sum.
|
||||
*/
|
||||
date_ui = 0;
|
||||
tmp = 0;
|
||||
for (i = 0; i < NCHUCHARS; i++)
|
||||
M_ADD(date_ui, tmp, off[i].l_ui, off[i].l_uf);
|
||||
if (M_ISNEG(date_ui, tmp))
|
||||
isneg = 1;
|
||||
else
|
||||
isneg = 0;
|
||||
|
||||
/*
|
||||
* Here is a multiply-by-0.1 optimization that should apply
|
||||
* just about everywhere. If the magnitude of the sum
|
||||
* is less than 9 we don't have to worry about overflow
|
||||
* out of a 64 bit product, even after rounding.
|
||||
*/
|
||||
if (date_ui < 9 || date_ui > 0xfffffff7) {
|
||||
register u_long prod_ui;
|
||||
register u_long prod_uf;
|
||||
|
||||
prod_ui = prod_uf = 0;
|
||||
/*
|
||||
* This code knows the low order bit in 0.1 is zero
|
||||
*/
|
||||
for (i = 1; i < NZPOBITS; i++) {
|
||||
M_LSHIFT(date_ui, tmp);
|
||||
if (ZEROPTONE & (1<<i))
|
||||
M_ADD(prod_ui, prod_uf, date_ui, tmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Done, round it correctly. Prod_ui contains the
|
||||
* fraction.
|
||||
*/
|
||||
if (prod_uf & 0x80000000)
|
||||
prod_ui++;
|
||||
if (isneg)
|
||||
date_ui = 0xffffffff;
|
||||
else
|
||||
date_ui = 0;
|
||||
tmp = prod_ui;
|
||||
/*
|
||||
* date_ui is integral part, tmp is fraction.
|
||||
*/
|
||||
} else {
|
||||
register u_long prod_ovr;
|
||||
register u_long prod_ui;
|
||||
register u_long prod_uf;
|
||||
register u_long highbits;
|
||||
|
||||
prod_ovr = prod_ui = prod_uf = 0;
|
||||
if (isneg)
|
||||
highbits = 0xffffffff; /* sign extend */
|
||||
else
|
||||
highbits = 0;
|
||||
/*
|
||||
* This code knows the low order bit in 0.1 is zero
|
||||
*/
|
||||
for (i = 1; i < NZPOBITS; i++) {
|
||||
M_LSHIFT3(highbits, date_ui, tmp);
|
||||
if (ZEROPTONE & (1<<i))
|
||||
M_ADD3(prod_ovr, prod_uf, prod_ui,
|
||||
highbits, date_ui, tmp);
|
||||
}
|
||||
|
||||
if (prod_uf & 0x80000000)
|
||||
M_ADDUF(prod_ovr, prod_ui, (u_long)1);
|
||||
date_ui = prod_ovr;
|
||||
tmp = prod_ui;
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point we have the mean offset, with the integral
|
||||
* part in date_ui and the fractional part in tmp. Store
|
||||
* it in the structure.
|
||||
*/
|
||||
/*
|
||||
* Add in fudge factor.
|
||||
*/
|
||||
M_ADD(date_ui, tmp, offset_fudge.l_ui, offset_fudge.l_uf);
|
||||
|
||||
/*
|
||||
* Find the minimun and maximum offset
|
||||
*/
|
||||
imin = imax = 0;
|
||||
for (i = 1; i < NCHUCHARS; i++) {
|
||||
if (L_ISGEQ(&off[i], &off[imax])) {
|
||||
imax = i;
|
||||
} else if (L_ISGEQ(&off[imin], &off[i])) {
|
||||
imin = i;
|
||||
}
|
||||
}
|
||||
|
||||
L_ADD(&off[imin], &offset_fudge);
|
||||
if (imin != imax)
|
||||
L_ADD(&off[imax], &offset_fudge);
|
||||
(void) printf("mean %s, min %s, max %s\n",
|
||||
mfptoa(date_ui, tmp, 8), lfptoa(&off[imin], 8),
|
||||
lfptoa(&off[imax], 8));
|
||||
}
|
529
contrib/ntp/clockstuff/clktest.c
Normal file
529
contrib/ntp/clockstuff/clktest.c
Normal file
@ -0,0 +1,529 @@
|
||||
/* clktest.c,v 3.1 1993/07/06 01:05:23 jbj Exp
|
||||
* clktest - test the clock line discipline
|
||||
*
|
||||
* usage: clktest -b bps -f -t timeo -s cmd -c char1 -a char2 /dev/whatever
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <signal.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/file.h>
|
||||
#include <sgtty.h>
|
||||
|
||||
#include "../include/ntp_fp.h"
|
||||
#include "../include/ntp.h"
|
||||
#include "../include/ntp_unixtime.h"
|
||||
|
||||
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
|
||||
|
||||
#if defined(ULT_2_0_SUCKS)
|
||||
#ifndef sigmask
|
||||
#define sigmask(m) (1<<(m))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STREAM
|
||||
#ifndef CLKLDISC
|
||||
CLOCK_LINE_DISCIPLINE_NEEDED_BY_THIS_PROGRAM;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mask for blocking SIGIO and SIGALRM
|
||||
*/
|
||||
#define BLOCKSIGMASK (sigmask(SIGIO)|sigmask(SIGALRM))
|
||||
|
||||
/*
|
||||
* speed table
|
||||
*/
|
||||
struct speeds {
|
||||
int bps;
|
||||
int rate;
|
||||
} speedtab[] = {
|
||||
{ 300, B300 },
|
||||
{ 1200, B1200 },
|
||||
{ 2400, B2400 },
|
||||
{ 4800, B4800 },
|
||||
{ 9600, B9600 },
|
||||
{ 19200, EXTA },
|
||||
{ 38400, EXTB },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
char *progname;
|
||||
int debug;
|
||||
|
||||
#ifdef CLKLDISC
|
||||
#define DEFMAGIC '\r'
|
||||
#endif
|
||||
|
||||
#ifdef CLKLDISC
|
||||
# ifdef STREAM
|
||||
# include <stropts.h>
|
||||
# ifdef HAVE_SYS_CLKDEFS_H
|
||||
# include <sys/clkdefs.h>
|
||||
# endif
|
||||
# define DEFMAGIC "\r"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct timeval timeout = { 0 };
|
||||
char *cmd = NULL;
|
||||
int cmdlen;
|
||||
int docmd = 0;
|
||||
#ifdef CLKLDISC
|
||||
u_long magic1 = DEFMAGIC;
|
||||
u_long magic2 = DEFMAGIC;
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
char magic[32];
|
||||
#endif
|
||||
int speed = B9600;
|
||||
int ttflags = RAW|EVENP|ODDP;
|
||||
|
||||
volatile int wasalarmed;
|
||||
volatile int iosig;
|
||||
|
||||
struct timeval lasttv;
|
||||
|
||||
extern u_long ustotslo[];
|
||||
extern u_long ustotsmid[];
|
||||
extern u_long ustotshi[];
|
||||
|
||||
/*
|
||||
* main - parse arguments and handle options
|
||||
*/
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
struct speeds *spd;
|
||||
u_long tmp;
|
||||
int fd;
|
||||
struct sgttyb ttyb;
|
||||
struct itimerval itimer;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
int alarming();
|
||||
int ioready();
|
||||
|
||||
progname = argv[0];
|
||||
#ifdef STREAM
|
||||
magic[0] = 0;
|
||||
#endif
|
||||
while ((c = ntp_getopt(argc, argv, "a:b:c:dfs:t:")) != EOF)
|
||||
switch (c) {
|
||||
#ifdef CLKLDISC
|
||||
case 'a':
|
||||
#endif
|
||||
case 'c':
|
||||
if (!atouint(ntp_optarg, &tmp)) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: argument for -%c must be integer\n",
|
||||
progname, c);
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
#ifdef CLKLDISC
|
||||
if (c == 'c')
|
||||
magic1 = tmp;
|
||||
else
|
||||
magic2 = tmp;
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
magic[strlen(magic)+1] = '\0';
|
||||
magic[strlen(magic)] = tmp;
|
||||
#endif
|
||||
break;
|
||||
case 'b':
|
||||
if (!atouint(ntp_optarg, &tmp)) {
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
spd = speedtab;
|
||||
while (spd->bps != 0)
|
||||
if ((int)tmp == spd->bps)
|
||||
break;
|
||||
if (spd->bps == 0) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: speed %lu is unsupported\n",
|
||||
progname, tmp);
|
||||
errflg++;
|
||||
} else {
|
||||
speed = spd->rate;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
++debug;
|
||||
break;
|
||||
case 'f':
|
||||
ttflags |= CRMOD;
|
||||
break;
|
||||
case 's':
|
||||
cmdlen = strlen(ntp_optarg);
|
||||
if (cmdlen == 0)
|
||||
errflg++;
|
||||
else
|
||||
cmd = ntp_optarg;
|
||||
break;
|
||||
case 't':
|
||||
if (!atouint(ntp_optarg, &tmp))
|
||||
errflg++;
|
||||
else {
|
||||
timeout.tv_sec = (long)tmp;
|
||||
docmd = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || ntp_optind+1 != argc) {
|
||||
(void) fprintf(stderr,
|
||||
#ifdef CLKLDISC
|
||||
"usage: %s [-b bps] [-c magic1] [-a magic2] [-f] [-s cmd] [-t timeo] tty_device\n",
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
"usage: %s [-b bps] [-c magic1] [-c magic2]... [-f] [-s cmd] [-t timeo] tty_device\n",
|
||||
#endif
|
||||
progname);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
#ifdef STREAM
|
||||
if (!strlen(magic))
|
||||
strcpy(magic,DEFMAGIC);
|
||||
#endif
|
||||
|
||||
if (docmd)
|
||||
fd = open(argv[ntp_optind], O_RDWR, 0777);
|
||||
else
|
||||
fd = open(argv[ntp_optind], O_RDONLY, 0777);
|
||||
if (fd == -1) {
|
||||
(void) fprintf(stderr, "%s: open(%s): ", progname,
|
||||
argv[ntp_optind]);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ioctl(fd, TIOCEXCL, (char *)0) < 0) {
|
||||
(void) fprintf(stderr, "%s: ioctl(TIOCEXCL): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have the clock discipline, set the port to raw. Otherwise
|
||||
* we run cooked.
|
||||
*/
|
||||
ttyb.sg_ispeed = ttyb.sg_ospeed = speed;
|
||||
#ifdef CLKLDISC
|
||||
ttyb.sg_erase = (char)magic1;
|
||||
ttyb.sg_kill = (char)magic2;
|
||||
#endif
|
||||
ttyb.sg_flags = (short)ttflags;
|
||||
if (ioctl(fd, TIOCSETP, (char *)&ttyb) < 0) {
|
||||
(void) fprintf(stderr, "%s: ioctl(TIOCSETP): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (fcntl(fd, F_SETOWN, getpid()) == -1) {
|
||||
(void) fprintf(stderr, "%s: fcntl(F_SETOWN): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef CLKLDISC
|
||||
{
|
||||
int ldisc;
|
||||
ldisc = CLKLDISC;
|
||||
if (ioctl(fd, TIOCSETD, (char *)&ldisc) < 0) {
|
||||
(void) fprintf(stderr, "%s: ioctl(TIOCSETD): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef STREAM
|
||||
if (ioctl(fd, I_POP, 0) >=0 ) ;
|
||||
if (ioctl(fd, I_PUSH, "clk") < 0) {
|
||||
(void) fprintf(stderr, "%s: ioctl(I_PUSH): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
if (ioctl(fd, CLK_SETSTR, magic) < 0) {
|
||||
(void) fprintf(stderr, "%s: ioctl(CLK_SETSTR): ", progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
(void) gettimeofday(&lasttv, (struct timezone *)0);
|
||||
if (docmd) {
|
||||
/*
|
||||
* set non-blocking, async I/O on the descriptor
|
||||
*/
|
||||
iosig = 0;
|
||||
(void) signal(SIGIO, ioready);
|
||||
if (fcntl(fd, F_SETFL, FNDELAY|FASYNC) < 0) {
|
||||
(void) fprintf(stderr, "%s: fcntl(F_SETFL): ",
|
||||
progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the alarm interrupt.
|
||||
*/
|
||||
wasalarmed = 0;
|
||||
(void) signal(SIGALRM, alarming);
|
||||
itimer.it_interval = itimer.it_value = timeout;
|
||||
setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0);
|
||||
doboth(fd);
|
||||
}
|
||||
doioonly(fd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doboth - handle both I/O and alarms via SIGIO
|
||||
*/
|
||||
int
|
||||
doboth(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
int n;
|
||||
int sawalarm;
|
||||
int sawiosig;
|
||||
int omask;
|
||||
fd_set fds;
|
||||
struct timeval tvzero;
|
||||
|
||||
sawalarm = 0;
|
||||
sawiosig = 0;
|
||||
FD_ZERO(&fds);
|
||||
for (;;) {
|
||||
omask = sigblock(BLOCKSIGMASK);
|
||||
if (wasalarmed) { /* alarmed? */
|
||||
sawalarm = 1;
|
||||
wasalarmed = 0;
|
||||
}
|
||||
if (iosig) {
|
||||
sawiosig = 1;
|
||||
iosig = 0;
|
||||
}
|
||||
|
||||
if (!sawalarm && !sawiosig) {
|
||||
/*
|
||||
* Nothing to do. Wait for something.
|
||||
*/
|
||||
sigpause(omask);
|
||||
if (wasalarmed) { /* alarmed? */
|
||||
sawalarm = 1;
|
||||
wasalarmed = 0;
|
||||
}
|
||||
if (iosig) {
|
||||
sawiosig = 1;
|
||||
iosig = 0;
|
||||
}
|
||||
}
|
||||
(void)sigsetmask(omask);
|
||||
|
||||
if (sawiosig) {
|
||||
|
||||
do {
|
||||
tvzero.tv_sec = tvzero.tv_usec = 0;
|
||||
FD_SET(fd, &fds);
|
||||
n = select(fd+1, &fds, (fd_set *)0,
|
||||
(fd_set *)0, &tvzero);
|
||||
if (n > 0)
|
||||
doio(fd);
|
||||
} while (n > 0);
|
||||
|
||||
if (n == -1) {
|
||||
(void) fprintf(stderr, "%s: select: ",
|
||||
progname);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
sawiosig = 0;
|
||||
}
|
||||
if (sawalarm) {
|
||||
doalarm(fd);
|
||||
sawalarm = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doioonly - do I/O. This avoids the use of signals
|
||||
*/
|
||||
int
|
||||
doioonly(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
int n;
|
||||
fd_set fds;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
for (;;) {
|
||||
FD_SET(fd, &fds);
|
||||
n = select(fd+1, &fds, (fd_set *)0, (fd_set *)0,
|
||||
(struct timeval *)0);
|
||||
if (n > 0)
|
||||
doio(fd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doio - read a buffer full of stuff and print it out
|
||||
*/
|
||||
int
|
||||
doio(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
register char *rp, *rpend;
|
||||
register char *cp;
|
||||
register int i;
|
||||
char raw[512];
|
||||
struct timeval tv, tvd;
|
||||
int rlen;
|
||||
int ind;
|
||||
char cooked[2049];
|
||||
static char *digits = "0123456789abcdef";
|
||||
|
||||
rlen = read(fd, raw, sizeof(raw));
|
||||
if (rlen < 0) {
|
||||
(void) fprintf(stderr, "%s: read(): ", progname);
|
||||
perror("");
|
||||
return;
|
||||
}
|
||||
if (rlen == 0) {
|
||||
(void) printf("Zero length read\n");
|
||||
return;
|
||||
}
|
||||
|
||||
cp = cooked;
|
||||
rp = raw;
|
||||
rpend = &raw[rlen];
|
||||
ind = 0;
|
||||
|
||||
while (rp < rpend) {
|
||||
ind = 1;
|
||||
if (isprint(*rp))
|
||||
*cp++ = *rp;
|
||||
else {
|
||||
*cp++ = '<';
|
||||
*cp++ = digits[((*rp)>>4) & 0xf];
|
||||
*cp++ = digits[*rp & 0xf];
|
||||
*cp++ = '>';
|
||||
}
|
||||
if (
|
||||
#ifdef CLKLDISC
|
||||
(*rp == (char)magic1 || *rp == (char)magic2)
|
||||
#else
|
||||
( strchr( magic, *rp) != NULL )
|
||||
#endif
|
||||
) {
|
||||
rp++;
|
||||
ind = 0;
|
||||
*cp = '\0';
|
||||
if ((rpend - rp) < sizeof(struct timeval)) {
|
||||
(void)printf(
|
||||
"Too little data (%d): %s\n",
|
||||
rpend-rp, cooked);
|
||||
return;
|
||||
}
|
||||
|
||||
tv.tv_sec = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
tv.tv_sec <<= 8;
|
||||
tv.tv_sec |= ((long)*rp++) & 0xff;
|
||||
}
|
||||
tv.tv_usec = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
tv.tv_usec <<= 8;
|
||||
tv.tv_usec |= ((long)*rp++) & 0xff;
|
||||
}
|
||||
|
||||
tvd.tv_sec = tv.tv_sec - lasttv.tv_sec;
|
||||
tvd.tv_usec = tv.tv_usec - lasttv.tv_usec;
|
||||
if (tvd.tv_usec < 0) {
|
||||
tvd.tv_usec += 1000000;
|
||||
tvd.tv_sec--;
|
||||
}
|
||||
|
||||
(void)printf("%lu.%06lu %lu.%06lu %s\n",
|
||||
tv.tv_sec, tv.tv_usec, tvd.tv_sec, tvd.tv_usec,
|
||||
cooked);
|
||||
lasttv = tv;
|
||||
} else {
|
||||
rp++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ind) {
|
||||
*cp = '\0';
|
||||
(void)printf("Incomplete data: %s\n", cooked);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doalarm - send a string out the port, if we have one.
|
||||
*/
|
||||
int
|
||||
doalarm(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (cmd == NULL || cmdlen <= 0)
|
||||
return;
|
||||
|
||||
n = write(fd, cmd, cmdlen);
|
||||
|
||||
if (n < 0) {
|
||||
(void) fprintf(stderr, "%s: write(): ", progname);
|
||||
perror("");
|
||||
} else if (n < cmdlen) {
|
||||
(void) printf("Short write (%d bytes, should be %d)\n",
|
||||
n, cmdlen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* alarming - receive alarm interupt
|
||||
*/
|
||||
void
|
||||
alarming(void)
|
||||
{
|
||||
wasalarmed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ioready - handle SIGIO interrupt
|
||||
*/
|
||||
void
|
||||
ioready(void)
|
||||
{
|
||||
iosig = 1;
|
||||
}
|
544
contrib/ntp/clockstuff/propdelay.c
Normal file
544
contrib/ntp/clockstuff/propdelay.c
Normal file
@ -0,0 +1,544 @@
|
||||
/* propdelay.c,v 3.1 1993/07/06 01:05:24 jbj Exp
|
||||
* propdelay - compute propagation delays
|
||||
*
|
||||
* cc -o propdelay propdelay.c -lm
|
||||
*
|
||||
* "Time and Frequency Users' Manual", NBS Technical Note 695 (1977).
|
||||
*/
|
||||
|
||||
/*
|
||||
* This can be used to get a rough idea of the HF propagation delay
|
||||
* between two points (usually between you and the radio station).
|
||||
* The usage is
|
||||
*
|
||||
* propdelay latitudeA longitudeA latitudeB longitudeB
|
||||
*
|
||||
* where points A and B are the locations in question. You obviously
|
||||
* need to know the latitude and longitude of each of the places.
|
||||
* The program expects the latitude to be preceded by an 'n' or 's'
|
||||
* and the longitude to be preceded by an 'e' or 'w'. It understands
|
||||
* either decimal degrees or degrees:minutes:seconds. Thus to compute
|
||||
* the delay between the WWVH (21:59:26N, 159:46:00W) and WWV (40:40:49N,
|
||||
* 105:02:27W) you could use:
|
||||
*
|
||||
* propdelay n21:59:26 w159:46 n40:40:49 w105:02:27
|
||||
*
|
||||
* By default it prints out a summer (F2 average virtual height 350 km) and
|
||||
* winter (F2 average virtual height 250 km) number. The results will be
|
||||
* quite approximate but are about as good as you can do with HF time anyway.
|
||||
* You might pick a number between the values to use, or use the summer
|
||||
* value in the summer and switch to the winter value when the static
|
||||
* above 10 MHz starts to drop off in the fall. You can also use the
|
||||
* -h switch if you want to specify your own virtual height.
|
||||
*
|
||||
* You can also do a
|
||||
*
|
||||
* propdelay -W n45:17:47 w75:45:22
|
||||
*
|
||||
* to find the propagation delays to WWV and WWVH (from CHU in this
|
||||
* case), a
|
||||
*
|
||||
* propdelay -C n40:40:49 w105:02:27
|
||||
*
|
||||
* to find the delays to CHU, and a
|
||||
*
|
||||
* propdelay -G n52:03:17 w98:34:18
|
||||
*
|
||||
* to find delays to GOES via each of the three satellites.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ntp_stdlib.h"
|
||||
|
||||
extern double sin (double);
|
||||
extern double cos (double);
|
||||
extern double acos (double);
|
||||
extern double tan (double);
|
||||
extern double atan (double);
|
||||
extern double sqrt (double);
|
||||
|
||||
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
|
||||
|
||||
/*
|
||||
* Program constants
|
||||
*/
|
||||
#define EARTHRADIUS (6370.0) /* raduis of earth (km) */
|
||||
#define LIGHTSPEED (299800.0) /* speed of light, km/s */
|
||||
#define PI (3.1415926536)
|
||||
#define RADPERDEG (PI/180.0) /* radians per degree */
|
||||
#define MILE (1.609344) /* km in a mile */
|
||||
|
||||
#define SUMMERHEIGHT (350.0) /* summer height in km */
|
||||
#define WINTERHEIGHT (250.0) /* winter height in km */
|
||||
|
||||
#define SATHEIGHT (6.6110 * 6378.0) /* geosync satellite height in km
|
||||
from centre of earth */
|
||||
|
||||
#define WWVLAT "n40:40:49"
|
||||
#define WWVLONG "w105:02:27"
|
||||
|
||||
#define WWVHLAT "n21:59:26"
|
||||
#define WWVHLONG "w159:46:00"
|
||||
|
||||
#define CHULAT "n45:17:47"
|
||||
#define CHULONG "w75:45:22"
|
||||
|
||||
#define GOES_UP_LAT "n37:52:00"
|
||||
#define GOES_UP_LONG "w75:27:00"
|
||||
#define GOES_EAST_LONG "w75:00:00"
|
||||
#define GOES_STBY_LONG "w105:00:00"
|
||||
#define GOES_WEST_LONG "w135:00:00"
|
||||
#define GOES_SAT_LAT "n00:00:00"
|
||||
|
||||
char *wwvlat = WWVLAT;
|
||||
char *wwvlong = WWVLONG;
|
||||
|
||||
char *wwvhlat = WWVHLAT;
|
||||
char *wwvhlong = WWVHLONG;
|
||||
|
||||
char *chulat = CHULAT;
|
||||
char *chulong = CHULONG;
|
||||
|
||||
char *goes_up_lat = GOES_UP_LAT;
|
||||
char *goes_up_long = GOES_UP_LONG;
|
||||
char *goes_east_long = GOES_EAST_LONG;
|
||||
char *goes_stby_long = GOES_STBY_LONG;
|
||||
char *goes_west_long = GOES_WEST_LONG;
|
||||
char *goes_sat_lat = GOES_SAT_LAT;
|
||||
|
||||
int hflag = 0;
|
||||
int Wflag = 0;
|
||||
int Cflag = 0;
|
||||
int Gflag = 0;
|
||||
int height;
|
||||
|
||||
char *progname;
|
||||
int debug;
|
||||
|
||||
static void doit (double, double, double, double, double, char *);
|
||||
static double latlong (char *, int);
|
||||
static double greatcircle (double, double, double, double);
|
||||
static double waveangle (double, double, int);
|
||||
static double propdelay (double, double, int);
|
||||
static int finddelay (double, double, double, double, double, double *);
|
||||
static void satdoit (double, double, double, double, double, double, char *);
|
||||
static void satfinddelay (double, double, double, double, double *);
|
||||
static double satpropdelay (double);
|
||||
|
||||
/*
|
||||
* main - parse arguments and handle options
|
||||
*/
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *argv[]
|
||||
)
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
double lat1, long1;
|
||||
double lat2, long2;
|
||||
double lat3, long3;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = ntp_getopt(argc, argv, "dh:CWG")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
break;
|
||||
case 'h':
|
||||
hflag++;
|
||||
height = atof(ntp_optarg);
|
||||
if (height <= 0.0) {
|
||||
(void) fprintf(stderr, "height %s unlikely\n",
|
||||
ntp_optarg);
|
||||
errflg++;
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
Cflag++;
|
||||
break;
|
||||
case 'W':
|
||||
Wflag++;
|
||||
break;
|
||||
case 'G':
|
||||
Gflag++;
|
||||
break;
|
||||
default:
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || (!(Cflag || Wflag || Gflag) && ntp_optind+4 != argc) ||
|
||||
((Cflag || Wflag || Gflag) && ntp_optind+2 != argc)) {
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s [-d] [-h height] lat1 long1 lat2 long2\n",
|
||||
progname);
|
||||
(void) fprintf(stderr," - or -\n");
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s -CWG [-d] lat long\n",
|
||||
progname);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
|
||||
if (!(Cflag || Wflag || Gflag)) {
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(argv[ntp_optind + 2], 1);
|
||||
long2 = latlong(argv[ntp_optind + 3], 0);
|
||||
if (hflag) {
|
||||
doit(lat1, long1, lat2, long2, height, "");
|
||||
} else {
|
||||
doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
|
||||
"summer propagation, ");
|
||||
doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
|
||||
"winter propagation, ");
|
||||
}
|
||||
} else if (Wflag) {
|
||||
/*
|
||||
* Compute delay from WWV
|
||||
*/
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(wwvlat, 1);
|
||||
long2 = latlong(wwvlong, 0);
|
||||
if (hflag) {
|
||||
doit(lat1, long1, lat2, long2, height, "WWV ");
|
||||
} else {
|
||||
doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
|
||||
"WWV summer propagation, ");
|
||||
doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
|
||||
"WWV winter propagation, ");
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute delay from WWVH
|
||||
*/
|
||||
lat2 = latlong(wwvhlat, 1);
|
||||
long2 = latlong(wwvhlong, 0);
|
||||
if (hflag) {
|
||||
doit(lat1, long1, lat2, long2, height, "WWVH ");
|
||||
} else {
|
||||
doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
|
||||
"WWVH summer propagation, ");
|
||||
doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
|
||||
"WWVH winter propagation, ");
|
||||
}
|
||||
} else if (Cflag) {
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(chulat, 1);
|
||||
long2 = latlong(chulong, 0);
|
||||
if (hflag) {
|
||||
doit(lat1, long1, lat2, long2, height, "CHU ");
|
||||
} else {
|
||||
doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
|
||||
"CHU summer propagation, ");
|
||||
doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
|
||||
"CHU winter propagation, ");
|
||||
}
|
||||
} else if (Gflag) {
|
||||
lat1 = latlong(goes_up_lat, 1);
|
||||
long1 = latlong(goes_up_long, 0);
|
||||
lat3 = latlong(argv[ntp_optind], 1);
|
||||
long3 = latlong(argv[ntp_optind + 1], 0);
|
||||
|
||||
lat2 = latlong(goes_sat_lat, 1);
|
||||
|
||||
long2 = latlong(goes_west_long, 0);
|
||||
satdoit(lat1, long1, lat2, long2, lat3, long3,
|
||||
"GOES Delay via WEST");
|
||||
|
||||
long2 = latlong(goes_stby_long, 0);
|
||||
satdoit(lat1, long1, lat2, long2, lat3, long3,
|
||||
"GOES Delay via STBY");
|
||||
|
||||
long2 = latlong(goes_east_long, 0);
|
||||
satdoit(lat1, long1, lat2, long2, lat3, long3,
|
||||
"GOES Delay via EAST");
|
||||
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doit - compute a delay and print it
|
||||
*/
|
||||
static void
|
||||
doit(
|
||||
double lat1,
|
||||
double long1,
|
||||
double lat2,
|
||||
double long2,
|
||||
double h,
|
||||
char *str
|
||||
)
|
||||
{
|
||||
int hops;
|
||||
double delay;
|
||||
|
||||
hops = finddelay(lat1, long1, lat2, long2, h, &delay);
|
||||
printf("%sheight %g km, hops %d, delay %g seconds\n",
|
||||
str, h, hops, delay);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* latlong - decode a latitude/longitude value
|
||||
*/
|
||||
static double
|
||||
latlong(
|
||||
char *str,
|
||||
int islat
|
||||
)
|
||||
{
|
||||
register char *cp;
|
||||
register char *bp;
|
||||
double arg;
|
||||
double div;
|
||||
int isneg;
|
||||
char buf[32];
|
||||
char *colon;
|
||||
|
||||
if (islat) {
|
||||
/*
|
||||
* Must be north or south
|
||||
*/
|
||||
if (*str == 'N' || *str == 'n')
|
||||
isneg = 0;
|
||||
else if (*str == 'S' || *str == 's')
|
||||
isneg = 1;
|
||||
else
|
||||
isneg = -1;
|
||||
} else {
|
||||
/*
|
||||
* East is positive, west is negative
|
||||
*/
|
||||
if (*str == 'E' || *str == 'e')
|
||||
isneg = 0;
|
||||
else if (*str == 'W' || *str == 'w')
|
||||
isneg = 1;
|
||||
else
|
||||
isneg = -1;
|
||||
}
|
||||
|
||||
if (isneg >= 0)
|
||||
str++;
|
||||
|
||||
colon = strchr(str, ':');
|
||||
if (colon != NULL) {
|
||||
/*
|
||||
* in hhh:mm:ss form
|
||||
*/
|
||||
cp = str;
|
||||
bp = buf;
|
||||
while (cp < colon)
|
||||
*bp++ = *cp++;
|
||||
*bp = '\0';
|
||||
cp++;
|
||||
arg = atof(buf);
|
||||
div = 60.0;
|
||||
colon = strchr(cp, ':');
|
||||
if (colon != NULL) {
|
||||
bp = buf;
|
||||
while (cp < colon)
|
||||
*bp++ = *cp++;
|
||||
*bp = '\0';
|
||||
cp++;
|
||||
arg += atof(buf) / div;
|
||||
div = 3600.0;
|
||||
}
|
||||
if (*cp != '\0')
|
||||
arg += atof(cp) / div;
|
||||
} else {
|
||||
arg = atof(str);
|
||||
}
|
||||
|
||||
if (isneg == 1)
|
||||
arg = -arg;
|
||||
|
||||
if (debug > 2)
|
||||
(void) printf("latitude/longitude %s = %g\n", str, arg);
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* greatcircle - compute the great circle distance in kilometers
|
||||
*/
|
||||
static double
|
||||
greatcircle(
|
||||
double lat1,
|
||||
double long1,
|
||||
double lat2,
|
||||
double long2
|
||||
)
|
||||
{
|
||||
double dg;
|
||||
double l1r, l2r;
|
||||
|
||||
l1r = lat1 * RADPERDEG;
|
||||
l2r = lat2 * RADPERDEG;
|
||||
dg = EARTHRADIUS * acos(
|
||||
(cos(l1r) * cos(l2r) * cos((long2-long1)*RADPERDEG))
|
||||
+ (sin(l1r) * sin(l2r)));
|
||||
if (debug >= 2)
|
||||
printf(
|
||||
"greatcircle lat1 %g long1 %g lat2 %g long2 %g dist %g\n",
|
||||
lat1, long1, lat2, long2, dg);
|
||||
return dg;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* waveangle - compute the wave angle for the given distance, virtual
|
||||
* height and number of hops.
|
||||
*/
|
||||
static double
|
||||
waveangle(
|
||||
double dg,
|
||||
double h,
|
||||
int n
|
||||
)
|
||||
{
|
||||
double theta;
|
||||
double delta;
|
||||
|
||||
theta = dg / (EARTHRADIUS * (double)(2 * n));
|
||||
delta = atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2)) - theta;
|
||||
if (debug >= 2)
|
||||
printf("waveangle dist %g height %g hops %d angle %g\n",
|
||||
dg, h, n, delta / RADPERDEG);
|
||||
return delta;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* propdelay - compute the propagation delay
|
||||
*/
|
||||
static double
|
||||
propdelay(
|
||||
double dg,
|
||||
double h,
|
||||
int n
|
||||
)
|
||||
{
|
||||
double phi;
|
||||
double theta;
|
||||
double td;
|
||||
|
||||
theta = dg / (EARTHRADIUS * (double)(2 * n));
|
||||
phi = (PI/2.0) - atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2));
|
||||
td = dg / (LIGHTSPEED * sin(phi));
|
||||
if (debug >= 2)
|
||||
printf("propdelay dist %g height %g hops %d time %g\n",
|
||||
dg, h, n, td);
|
||||
return td;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* finddelay - find the propagation delay
|
||||
*/
|
||||
static int
|
||||
finddelay(
|
||||
double lat1,
|
||||
double long1,
|
||||
double lat2,
|
||||
double long2,
|
||||
double h,
|
||||
double *delay
|
||||
)
|
||||
{
|
||||
double dg; /* great circle distance */
|
||||
double delta; /* wave angle */
|
||||
int n; /* number of hops */
|
||||
|
||||
dg = greatcircle(lat1, long1, lat2, long2);
|
||||
if (debug)
|
||||
printf("great circle distance %g km %g miles\n", dg, dg/MILE);
|
||||
|
||||
n = 1;
|
||||
while ((delta = waveangle(dg, h, n)) < 0.0) {
|
||||
if (debug)
|
||||
printf("tried %d hop%s, no good\n", n, n>1?"s":"");
|
||||
n++;
|
||||
}
|
||||
if (debug)
|
||||
printf("%d hop%s okay, wave angle is %g\n", n, n>1?"s":"",
|
||||
delta / RADPERDEG);
|
||||
|
||||
*delay = propdelay(dg, h, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* satdoit - compute a delay and print it
|
||||
*/
|
||||
static void
|
||||
satdoit(
|
||||
double lat1,
|
||||
double long1,
|
||||
double lat2,
|
||||
double long2,
|
||||
double lat3,
|
||||
double long3,
|
||||
char *str
|
||||
)
|
||||
{
|
||||
double up_delay,down_delay;
|
||||
|
||||
satfinddelay(lat1, long1, lat2, long2, &up_delay);
|
||||
satfinddelay(lat3, long3, lat2, long2, &down_delay);
|
||||
|
||||
printf("%s, delay %g seconds\n", str, up_delay + down_delay);
|
||||
}
|
||||
|
||||
/*
|
||||
* satfinddelay - calculate the one-way delay time between a ground station
|
||||
* and a satellite
|
||||
*/
|
||||
static void
|
||||
satfinddelay(
|
||||
double lat1,
|
||||
double long1,
|
||||
double lat2,
|
||||
double long2,
|
||||
double *delay
|
||||
)
|
||||
{
|
||||
double dg; /* great circle distance */
|
||||
|
||||
dg = greatcircle(lat1, long1, lat2, long2);
|
||||
|
||||
*delay = satpropdelay(dg);
|
||||
}
|
||||
|
||||
/*
|
||||
* satpropdelay - calculate the one-way delay time between a ground station
|
||||
* and a satellite
|
||||
*/
|
||||
static double
|
||||
satpropdelay(
|
||||
double dg
|
||||
)
|
||||
{
|
||||
double k1, k2, dist;
|
||||
double theta;
|
||||
double td;
|
||||
|
||||
theta = dg / (EARTHRADIUS);
|
||||
k1 = EARTHRADIUS * sin(theta);
|
||||
k2 = SATHEIGHT - (EARTHRADIUS * cos(theta));
|
||||
if (debug >= 2)
|
||||
printf("Theta %g k1 %g k2 %g\n", theta, k1, k2);
|
||||
dist = sqrt(k1*k1 + k2*k2);
|
||||
td = dist / LIGHTSPEED;
|
||||
if (debug >= 2)
|
||||
printf("propdelay dist %g height %g time %g\n", dg, dist, td);
|
||||
return td;
|
||||
}
|
17
contrib/ntp/conf/README
Normal file
17
contrib/ntp/conf/README
Normal file
@ -0,0 +1,17 @@
|
||||
README file for directory ./conf of the NTP Version 4 distribution
|
||||
|
||||
This directory contains example run-time configuration files for the
|
||||
NTP Version 4 daemon ntpd. These files illustrate some of the more
|
||||
obtuse configurations you may run into. They are not likely to do
|
||||
anything good if run on machines other than their native spot, so don't
|
||||
just blindly copy something and put it up. Additional information can
|
||||
be found in the ./doc directory of the base directory.
|
||||
|
||||
See the Config.local.dist file in the base directory for an explanation
|
||||
of the defines used.
|
||||
|
||||
The files Config.* are used to generate fullblown binaries suitable for
|
||||
distribution with the systems shown as suffix. While this can result
|
||||
in some degree of useless code, the degree is small compared to the
|
||||
size of the baseline code. The files *.conf are representative NTP
|
||||
run-time configuration files, which normally live in /etc/ntp.conf.
|
35
contrib/ntp/conf/baldwin.conf
Normal file
35
contrib/ntp/conf/baldwin.conf
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
# baldwin.udel.edu
|
||||
#
|
||||
# This illustrates the use of an external clock with the local clock
|
||||
# driver, as well as a multicast server. The prefer keyword on the
|
||||
# local clock driver declares an external clock and that the time of
|
||||
# this server should not be wiggled by an NTP peer, unless the
|
||||
# external clock comes unstuck. Note the use of the multicast group
|
||||
# ID assigned to NTP, 224.0.1.1, which identifies this as a multicast
|
||||
# server rather than a broadcast one. The other NTP peers are known
|
||||
# stratum-1 chimes intended as backup should the external clock croak.
|
||||
#
|
||||
peer 127.127.1.0 prefer # local clock driver
|
||||
fudge 127.127.12.0 stratum 0 refid GPS
|
||||
broadcast 224.0.1.1 key 6 ttl 127
|
||||
peer rackety.udel.edu # (Sun4c/40 IPC)
|
||||
peer barnstable.udel.edu # (Sun4c/65 SS1+)
|
||||
peer mizbeaver.udel.edu #(Bancomm bc700LAN)
|
||||
peer pogo.udel.edu # (Sun4c/65 SS1+)
|
||||
#
|
||||
# Miscellaneous stuff
|
||||
#
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
statsdir /baldwin/ntpstats/ # directory for statistics files
|
||||
filegen peerstats file peerstats type day enable
|
||||
filegen loopstats file loopstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
#
|
||||
# Authentication stuff
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for keys file
|
||||
trustedkey 3 4 5 6 14 15 # define trusted keys
|
||||
requestkey 15 # key (7) for accessing server variables
|
||||
controlkey 15 # key (6) for accessing server variables
|
23
contrib/ntp/conf/beauregard.conf
Normal file
23
contrib/ntp/conf/beauregard.conf
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
# bearegard.udel.edu
|
||||
#
|
||||
server 127.127.18.1 # NIST ACTS modem driver
|
||||
fudge 127.127.18.1 time1 .0035
|
||||
phone atdt913034944774 atdt913034944785 atdt913034944774
|
||||
#phone atdt913034944812 atdt913034948497 atdt913034948022
|
||||
#
|
||||
# Miscellaneous stuff
|
||||
#
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
statsdir /beauregard/ntpstats/ # directory for statistics files
|
||||
filegen peerstats file peerstats type day enable
|
||||
filegen loopstats file loopstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
#
|
||||
# Authentication stuff
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for keys file
|
||||
trustedkey 3 4 5 6 14 15 # define trusted keys
|
||||
requestkey 15 # key (7) for accessing server variables
|
||||
controlkey 15 # key (6) for accessing server variables
|
42
contrib/ntp/conf/dewey.conf
Normal file
42
contrib/ntp/conf/dewey.conf
Normal file
@ -0,0 +1,42 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
#
|
||||
# Generic configuration file for UDel NTP stratum-2 time servers. Don't
|
||||
# forget each server should have a /etc/ntp.drift and /etc/ntp.keys file.
|
||||
#
|
||||
# Stratum-1 peers. Each server should chime two different stratum-1
|
||||
# servers from the following list. Each stratum-1 server should be used
|
||||
# only once.
|
||||
#
|
||||
#peer 128.8.10.1 # umd1.umd.edu
|
||||
#peer 18.72.0.3 version 2 # bitsy.mit.edu
|
||||
peer 132.249.16.1 # fuzz.sdsc.edu
|
||||
peer 128.118.46.3 version 2 # otc1.psu.edu
|
||||
#peer 128.9.2.129 # wwvb.isi.edu
|
||||
#peer 130.43.2.2 version 2 # apple.com
|
||||
#peer 16.1.0.22 # clepsydra.dec.com
|
||||
#peer 130.105.1.156 version 2 # clock.osf.orga
|
||||
#peer 128.96.60.5 version 2 # pi.bellcore.com
|
||||
#peer 128.4.1.1 # rackety.udel.edu
|
||||
#peer 129.116.3.5 # shorty.chpc.utexas.edu
|
||||
#
|
||||
# Stratum-2 peers. Each server should chime all of the others in this
|
||||
# list except itself.
|
||||
#
|
||||
peer 128.175.1.1 # huey.udel.edu (VAX)
|
||||
#peer 128.175.1.2 # dewey.udel.edu (VAX)
|
||||
peer 128.175.1.3 # louie.udel.edu (SPARC)
|
||||
peer 128.175.2.15 # snow-white.ee.udel.edu (SPARC)
|
||||
peer 128.175.7.4 # sol.cis.udel.edu (SPARC)
|
||||
#
|
||||
# Miscellaneous stuff
|
||||
#
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
#
|
||||
# Authentication stuff. Note the different authentication delay on
|
||||
# VAX and SPARC.
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for key file
|
||||
trustedkey 1 2 15 # define trusted keys
|
||||
requestkey 15 # key (7) for accessing server variables
|
||||
controlkey 15 # key (6) for accessing server variables
|
154
contrib/ntp/conf/grundoon.conf
Normal file
154
contrib/ntp/conf/grundoon.conf
Normal file
@ -0,0 +1,154 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
# grundoon.udel.edu
|
||||
#
|
||||
# This machine can best be described as the kitchen sink. It has, in
|
||||
# addition to the baseboard tty ports ttya and ttyb, an 8-line
|
||||
# Serial/Parallel Interface (SPIF) with ports ttyz00 through ttyz07. The
|
||||
# configuration includes the following drivers, clock addresses and Unix
|
||||
# device names.
|
||||
#
|
||||
# Local Clock 127.127.1.0 /dev/audio
|
||||
# PST 1020 WWV/WWVH Receiver 127.127.3.1 /dev/pst1
|
||||
# Spectracom 8170 WWVB Receiver 127.127.4.1 /dev/wwvb1
|
||||
# IRIG Audio Decoder 127.127.6.0 /dev/audio
|
||||
# Scratchbuilt CHU Receiver 127.127.7.1 /dev/chu1
|
||||
# NIST ACTS modem 127.127.18.1 /dev/acts1
|
||||
# Heath GC-1000 WWV Receiver 127.127.19.1 /dev/pst1
|
||||
# PPS Clock 127.127.22.1 none
|
||||
#
|
||||
# This machine has the kernel modifications described in the README.kern
|
||||
# file, as well as the tty_clk, tty_chu and ppsclock streams modules.
|
||||
#
|
||||
# Spectracom 8170/Netclock-2 WWVB receiver. This receiver is equipped
|
||||
# with a 1-pps and IRIG outputs. The 1-pps signal is connected via the
|
||||
# ppsclock streams module and the carrier detect line of the CHU
|
||||
# receiver below (ttyb). The IRIG signal is connected via an attenuator
|
||||
# to the audio port (/dev/audio). The propagation delay computed from
|
||||
# geographical coordinates is 8.8 ms, while the receiver delay
|
||||
# calibrated at the factory is 17.3 ms, for a total delay of 26.1 ms.
|
||||
# This is confirmed within 0.1 ms at the 1-pps signal output using a
|
||||
# portable cesium clock. We add a fudge time1 of 3.5 ms so the driver
|
||||
# time agrees with the 1-pps signal to within 1 ms. The fudge flag4 is
|
||||
# set to cause the receiver to dump the quality table once each day to
|
||||
# the clockstats file.
|
||||
|
||||
#
|
||||
#server 127.127.4.1 # /dev/wwvb1 -> /dev/ttyz03
|
||||
#fudge 127.127.4.1 time1 0.0035 flag4 1
|
||||
#
|
||||
# IRIG Audio Decoder. The IRGI signal of the Spectracom WWVB receiver is
|
||||
# connected to the audio codec via a resistor attenuator. We add a fudge
|
||||
# time1 of 3.5 ms so the driver agrees with the calibrated 1-pps signal
|
||||
# to within 0.1 ms. We also specify a reference ID of WWVB to indicate
|
||||
# the signal origin. Note the prefer keyword in the server line, which
|
||||
# favors this driver over all others that survive the clock selection
|
||||
# algorithm. See README.refclock for further insight on this feature.
|
||||
#
|
||||
server 127.127.6.0 prefer # /dev/audio
|
||||
fudge 127.127.6.0 time1 0.0005 refid WWVB
|
||||
|
||||
#
|
||||
# PST/Traconex 1020 WWV/WWVH Receier. The internal DIPswitches are set
|
||||
# as near as possible to the delays to WWV (8.8 ms) and WWVH (28.1 ms),
|
||||
# as computed from geographical coordinates. We add a fudge time1 of 5.9
|
||||
# ms so the driver time agrees with the 1-pps signal to within 1 ms for
|
||||
# WWV. We also set the stratum to 1, so this receiver will not normally
|
||||
# be selected, unless the primary WWVB receiver comes unstuck.
|
||||
#
|
||||
server 127.127.3.1 # /dev/pst1 -> ttyz05
|
||||
fudge 127.127.3.1 time1 0.0059 stratum 1
|
||||
|
||||
#
|
||||
# Scratchbuilt CHU Receiver. The audio signal from a computer controlled
|
||||
# CHU receiver is connected to a gadget box, which contains a 103A modem
|
||||
# chip and level converter operating at 300 bps. The propagation delay
|
||||
# computed from geographical coordinates is 3.0 ms, which is the value
|
||||
# of the fudge time1 parameter. We add a fudge time2 of 9.9 ms so that
|
||||
# the driver time agrees with the 1-pps signal to within a few ms,
|
||||
# ordinarily the best possible with this receiver. The fudge flag3 is
|
||||
# set because the 1-pps signal happens to be connected vit the carrier
|
||||
# detect line on this port (ttyb). We also set the stratum to 1, so this
|
||||
# receiver will not normally be selected, unless the primary WWVB
|
||||
# receiver comes unstuck.
|
||||
#
|
||||
server 127.127.7.1 # /dev/chu1 -> /dev/ttyb
|
||||
fudge 127.127.7.1 time1 0.0030 time2 0.0099 flag3 1 stratum 1
|
||||
|
||||
#
|
||||
# NIST Automated Computer Time Service. This driver calls a special
|
||||
# telephone number in Boulder, CO, to fetch the time directly from the
|
||||
# NIST cesium farm. The details of the complicated calling program are
|
||||
# in the README.refclock file. The Practical Peripherals 9600SA modem
|
||||
# does not work correctly with the ACTS echo-delay scheme for
|
||||
# automatically calculating the propagation delay, so the fudge flag2 is
|
||||
# set to disable the feature. Instead, we add a fudge time1 of 65.0 ms
|
||||
# so that the driver time agrees with th e1-pps signal to within 1 ms.
|
||||
# The phone command specifies three alternate telephone numbers,
|
||||
# including AT modem command prefix, which will be tried one after the
|
||||
# other at each measurement attempt. In this case, a cron job is used to
|
||||
# set fudge flag1, causing a measurement attempt, every six hours.
|
||||
#
|
||||
server 127.127.18.1 # /dev/acts1 -> /dev/ttyz00
|
||||
fudge 127.127.18.1 time1 0.0650 flag2 1
|
||||
phone atdt13034944774 atdt13034944785 atdt13034944774
|
||||
|
||||
#
|
||||
# Heath GC-1000 Most Accurate Clock. This is a WWV receiver with a
|
||||
# claimed accuracy better than 100 ms under "hi spec" conditions, but
|
||||
# such conditions are not frequent. The propagation delay DIPswitchs are
|
||||
# set to 9 ms, as close as possible to the 8.8 ms computed from
|
||||
# geographical coordinates. We add a fudge time2 of 40.0 ms so that the
|
||||
# driver time agrees with the 1-pps signal to within 50 ms, ordinarily
|
||||
# the best possible with this receiver. We also set the stratum to 1, so
|
||||
# this receiver will not normally be selected, unless the primary WWVB
|
||||
# receiver comes unstuck.
|
||||
#
|
||||
server 127.127.19.1 # /dev/heath1 -> ttyz07
|
||||
fudge 127.127.19.1 time1 0.040 stratum 1
|
||||
|
||||
#
|
||||
# Undisciplined Local Clock. This is a fake driver intended for backup
|
||||
# and when no outside source of synchronized time is available. The
|
||||
# default stratum is usually 3, but in this case we elect to use stratum
|
||||
# 0. Since the server line does not have the prefer keyword, this driver
|
||||
# is never used for synchronization, unless no other other
|
||||
# synchronization source is available. In case the local host is
|
||||
# controlled by some external source, such as an external oscillator or
|
||||
# another protocol, the prefer keyword would cause the local host to
|
||||
# disregard all other synchronization sources, unless the kernel
|
||||
# modifications are in use and declare an unsynchronized condition.
|
||||
#
|
||||
server 127.127.1.0 # local clock
|
||||
fudge 127.127.1.0 stratum 0
|
||||
|
||||
#
|
||||
# PPS Clock. This driver is used to capture a 1-pps signal when the PPS
|
||||
# kernel modifications are not in use. It can be configured for the
|
||||
# tty_clk or ppsclock streams module or no module at all, assuming the
|
||||
# RS232 connector is properly wired. Normally, the 1-pps signal is
|
||||
# generated by a radio clock, in this cast the Spectracom clock
|
||||
# 127.127.4.1 also configured for this host. When used this way, the
|
||||
# associated radio clock normally has the prefer keyword in the serve
|
||||
# command line. The PPS driver then will be selected only if the prefer
|
||||
# peer is operating within nominal error bounds. See the README.refclock
|
||||
# file for further details.
|
||||
#
|
||||
#server 127.127.22.1 # pps clock
|
||||
|
||||
#
|
||||
# Miscellaneous stuff. We enable authentication in order to prevent
|
||||
#
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
statsdir /grundoon/ntpstats/ # directory for statistics files
|
||||
filegen peerstats file peerstats type day enable
|
||||
filegen loopstats file loopstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
|
||||
#
|
||||
# Authentication stuff
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for keys file
|
||||
trustedkey 1 2 3 4 5 6 14 15 # define trusted keys
|
||||
requestkey 15 # key (7) for accessing server variables
|
||||
controlkey 15 # key (6) for accessing server variables
|
24
contrib/ntp/conf/malarky.conf
Normal file
24
contrib/ntp/conf/malarky.conf
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
#
|
||||
# This is for a broadcast/multicast client. Except for the statistics
|
||||
# stuff, this can be done with only a commmand line of the form
|
||||
#
|
||||
# /usr/local/bin/xntpd -a -k /usr/local/bin/ntp.keys -m -t 3
|
||||
#
|
||||
multicastclient # listen on default 224.0.1.1
|
||||
#
|
||||
# Miscellaneous stuff
|
||||
#
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
statsdir /malarky/ntpstats/ # directory for statistics files
|
||||
filegen peerstats file peerstats type day enable
|
||||
filegen loopstats file loopstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
#
|
||||
# Authentication stuff
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for key file
|
||||
trustedkey 3 4 5 6 14 # define trusted keys
|
||||
requestkey 14 # key (7) for accessing server variables
|
||||
controlkey 14 # key (6) for accessing server variables
|
30
contrib/ntp/conf/pogo.conf
Normal file
30
contrib/ntp/conf/pogo.conf
Normal file
@ -0,0 +1,30 @@
|
||||
#
|
||||
# NTP configuration file (ntp.conf)
|
||||
# pogo.udel.edu
|
||||
#
|
||||
server 127.127.10.1 prefer # austron 2201A gps receiver
|
||||
peer 128.4.1.1 # rackety.udel.edu (Sun4c/40 IPC)
|
||||
peer 128.4.1.2 # mizbeaver.udel.edu (Bancomm bc700LAN)
|
||||
peer 128.4.1.4 # barnstable.udel.edu (Sun4c/65 SS1+)
|
||||
peer 128.4.1.5 maxpoll 8 # churchy.udel.edu (cisco IGS router)
|
||||
peer 132.163.135.130 maxpoll 8 # time_A.timefreq.bldrdoc.gov (Cesium)
|
||||
peer 131.188.1.40 maxpoll 8 # ntps1-0.uni-erlangen.de (DCF77)
|
||||
peer 129.132.2.21 maxpoll 8 # swisstime.ethz.ch (DCF77)
|
||||
peer 130.155.98.13 maxpoll 8 # terss.ml.csiro.au (Cesium)
|
||||
peer 192.36.143.150 maxpoll 8 # Time1.Stupi.SE (Cesium)
|
||||
#
|
||||
# Miscellaneous stuff
|
||||
#
|
||||
precision -18 # clock reading precision (usec)
|
||||
driftfile /etc/ntp.drift # path for drift file
|
||||
statsdir /pogo/ntpstats/ # directory for statistics files
|
||||
filegen peerstats file peerstats type day enable
|
||||
filegen loopstats file loopstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
#
|
||||
# Authentication stuff
|
||||
#
|
||||
keys /usr/local/etc/ntp.keys # path for keys file
|
||||
trustedkey 3 4 5 6 14 # define trusted keys
|
||||
requestkey 15 # key (7) for accessing server variables
|
||||
controlkey 15 # key (6) for accessing server variables
|
1090
contrib/ntp/config.guess
vendored
Executable file
1090
contrib/ntp/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
887
contrib/ntp/config.h.in
Normal file
887
contrib/ntp/config.h.in
Normal file
@ -0,0 +1,887 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#undef __CHAR_UNSIGNED__
|
||||
#endif
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* debugging code */
|
||||
#undef DEBUG
|
||||
|
||||
/* Minutes per DST adjustment */
|
||||
#undef DSTMINUTES
|
||||
|
||||
/* MD5 authentication */
|
||||
#undef MD5
|
||||
|
||||
/* DES authentication (COCOM only) */
|
||||
#undef DES
|
||||
|
||||
/* time_t */
|
||||
#undef time_t
|
||||
|
||||
/* reference clock interface */
|
||||
#undef REFCLOCK
|
||||
|
||||
/* Audio CHU? */
|
||||
#undef AUDIO_CHU
|
||||
|
||||
/* ACTS modem service */
|
||||
#undef CLOCK_ACTS
|
||||
|
||||
/* Arbiter 1088A/B GPS receiver */
|
||||
#undef CLOCK_ARBITER
|
||||
|
||||
/* DHD19970505: ARCRON support. */
|
||||
#undef CLOCK_ARCRON_MSF
|
||||
|
||||
/* Austron 2200A/2201A GPS receiver */
|
||||
#undef CLOCK_AS2201
|
||||
|
||||
/* PPS interface */
|
||||
#undef CLOCK_ATOM
|
||||
|
||||
/* PPS auxiliary interface for ATOM */
|
||||
#undef PPS_SAMPLE
|
||||
|
||||
/* Datum/Bancomm bc635/VME interface */
|
||||
#undef CLOCK_BANC
|
||||
|
||||
/* ELV/DCF7000 clock */
|
||||
#undef CLOCK_DCF7000
|
||||
|
||||
/* HOPF 6021 clock */
|
||||
#undef CLOCK_HOPF6021
|
||||
|
||||
/* Meinberg clocks */
|
||||
#undef CLOCK_MEINBERG
|
||||
|
||||
/* DCF77 raw time code */
|
||||
#undef CLOCK_RAWDCF
|
||||
|
||||
/* RCC 8000 clock */
|
||||
#undef CLOCK_RCC8000
|
||||
|
||||
/* Schmid DCF77 clock */
|
||||
#undef CLOCK_SCHMID
|
||||
|
||||
/* Trimble GPS receiver/TAIP protocol */
|
||||
#undef CLOCK_TRIMTAIP
|
||||
|
||||
/* Trimble GPS receiver/TSIP protocol */
|
||||
#undef CLOCK_TRIMTSIP
|
||||
|
||||
/* WHARTON 400A Series protocol */
|
||||
#undef CLOCK_WHARTON_400A
|
||||
|
||||
/* VARITEXT protocol */
|
||||
#undef CLOCK_VARITEXT
|
||||
|
||||
/* Diems Computime Radio Clock */
|
||||
#undef CLOCK_COMPUTIME
|
||||
|
||||
/* Datum Programmable Time System */
|
||||
#undef CLOCK_DATUM
|
||||
|
||||
/* TrueTime GPS receiver/VME interface */
|
||||
#undef CLOCK_GPSVME
|
||||
|
||||
/* Heath GC-1000 WWV/WWVH receiver */
|
||||
#undef CLOCK_HEATH
|
||||
|
||||
/* HP 58503A GPS receiver */
|
||||
#undef CLOCK_HPGPS
|
||||
|
||||
/* Sun IRIG audio decoder */
|
||||
#undef CLOCK_IRIG
|
||||
|
||||
/* Rockwell Jupiter GPS clock */
|
||||
#undef CLOCK_JUPITER
|
||||
|
||||
/* Leitch CSD 5300 Master Clock System Driver */
|
||||
#undef CLOCK_LEITCH
|
||||
|
||||
/* local clock reference */
|
||||
#undef CLOCK_LOCAL
|
||||
|
||||
/* EES M201 MSF receiver */
|
||||
#undef CLOCK_MSFEES
|
||||
|
||||
/* Magnavox MX4200 GPS receiver */
|
||||
#undef CLOCK_MX4200
|
||||
|
||||
/* NMEA GPS receiver */
|
||||
#undef CLOCK_NMEA
|
||||
|
||||
/* Palisade clock */
|
||||
#undef CLOCK_PALISADE
|
||||
|
||||
/* PARSE driver interface */
|
||||
#undef CLOCK_PARSE
|
||||
|
||||
/* PARSE kernel PLL PPS support */
|
||||
#undef PPS_SYNC
|
||||
|
||||
/* PCL 720 clock support */
|
||||
#undef CLOCK_PPS720
|
||||
|
||||
/* PST/Traconex 1020 WWV/WWVH receiver */
|
||||
#undef CLOCK_PST
|
||||
|
||||
/* PTB modem service */
|
||||
#undef CLOCK_PTBACTS
|
||||
|
||||
/* clock thru shared memory */
|
||||
#undef CLOCK_SHM
|
||||
|
||||
/* Motorola UT Oncore GPS */
|
||||
#undef CLOCK_ONCORE
|
||||
|
||||
/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
|
||||
#undef CLOCK_TPRO
|
||||
|
||||
/* TRAK 8810 GPS receiver */
|
||||
#undef CLOCK_TRAK
|
||||
|
||||
/* Kinemetrics/TrueTime receivers */
|
||||
#undef CLOCK_TRUETIME
|
||||
|
||||
/* USNO modem service */
|
||||
#undef CLOCK_USNO
|
||||
|
||||
/* Spectracom 8170/Netclock/2 WWVB receiver */
|
||||
#undef CLOCK_WWVB
|
||||
|
||||
/* Ultralink M320 WWVB receiver */
|
||||
#undef CLOCK_ULINK
|
||||
|
||||
/* Chronolog K-series WWVB receiver */
|
||||
#undef CLOCK_CHRONOLOG
|
||||
|
||||
/* Dumb generic hh:mm:ss local clock */
|
||||
#undef CLOCK_DUMBCLOCK
|
||||
|
||||
/* define if we need to declare int errno; */
|
||||
#undef DECL_ERRNO
|
||||
|
||||
/* define if we may declare int h_errno; */
|
||||
#undef DECL_H_ERRNO
|
||||
|
||||
/* define if it's OK to declare char *sys_errlist[]; */
|
||||
#undef CHAR_SYS_ERRLIST
|
||||
|
||||
/* define if it's OK to declare int syscall P((int, struct timeval *, struct timeval *)); */
|
||||
#undef DECL_SYSCALL
|
||||
|
||||
/* define if we have syscall is buggy (Solaris 2.4) */
|
||||
#undef SYSCALL_BUG
|
||||
|
||||
/* Do we need extra room for SO_RCVBUF? (HPUX <8) */
|
||||
#undef NEED_RCVBUF_SLOP
|
||||
|
||||
/* Should we open the broadcast socket? */
|
||||
#undef OPEN_BCAST_SOCKET
|
||||
|
||||
/* Do we want the HPUX FindConfig()? */
|
||||
#undef NEED_HPUX_FINDCONFIG
|
||||
|
||||
/* canonical system (cpu-vendor-os) string */
|
||||
#undef STR_SYSTEM
|
||||
|
||||
/* define if NetInfo support is available */
|
||||
#undef HAVE_NETINFO
|
||||
|
||||
/* define if [gs]ettimeofday() only takes 1 argument */
|
||||
#undef SYSV_TIMEOFDAY
|
||||
|
||||
/* define if struct sockaddr has sa_len */
|
||||
#undef HAVE_SA_LEN_IN_STRUCT_SOCKADDR
|
||||
|
||||
/* define if struct clockinfo has hz */
|
||||
#undef HAVE_HZ_IN_STRUCT_CLOCKINFO
|
||||
|
||||
/* define if struct sigaction has sa_sigaction */
|
||||
#undef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION
|
||||
|
||||
/* define if struct clockinfo has tickadj */
|
||||
#undef HAVE_TICKADJ_IN_STRUCT_CLOCKINFO
|
||||
|
||||
/* define if struct ntptimeval uses time.tv_nsec instead of time.tv_usec */
|
||||
#undef HAVE_TV_NSEC_IN_NTPTIMEVAL
|
||||
|
||||
/* Does a system header defind struct ppsclockev? */
|
||||
#undef HAVE_STRUCT_PPSCLOCKEV
|
||||
|
||||
/* define if function prototypes are OK */
|
||||
#undef HAVE_PROTOTYPES
|
||||
|
||||
/* define if setpgrp takes 0 arguments */
|
||||
#undef HAVE_SETPGRP_0
|
||||
|
||||
/* hardwire a value for tick? */
|
||||
#undef PRESET_TICK
|
||||
|
||||
/* hardwire a value for tickadj? */
|
||||
#undef PRESET_TICKADJ
|
||||
|
||||
/* is adjtime() accurate? */
|
||||
#undef ADJTIME_IS_ACCURATE
|
||||
|
||||
/* should we NOT read /dev/kmem? */
|
||||
#undef NOKMEM
|
||||
|
||||
/* use UDP Wildcard Delivery? */
|
||||
#undef UDP_WILDCARD_DELIVERY
|
||||
|
||||
/* always slew the clock? */
|
||||
#undef SLEWALWAYS
|
||||
|
||||
/* step, then slew the clock? */
|
||||
#undef STEP_SLEW
|
||||
|
||||
/* force ntpdate to step the clock if !defined(STEP_SLEW) ? */
|
||||
#undef FORCE_NTPDATE_STEP
|
||||
|
||||
/* synch TODR hourly? */
|
||||
#undef DOSYNCTODR
|
||||
|
||||
/* do we set process groups with -pid? */
|
||||
#undef UDP_BACKWARDS_SETOWN
|
||||
|
||||
/* must we have a CTTY for fsetown? */
|
||||
#undef USE_FSETOWNCTTY
|
||||
|
||||
/* can we use SIGIO for tcp and udp IO? */
|
||||
#undef HAVE_SIGNALED_IO
|
||||
|
||||
/* can we use SIGPOLL for UDP? */
|
||||
#undef USE_UDP_SIGPOLL
|
||||
|
||||
/* can we use SIGPOLL for tty IO? */
|
||||
#undef USE_TTY_SIGPOLL
|
||||
|
||||
/* do we want the CHU driver? */
|
||||
#undef CLOCK_CHU
|
||||
|
||||
/* do we have the ppsclock streams module? */
|
||||
#undef PPS
|
||||
|
||||
/* do we have the tty_clk line discipline/streams module? */
|
||||
#undef TTYCLK
|
||||
|
||||
/* does the kernel support precision time discipline? */
|
||||
#undef KERNEL_PLL
|
||||
|
||||
/* does the kernel support multicasting IP? */
|
||||
#undef MCAST
|
||||
|
||||
/* do we have ntp_{adj,get}time in libc? */
|
||||
#undef NTP_SYSCALLS_LIBC
|
||||
|
||||
/* do we have ntp_{adj,get}time in the kernel? */
|
||||
#undef NTP_SYSCALLS_STD
|
||||
|
||||
/* do we have STREAMS/TLI? (Can we replace this with HAVE_SYS_STROPTS_H? */
|
||||
#undef STREAMS_TLI
|
||||
|
||||
/* do we need an s_char typedef? */
|
||||
#undef NEED_S_CHAR_TYPEDEF
|
||||
|
||||
/* does SIOCGIFCONF return size in the buffer? */
|
||||
#undef SIZE_RETURNED_IN_BUFFER
|
||||
|
||||
/* what is the name of TICK in the kernel? */
|
||||
#undef K_TICK_NAME
|
||||
|
||||
/* Is K_TICK_NAME (nsec_per_tick, for example) in nanoseconds? */
|
||||
#undef TICK_NANO
|
||||
|
||||
/* what is the name of TICKADJ in the kernel? */
|
||||
#undef K_TICKADJ_NAME
|
||||
|
||||
/* Is K_TICKADJ_NAME (hrestime_adj, for example) in nanoseconds? */
|
||||
#undef TICKADJ_NANO
|
||||
|
||||
/* what is (probably) the name of DOSYNCTODR in the kernel? */
|
||||
#undef K_DOSYNCTODR_NAME
|
||||
|
||||
/* what is (probably) the name of NOPRINTF in the kernel? */
|
||||
#undef K_NOPRINTF_NAME
|
||||
|
||||
/* do we need HPUX adjtime() library support? */
|
||||
#undef NEED_HPUX_ADJTIME
|
||||
|
||||
/* Might nlist() values require an extra level of indirection (AIX)? */
|
||||
#undef NLIST_EXTRA_INDIRECTION
|
||||
|
||||
/* Should we recommend a minimum value for tickadj? */
|
||||
#undef MIN_REC_TICKADJ
|
||||
|
||||
/* Is there a problem using PARENB and IGNPAR (IRIX)? */
|
||||
#undef NO_PARENB_IGNPAR
|
||||
|
||||
/* Should we not IGNPAR (Linux)? */
|
||||
#undef RAWDCF_NO_IGNPAR
|
||||
|
||||
/* Does the compiler like "volatile"? */
|
||||
#undef volatile
|
||||
|
||||
/* Does qsort expect to work on "void *" stuff? */
|
||||
#undef QSORT_USES_VOID_P
|
||||
|
||||
/* What is the fallback value for HZ? */
|
||||
#undef DEFAULT_HZ
|
||||
|
||||
/* Do we need to override the system's idea of HZ? */
|
||||
#undef OVERRIDE_HZ
|
||||
|
||||
/* Do we want the SCO clock hacks? */
|
||||
#undef SCO5_CLOCK
|
||||
|
||||
/* Do we want the ReliantUNIX clock hacks? */
|
||||
#undef RELIANTUNIX_CLOCK
|
||||
|
||||
/* Does the kernel have an FLL bug? */
|
||||
#undef KERNEL_FLL_BUG
|
||||
|
||||
/* Define if you have the TIOCGPPSEV ioctl (Solaris) */
|
||||
#undef HAVE_TIOCGPPSEV
|
||||
|
||||
/* Define if you have the TIOCSPPS ioctl (Solaris) */
|
||||
#undef HAVE_TIOCSPPS
|
||||
|
||||
/* Define if you have the CIOGETEV ioctl (SunOS, Linux) */
|
||||
#undef HAVE_CIOGETEV
|
||||
|
||||
/* Define if you have the TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, and ASYNC_PPS_CD_NEG ioctls (linux) */
|
||||
#undef HAVE_TIO_SERIAL_STUFF
|
||||
|
||||
/* Define if you use struct timespec rather than struct timeval (time in ns rather than us) */
|
||||
#undef HAVE_TIMESPEC
|
||||
|
||||
/* Define if you have the interface in the Draft RFC */
|
||||
#undef HAVE_PPSAPI
|
||||
|
||||
/* Do we need to #define _SVID3 when we #include <termios.h>? */
|
||||
#undef TERMIOS_NEEDS__SVID3
|
||||
|
||||
/* adjtime()? */
|
||||
#undef DECL_ADJTIME_0
|
||||
|
||||
/* bcopy()? */
|
||||
#undef DECL_BCOPY_0
|
||||
|
||||
/* bzero()? */
|
||||
#undef DECL_BZERO_0
|
||||
|
||||
/* cfset[io]speed()? */
|
||||
#undef DECL_CFSETISPEED_0
|
||||
|
||||
/* ioctl()? */
|
||||
#undef DECL_IOCTL_0
|
||||
|
||||
/* IPC? (bind, connect, recvfrom, sendto, setsockopt, socket) */
|
||||
#undef DECL_IPC_0
|
||||
|
||||
/* memmove()? */
|
||||
#undef DECL_MEMMOVE_0
|
||||
|
||||
/* mkstemp()? */
|
||||
#undef DECL_MKSTEMP_0
|
||||
|
||||
/* mktemp()? */
|
||||
#undef DECL_MKTEMP_0
|
||||
|
||||
/* mrand48()? */
|
||||
#undef DECL_MRAND48_0
|
||||
|
||||
/* nlist()? */
|
||||
#undef DECL_NLIST_0
|
||||
|
||||
/* plock()? */
|
||||
#undef DECL_PLOCK_0
|
||||
|
||||
/* rename()? */
|
||||
#undef DECL_RENAME_0
|
||||
|
||||
/* select()? */
|
||||
#undef DECL_SELECT_0
|
||||
|
||||
/* setitimer()? */
|
||||
#undef DECL_SETITIMER_0
|
||||
|
||||
/* setpriority()? */
|
||||
#undef DECL_SETPRIORITY_0
|
||||
#undef DECL_SETPRIORITY_1
|
||||
|
||||
/* sigvec()? */
|
||||
#undef DECL_SIGVEC_0
|
||||
|
||||
/* srand48()? */
|
||||
#undef DECL_SRAND48_0
|
||||
|
||||
/* stdio stuff? */
|
||||
#undef DECL_STDIO_0
|
||||
|
||||
/* stime()? */
|
||||
#undef DECL_STIME_0
|
||||
|
||||
/* strtol()? */
|
||||
#undef DECL_STRTOL_0
|
||||
|
||||
/* syslog() stuff? */
|
||||
#undef DECL_SYSLOG_0
|
||||
|
||||
/* time()? */
|
||||
#undef DECL_TIME_0
|
||||
|
||||
/* [gs]ettimeofday()? */
|
||||
#undef DECL_TIMEOFDAY_0
|
||||
|
||||
/* tolower()? */
|
||||
#undef DECL_TOLOWER_0
|
||||
|
||||
/* toupper()? */
|
||||
#undef DECL_TOUPPER_0
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The number of bytes in a long. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The number of bytes in a signed char. */
|
||||
#undef SIZEOF_SIGNED_CHAR
|
||||
|
||||
/* Define if you have the K_open function. */
|
||||
#undef HAVE_K_OPEN
|
||||
|
||||
/* Define if you have the __adjtimex function. */
|
||||
#undef HAVE___ADJTIMEX
|
||||
|
||||
/* Define if you have the __ntp_gettime function. */
|
||||
#undef HAVE___NTP_GETTIME
|
||||
|
||||
/* Define if you have the clock_settime function. */
|
||||
#undef HAVE_CLOCK_SETTIME
|
||||
|
||||
/* Define if you have the daemon function. */
|
||||
#undef HAVE_DAEMON
|
||||
|
||||
/* Define if you have the getbootfile function. */
|
||||
#undef HAVE_GETBOOTFILE
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
/* Define if you have the getrusage function. */
|
||||
#undef HAVE_GETRUSAGE
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the getuid function. */
|
||||
#undef HAVE_GETUID
|
||||
|
||||
/* Define if you have the kvm_open function. */
|
||||
#undef HAVE_KVM_OPEN
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memlk function. */
|
||||
#undef HAVE_MEMLK
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the mlockall function. */
|
||||
#undef HAVE_MLOCKALL
|
||||
|
||||
/* Define if you have the mrand48 function. */
|
||||
#undef HAVE_MRAND48
|
||||
|
||||
/* Define if you have the nice function. */
|
||||
#undef HAVE_NICE
|
||||
|
||||
/* Define if you have the nlist function. */
|
||||
#undef HAVE_NLIST
|
||||
|
||||
/* Define if you have the ntp_adjtime function. */
|
||||
#undef HAVE_NTP_ADJTIME
|
||||
|
||||
/* Define if you have the ntp_gettime function. */
|
||||
#undef HAVE_NTP_GETTIME
|
||||
|
||||
/* Define if you have the plock function. */
|
||||
#undef HAVE_PLOCK
|
||||
|
||||
/* Define if you have the pututline function. */
|
||||
#undef HAVE_PUTUTLINE
|
||||
|
||||
/* Define if you have the pututxline function. */
|
||||
#undef HAVE_PUTUTXLINE
|
||||
|
||||
/* Define if you have the random function. */
|
||||
#undef HAVE_RANDOM
|
||||
|
||||
/* Define if you have the rtprio function. */
|
||||
#undef HAVE_RTPRIO
|
||||
|
||||
/* Define if you have the sched_setscheduler function. */
|
||||
#undef HAVE_SCHED_SETSCHEDULER
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the setpgid function. */
|
||||
#undef HAVE_SETPGID
|
||||
|
||||
/* Define if you have the setpriority function. */
|
||||
#undef HAVE_SETPRIORITY
|
||||
|
||||
/* Define if you have the setsid function. */
|
||||
#undef HAVE_SETSID
|
||||
|
||||
/* Define if you have the settimeofday function. */
|
||||
#undef HAVE_SETTIMEOFDAY
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the sigaction function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the sigset function. */
|
||||
#undef HAVE_SIGSET
|
||||
|
||||
/* Define if you have the sigsuspend function. */
|
||||
#undef HAVE_SIGSUSPEND
|
||||
|
||||
/* Define if you have the sigvec function. */
|
||||
#undef HAVE_SIGVEC
|
||||
|
||||
/* Define if you have the srand48 function. */
|
||||
#undef HAVE_SRAND48
|
||||
|
||||
/* Define if you have the srandom function. */
|
||||
#undef HAVE_SRANDOM
|
||||
|
||||
/* Define if you have the stime function. */
|
||||
#undef HAVE_STIME
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the sysconf function. */
|
||||
#undef HAVE_SYSCONF
|
||||
|
||||
/* Define if you have the sysctl function. */
|
||||
#undef HAVE_SYSCTL
|
||||
|
||||
/* Define if you have the timer_create function. */
|
||||
#undef HAVE_TIMER_CREATE
|
||||
|
||||
/* Define if you have the timer_settime function. */
|
||||
#undef HAVE_TIMER_SETTIME
|
||||
|
||||
/* Define if you have the umask function. */
|
||||
#undef HAVE_UMASK
|
||||
|
||||
/* Define if you have the uname function. */
|
||||
#undef HAVE_UNAME
|
||||
|
||||
/* Define if you have the updwtmp function. */
|
||||
#undef HAVE_UPDWTMP
|
||||
|
||||
/* Define if you have the updwtmpx function. */
|
||||
#undef HAVE_UPDWTMPX
|
||||
|
||||
/* Define if you have the vsprintf function. */
|
||||
#undef HAVE_VSPRINTF
|
||||
|
||||
/* Define if you have the </sys/sync/queue.h> header file. */
|
||||
#undef HAVE__SYS_SYNC_QUEUE_H
|
||||
|
||||
/* Define if you have the </sys/sync/sema.h> header file. */
|
||||
#undef HAVE__SYS_SYNC_SEMA_H
|
||||
|
||||
/* Define if you have the <arpa/nameser.h> header file. */
|
||||
#undef HAVE_ARPA_NAMESER_H
|
||||
|
||||
/* Define if you have the <bstring.h> header file. */
|
||||
#undef HAVE_BSTRING_H
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <machine/inline.h> header file. */
|
||||
#undef HAVE_MACHINE_INLINE_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <net/if.h> header file. */
|
||||
#undef HAVE_NET_IF_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define if you have the <netinet/ip.h> header file. */
|
||||
#undef HAVE_NETINET_IP_H
|
||||
|
||||
/* Define if you have the <netinfo/ni.h> header file. */
|
||||
#undef HAVE_NETINFO_NI_H
|
||||
|
||||
/* Define if you have the <poll.h> header file. */
|
||||
#undef HAVE_POLL_H
|
||||
|
||||
/* Define if you have the <resolv.h> header file. */
|
||||
#undef HAVE_RESOLV_H
|
||||
|
||||
/* Define if you have the <sched.h> header file. */
|
||||
#undef HAVE_SCHED_H
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <sun/audioio.h> header file. */
|
||||
#undef HAVE_SUN_AUDIOIO_H
|
||||
|
||||
/* Define if you have the <sys/audioio.h> header file. */
|
||||
#undef HAVE_SYS_AUDIOIO_H
|
||||
|
||||
/* Define if you have the <sys/clkdefs.h> header file. */
|
||||
#undef HAVE_SYS_CLKDEFS_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/i8253.h> header file. */
|
||||
#undef HAVE_SYS_I8253_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the <sys/lock.h> header file. */
|
||||
#undef HAVE_SYS_LOCK_H
|
||||
|
||||
/* Define if you have the <sys/mman.h> header file. */
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
|
||||
/* Define if you have the <sys/modem.h> header file. */
|
||||
#undef HAVE_SYS_MODEM_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/pcl720.h> header file. */
|
||||
#undef HAVE_SYS_PCL720_H
|
||||
|
||||
/* Define if you have the <sys/ppsclock.h> header file. */
|
||||
#undef HAVE_SYS_PPSCLOCK_H
|
||||
|
||||
/* Define if you have the <sys/ppstime.h> header file. */
|
||||
#undef HAVE_SYS_PPSTIME_H
|
||||
|
||||
/* Define if you have the <sys/proc.h> header file. */
|
||||
#undef HAVE_SYS_PROC_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/sched.h> header file. */
|
||||
#undef HAVE_SYS_SCHED_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/sio.h> header file. */
|
||||
#undef HAVE_SYS_SIO_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/stream.h> header file. */
|
||||
#undef HAVE_SYS_STREAM_H
|
||||
|
||||
/* Define if you have the <sys/stropts.h> header file. */
|
||||
#undef HAVE_SYS_STROPTS_H
|
||||
|
||||
/* Define if you have the <sys/sysctl.h> header file. */
|
||||
#undef HAVE_SYS_SYSCTL_H
|
||||
|
||||
/* Define if you have the <sys/syssgi.h> header file. */
|
||||
#undef HAVE_SYS_SYSSGI_H
|
||||
|
||||
/* Define if you have the <sys/termios.h> header file. */
|
||||
#undef HAVE_SYS_TERMIOS_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/timepps.h> header file. */
|
||||
#undef HAVE_SYS_TIMEPPS_H
|
||||
|
||||
/* Define if you have the <sys/timers.h> header file. */
|
||||
#undef HAVE_SYS_TIMERS_H
|
||||
|
||||
/* Define if you have the <sys/timex.h> header file. */
|
||||
#undef HAVE_SYS_TIMEX_H
|
||||
|
||||
/* Define if you have the <sys/tpro.h> header file. */
|
||||
#undef HAVE_SYS_TPRO_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <timepps.h> header file. */
|
||||
#undef HAVE_TIMEPPS_H
|
||||
|
||||
/* Define if you have the <timex.h> header file. */
|
||||
#undef HAVE_TIMEX_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <utmp.h> header file. */
|
||||
#undef HAVE_UTMP_H
|
||||
|
||||
/* Define if you have the <utmpx.h> header file. */
|
||||
#undef HAVE_UTMPX_H
|
||||
|
||||
/* Define if you have the advapi32 library (-ladvapi32). */
|
||||
#undef HAVE_LIBADVAPI32
|
||||
|
||||
/* Define if you have the elf library (-lelf). */
|
||||
#undef HAVE_LIBELF
|
||||
|
||||
/* Define if you have the gen library (-lgen). */
|
||||
#undef HAVE_LIBGEN
|
||||
|
||||
/* Define if you have the kvm library (-lkvm). */
|
||||
#undef HAVE_LIBKVM
|
||||
|
||||
/* Define if you have the ld library (-lld). */
|
||||
#undef HAVE_LIBLD
|
||||
|
||||
/* Define if you have the mld library (-lmld). */
|
||||
#undef HAVE_LIBMLD
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have the rt library (-lrt). */
|
||||
#undef HAVE_LIBRT
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if compiler has function prototypes */
|
||||
#undef PROTOTYPES
|
||||
|
||||
/* Do we have struct ntptimeval? */
|
||||
#undef HAVE_STRUCT_NTPTIMEVAL
|
||||
|
||||
/* Does ntptimeval use struct timespec? */
|
||||
#undef TIMESPEC_IN_NTPTIMEVAL
|
||||
|
1215
contrib/ntp/config.sub
vendored
Executable file
1215
contrib/ntp/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
10546
contrib/ntp/configure
vendored
Executable file
10546
contrib/ntp/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
2896
contrib/ntp/configure.in
Normal file
2896
contrib/ntp/configure.in
Normal file
File diff suppressed because it is too large
Load Diff
18
contrib/ntp/dot.emacs
Normal file
18
contrib/ntp/dot.emacs
Normal file
@ -0,0 +1,18 @@
|
||||
;; This is how Dave Mills likes to see the code formatted.
|
||||
|
||||
(defconst ntp-c-style
|
||||
'((c-basic-offset . 8)
|
||||
(c-offsets-alist . ((arglist-intro . +)
|
||||
(case-label . *)
|
||||
(statement-case-intro . *)
|
||||
(statement-cont . *)
|
||||
(substatement-open . 0))))
|
||||
"Dave L. Mills; programming style for use with ntp")
|
||||
|
||||
(defun ntp-c-mode-common-hook ()
|
||||
;; add ntp c style
|
||||
(c-add-style "ntp" ntp-c-style nil))
|
||||
|
||||
(add-hook 'c-mode-common-hook 'ntp-c-mode-common-hook)
|
||||
|
||||
;; 1997112600
|
1
contrib/ntp/excludes
Normal file
1
contrib/ntp/excludes
Normal file
@ -0,0 +1 @@
|
||||
*.obj *.pch *.bsc *.pdb *.sbr nt*.zip *.tar *.gz *.ilk beta*.zip
|
219
contrib/ntp/html/accopt.htm
Normal file
219
contrib/ntp/html/accopt.htm
Normal file
@ -0,0 +1,219 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Access Control Options
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Access Control Options</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Access Control Support</H4>
|
||||
<TT>ntpd</TT> implements a general purpose address-and-mask based restriction
|
||||
list. The list is sorted by address and by mask, and the list is searched
|
||||
in this order for matches, with the last match found defining the restriction
|
||||
flags associated with the incoming packets. The source address of incoming
|
||||
packets is used for the match, with the 32-bit address being and'ed with
|
||||
the mask associated with the restriction entry and then compared with the
|
||||
entry's address (which has also been and'ed with the mask) to look for
|
||||
a match. Additional information and examples can be found in the <A HREF="notes.htm">Notes
|
||||
on Configuring NTP and Setting up a NTP Subnet </A>page.
|
||||
|
||||
<P>The restriction facility was implemented in conformance with the access
|
||||
policies for the original NSFnet backbone time servers. While this facility
|
||||
may be otherwise useful for keeping unwanted or broken remote time servers
|
||||
from affecting your own, it should not be considered an alternative to
|
||||
the standard NTP authentication facility. Source address based restrictions
|
||||
are easily circumvented by a determined cracker.
|
||||
<H4>
|
||||
Access Control Commands</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>restrict <I>numeric_address</I> [mask <I>numeric_mask</I>] [<I>flag</I>]
|
||||
[...]</TT></DT>
|
||||
|
||||
<DD>
|
||||
The <I><TT>numeric_address</TT></I> argument, expressed in dotted-quad
|
||||
form, is the address of an host or network. The <I><TT>mask</TT></I> argument,
|
||||
also expressed in dotted-quad form, defaults to <TT>255.255.255.255</TT>,
|
||||
meaning that the <I><TT>numeric_address</TT></I> is treated as the address
|
||||
of an individual host. A default entry (address <TT>0.0.0.0</TT>, mask
|
||||
<TT>0.0.0.0</TT>) is always included and, given the sort algorithm, is
|
||||
always the first entry in the list. Note that, while <I><TT>numeric_address</TT></I>
|
||||
is normally given in dotted-quad format, the text string <TT>default</TT>,
|
||||
with no mask option, may be used to indicate the default entry.</DD>
|
||||
|
||||
<DD>
|
||||
In the current implementation, <I><TT>flag</TT></I> always restricts access,
|
||||
i.e., an entry with no flags indicates that free access to the server is
|
||||
to be given. The flags are not orthogonal, in that more restrictive flags
|
||||
will often make less restrictive ones redundant. The flags can generally
|
||||
be classed into two catagories, those which restrict time service and those
|
||||
which restrict informational queries and attempts to do run-time reconfiguration
|
||||
of the server. One or more of the following flags may be specified:</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>ignore</TT></DT>
|
||||
|
||||
<DD>
|
||||
Ignore all packets from hosts which match this entry. If this flag is specified
|
||||
neither queries nor time server polls will be responded to.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>noquery</TT></DT>
|
||||
|
||||
<DD>
|
||||
Ignore all NTP mode 6 and 7 packets (i.e. information queries and configuration
|
||||
requests) from the source. Time service is not affected.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>nomodify</TT></DT>
|
||||
|
||||
<DD>
|
||||
Ignore all NTP mode 6 and 7 packets which attempt to modify the state of
|
||||
the server (i.e. run time reconfiguration). Queries which return information
|
||||
are permitted.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>notrap</TT></DT>
|
||||
|
||||
<DD>
|
||||
Decline to provide mode 6 control message trap service to matching hosts.
|
||||
The trap service is a subsystem of the mode 6 control message protocol
|
||||
which is intended for use by remote event logging programs.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>lowpriotrap</TT></DT>
|
||||
|
||||
<DD>
|
||||
Declare traps set by matching hosts to be low priority. The number of traps
|
||||
a server can maintain is limited (the current limit is 3). Traps are usually
|
||||
assigned on a first come, first served basis, with later trap requestors
|
||||
being denied service. This flag modifies the assignment algorithm by allowing
|
||||
low priority traps to be overridden by later requests for normal priority
|
||||
traps.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>noserve</TT></DT>
|
||||
|
||||
<DD>
|
||||
Ignore NTP packets whose mode is other than 6 or 7. In effect, time service
|
||||
is denied, though queries may still be permitted.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>nopeer</TT></DT>
|
||||
|
||||
<DD>
|
||||
Provide stateless time service to polling hosts, but do not allocate peer
|
||||
memory resources to these hosts even if they otherwise might be considered
|
||||
useful as future synchronization partners.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>notrust</TT></DT>
|
||||
|
||||
<DD>
|
||||
Treat these hosts normally in other respects, but never use them as synchronization
|
||||
sources.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>limited</TT></DT>
|
||||
|
||||
<DD>
|
||||
These hosts are subject to limitation of number of clients from the same
|
||||
net. Net in this context refers to the IP notion of net (class A, class
|
||||
B, class C, etc.). Only the first <TT>client_limit</TT> hosts that have
|
||||
shown up at the server and that have been active during the last <TT>client_limit_period</TT>
|
||||
seconds are accepted. Requests from other clients from the same net are
|
||||
rejected. Only time request packets are taken into account. Query packets
|
||||
sent by the <TT>ntpq</TT> and <TT>ntpdc</TT> programs are not subject to
|
||||
these limits. A history of clients is kept using the monitoring capability
|
||||
of <TT>ntpd</TT>. Thus, monitoring is always active as long as there is
|
||||
a restriction entry with the <TT>limited</TT> flag.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>ntpport</TT></DT>
|
||||
|
||||
<DD>
|
||||
This is actually a match algorithm modifier, rather than a restriction
|
||||
flag. Its presence causes the restriction entry to be matched only if the
|
||||
source port in the packet is the standard NTP UDP port (123). Both <TT>ntpport</TT>
|
||||
and <TT>non-ntpport</TT> may be specified. The <TT>ntpport</TT> is considered
|
||||
more specific and is sorted later in the list.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
</DL>
|
||||
|
||||
<DD>
|
||||
Default restriction list entries, with the flags <TT>ignore, ntpport</TT>,
|
||||
for each of the local host's interface addresses are inserted into the
|
||||
table at startup to prevent the server from attempting to synchronize to
|
||||
its own time. A default entry is also always present, though if it is otherwise
|
||||
unconfigured; no flags are associated with the default entry (i.e., everything
|
||||
besides your own NTP server is unrestricted).</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>clientlimit <I>limit</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Set the <TT>client_limit</TT> variable, which limits the number of simultaneous
|
||||
access-controlled clients. The default value for this variable is 3.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>clientperiod <I>period</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Set the <TT>client_limit_period</TT> variable, which specifies the number
|
||||
of seconds after which a client is considered inactive and thus no longer
|
||||
is counted for client limit restriction. The default value for this variable
|
||||
is 3600 seconds.</DD>
|
||||
</DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
170
contrib/ntp/html/assoc.htm
Normal file
170
contrib/ntp/html/assoc.htm
Normal file
@ -0,0 +1,170 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Release Notes
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Association Management</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Association Modes</H4>
|
||||
This release of the NTP Version 4 (NTPv4) daemon for Unix incorporates
|
||||
new features and refinements to the NTP Version 3 (NTPv3) algorithms. However,
|
||||
it continues the tradition of retaining backwards compatibility with older
|
||||
versions. The NTPv4 version has been under development for quite a while
|
||||
and isn't finished yet. In fact, quite a number of NTPv4 features have
|
||||
already been implemented in the current NTPv3, including a number of new
|
||||
operating modes for automatic server discovery and improved accuracy in
|
||||
occasionally-connected networks. Following is an extended abstract describing
|
||||
the new features..
|
||||
|
||||
<P>An ephemeral association of some mode is mobilized when a message arrives
|
||||
from another client or server. For instance, a symmetric-passive association
|
||||
is mobilized upon arrival of a message from a symmetric- active peer. A
|
||||
client association is mobilized upon arrival of a broadcast message from
|
||||
a multicast server or a server message from a manycast server. Ephemeral
|
||||
associations are demobilized when either (a) the server becomes unreachable
|
||||
or (b) an error occurs on initial contact before the association is mobilized.
|
||||
|
||||
<P>The one exception to (a) and (b) above is when
|
||||
<TT><A HREF="authopt.htm">autokey</A></TT> is in use and the initial
|
||||
authentication check fails due to unknown
|
||||
key identifier or autokey mismatch. This exception is necessary because
|
||||
the Unix kernel does not bind the local address until the first packet
|
||||
is received. The result in broadcast mode is a rather painful initial exchange,
|
||||
where authentication fails until after the first round of messages. The
|
||||
result in multicast mode is in general fatal, especially if multiple interfaces
|
||||
are in use. As promiscuous modes such as multicast and manycast require
|
||||
authentication for reliable and safe operation, autokey is in general useless
|
||||
with these modes until and if the input/output machinery is overhauled.
|
||||
|
||||
<P>Following is a summary of the protocol operations for each mode.
|
||||
|
||||
<P>Peer Modes (Active and Passive)
|
||||
<UL>In these modes, two client/server peers agree to back each other up,
|
||||
should the synchronization source for either peer fail. One or both peers
|
||||
is configured in symmetric-active mode using the peer command. Alternatively,
|
||||
one - the active peer - is configured in this mode and the other, the passive
|
||||
peer, operates in symmetric-passive mode and requires no prior configuration.
|
||||
Both association scenarios operate in NTPv4 as in NTPv3; however, several
|
||||
bugs in the handling of keys and recovery of resources when an active peer
|
||||
fails, have been corrected in NTPv4. The original NTPv3 authentication
|
||||
scheme is applicable in this mode, as well as the new NTPv3 autokey scheme.</UL>
|
||||
Client/Server Modes
|
||||
<UL>In these modes, a client sends a request to the server and expects
|
||||
a reply at some future time. The client is configured in client mode using
|
||||
the server (sic) command; the server requires no prior configuration. The
|
||||
original NTPv3 authentication scheme is applicable in this mode, as well
|
||||
as the new NTPv3 autokey scheme.</UL>
|
||||
Broadcast/Multicast Modes
|
||||
<UL>In these modes, the server generates messages at intervals specified
|
||||
by the minpoll subcommand. When using IP multicast addresses, the scope
|
||||
of the multicast tree is specified by the ttl subcommand in hops. When
|
||||
using a local interface broadcast address, the scope is limited to the
|
||||
attached subnet. The client responds to the first message received by waiting
|
||||
an interval randomized over the minpoll interval, in order to avoid implosions.
|
||||
Then, it polls the server in burst mode, in order to accumulate data to
|
||||
reliably set the host clock. This normally results in eight client/server
|
||||
cycles over a 32-s interval. When the next multicast message is received,
|
||||
the client computes the offset between the system clock just set and the
|
||||
apparent time of the multicast message in order to correct the apparent
|
||||
time in future multicast messages.</UL>
|
||||
Manycast Mode
|
||||
<UL>In this mode, a configured client broadcasts a request message as in
|
||||
client mode to a designated multicast group address. All servers configured
|
||||
as manycast clients and in ttl range respond with a server reply message.
|
||||
Each reply mobilizes a persistent client/server association as in client
|
||||
mode. Then, the NTP intersection and clustering algorithms act to discard
|
||||
all but the "best" of these associations, which then continue as in client/server
|
||||
mode.</UL>
|
||||
|
||||
<H4>
|
||||
Burst Mode</H4>
|
||||
Burst mode can be configured when the network attachment requires an initial
|
||||
calling or training procedure. Each poll initiates a burst of eight request
|
||||
messages at intervals randomized over the range 3-5 s. The reply messages
|
||||
update the clock filter, which then selects the best (most accurate) among
|
||||
them. When the last reply in the burst is sent, the next reply updates
|
||||
the client variables and system clock in the usual manner, as if only a
|
||||
single request/reply cycle had occurred. This mode does produce additional
|
||||
network overhead and can cause trouble if used indiscriminately. It should
|
||||
only be used where the poll interval is expected to settle to values above
|
||||
1024 s.
|
||||
<H4>
|
||||
Revised Error Checking</H4>
|
||||
It is very important to avoid spurious mobilizations from possibly broken
|
||||
or rogue servers; in particular, to avoid denial-of-service attacks. In
|
||||
order to resist such attacks, arriving messages that might mobilize ephemeral
|
||||
associations are carefully screened using a series of eleven sanity checks.
|
||||
<OL>
|
||||
<LI>
|
||||
Duplicate packet. This message is a duplicate of one previously received.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Bogus packet. This message did not result from a message previously sent,
|
||||
or messages have been received out of order.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Unsynchronized. The server has not yet stored the previous timestamps.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Invalid delay or dispersion. Either the delay or dispersion or both computed
|
||||
from the message timestamps are above the normal range.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Authentication failed. The sent MAC does not match the received MAC, either
|
||||
due to the wrong key material or damaged message.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Server unsynchronized. The server indicates unsynchronized in the leap
|
||||
bits included in the packet.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Server stratum check. The server is operating at a stratum above the normal
|
||||
range.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Delay/dispersion check. The related server packet data values are above
|
||||
the normal range.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Autokey failed. The hash of the current session key does not match the
|
||||
most recent key identifiers used. (The hash is repeated four times, in
|
||||
order to recover from lost packets whenever possible.)</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Access denied. The sender has been blocked by the access control list.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
Key not found. The key identifier does not match any identifier in the
|
||||
key list or the key has expired or been revoked.</LI>
|
||||
</OL>
|
||||
Failure to pass tests 5-11 is sufficient evidence to discard the packet
|
||||
without forming an association. However, failure to pass tests 1-4 is not
|
||||
necessarily grounds to reject the packet, since subsequent packets may
|
||||
be acceptable. In this case, the association is mobilized, but only the
|
||||
packet timestamps are stored. For the moment, and until the cryptographic
|
||||
signature algorithm is available, test 9 is temporarily disabled.
|
||||
<BR>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
<BR>
|
||||
</BODY>
|
||||
</HTML>
|
281
contrib/ntp/html/authopt.htm
Normal file
281
contrib/ntp/html/authopt.htm
Normal file
@ -0,0 +1,281 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Authentication Options
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Authentication Options
|
||||
</H3><HR>
|
||||
|
||||
<H4>Authentication Support</H4>
|
||||
|
||||
Authentication support allows the NTP client to verify that the server
|
||||
is in fact known and trusted and not an intruder intending accidentally
|
||||
or on purpose to masquerade as that server. The NTPv3 specification RFC-1305
|
||||
defines an scheme which provides cryptographic authentication of received
|
||||
NTP packets. Originally, this was done using the Data Encryption Standard
|
||||
(DES) operating in Cipher Block Chaining (CBC) mode, commonly called DES-CBC.
|
||||
Subsequently, this was augmented by the RSA Message Digest 5 (MD5) using
|
||||
a private key, commonly called keyed-MD5. Either algorithm computes a message
|
||||
digest, or one-way hash, which can be used to verify the server has the
|
||||
correct private key and key identifier. NTPv4 retains this scheme and,
|
||||
in addition, provides a new <I>autokey </I>scheme based on reverse hashing
|
||||
and public key cryptography. Authentication can be configured separately
|
||||
for each association using the <TT>key </TT>or <TT>autokey </TT>subcommands
|
||||
on the <TT>peer</TT>, <TT>server</TT>, <TT>broadcast</TT> and <TT>manycastclient</TT>
|
||||
commands as described in the <A HREF="config.htm">Configuration Options</A>
|
||||
page.
|
||||
|
||||
<P>The authentication options specify the suite of keys, select the key
|
||||
for each configured association and manage the configuration operations,
|
||||
as described below. The <TT>auth</TT> flag which controls these functions
|
||||
can be set or reset by the <TT>enable</TT> and <TT>disable</TT> configuration
|
||||
commands and also by remote configuration commands sent by a <TT>ntpdc</TT>
|
||||
program running in another machine. If this flag is set, persistent peer
|
||||
associations and remote configuration commands are effective only if cryptographically
|
||||
authenticated. If this flag is disabled, these operations are effective
|
||||
even if not cryptographic authenticated. It should be understood that operating
|
||||
in the latter mode invites a significant vulnerability where a rogue hacker
|
||||
can seriously disrupt client operations.
|
||||
|
||||
<P>The <TT>auth</TT> flag affects all authentication procedures described
|
||||
below; however, it operates differently if cryptographic support is compiled
|
||||
in the distribution. If this support is available and the flag is enabled,
|
||||
then persistent associations are mobilized and remote configuration commands
|
||||
are effective only if successfully authenticated. If the support is unavailable
|
||||
and the flag is enabled, then it is not possible under any conditions to
|
||||
mobilize persistent associations or respond to remote configuration commands.
|
||||
The <TT>auth </TT>flag normally defaults to set if cryptographic support
|
||||
is available and to reset otherwise.
|
||||
|
||||
<P>With the above vulnerabilities in mind, it is desirable to set the auth
|
||||
flag in all cases. One aspect which is often confusing is the name resolution
|
||||
process which maps server names in the configuration file to IP addresses.
|
||||
In order to protect against bogus name server messages, this process is
|
||||
authenticated using an internally generated key which is normally invisible
|
||||
to the user. However, if cryptographic support is unavailable and the <TT>auth</TT>
|
||||
flag is enabled, the name resolution process will fail. This can be avoided
|
||||
either by specifying IP addresses instead of host names, which is generally
|
||||
inadvisable, or by leaving the flag disabled and enabling it once the name
|
||||
resolution process is complete.
|
||||
<H4>
|
||||
Private Key Scheme</H4>
|
||||
The original RFC-1305 specification allows any one of possibly 65,536 keys,
|
||||
each distinguished a 32-bit key identifier, to authenticate an association.
|
||||
The servers involved must agree on the key and key identifier to authenticate
|
||||
their messages. Keys and related information are specified in a key file,
|
||||
usually called <TT>ntp.key</TT>s, which should be exchanged and stored
|
||||
using secure procedures beyond the scope of the NTP protocol itself. Besides
|
||||
the keys used for ordinary NTP associations, additional ones can be used
|
||||
as passwords for the <TT><A HREF="ntpq.htm">ntpq</A></TT> and <TT><A HREF="ntpdc.htm">ntpdc</A></TT>
|
||||
utility programs.
|
||||
|
||||
<P>When <TT>ntpd </TT>is first started, it reads the key file and installs
|
||||
the keys in the key cache. However, the keys must be activated before they
|
||||
can be used with the <TT>trusted </TT>command. This allows, for instance,
|
||||
the installation of possibly several batches of keys and then activating
|
||||
or inactivating each batch remotely using <TT>ntpdc</TT>. This also provides
|
||||
a revocation capability that can be used if a key becomes compromised.
|
||||
The <TT>requestkey </TT>command selects the key used as the password for
|
||||
the <TT>ntpdc </TT>utility, while the <TT>controlkey </TT>command selects
|
||||
the key used as the password for the the <TT>ntpq </TT>utility.
|
||||
<H4>
|
||||
Autokey Scheme</H4>
|
||||
The original NTPv3 authentication scheme described in RFC-1305 continues
|
||||
to be supported. In NTPv4, an additional authentication scheme called <I>autokey
|
||||
</I>is available. It operates much like the S-KEY scheme, in that a session
|
||||
key list is constructed and the entries used in reverse order. A description
|
||||
of the scheme, along with a comprehensive security analysis, is contained
|
||||
in a technical report available from the IETF web page <A HREF="www.ietf.org">www.ietf.org</A>
|
||||
.
|
||||
|
||||
<P>The autokey scheme is specifically designed for multicast modes, where
|
||||
clients normally do not send messages to the server. In these modes, the
|
||||
server uses the scheme to generate a key list by repeated hashing of a
|
||||
secret value. The list is used in reverse order to generate a unique session
|
||||
key for each message sent. The client regenerates the session key and verifies
|
||||
the hash matches the previous session key. Each message contains the public
|
||||
values binding the session key to the secret value, but these values need
|
||||
to be verified only when the server generates a new key list or more than
|
||||
four server messages have been lost.
|
||||
|
||||
<P>The scheme is appropriate for client/server and symmetric-peer modes
|
||||
as well. In these modes, the client generates a session key as in multicast
|
||||
modes. The server regenerates the session key and uses it to formulates
|
||||
a reply using its own public values. The client verifies the key identifier
|
||||
of the reply matches the request, verifies the public values and validates
|
||||
the message. In peer mode, each peer independently generates a key list
|
||||
and operates as in the multicast mode.
|
||||
|
||||
<P>The autokey scheme requires no change to the NTP packet header format
|
||||
or message authentication code (MAC), which is appended to the header;
|
||||
however, if autokey is in use, an extensions field is inserted between
|
||||
the header and MAC. The extensions field contains a random public value
|
||||
which is updated at intervals specified by the revoke command, together
|
||||
with related cryptographic values used in the signing algorithm. The format
|
||||
of the extensions field is defined in Internet Draft draft-NTP- auth-coexist-00.txt.
|
||||
The MAC itself is constructed in the same way as NTPv3, but using the original
|
||||
NTP header and the extensions field padded to a 64-bit boundary. Each new
|
||||
public value is encrypted by the host private value. It is the intent of
|
||||
the design, not yet finalized, that the public value, encrypted public
|
||||
value, public key and certificate be embedded in the extensions field where
|
||||
the client can decrypt as needed. However, the relatively expensive encryption
|
||||
and decryption operations are necessary only when the public value is changed.
|
||||
|
||||
<P>Note that both the original NTPv3 authentication scheme and the new
|
||||
NTPv4 autokey scheme operate separately for each configured association,
|
||||
so there may be several session key lists operating independently at the
|
||||
same time. Since all keys, including session keys, occupy the same key
|
||||
cache, provisions have been made to avoid collisions, where some random
|
||||
roll happens to collide with another already generated. Since something
|
||||
like four billion different session key identifiers are available, the
|
||||
chances are small that this might happen. If it happens during generation,
|
||||
the generator terminates the current session key list. By the time the
|
||||
next list is generated, the collided key will probably have been expired
|
||||
or revoked.
|
||||
|
||||
<P>While permanent keys have lifetimes that expire only when manually revoked,
|
||||
random session keys have a lifetime specified at the time of generation.
|
||||
When generating a key list for an association, the lifetime of each key
|
||||
is set to expire one poll interval later than it is scheduled to be used.
|
||||
The maximum lifetime of any key in the list is specified by the <TT>autokey</TT>
|
||||
command. Lifetime enforcement is a backup to the normal procedure that
|
||||
revokes the last-used key at the time the next key on the key list is used.
|
||||
<H4>
|
||||
Authentication Commands</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>keys <I>keyfile</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the file name containing the encryption keys and key identifiers
|
||||
used by <TT>ntpd</TT>, <TT>ntpq</TT> and <TT>ntpdc</TT> when operating
|
||||
in authenticated mode. The format of this file is described later in this
|
||||
document.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>trustedkey <I>key</I> [...]</TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the encryption key identifiers which are trusted for the purposes
|
||||
of authenticating peers suitable for synchronization, as well as keys used
|
||||
by the <TT>ntpq </TT>and <TT>ntpdc </TT>programs. The authentication procedures
|
||||
require that both the local and remote servers share the same key and key
|
||||
identifier for this purpose, although different keys can be used with different
|
||||
servers. The <I><TT>key</TT></I> arguments are 32-bit unsigned integers
|
||||
with values less than 65,536. Note that NTP key 0 is used to indicate an
|
||||
invalid key and/or key identifier, so should not be used for any other
|
||||
purpose.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>requestkey <I>key</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the key identifier to use with the <TT>ntpdc</TT> program, which
|
||||
uses a proprietary protocol specific to this implementation of <TT>ntpd</TT>.
|
||||
This program is useful to diagnose and repair problems that affect <TT>ntpd</TT>
|
||||
operation. The <I><TT>key</TT></I> argument to this command is a 32-bit
|
||||
key identifier for a previously defined trusted key. If no <TT>requestkey
|
||||
</TT>command is included in the configuration file, or if the keys don't
|
||||
match, any request to change a server variable with be denied.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>controlkey <I>key</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the key identifier to use with the <TT>ntpq</TT> program, which
|
||||
uses the standard protocol defined in RFC-1305. This program is useful
|
||||
to diagnose and repair problems that affect <TT>ntpd</TT> operation. The
|
||||
<I><TT>key</TT></I> argument to this command is a 32-bit key identifier
|
||||
for a trusted key in the key cache. If no <TT>controlkey </TT>command is
|
||||
included in the configuration file, or if the keys don't match, any request
|
||||
to change a server variable with be denied.</DD>
|
||||
</DL>
|
||||
|
||||
<H4>
|
||||
Authentication Key File Format</H4>
|
||||
In the case of DES, the keys are 56 bits long with, depending on type,
|
||||
a parity check on each byte. In the case of MD5, the keys are 64 bits (8
|
||||
bytes). <TT>ntpd</TT> reads its keys from a file specified using the <TT>-k</TT>
|
||||
command line option or the <TT>keys</TT> statement in the configuration
|
||||
file. While key number 0 is fixed by the NTP standard (as 56 zero bits)
|
||||
and may not be changed, one or more of the keys numbered 1 through 15 may
|
||||
be arbitrarily set in the keys file.
|
||||
|
||||
<P>The key file uses the same comment conventions as the configuration
|
||||
file. Key entries use a fixed format of the form
|
||||
|
||||
<P><I><TT>keyno type key</TT></I>
|
||||
|
||||
<P>where <I><TT>keyno</TT></I> is a positive integer, <I><TT>type</TT></I>
|
||||
is a single character which defines the key format, and <I><TT>key</TT></I>
|
||||
is the key itself.
|
||||
|
||||
<P>The key may be given in one of three different formats, controlled by
|
||||
the <I><TT>type</TT></I> character. The three key types, and corresponding
|
||||
formats, are listed following.
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>S</TT></DT>
|
||||
|
||||
<DD>
|
||||
The key is a 64-bit hexadecimal number in the format specified in the DES
|
||||
specification; that is, the high order seven bits of each octet are used
|
||||
to form the 56-bit key while the low order bit of each octet is given a
|
||||
value such that odd parity is maintained for the octet. Leading zeroes
|
||||
must be specified (i.e., the key must be exactly 16 hex digits long) and
|
||||
odd parity must be maintained. Hence a zero key, in standard format, would
|
||||
be given as <TT>0101010101010101</TT>.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>N</TT></DT>
|
||||
|
||||
<DD>
|
||||
The key is a 64-bit hexadecimal number in the format specified in the NTP
|
||||
standard. This is the same as the DES format, except the bits in each octet
|
||||
have been rotated one bit right so that the parity bit is now the high
|
||||
order bit of the octet. Leading zeroes must be specified and odd parity
|
||||
must be maintained. A zero key in NTP format would be specified as <TT>8080808080808080</TT>.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>A</TT></DT>
|
||||
|
||||
<DD>
|
||||
The key is a 1-to-8 character ASCII string. A key is formed from this by
|
||||
using the low order 7 bits of each ASCII character in the string, with
|
||||
zeroes added on the right when necessary to form a full width 56-bit key,
|
||||
in the same way that encryption keys are formed from Unix passwords.</DD>
|
||||
|
||||
<DD>
|
||||
</DD>
|
||||
|
||||
<DT>
|
||||
<TT>M</TT></DT>
|
||||
|
||||
<DD>
|
||||
The key is a 1-to-8 character ASCII string, using the MD5 authentication
|
||||
scheme. Note that both the keys and the authentication schemes (DES or
|
||||
MD5) must be identical between a set of peers sharing the same key number.</DD>
|
||||
</DL>
|
||||
Note that the keys used by the <TT>ntpq</TT> and <TT>ntpdc</TT> programs
|
||||
are checked against passwords requested by the programs and entered by
|
||||
hand, so it is generally appropriate to specify these keys in ASCII format.
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
259
contrib/ntp/html/biblio.htm
Normal file
259
contrib/ntp/html/biblio.htm
Normal file
@ -0,0 +1,259 @@
|
||||
<html><head><title>
|
||||
Protocol Conformance Statement
|
||||
</title></head><body><h3>
|
||||
Protocol Conformance Statement
|
||||
</h3>
|
||||
<BR><IMG align=left SRC="pic/flatheads.gif">From <i>The
|
||||
Wizard of Oz</i>, L. Frank Baum
|
||||
|
||||
<p>Say it three times and it must be right.
|
||||
<br clear=left>
|
||||
<hr>
|
||||
|
||||
<p>The Network Time Protocol (NTP) is used to synchronize the time of
|
||||
a computer client or server to another server or reference time source,
|
||||
such as a radio or satellite receiver or modem. It provides accuracies
|
||||
typically within a millisecond on LANs up to a few tens of milliseconds
|
||||
on WANs relative to Coordinated Universal Time (UTC), as provided by a
|
||||
Global Positioning Service (GPS) receiver, for example.
|
||||
|
||||
<p>Typical NTP configurations utilize multiple redundant servers and
|
||||
diverse network paths, in order to achieve high accuracy and
|
||||
reliability. Some configurations include cryptographic authentication to
|
||||
prevent accidental or malicious protocol attacks. Information on the NTP
|
||||
architecture, protocol and algorithms can be found in the following
|
||||
articles and reports, which are available online. General issues of the
|
||||
concepts and facilities assumed by NTP are discussed in tne <a
|
||||
href=exec.htm>Executive Summary - Computer Network Time
|
||||
Synchronization</a> page, while issues related to the NTP timescale and
|
||||
pending century are discussed in the <A HREF=y2k.htm> Network Time
|
||||
Protocol Year 2000 Conformance Statement</A> page, both of which are
|
||||
included in this document.
|
||||
|
||||
<p>Note that network timekeeping technology continues to advance and may
|
||||
obsolete some of the following documents. For a current list of all
|
||||
papers, reports, briefings and other documents relevant to the NTP
|
||||
community, see the <a href=http://www.eecis.udel.edu/~mills>David L.
|
||||
Mills</a> web page.
|
||||
|
||||
<P>The NTP architecture, protocol and algorithm models are described in
|
||||
|
||||
<UL>
|
||||
|
||||
<li>Mills, D.L. Internet time synchronization: the Network Time
|
||||
Protocol. <I>IEEE Trans. Communications COM-39, 10</I> (October 1991),
|
||||
1482-1493. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/trans.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/trans.pdf>
|
||||
PDF</a>. Also in: Yang, Z., and T.A. Marsland (Eds.). <I>Global States
|
||||
and Time in Distributed Systems</I>. IEEE Computer Society Press, Los
|
||||
Alamitos, CA, 1994, 91-102.
|
||||
</UL>
|
||||
|
||||
The NTP specification and implementation has evolved over the last two
|
||||
decades to the current Version 4 of the protocol. This version includes
|
||||
significant enhancements in accuracy and reliability, as determined by
|
||||
experience in an estimated total of well over 100,000 clients and
|
||||
servers in the Internet, while retaining backward compatibility with
|
||||
previous versions.
|
||||
|
||||
<P>This software distribution contains an implementation of the NTP
|
||||
Version 4 architecture, protocol and algorithms. While a formal
|
||||
specification of this version is not yet available, this version is
|
||||
fully compliant with the previous NTP Version 3 specification and
|
||||
implementation defined in
|
||||
<UL>
|
||||
|
||||
<li>Mills, D.L. Network Time Protocol (Version 3) specification,
|
||||
implementation and analysis. Network Working Group Report RFC-1305,
|
||||
University of Delaware, March 1992, 113 pp. Abstract: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305a.ps>
|
||||
PostScript)</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305a.pdf>
|
||||
PDF</A>, Body: <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305b.ps>
|
||||
PostScript)</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305b.pdf>
|
||||
PDF</A>, Appendices: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305c.ps>
|
||||
PostScript</a> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305c.pdf>
|
||||
PDF</A>.
|
||||
|
||||
</UL>
|
||||
|
||||
The NTP Version 4 implementation adds a number of extensions and
|
||||
refinements to the previous version, including an autonomous
|
||||
configuration and authentication capability, improved clock discipline
|
||||
algorithms capable of submicrosecond accuracy and many other
|
||||
refinements. Specific changes since the Version 3 specification was
|
||||
issued include:
|
||||
|
||||
<OL>
|
||||
|
||||
<p><LI>Support for precision-time kernel modifications, as described
|
||||
in</LI>
|
||||
|
||||
<P>Mills, D.L. Unix kernel modifications for precision time
|
||||
synchronization. Electrical Engineering Department Report 94-10-1,
|
||||
University of Delaware, October 1994, 24 pp. Abstract: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/kern/kerna.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/kern/kerna.pdf>
|
||||
PDF</a>, Body: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf>
|
||||
PDF</a>. Major revision and update of: Network Working Group Report
|
||||
RFC-1589, University of Delaware, March 1994. 31 pp. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc1589.txt>ASCII</A>
|
||||
|
||||
<p><LI>Support for IP Multicasting, as described in</LI>
|
||||
|
||||
<P>Mills, D.L, and A. Thyagarajan. Network time protocol version 4
|
||||
proposed changes. Electrical Engineering Department Report 94-10-2,
|
||||
University of Delaware, October 1994, 32 pp. Abstract: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/acts/actsa.ps>
|
||||
PostScript</A> | <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/acts/actsa.pdf>
|
||||
PDF</A>, Body: <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/acts/actsb.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/acts/actsb.pdf>
|
||||
PDF</a>
|
||||
|
||||
<p><LI>A new hybrid phase/frequency-lock clock discipline, which
|
||||
replaces the RFC-1305 local clock algorithm, as described in</LI>
|
||||
|
||||
|
||||
<P>Mills, D.L. Clock discipline algorithms for the Network Time Protocol
|
||||
Version 4. Electrical Engineering Report 97-3-3, University of Delaware,
|
||||
March 1997, 35 pp. Abstract: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/allan/securea.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/allan/securea.pdf>
|
||||
PDF</a>, Body: <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/reports/allan/secureb.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/allan/secureb.pdf>
|
||||
PDF</a>
|
||||
|
||||
<P>Mills, D.L. Improved algorithms for synchronizing computer network
|
||||
clocks. <I>IEEE/ACM Trans. Networks 3, 3</I> (June 1995), 245-254. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/tune2.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/tune2.pdf>
|
||||
PDF</a>
|
||||
|
||||
<P><LI>Engineered refinements to radio clock drivers and interface code,
|
||||
as describedin:</LI>
|
||||
|
||||
<P>Mills, D.L. Precision synchronization of computer network clocks.
|
||||
<I>ACM Computer Communication Review 24, 2</I> (April 1994). 28-43. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/fine.ps>
|
||||
PostScript</A> | <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/fine.pdf>
|
||||
PDF</a>
|
||||
|
||||
<P><LI>Support for over two dozen reference clock drivers for all known
|
||||
national and international radio, satellite and modem standard time
|
||||
services known at this time. See the <A HREF=refclock.htm>Reference
|
||||
Clock Drivers </A>page.</LI>
|
||||
|
||||
<P><LI>A new security model and authentication scheme based on public-
|
||||
key cryptography called <I>autokey</I>, as described in</LI>
|
||||
|
||||
<P>Mills, D.L., T.S. Glassey, and M.E. McNeil. Coexistence and
|
||||
interoperability of NTP authentication schemes. Internet Draft
|
||||
draft-mills-ntp-auth-coexist-00.txt, University of Delaware and Coastek
|
||||
InfoSys, Inc., November 1997, 8 pp. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/memos/draft.txt>ASCII</A>
|
||||
|
||||
<P>Mills, D.L. Authentication scheme for distributed, ubiquitous, real-
|
||||
time protocols. <I>Proc. Advanced Telecommunications/Information
|
||||
Distribution Research Program (ATIRP) Conference</I> (College Park MD,
|
||||
January 1997), 293-298. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/atirp.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/papers/atirp.pdf>
|
||||
PDF</a>
|
||||
|
||||
<P>Mills, D.L. Proposed authentication enhancements for the Network Time
|
||||
Protocol version 4. Electrical Engineering Report 96-10-3, University of
|
||||
Delaware, October 1996, 36 pp. Abstract: <A
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/secure/securea.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/secure/securea.pdf>
|
||||
PDF</a>, Body: <A
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/secure/secureb.ps>
|
||||
PostScript</A> | <a
|
||||
HREF=
|
||||
http://www.eecis.udel.edu/~mills/database/reports/secure/secureb.pdf>
|
||||
PDF</a>
|
||||
|
||||
<P><LI> Support for the MD5 cryptographic hash algorithm, in addition to
|
||||
the DES-CBC algorithm described in RFC-1305, as described in the <A
|
||||
HREF=ntpd.htm><TT>ntpd</TT> - Network Time Protocol (NTP) daemon
|
||||
</A>page.</LI>
|
||||
|
||||
<P><LI>The prefer-peer scheme, as described in the <A
|
||||
HREF=prefer.htm>Mitigation Rules and the <TT>prefer</TT> Keyword
|
||||
</A>page.</LI>
|
||||
|
||||
<P><LI>Specification for the Simple Network Time Protocol (SNTP), as
|
||||
described in</LI>
|
||||
|
||||
<P>Mills, D.L. Simple network time protocol (SNTP) version 4 for IPv4,
|
||||
IPv6 and OSI. Network Working Group Report RFC-2030, University of
|
||||
Delaware, October 1996, 18 pp. <A
|
||||
HREF=http://www.eecis.udel.edu/~mills/database/rfc/rfc2030.txt>
|
||||
ASCII</A>. Obsoletes RFC-1769 and RFC-1361.
|
||||
|
||||
<P><LI>Performance surveys for NTP Version 4 can be found in</LI>
|
||||
|
||||
<p><li>Mills, D.L., A. Thyagarajan and B.C. Huffman. Internet
|
||||
timekeeping around the globe. <i>Proc. Precision Time and Time Interval
|
||||
(PTTI) Applications and Planning Meeting</i> (Long Beach CA, December
|
||||
1997), 365-371. Paper: <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/papers/survey5.ps>
|
||||
PostScript</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/papers/survey5.pdf>
|
||||
PDF</a>, Slides: <a
|
||||
href=
|
||||
http://www.eecis.udel.edu/~mills/database/brief/survey/survey/index.htm>
|
||||
HTML</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/survey/survey.ps>
|
||||
PostScript</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/survey.ppt>
|
||||
PowerPoint</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/survey/survey.pdf>
|
||||
PDF</a></li>
|
||||
|
||||
<p><li>Mills, D.L. The network computer as precision timekeeper.
|
||||
<i>Proc. Precision Time and Time Interval (PTTI) Applications and
|
||||
Planning Meeting</i> (Reston VA, December 1996), 96-108. Paper: <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/papers/ptti.ps>
|
||||
PostScript</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/papers/ptti.pdf>
|
||||
PDF</a>, Slides: <a
|
||||
href=
|
||||
http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti/index.htm>
|
||||
HTML</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti.ps>
|
||||
PostScript</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti.ppt>
|
||||
PowerPoint</a> | <a
|
||||
href=http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti.pdf>
|
||||
PDF</a></li>
|
||||
|
||||
</OL>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
206
contrib/ntp/html/build.htm
Normal file
206
contrib/ntp/html/build.htm
Normal file
@ -0,0 +1,206 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Building and Installing the Distribution
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Building and Installing the Distribution
|
||||
</H3>
|
||||
|
||||
<img align=left src=pic/beaver.gif>From <i>pogo</i>, Walt Kelly
|
||||
|
||||
<p>For putting out compiler fires.
|
||||
<br clear=left><hr>
|
||||
|
||||
<H4>Building and Installing the Distribution</H4>
|
||||
|
||||
As a practical matter, every computer architecture and operating system
|
||||
version seems to be different than any other. The device drivers may be
|
||||
different, the input/output system may bew idiosyncratic and the
|
||||
libraries may have different semantics. It is not possible in a software
|
||||
distribution such as this one to support every individual sysdtem with a
|
||||
common set of binaries, even with the same system but different
|
||||
versions. Therefore, it is necessary to configure each system
|
||||
individually for each system and version, both at compile time and at
|
||||
run time. In almost all cases, these procedures are completely automatic
|
||||
and all the newbie user need do is type "make" and the autoconfigure
|
||||
system does the rest. There are some exceptions, as noted below.
|
||||
|
||||
<p>The autoconfigure system inspects the hardware and software
|
||||
environment and tests for the presence of system header files and the
|
||||
contents of these files to determine if certain features are available.
|
||||
When one or more of these features are present, the code is compiled to
|
||||
use them; if not, no special code is compiled. However, even if the code
|
||||
is compiled to use these features, the code does a special test at run
|
||||
time to see if one or more are actually present and avoids using them if
|
||||
not present. In such cases a warning message is sent to the system log,
|
||||
but the daemon should still work properly.
|
||||
|
||||
Some programs included in this distribution use cryptographic algorithms
|
||||
to verify server authenticity and credentials. As required by the
|
||||
International Trade in Arms Regulations (ITAR), now called the Defense
|
||||
Trade Regulations (DTR), certain cryptographic products and media,
|
||||
including the Data Encryption Standard (DES), cannot be exported without
|
||||
per-instance license. For this reason, the DES encryption routine has
|
||||
been removed from the the current version, even though it is used only
|
||||
to compute a message digest. Current DTR regulations allow export of the
|
||||
the MD5 message digest routine, which is in fact the preferred
|
||||
algorithm, and this is included in the current
|
||||
version.
|
||||
|
||||
<P>The NTP authentication routines conform to the interface used by RSA
|
||||
Laboratories in the <TT>rsaref20.zip</TT> package, which is downloadable
|
||||
from <TT>ftp.rsa.com</TT> or via the web at <TT>www.rsa.com</TT>.
|
||||
Outside the U.S. and Canada, the functionally identical
|
||||
<TT>rsaeuro.zip</TT> package is available from J.S.A. Kapp and other
|
||||
sources. The recommended way to integrate the DES routines in either
|
||||
package with the NTP build procedures is to copy the <TT>desc.c</TT>
|
||||
file from the <TT>./source</TT> directory in the package to the
|
||||
<TT>./libntp</TT> directory in the distribution. Then copy the header
|
||||
files <TT>rsaref.h</TT>, <TT>des.h</TT> and <TT>md2.h</TT> in the
|
||||
<TT>./source</TT> directory to the <TT>./include</TT> directory. Do not
|
||||
copy the <TT>global.h</TT> header file; the one in the distribution has
|
||||
been modified. These steps must be completed before the configuration
|
||||
process described below.
|
||||
|
||||
<H4>Building and Installing under Unix</H4>
|
||||
|
||||
Make sure that you have all necessary tools for building executables.
|
||||
These tools include <TT>cc/gcc, make, awk, sed, tr, sh, grep, egrep</TT>
|
||||
and a few others. Not all of these tools exist in the standard
|
||||
distribution of modern Unix versions (compilers are likely to be an
|
||||
add-on product - consider using the GNU tools and <TT>gcc</TT>
|
||||
compiler in this case). For a successful build, all of these tools
|
||||
should be accessible via the current path.
|
||||
|
||||
<H4>Configuration</H4>
|
||||
|
||||
Use the <TT>./configure</TT> command to perform an automatic
|
||||
configuration procedure. This procedure normally includes the debugging
|
||||
code, which can be useful in diagnosing problems found in initial test,
|
||||
and all reference clock drivers known to work with each machine and
|
||||
operating system. Unless memory space is at a premium, this is a
|
||||
sensible strategy and saves lots of messy fiddling. If you need to
|
||||
delete either the debugging code or one or more or all reference clock
|
||||
drivers to save space, see the <A HREF="config.htm">Configuration
|
||||
Options</A> page.
|
||||
|
||||
<P>If your site supports multiple architectures and uses NFS to share
|
||||
files, you can use a single source tree to compile executables for all
|
||||
architectures. While running on a target architecture machine and with
|
||||
the distribution base directory active, create a subdirectory using a
|
||||
command like <TT>mkdir A.`config.guess`</TT>, which will create an
|
||||
architecture-specific directory with name peculiar to the architecture
|
||||
and operating system. Then change to this directory and configure with
|
||||
the <TT>../configure</TT> command. The remaining steps are the same
|
||||
whether building in the base directory or in the subdirectory.
|
||||
|
||||
<H4>Compilation</H4>
|
||||
|
||||
Peruse the operating-system-specific information for your architecture
|
||||
under <A HREF="hints.htm">Hints and Kinks</A>.
|
||||
|
||||
<P>Use the <TT>make</TT> command to compile all source modules,
|
||||
construct the libraries and link the distribution. Expect few or no
|
||||
warnings using <TT>cc</TT> and a moderate level of warnings using
|
||||
<TT>gcc</TT>. Note: On some Unix platforms the use of <TT>gcc</TT> can
|
||||
result in quite a few complaints about system header files and type
|
||||
inconsistencies, especially about pointer variables. This is usually the
|
||||
case when the system header files are not up to ANSI standards or
|
||||
<TT>gcc</TT>-isms, when gcc is not installed properly, or when operating
|
||||
system updates and patches are applied and gcc is not reinstalled. While
|
||||
the autoconfigure process is quite thorough, the Unix programming
|
||||
cultures of the various workstation makers still remain idiosyncratic.
|
||||
|
||||
<H4>Installation</H4>
|
||||
|
||||
As root, use the <TT>make install</TT> command to install the binaries
|
||||
in the destination directory. You must of course have write permission
|
||||
on the install destination directory. This includes the programs <TT><A
|
||||
HREF="ntpd.htm">ntpd</A></TT> (the daemon), <TT><A
|
||||
HREF="ntpdc.htm">ntpdc</A></TT> (an <TT>ntpd</TT>-dependent query
|
||||
program), <TT><A HREF="ntpq.htm">ntpq</A></TT> (a standard query
|
||||
program), <TT><A HREF="ntpdate.htm">ntpdate</A></TT> (an <TT>rdate</TT>
|
||||
replacement for boot time date setting and sloppy time keeping) and
|
||||
<TT><A HREF="ntptrace.htm">ntptrace</A></TT> (a utility useful to find
|
||||
the primary (stratum-1) servers). In some systems, the <TT><A
|
||||
HREF="tickadj.htm">tickadj</A></TT> (a utility useful to adjust kernel
|
||||
variables) is installed. If the precision time kernel modifications are
|
||||
present, the <TT><A HREF="ntptime.htm">ntptime</A></TT> (a utility
|
||||
useful to debug kernel time functions) is installed.
|
||||
|
||||
<P>You are now ready to configure the daemon and start it. You will need
|
||||
to create a NTP configuration file <TT>ntp.conf</TT> and possibly a
|
||||
cryptographic key file <TT>ntp.keys</TT>. Directions for doing that are
|
||||
in the <A HREF="notes.htm">Notes on Configuring NTP and Setting up a NTP
|
||||
Subnet</A>. The behavior when the daemon starts for the first time can
|
||||
be counterintuitive. To reduce the level of angst, see the <a
|
||||
href=quick.htm>Quick Start</a> page. A tutorial on debugging technique
|
||||
is in <A HREF="debug.htm">NTP Debugging Technique</A>.
|
||||
|
||||
<P>If problems peculiar to the particular hardware and software
|
||||
environment (e.g. operating system -specific issues) are suspected,
|
||||
browse the <A HREF="hints.htm">Hints and Kinks</A> page.
|
||||
|
||||
<P>Bug reports of a general nature can be sent to David Mills <A
|
||||
HREF="mailto: mills@udel.edu"><mills@udel.edu></A>. Bug reports of a
|
||||
specific nature on features implemented by the programmer corps
|
||||
mentioned in the <A HREF="copyright.htm">Copyright</A> page should be
|
||||
sent directly to the implementor listed in that page, with copy to
|
||||
mills@udel.edu.
|
||||
|
||||
<P><B>Please include the version of the source distribution (e.g., ntp-
|
||||
4.0.70a) in your bug report.</B>
|
||||
|
||||
<P><B>Please include the <B>output</B> of <TT>config.guess</TT> in your
|
||||
bug report.</B>
|
||||
|
||||
<P><B>It will look something like: <TT>pdp11-dec-fuzzos3.4</TT></B>
|
||||
|
||||
<P>Additional <TT>make</TT> commands
|
||||
|
||||
<DL>
|
||||
|
||||
<DT><TT>make clean</TT></DT>
|
||||
|
||||
<DD>Cleans out object files, programs and temporary files.</DD>
|
||||
|
||||
<DT><TT>make distclean</TT></DT>
|
||||
|
||||
<DD>Does the work of <TT>clean</TT>, but cleans out all directories in
|
||||
preparation for a new distribution release.</DD>
|
||||
|
||||
<DT><TT>make dist</TT></DT>
|
||||
|
||||
<DD>
|
||||
Does the work of <TT>make distclean</TT>, but constructs compressed tar
|
||||
files for distribution. You must have GNU automake to perform this
|
||||
function.</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
<H4>Building and Installing under Windows NT</H4>
|
||||
|
||||
Under Windows NT, you will need <TT>Visual C++ 5.0</TT> or above,
|
||||
<TT>InstallShield</TT> SDK, <TT>Perl5</TT> and some version of the
|
||||
archiving program <TT>ZIP</TT>. Note that the version of
|
||||
<TT>InstallShield</TT> that comes with VC++5.0 is not useable here,
|
||||
since it does not include the command line tools.
|
||||
|
||||
<P>See the <TT>./scripts/wininstall/readme.nt</TT> file for directions
|
||||
to compile the sources, build the libraries and link the executables.
|
||||
Initiate the build by running either <TT>bldrel.bat</TT> or
|
||||
<TT>blddbg.bat</TT> to compile all of the source and create an
|
||||
<TT>InstallShield</TT> based graphical installation package.
|
||||
|
||||
<P>To install the executables, make sure that you are logged in as a
|
||||
system account, or one with administrator privileges such as the
|
||||
"administrator" account. As part of the build an <TT>InstallShield</TT>
|
||||
based graphical installer was created. Run
|
||||
<TT>\ntp\scripts\wininstall\intel\disk1\setup.exe</TT> to begin the
|
||||
installation. This installer will prompt for basic defaults,
|
||||
copy the binaries, install the service, and start it up. The other
|
||||
option is to run <TT>\ntp\scripts\wininstall\distrib\install.bat</TT>
|
||||
which will do the basic installation from the command line.
|
||||
|
||||
<hr><a href=index.htm><img align=left
|
||||
src=pic/home.gif></a><address><a href="mailto:mills@udel.edu"> David L.
|
||||
Mills <mills@udel.edu></a>
|
||||
</address></body></html>
|
193
contrib/ntp/html/clockopt.htm
Normal file
193
contrib/ntp/html/clockopt.htm
Normal file
@ -0,0 +1,193 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Reference Clock Options
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Reference Clock Options
|
||||
</H3><HR>
|
||||
|
||||
<H4>Reference Clock Support</H4>
|
||||
|
||||
The NTP Version 4 daemon supports many different radio, satellite and
|
||||
modem reference clocks plus a special pseudo-clock used for backup or
|
||||
when no other clock source is available. Detailed descriptions of
|
||||
individual device drivers and options can be found in the <A
|
||||
HREF="refclock.htm">Reference Clock Drivers </A>page. Additional
|
||||
information can be found in the pages referenced there, including the <A
|
||||
HREF="rdebug.htm">Debugging Hints for Reference Clock Drivers</A> and <A
|
||||
HREF="howto.html">How To Write a Reference Clock Driver</A> pages. In
|
||||
many drivers, support for a PPS signal is available as described in <A
|
||||
HREF="pps.htm">Pulse-per-second (PPS) Signal Interfacing</A> page. Many
|
||||
drivers support special line discipline/streams modules which can
|
||||
significantly improve the accuracy using the driver. These are described
|
||||
in the <A HREF="ldisc.htm">Line Disciplines and Streams Drivers</A>
|
||||
page.
|
||||
|
||||
<P>A reference clock will generally (though not always) be a radio
|
||||
timecode receiver which is synchronized to a source of standard time
|
||||
such as the services offered by the NRC in Canada and NIST and USNO in
|
||||
the U.S. The interface between the computer and the timecode receiver is
|
||||
device dependent, but is usually a serial port. A device driver specific
|
||||
to each reference clock must be selected and compiled in the
|
||||
distribution; however, most common radio, satellite and modem clocks are
|
||||
included by default. Note that an attempt to configure a reference clock
|
||||
when the driver has not been included or the hardware port has not been
|
||||
appropriately configured results in a scalding remark to the system log
|
||||
file, but is otherwise non hazardous.
|
||||
|
||||
<P>For the purposes of configuration, <TT>ntpd</TT> treats reference
|
||||
clocks in a manner analogous to normal NTP peers as much as possible.
|
||||
Reference clocks are identified by a syntactically correct but invalid
|
||||
IP address, in order to distinguish them from normal NTP peers.
|
||||
Reference clock addresses are of the form <TT>127.127.<I>t.u</I></TT>,
|
||||
where <I><TT>t</TT></I> is an integer denoting the clock type and
|
||||
<I><TT>u</TT></I> indicates the unit number. While it may seem overkill,
|
||||
it is in fact sometimes useful to configure multiple reference clocks of
|
||||
the same type, in which case the unit numbers must be unique.
|
||||
|
||||
<P>The <TT>server</TT> command is used to configure a reference clock,
|
||||
where the <I><TT>address</TT></I> argument in that command is the clock
|
||||
address. The <TT>key</TT>, <TT>version</TT> and <TT>ttl</TT> options are
|
||||
not used for reference clock support. The <TT>mode</TT> option is added
|
||||
for reference clock support, as described below. The <TT>prefer</TT>
|
||||
option can be useful to persuade the server to cherish a reference clock
|
||||
with somewhat more enthusiasm than other reference clocks or peers.
|
||||
Further information on this option can be found in the <A
|
||||
HREF="prefer.htm">Mitigation Rules and the <TT>prefer</TT> Keyword
|
||||
</A>page. The <TT>minpoll</TT> and <TT>maxpoll</TT> options have meaning
|
||||
only for selected clock drivers. See the individual clock driver
|
||||
document pages for additional information.
|
||||
|
||||
<P>The stratum number of a reference clock is by default zero. Since the
|
||||
<TT>ntpd</TT> daemon adds one to the stratum of each peer, a primary
|
||||
server ordinarily displays stratum one. In order to provide engineered
|
||||
backups, it is often useful to specify the reference clock stratum as
|
||||
greater than zero. The <TT>stratum</TT> option is used for this purpose.
|
||||
Also, in cases involving both a reference clock and a pulse-per-second
|
||||
(PPS) discipline signal, it is useful to specify the reference clock
|
||||
identifier as other than the default, depending on the driver. The
|
||||
<TT>refid</TT> option is used for this purpose. Except where noted,
|
||||
these options apply to all clock drivers.
|
||||
|
||||
<H4>Reference Clock Commands</H4>
|
||||
|
||||
<DL><DT><TT>server 127.127.<I>t.u</I> [prefer] [mode <I>int</I>]
|
||||
[minpoll <I>int</I>] [maxpoll <I>int</I>]</TT></DT>
|
||||
<DD>This command can be used to configure reference clocks in special
|
||||
ways. The options are interpreted as follows:</DD>
|
||||
|
||||
<DL><DT><TT>prefer</TT></DT>
|
||||
<DD>Marks the reference clock as preferred. All other things being
|
||||
equal, this host will be chosen for synchronization among a set of
|
||||
correctly operating hosts. See the <A HREF="prefer.htm">Mitigation Rules
|
||||
and the <TT>prefer</TT> Keyword </A>page for further information.</DD>
|
||||
|
||||
<DT><TT>mode <I>int</I></TT></DT>
|
||||
<DD>Specifies a mode number which is interpreted in a device-specific
|
||||
fashion. For instance, it selects a dialing protocol in the ACTS driver
|
||||
and a device subtype in the <TT>parse</TT> drivers.</DD>
|
||||
|
||||
<DT><TT>minpoll <I>int</I></TT></DT>
|
||||
<DT><TT>maxpoll<I> int</I></TT></DT>
|
||||
<DD>These options specify the minimum and maximum polling interval for
|
||||
reference clock messages, in seconds to the power of two. For most
|
||||
directly connected reference clocks, both <TT>minpoll</TT> and
|
||||
<TT>maxpoll</TT> default to 6 (64 s). For modem reference clocks,
|
||||
<TT>minpoll</TT> defaults to 10 (17.1 m) and <TT>maxpoll</TT> defaults
|
||||
to 14 (4.5 h). The allowable range is 4 (16 s) to 17 (36.4 h)
|
||||
inclusive.</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
<DT><TT>fudge 127.127.<I>t.u</I> [time1 <I>sec</I>] [time2 <I>sec</I>]
|
||||
[stratum <I>int</I>] [refid <I>string</I>] [mode <I>int</I>] [flag1 0|1]
|
||||
[flag2 0|1] [flag3 0|1] [flag4 0|1]</TT></DT>
|
||||
<DD>This command can be used to configure reference clocks in special
|
||||
ways. It must immediately follow the <TT>server</TT> command which
|
||||
configures the driver. Note that the same capability is possible at run
|
||||
time using the <TT><A HREF="ntpdc.htm">ntpdc</A></TT> program. The
|
||||
options are interpreted as follows:</DD>
|
||||
|
||||
<DL>
|
||||
|
||||
<DT><TT>time1 <I>sec</I></TT></DT>
|
||||
<DD>Specifies a constant to be added to the time offset produced by the
|
||||
driver, a fixed-point decimal number in seconds. This is used as a
|
||||
calibration constant to adjust the nominal time offset of a particular
|
||||
clock to agree with an external standard, such as a precision PPS
|
||||
signal. It also provides a way to correct a systematic error or bias due
|
||||
to serial port latencies, different cable lengths or receiver internal
|
||||
delay. The specified offset is in addition to the propagation delay
|
||||
provided by other means, such as internal DIPswitches. Where a
|
||||
calibration for an individual system and driver is available, an
|
||||
approximate correction is noted in the driver documentation pages.</DD>
|
||||
|
||||
<DT><TT>time2 <I>secs</I></TT></DT>
|
||||
<DD>Specifies a fixed-point decimal number in seconds, which is
|
||||
interpreted in a driver-dependent way. See the descriptions of specific
|
||||
drivers in the <A HREF="refclock.htm">reference clock drivers</A>
|
||||
page.</DD>
|
||||
|
||||
<DT><TT>stratum <I>int</I></TT></DT>
|
||||
<DD>Specifies the stratum number assigned to the driver, an integer
|
||||
between 0 and 15. This number overrides the default stratum number
|
||||
ordinarily assigned by the driver itself, usually zero.</DD>
|
||||
|
||||
<DT><TT>refid <I>string</I></TT></DT>
|
||||
<DD>Specifies an ASCII string of from one to four characters which
|
||||
defines the reference identifier used by the driver. This string
|
||||
overrides the default identifier ordinarily assigned by the driver
|
||||
itself.</DD>
|
||||
|
||||
<DT><TT>mode <I>int</I></TT></DT>
|
||||
<DD>Specifies a mode number which is interpreted in a device-specific
|
||||
fashion. For instance, it selects a dialing protocol in the ACTS driver
|
||||
and a device subtype in the <TT>parse</TT> drivers.</DD>
|
||||
|
||||
<DT><TT>flag1</TT> <TT>flag2</TT> <TT>flag3</TT> <TT>flag4</TT></DT>
|
||||
<DD>These four flags are used for customizing the clock driver. The
|
||||
interpretation of these values, and whether they are used at all, is a
|
||||
function of the particular clock driver. However, by convention
|
||||
<TT>flag4</TT> is used to enable recording monitoring data to the
|
||||
<TT>clockstats</TT> file configured with the <TT>filegen</TT> command.
|
||||
When a PPS signal is available, a special automatic calibration facility
|
||||
is provided. If the <tt>flag1</tt> switch is set and the PPS signal is
|
||||
actively disciplining the system time, the calibration value is
|
||||
automatically adjusted to maintain a residual offset of zero. Further
|
||||
information on the <TT>filegen</TT> command can be found in the <A
|
||||
HREF="monopt.htm">Monitoring Options </A>page.</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
<DT><TT>pps <I>device</I> [assert|clear] [hardpps]</TT></DT>
|
||||
<DD>Specifies the name and options for the serial port device to which
|
||||
the PPS signal is connected. Note, this command replaces use of
|
||||
<TT>fudge flag3</TT>, which was used for the same purpose in NTPv3. Note
|
||||
that this command should preceed the <TT>server</TT> and <TT>fudge</TT>
|
||||
command for the same device. Note also that the <TT>assert</TT>,
|
||||
<TT>clear</TT> and <TT>hardpps</TT> options are only available if the
|
||||
<tt>ppsapi</tt> standard PPS interface is available.</DD>
|
||||
|
||||
<DL>
|
||||
|
||||
<DT><TT>device</TT></DT>
|
||||
<DD>Specify the device name associated with the PPS signal. The name
|
||||
must match exactly the link name specified in the driver documentation
|
||||
page.</DD>
|
||||
|
||||
<DT><TT>assert</TT></DT>
|
||||
<DT><TT>clear</TT></DT>
|
||||
<DD>Using <TT>assert</TT> or <TT>clear</TT> specifies if the high going
|
||||
or low going edge of the signal must be used. The default is
|
||||
<TT>assert</TT>.</DD>
|
||||
|
||||
<DT><TT>hardpps</TT></DT>
|
||||
<DD>This flag is used to tell the kernel that the signal from this
|
||||
device must be used to drive hardpps().</DD>
|
||||
|
||||
<DD>The <TT>assert</TT>, <TT>clear</TT> and <TT>hardpps</TT> options
|
||||
are only available if the PPSAPI is used.</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
291
contrib/ntp/html/config.htm
Normal file
291
contrib/ntp/html/config.htm
Normal file
@ -0,0 +1,291 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Configuration Options
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Configuration Options
|
||||
</H3>
|
||||
|
||||
<IMG align=left SRC="pic/pogo3a.gif">From <i>pogo</i>, Walt Kelly
|
||||
<BR clear=left><HR>
|
||||
|
||||
<H4>Basic Configuration Options - the <TT>configure</TT> utility</H4>
|
||||
|
||||
The following options are for compiling and installing a working version
|
||||
of the NTP distribution. In most cases, the build process is completely
|
||||
automatic. In some cases where memory space is at a premium, or the
|
||||
binaries are to be installed in a different place, it is possible to
|
||||
tailor the configuration to remove such features as reference clock
|
||||
driver support, debugging support, and so forth.
|
||||
|
||||
<P>Configuration options are specified as arguments to the
|
||||
<TT>configure</TT> script. Following is a summary of the current
|
||||
options:
|
||||
|
||||
<P>Usage: <TT>configure [options] [host]</TT>
|
||||
<BR>Options: <TT>[defaults in brackets after descriptions]</TT>
|
||||
<PRE>Configuration
|
||||
|
||||
--cache-file=FILE cache test
|
||||
results in FILE
|
||||
--
|
||||
help &n
|
||||
bsp; print this message
|
||||
--no-
|
||||
create
|
||||
do not create output files
|
||||
--quiet, --silent do not print
|
||||
`checking...' messages
|
||||
--
|
||||
version  
|
||||
; print the version of autoconf that created
|
||||
|
||||
|
||||
configure
|
||||
Directory and file names
|
||||
|
||||
--prefix=PREFIX install
|
||||
architecture-independent files in
|
||||
|
||||
|
||||
PREFIX [/usr/local]
|
||||
--exec-prefix=EPREFIX install architecture-dependent files
|
||||
in EPREFIX
|
||||
|
||||
|
||||
[same as prefix]
|
||||
--
|
||||
bindir=DIR
|
||||
user executables in DIR [EPREFIX/bin]
|
||||
--
|
||||
sbindir=DIR system
|
||||
admin executables in DIR [EPREFIX/sbin]
|
||||
--libexecdir=DIR program
|
||||
executables in DIR [EPREFIX/libexec]
|
||||
--
|
||||
datadir=DIR read-
|
||||
only architecture-independent data in DIR
|
||||
|
||||
|
||||
[PREFIX/share]
|
||||
--sysconfdir=DIR read-only
|
||||
single-machine data in DIR
|
||||
|
||||
|
||||
[PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-
|
||||
independent data in DIR
|
||||
|
||||
|
||||
[PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine
|
||||
data in DIR
|
||||
|
||||
|
||||
[PREFIX/var]
|
||||
--
|
||||
libdir=DIR
|
||||
object code libraries in DIR [EPREFIX/lib]
|
||||
--includedir=DIR C header
|
||||
files in DIR [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc
|
||||
in DIR
|
||||
|
||||
|
||||
[/usr/include]
|
||||
--
|
||||
infodir=DIR info
|
||||
documentation in DIR [PREFIX/info]
|
||||
--
|
||||
mandir=DIR
|
||||
man documentation in DIR [PREFIX/man]
|
||||
--
|
||||
srcdir=DIR
|
||||
find the sources in DIR [configure dir or ..]
|
||||
--program-prefix=PREFIX prepend PREFIX to installed program names
|
||||
--program-suffix=SUFFIX append SUFFIX to installed program names
|
||||
--program-transform-name=PROGRAM run sed PROGRAM on installed
|
||||
program
|
||||
|
||||
|
||||
names
|
||||
Host type
|
||||
|
||||
--
|
||||
build=BUILD
|
||||
configure for building on BUILD [BUILD=HOST]
|
||||
--
|
||||
host=HOST &nb
|
||||
sp; configure for HOST [guessed]
|
||||
--target=TARGET
|
||||
configure for TARGET [TARGET=HOST]</PRE>
|
||||
|
||||
<PRE>Features and packages
|
||||
|
||||
--disable-FEATURE do not include
|
||||
FEATURE (same as --enable-
|
||||
|
||||
|
||||
FEATURE=no)
|
||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
--without-PACKAGE do not use
|
||||
PACKAGE (same as --with-PACKAGE=no)
|
||||
--x-includes=DIR X include
|
||||
files are in DIR
|
||||
--x-libraries=DIR X library files
|
||||
are in DIR
|
||||
|
||||
--enable- and --disable- with options recognized
|
||||
|
||||
|
||||
debugging
|
||||
Include debugging code [enable]
|
||||
gdt-
|
||||
surveying Include GDT survey code
|
||||
[disable]
|
||||
|
||||
md5 &nb
|
||||
sp; Include support for MD5 keys [enable]
|
||||
|
||||
des &nb
|
||||
sp; Include support for DES keys [enable]
|
||||
all-
|
||||
clocks Include
|
||||
drivers for all reference clocks
|
||||
|
||||
|
||||
[enable]
|
||||
|
||||
Radio Clocks (these are ordinarily enabled, if supported by the
|
||||
|
||||
|
||||
machine and operating system)
|
||||
|
||||
|
||||
ACTS &n
|
||||
bsp; NIST dialup clock
|
||||
|
||||
ARBITER  
|
||||
; Arbiter 1088A/B GPS receiver
|
||||
|
||||
AS2201
|
||||
Austron 2200A or 2201A GPS receiver
|
||||
|
||||
ATOM &n
|
||||
bsp; ATOM clock
|
||||
|
||||
BANCOMM  
|
||||
; BANCOMM clock
|
||||
|
||||
CHU &nb
|
||||
sp; CHU clock
|
||||
|
||||
DATUM &
|
||||
nbsp; Datum Programmable Time System
|
||||
|
||||
DCF7000  
|
||||
; ELV/DCF7000
|
||||
|
||||
GPSVME
|
||||
GPS-VME Clock
|
||||
|
||||
HEATH &
|
||||
nbsp; HeathKit GC-1000 Most Accurate Clock
|
||||
|
||||
HOPF6021 &nbs
|
||||
p; HOPF6021 Radio Clock support
|
||||
|
||||
HPGPS &
|
||||
nbsp; HP 58503A GPS Time & Frequency receiver
|
||||
|
||||
IRIG &n
|
||||
bsp; IRIG (Audio) Clock
|
||||
|
||||
LEITCH
|
||||
Leitch CSD 5300 Master Clock System Driver
|
||||
LOCAL-
|
||||
CLOCK Local Clock driver
|
||||
|
||||
MEINBERG &nbs
|
||||
p; Meinberg clocks
|
||||
|
||||
MSFEES
|
||||
MSFEES clock
|
||||
|
||||
MOTO &n
|
||||
bsp; Motorola GPS clock
|
||||
|
||||
MX4200
|
||||
MX4200 clock
|
||||
|
||||
NMEA &n
|
||||
bsp; NMEA GPS clock
|
||||
|
||||
PARSE &
|
||||
nbsp; PARSE clock code
|
||||
|
||||
PST &nb
|
||||
sp; PST/Traconex 1020 WWV/H receiver
|
||||
|
||||
PTBACTS  
|
||||
; PTB dialup clock support
|
||||
|
||||
RAWDCF
|
||||
use raw DCF77 time code
|
||||
|
||||
RCC8000  
|
||||
; RCC8000 Radio Clock support
|
||||
|
||||
SCHMID
|
||||
SCHMID DCF77 clock support
|
||||
|
||||
TRAK &n
|
||||
bsp; TRAK 8810 GPS station clock
|
||||
|
||||
TPRO &n
|
||||
bsp; KSI/Odetics TPRO/S IRIG Interface
|
||||
|
||||
TRIMTAIP &nbs
|
||||
p; Trimble GPS/TAIP Protocol
|
||||
|
||||
TRIMTSIP &nbs
|
||||
p; Trimble GPS/TSIP Protocol
|
||||
|
||||
TRUETIME &nbs
|
||||
p; Kinemetrics/TrueTime (generic) receiver
|
||||
|
||||
WWVB &n
|
||||
bsp; Spectracom 8170 or Netclock/2 WWVB receiver
|
||||
|
||||
USNO &n
|
||||
bsp; US Naval Observatory dialup clock
|
||||
Miscellany
|
||||
|
||||
accurate-adjtime The
|
||||
adjtime() call is accurate
|
||||
|
||||
kmem &n
|
||||
bsp; Read kmem
|
||||
|
||||
tick=VALUE Force a
|
||||
value for 'tick'
|
||||
|
||||
tickadj=VALUE Force a value for
|
||||
'tickadj'
|
||||
udp-
|
||||
wildcard Use UDP wildcard
|
||||
delivery
|
||||
slew-
|
||||
always Always slew the
|
||||
time
|
||||
step-
|
||||
slew Step
|
||||
and slew the time
|
||||
ntpdate-
|
||||
step If ntpdate should step
|
||||
the time
|
||||
hourly-todr-sync If we should
|
||||
sync TODR hourly</PRE>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
330
contrib/ntp/html/confopt.htm
Normal file
330
contrib/ntp/html/confopt.htm
Normal file
@ -0,0 +1,330 @@
|
||||
<html><head><title>
|
||||
Configuration Options
|
||||
</title></head><body><h3>
|
||||
Configuration Options
|
||||
</h3><hr>
|
||||
|
||||
<h4>Configuration Support</h4>
|
||||
|
||||
<p>Following is a description of the configuration commands in
|
||||
NTPv4. These commands have the same basic functions as in NTPv3
|
||||
and in some cases new functions and new operands. The various
|
||||
modes are determined by the command keyword and the type of the
|
||||
required IP address. Addresses are classed by type as (s) a
|
||||
remote server or peer (IP class A, B and C), (b) the broadcast
|
||||
address of a local interface, (m) a multicast address (IP class
|
||||
D), or (r) a reference clock address (127.127.x.x). Note that,
|
||||
while autokey and burst modes are supported by these commands,
|
||||
their effect in some weird mode combinations can be meaningless
|
||||
or even destructive.</p>
|
||||
|
||||
<dl>
|
||||
<dt><tt>peer </tt><i><tt>address</tt></i><tt> [autokey | key </tt><i><tt>key</tt></i><tt>]
|
||||
[burst] [version </tt><i><tt>version</tt></i><tt>]
|
||||
[prefer] [minpoll </tt><i><tt>minpoll</tt></i><tt>]</tt><i><tt>
|
||||
</tt></i><tt>[maxpoll </tt><i><tt>maxpoll</tt></i><tt>]</tt></dt>
|
||||
<dd> </dd>
|
||||
<dt><tt>server </tt><i><tt>address</tt></i><tt> [autokey |
|
||||
key </tt><i><tt>key</tt></i><tt>] [burst] [version </tt><i><tt>version</tt></i><tt>]
|
||||
[prefer] [minpoll </tt><i><tt>minpoll</tt></i><tt>]</tt><i><tt>
|
||||
</tt></i><tt>[maxpoll </tt><i><tt>maxpoll</tt></i><tt>]</tt></dt>
|
||||
<dd> </dd>
|
||||
<dt><tt>broadcast </tt><i><tt>address</tt></i><tt> [autokey |
|
||||
key </tt><i><tt>key</tt></i><tt>] [burst] [version </tt><i><tt>version</tt></i><tt>]
|
||||
[minpoll </tt><i><tt>minpoll</tt></i><tt>]</tt><i><tt> </tt></i><tt>[maxpoll
|
||||
</tt><i><tt>maxpoll</tt></i><tt>] [ttl </tt><i><tt>ttl</tt></i><tt>]</tt></dt>
|
||||
<dd> </dd>
|
||||
<dt><tt>manycastclient </tt><i><tt>address</tt></i><tt>
|
||||
[autokey | key </tt><i><tt>key</tt></i><tt>] [burst]
|
||||
[version </tt><i><tt>version</tt></i><tt>] [minpoll </tt><i><tt>minpoll
|
||||
</tt></i><tt>[maxpoll </tt><i><tt>maxpoll</tt></i><tt>]
|
||||
[ttl </tt><i><tt>ttl</tt></i><tt>]</tt></dt>
|
||||
<dd> </dd>
|
||||
<dd>These four commands specify the time server name or
|
||||
address to be used and the mode in which to operate. The <i><tt>address</tt></i><tt>
|
||||
</tt>can be either a DNS name or a IP address in
|
||||
dotted-quad notation. Additional information on
|
||||
association behavior can be found in the <a
|
||||
href="assoc.htm">Association Management</a> page.</dd>
|
||||
<dd> </dd>
|
||||
<dd><dl>
|
||||
<dt><tt>server</tt></dt>
|
||||
<dd>For type s and r addresses, this operates as the
|
||||
NTPv3 server command, which mobilizes a
|
||||
persistent client mode association. The <tt>server</tt>
|
||||
command specifies that the local server is to
|
||||
operate in client mode with the specified remote
|
||||
server. In this mode, the local server can be
|
||||
synchronized to the remote server, but the remote
|
||||
server can never be synchronized to the local
|
||||
server.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>peer</tt></dt>
|
||||
<dd>For type s addresses (only), this operates as the
|
||||
current <tt>peer </tt>command, which mobilizes a
|
||||
persistent symmetric-active mode association,
|
||||
except that additional modes are available. This
|
||||
command should NOT be used for type b, m or r
|
||||
addresses.</dd>
|
||||
<dd> </dd>
|
||||
<dd>The <tt>peer</tt> command specifies that the
|
||||
local server is to operate in symmetric active
|
||||
mode with the remote server. In this mode, the
|
||||
local server can be synchronized to the remote
|
||||
server and, in addition, the remote server can be
|
||||
synchronized by the local server. This is useful
|
||||
in a network of servers where, depending on
|
||||
various failure scenarios, either the local or
|
||||
remote server may be the better source of time.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>broadcast</tt></dt>
|
||||
<dd>For type b and m addresses (only), this is
|
||||
operates as the current NTPv3 <tt>broadcast </tt>command,
|
||||
which mobilizes a persistent broadcast mode
|
||||
association, except that additional modes are
|
||||
available. Multiple commands can be used to
|
||||
specify multiple local broadcast interfaces
|
||||
(subnets) and/or multiple multicast groups. Note
|
||||
that local broadcast messages go only to the
|
||||
interface associated with the subnet specified,
|
||||
but multicast messages go to all interfaces. In
|
||||
the current implementation, the source address
|
||||
used for these messages is the Unix host default
|
||||
address.</dd>
|
||||
<dd> </dd>
|
||||
<dd>In broadcast mode, the local server sends
|
||||
periodic broadcast messages to a client
|
||||
population at the <i><tt>address </tt></i>specified,
|
||||
which is usually the broadcast address on (one
|
||||
of) the local network(s) or a multicast address
|
||||
assigned to NTP. The IANA has assigned the
|
||||
multicast group address 224.0.1.1 exclusively to
|
||||
NTP, but other nonconflicting addresses can be
|
||||
used to contain the messages within
|
||||
administrative boundaries.. Ordinarily, this
|
||||
specification applies only to the local server
|
||||
operating as a sender; for operation as a
|
||||
broadcast client, see the <tt>broadcastclient</tt>
|
||||
or <tt>multicastclient</tt> commands below.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>manycastclient</tt> </dt>
|
||||
<dd>For type m addresses (only), this mobilizes a
|
||||
manycast client-mode association for the
|
||||
multicast address specified. In this case a
|
||||
specific address must be supplied which matches
|
||||
the address used on the <tt>manycastserver </tt>command
|
||||
for the designated manycast servers. The NTP
|
||||
multicast address 224.0.1.1 assigned by the IANA
|
||||
should NOT be used, unless specific means are
|
||||
taken to avoid spraying large areas of the
|
||||
Internet with these messages and causing a
|
||||
possibly massive implosion of replies at the
|
||||
sender. </dd>
|
||||
<dd> </dd>
|
||||
<dd>The <tt>manycast </tt>command specifies that the
|
||||
local server is to operate in client mode with
|
||||
the remote server that are discovered as the
|
||||
result of broadcast/multicast messages. The
|
||||
client broadcasts a request message to the group
|
||||
address associated with the specified <i><tt>address
|
||||
</tt></i>and specifically enabled servers respond
|
||||
to these messages. The client selects the servers
|
||||
providing the best time and continues as with the
|
||||
<tt>server </tt>command. The remaining servers
|
||||
are discarded as if never heard.</dd>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>Options</dd>
|
||||
<dd> </dd>
|
||||
<dd><dl>
|
||||
<dt><tt>autokey</tt></dt>
|
||||
<dd>All packets sent to the address are to include
|
||||
authentication fields encrypted using the autokey
|
||||
scheme.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>burst</tt></dt>
|
||||
<dd>At each poll interval, send a burst of eight
|
||||
packets spaced, instead of the usual one.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>key </tt><i><tt>key</tt></i></dt>
|
||||
<dd>All packets sent to the address are to include
|
||||
authentication fields encrypted using the
|
||||
specified <i>key</i> identifier, which is an
|
||||
unsigned 32-bit integer less than 65536. The
|
||||
default is to include no encryption field.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>version </tt><i><tt>version</tt></i></dt>
|
||||
<dd>Specifies the version number to be used for
|
||||
outgoing NTP packets. Versions 1-4 are the
|
||||
choices, with version 4 the default.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>prefer</tt></dt>
|
||||
<dd>Marks the server as preferred. All other things
|
||||
being equal, this host will be chosen for
|
||||
synchronization among a set of correctly
|
||||
operating hosts. See the <a href="prefer.htm">Mitigation
|
||||
Rules and the <tt>prefer</tt> Keyword </a>page
|
||||
for further information.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>ttl </tt><i><tt>ttl</tt></i></dt>
|
||||
<dd>This option is used only with broadcast mode. It
|
||||
specifies the time-to-live <i><tt>ttl</tt></i> to
|
||||
use on multicast packets. Selection of the proper
|
||||
value, which defaults to 127, is something of a
|
||||
black art and must be coordinated with the
|
||||
network administrator.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>minpoll </tt><i><tt>minpoll</tt></i></dt>
|
||||
<dt><tt>maxpoll </tt><i><tt>maxpoll</tt></i></dt>
|
||||
<dd>These options specify the minimum and maximum
|
||||
polling intervals for NTP messages, in seconds to
|
||||
the power of two. The default range is 6 (64 s)
|
||||
to 10 (1,024 s).The allowable range is 4 (16 s)
|
||||
to 17 (36.4 h) inclusive.</dd>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><tt>broadcastclient</tt></dt>
|
||||
<dd>This command directs the local server to listen for and
|
||||
respond to broadcast messages received on any local
|
||||
interface. Upon hearing a broadcast message for the first
|
||||
time, the local server measures the nominal network delay
|
||||
using a brief client/server exchange with the remote
|
||||
server, then enters the broadcastclient mode, in which it
|
||||
listens for and synchronizes to succeeding broadcast
|
||||
messages. Note that, in order to avoid accidental or
|
||||
malicious disruption in this mode, both the local and
|
||||
remote servers should operate using authentication and
|
||||
the same trusted key and key identifier.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>multicastclient [</tt><i><tt>address</tt></i><tt>]
|
||||
[...]</tt></dt>
|
||||
<dd>This command directs the local server to listen for
|
||||
multicast messages at the group address(es) of the global
|
||||
network. The default address is that assigned by the
|
||||
Numbers Czar to NTP (224.0.1.1). This command operates in
|
||||
the same way as the <tt>broadcastclient</tt> command, but
|
||||
uses IP multicasting. Support for this command requires a
|
||||
multicast kernel.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>driftfile </tt><i><tt>driftfile</tt></i></dt>
|
||||
<dd>This command specifies the name of the file used to
|
||||
record the frequency offset of the local clock
|
||||
oscillator. If the file exists, it is read at startup in
|
||||
order to set the initial frequency offset and then
|
||||
updated once per hour with the current frequency offset
|
||||
computed by the daemon. If the file does not exist or
|
||||
this command is not given, the initial frequency offset
|
||||
is assumed zero. In this case, it may take some hours for
|
||||
the frequency to stabilize and the residual timing errors
|
||||
to subside.</dd>
|
||||
<dd> </dd>
|
||||
<dd>The file format consists of a single line containing a
|
||||
single floating point number, which records the frequency
|
||||
offset measured in parts-per-million (PPM). The file is
|
||||
updated by first writing the current drift value into a
|
||||
temporary file and then renaming this file to replace the
|
||||
old version. This implies that <tt>ntpd</tt> must have
|
||||
write permission for the directory the drift file is
|
||||
located in, and that file system links, symbolic or
|
||||
otherwise, should be avoided.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>manycastserver </tt><i><tt>address </tt></i><tt>[...]</tt></dt>
|
||||
<dd>This command directs the local server to listen for and
|
||||
respond to broadcast messages received on any local
|
||||
interface, and in addition enables the server to respond
|
||||
to client mode messages to the multicast group
|
||||
address(es) (type m) specified. At least one address is
|
||||
required, but The NTP multicast address 224.0.1.1
|
||||
assigned by the IANA should NOT be used, unless specific
|
||||
means are taken to limit the span of the reply and avoid
|
||||
a possibly massive implosion at the original sender.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>revoke [</tt><i><tt>logsec</tt></i><tt>]</tt> </dt>
|
||||
<dd>Specifies the interval between recomputations of the
|
||||
private value used with the autokey feature, which
|
||||
ordinarily requires an expensive public- key computation.
|
||||
The default value is 12 (65,536 s or about 18 hours). For
|
||||
poll intervals above the specified interval, a new
|
||||
private value will be recomputed for every message sent.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>autokey [</tt><i><tt>logsec</tt></i><tt>]</tt> </dt>
|
||||
<dd>Specifies the interval between regenerations of the
|
||||
session key list used with the autokey feature. Note that
|
||||
the size of the key list for each association depends on
|
||||
this interval and the current poll interval. The default
|
||||
value is 12 (4096 s or about 1.1 hours). For poll
|
||||
intervals above the specified interval, a session key
|
||||
list with a single entry will be regenerated for every
|
||||
message sent.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>enable [auth | bclient | kernel | monitor | ntp |
|
||||
stats]</tt></dt>
|
||||
<dt><tt>disable [auth | bclient | kernel | monitor | ntp |
|
||||
stats</tt><font face="Courier New">] </font></dt>
|
||||
<dd>Provides a way to enable or disable various server
|
||||
options. Flags not mentioned are unaffected. Note that
|
||||
all of these flags can be controlled remotely using the <a
|
||||
href="ntpdc.htm"><tt>ntpdc</tt></a> utility program.</dd>
|
||||
<dd> </dd>
|
||||
<dd><dl>
|
||||
<dt><tt>auth</tt></dt>
|
||||
<dd>Enables the server to synchronize with
|
||||
unconfigured peers only if the peer has been
|
||||
correctly authenticated using a trusted key and
|
||||
key identifier. The default for this flag is
|
||||
enable.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>bclient</tt></dt>
|
||||
<dd>When enabled, this is identical to the <tt>broadcastclient</tt>
|
||||
command. The default for this flag is disable.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>kernel</tt></dt>
|
||||
<dd>Enables the precision-time kernel support for the
|
||||
<tt>ntp_adjtime()</tt> system call, if
|
||||
implemented. Ordinarily, support for this routine
|
||||
is detected automatically when the NTP daemon is
|
||||
compiled, so it is not necessary for the user to
|
||||
worry about this flag. It flag is provided
|
||||
primarily so that this support can be disabled
|
||||
during kernel development.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>monitor</tt></dt>
|
||||
<dd>Enables the monitoring facility. See the <tt>ntpdc</tt>
|
||||
program and the <tt>monlist</tt> command or
|
||||
further information. The default for this flag is
|
||||
enable.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>ntp</tt></dt>
|
||||
<dd>Enables the server to adjust its local clock by
|
||||
means of NTP. If disabled, the local clock
|
||||
free-runs at its intrinsic time and frequency
|
||||
offset. This flag is useful in case the local
|
||||
clock is controlled by some other device or
|
||||
protocol and NTP is used only to provide
|
||||
synchronization to other clients. In this case,
|
||||
the local clock driver can be used to provide
|
||||
this function and also certain time variables for
|
||||
error estimates and leap-indicators. See the <a
|
||||
href="refclock.htm">Reference Clock Drivers </a>page
|
||||
for further information. The default for this
|
||||
flag is enable.</dd>
|
||||
<dd> </dd>
|
||||
<dt><tt>stats</tt></dt>
|
||||
<dd>Enables the statistics facility. See the <a
|
||||
href="monopt.htm">Monitoring Options </a>page for
|
||||
further information. The default for this flag is
|
||||
enable.</dd>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<hr>
|
||||
|
||||
<address>
|
||||
David L. Mills (mills@udel.edu)
|
||||
</address>
|
||||
</body>
|
||||
</html>
|
123
contrib/ntp/html/copyright.htm
Normal file
123
contrib/ntp/html/copyright.htm
Normal file
@ -0,0 +1,123 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Copyright Notice
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Copyright Notice
|
||||
</H3>
|
||||
|
||||
<IMG align=left HEIGHT=264 WIDTH=206 SRC=pic/sheepb.jpg >"Clone
|
||||
me," says Dolly sheepishly
|
||||
<br clear=left><hr>
|
||||
|
||||
<P>The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file.
|
||||
<br>
|
||||
|
||||
<PRE>/***********************************************************************
|
||||
* *
|
||||
* Copyright (c) David L. Mills 1992-1999 *
|
||||
* *
|
||||
* Permission to use, copy, modify, and distribute this software and *
|
||||
* its documentation for any purpose and without fee is hereby *
|
||||
* granted, provided that the above copyright notice appears in all *
|
||||
* copies and that both the copyright notice and this permission *
|
||||
* notice appear in supporting documentation, and that the name *
|
||||
* University of Delaware not be used in advertising or publicity *
|
||||
* pertaining to distribution of the software without specific, *
|
||||
* written prior permission. The University of Delaware makes no *
|
||||
* representations about the suitability this software for any *
|
||||
* purpose. It is provided "as is" without express or implied *
|
||||
* warranty. *
|
||||
**********************************************************************/</PRE>
|
||||
|
||||
The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work.
|
||||
|
||||
<OL>
|
||||
|
||||
<LI><A HREF="mailto: marka@syd.dms.csiro.au">Mark Andrews <marka@syd.dms.csiro.au></a> Leitch atomic clock controller</LI>
|
||||
|
||||
<LI><A HREF="mailto: vbais@mailman1.intel.co">Viraj Bais <vbais@mailman1.intel.com></a> and <A HREF="mailto: kirkwood@striderfm.intel.com">Clayton Kirkwood <kirkwood@striderfm.intel.com></a> port to WindowsNT 3.5</LI>
|
||||
|
||||
<LI><A HREF="mailto: karl@owl.HQ.ileaf.com">Karl Berry <karl@owl.HQ.ileaf.com></a> syslog to file option</LI>
|
||||
|
||||
<LI><A HREF="mailto: Piete.Brooks@cl.cam.ac.uk">Piete Brooks <Piete.Brooks@cl.cam.ac.uk></a> MSF clock driver, Trimble PARSE support</LI>
|
||||
|
||||
<LI><A HREF="mailto: clift@ml.csiro.au">Steve Clift <clift@ml.csiro.au></a> OMEGA clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto:casey@csc.co.za">Casey Crellin <casey@csc.co.za></a> vxWorks (Tornado) port and help with target configuration</LI>
|
||||
|
||||
<LI><A HREF="mailto: duwe@immd4.informatik.uni-erlangen.de">Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de></a> Linux port</LI>
|
||||
|
||||
<LI><A HREF="mailto: dundas@salt.jpl.nasa.gov">John A. Dundas III <dundas@salt.jpl.nasa.gov></a> Apple A/UX port</LI>
|
||||
|
||||
<LI><A HREF="mailto: dennis@mrbill.canet.ca">Dennis Ferguson <dennis@mrbill.canet.ca></a> foundation code for NTP Version 2 as specified in RFC-1119</LI>
|
||||
|
||||
<LI><A HREF="mailto: glenn@herald.usask.ca">Glenn Hollinger <glenn@herald.usask.ca></a> GOES clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: iglesias@uci.edu">Mike Iglesias <iglesias@uci.edu></a> DEC Alpha port</LI>
|
||||
|
||||
<LI><A HREF="mailto: jagubox.gsfc.nasa.gov">Jim Jagielski <jim@jagubox.gsfc.nasa.gov></a> A/UX port</LI>
|
||||
|
||||
<LI><A HREF="mailto: jbj@chatham.usdesign.com">Jeff Johnson <jbj@chatham.usdesign.com></a> massive prototyping overhaul</LI>
|
||||
|
||||
<LI><A HREF="mailto: jones@hermes.chpc.utexas.edu">William L. Jones <jones@hermes.chpc.utexas.edu></a> RS/6000 AIX modifications, HPUX modifications</LI>
|
||||
|
||||
<LI><A HREF="mailto: dkatz@cisco.com">Dave Katz <dkatz@cisco.com></a> RS/6000 AIX port</LI>
|
||||
|
||||
<LI><A HREF="mailto: leres@ee.lbl.gov">Craig Leres <leres@ee.lbl.gov></a> 4.4BSD port, ppsclock, Maganavox GPS clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: lindholm@ucs.ubc.ca">George Lindholm <lindholm@ucs.ubc.ca></a> SunOS 5.1 port</LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="mailto: louie@ni.umd.edu">Louis A. Mamakos <louie@ni.umd.edu></a>
|
||||
MD5-based authentication</LI>
|
||||
|
||||
<LI><A HREF="mailto: derek@toybox.demon.co.uk">Derek Mulcahy <derek@toybox.demon.co.uk></a> and <A HREF="mailto: d@hd.org">Damon Hart-Davis <d@hd.org></a> ARCRON MSF clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: thorinn@diku.dk">Lars H. Mathiesen <thorinn@diku.dk></a> adaptation of foundation code for Version 3 as specified in RFC-1305</LI>
|
||||
|
||||
<LI><A HREF="mailto: mills@udel.edu">David L. Mills <mills@udel.edu></a> Version 4 foundation, Spectractom WWVB, Austron GPS, Arbiter GPS, CHU, Heath, ATOM, ACTS, KSI/Odetics, IRIG clock drivers; PPS support; precision kernel; NTPv4 changes</LI>
|
||||
|
||||
<LI><A HREF="mailto: moeller@gwdgv1.dnet.gwdg.de">Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de></a> VMS port</LI>
|
||||
|
||||
<LI><A HREF="mailto: mogul@pa.dec.com">Jeffrey Mogul <mogul@pa.dec.com></a> ntptrace utility</LI>
|
||||
|
||||
<LI><A HREF="mailto: tmoore@fievel.daytonoh.ncr.com">Tom Moore <tmoore@fievel.daytonoh.ncr.com></a> i386 svr4 port</LI>
|
||||
|
||||
<LI><A HREF="mailto: Rainer.Pruy@informatik.uni-erlangen.de">Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de></a> monitoring/trap scripts, statistics file handling</LI>
|
||||
|
||||
<LI><A HREF="mailto: dirce@zk3.dec.com">Dirce Richards <dirce@zk3.dec.com></a> Digital UNIX V4.0 port</LI>
|
||||
|
||||
<LI><A HREF="mailto: mrapple@quack.kfu.com">Nick Sayer <mrapple@quack.kfu.com></a> SunOS streams modules</LI>
|
||||
|
||||
<LI><A HREF="http://www4.informatik.uni-erlangen.de/~kardel">Frank Kardel</A> <A HREF="mailto:
|
||||
Frank.Kardel@informatik.uni-erlangen.de">
|
||||
<Frank.Kardel@informatik.uni-erlangen.de></a>
|
||||
PARSE <GENERIC> driver (14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup</LI>
|
||||
|
||||
<LI><A HREF="mailto: schnitz@unipress.com">Ray Schnitzler <schnitz@unipress.com></a> Unixware1 port</LI>
|
||||
|
||||
<LI><A HREF="mailto: shields@tembel.org">Michael Shields <shields@tembel.org></a> USNO clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: pebbles.jpl.nasa.gov">Jeff Steinman <jss@pebbles.jpl.nasa.gov></a> Datum PTS clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: harlan@pfcs.com">Harlan Stenn <harlan@pfcs.com></a> GNU automake/autoconfigure makeover</LI>
|
||||
|
||||
<LI><A HREF="mailto: ken@sdd.hp.com">Kenneth Stone <ken@sdd.hp.com></a> HP-UX port</LI>
|
||||
|
||||
<LI><A HREF="mailto: ajit@ee.udel.edu">Ajit Thyagarajan <ajit@ee.udel.edu></a>IP multicast support</LI>
|
||||
|
||||
<LI><A HREF="mailto: tsuruoka@nc.fukuoka-u.ac.jp">Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp></a>TRAK clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: vixie@vix.com">Paul A Vixie <vixie@vix.com></a> TrueTime GPS driver, generic TrueTime clock driver</LI>
|
||||
|
||||
<LI><A HREF="mailto: Ulrich.Windl@rz.uni-regensburg.de">Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de></a> corrected and validated HTML documents according to the HTML DTD</LI>
|
||||
|
||||
<LI><A HREF="mailto: greg.brackley@bigfoot.com">Greg Brackley <greg.brackley@bigfoot.com></a> Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules.</LI>
|
||||
|
||||
<LI><A HREF="mailto: Sven_Dietrich@trimble.COM">Sven Dietrich <sven_dietrich@trimble.com></a> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port.</LI>
|
||||
|
||||
<LI><A HREF="mailto: wsanchez@apple.com">Wilfredo Sánchez <wsanchez@apple.com></A> added support for NetInfo</LI>
|
||||
</OL>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
288
contrib/ntp/html/debug.htm
Normal file
288
contrib/ntp/html/debug.htm
Normal file
@ -0,0 +1,288 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
NTP Debugging Techniques
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
NTP Debugging Techniques
|
||||
</H3>
|
||||
|
||||
<IMG align=left SRC="pic/pogo.gif"><I>Pogo Possum</I>, with toolkit
|
||||
and bug, Walt Kelly
|
||||
<br clear=left><hr>
|
||||
|
||||
<P>Once the NTP software distribution has been compiled and installed
|
||||
and the configuration file constructed, the next step is to verify
|
||||
correct operation and fix any bugs that may result. Usually, the command
|
||||
line that starts the daemon is included in the system startup file, so
|
||||
it is executed only at system boot time; however, the daemon can be
|
||||
stopped and restarted from root at any time. Usually, no command-line
|
||||
arguments are required, unless special actions described in the
|
||||
<TT><A HREF="ntpd.htm">ntpd</A></TT> page are required. Once started,
|
||||
the daemon will begin sending messages, as specified in the
|
||||
configuration file, and interpreting received messages.
|
||||
|
||||
<P>The best way to verify correct operation is using the <TT><A
|
||||
HREF="ntpq.htm">ntpq</A></TT> and <TT><A HREF="ntpdc.htm">ntpdc</A></TT>
|
||||
utility programs, either on the server itself or from another machine
|
||||
elsewhere in the network. The <TT>ntpq</TT> program implements the
|
||||
management functions specified in Appendix A of the NTP specification <A
|
||||
HREF="http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305c.ps"
|
||||
>
|
||||
RFC-1305, Appendix A</A>. The <TT>ntpdc</TT> program implements
|
||||
additional functions not provided in the standard. Both programs can be
|
||||
used to inspect the state variables defined in the specification and, in
|
||||
the case of <TT>ntpdc</TT>, additional ones of interest. In addition,
|
||||
the <TT>ntpdc</TT> program can be used to selectively enable and disable
|
||||
some functions of the daemon while the daemon is running.
|
||||
|
||||
<P>In extreme cases with elusive bugs, the daemon can operate in two
|
||||
modes, depending on the presence of the <TT>-d</TT> command-line debug
|
||||
switch. If not present, the daemon detaches from the controlling
|
||||
terminal and proceeds autonomously. If one or more <TT>-d</TT> switches
|
||||
are present, the daemon does not detach and generates special output
|
||||
useful for debugging. In general, interpretation of this output requires
|
||||
reference to the sources. However, a single <TT>-d</TT> does produce
|
||||
only mildly cryptic output and can be very useful in finding problems
|
||||
with configuration and network troubles. With a little experience, the
|
||||
volume of output can be reduced by piping the output to <TT>grep
|
||||
</TT>and specifying the keyword of the trace you want to see.
|
||||
|
||||
<P>Some problems are immediately apparent when the daemon first starts
|
||||
running. The most common of these are the lack of a ntp (UDP port 123)
|
||||
in the host <TT>/etc/services</TT> file. Note that NTP does not use TCP
|
||||
in any form. Other problems are apparent in the system log file. The log
|
||||
file should show the startup banner, some cryptic initialization data,
|
||||
and the computed precision value. The next most common problem is
|
||||
incorrect DNS names. Check that each DNS name used in the configuration
|
||||
file responds to the Unix <TT>ping</TT> command.
|
||||
|
||||
<P>When first started, the daemon normally polls the servers listed in
|
||||
the configuration file at 64-second intervals. In order to allow a
|
||||
sufficient number of samples for the NTP algorithms to reliably
|
||||
discriminate between correctly operating servers and possible intruders,
|
||||
at least four valid messages from at least one server is required before
|
||||
the daemon can set the local clock. However, if the current local time
|
||||
is greater than 1000 seconds in error from the server time, the daemon
|
||||
will not set the local clock; instead, it will plant a message in the
|
||||
system log and shut down. It is necessary to set the local clock to
|
||||
within 1000 seconds first, either by a time-of-year hardware clock, by
|
||||
first using the <A HREF="ntpdate.htm"><TT>ntpdate</TT> </A>program or
|
||||
manually be eyeball and wristwatch.
|
||||
|
||||
<P>After starting the daemon, run the <TT>ntpq</TT> program using the
|
||||
<TT>-n</TT> switch, which will avoid possible distractions due to name
|
||||
resolution problems. Use the <TT>pe</TT> command to display a billboard
|
||||
showing the status of configured peers and possibly other clients poking
|
||||
the daemon. After operating for a few minutes, the display should be
|
||||
something like:
|
||||
|
||||
<PRE>ntpq>pe
|
||||
remote refid st t when poll reach delay offset disp
|
||||
===================================================================
|
||||
+128.4.2.6 132.249.16.1 2 u 131 256 373 9.89 16.28 23.25
|
||||
*128.4.1.20 .WWVB. 1 u 137 256 377 280.62 21.74 20.23
|
||||
-128.8.2.88 128.8.10.1 2 u 49 128 376 294.14 5.94 17.47
|
||||
+128.4.2.17 .WWVB. 1 u 173 256 377 279.95 20.56 16.40
|
||||
</PRE>
|
||||
|
||||
The host addresses shown in the <TT>remote</TT> column should agree with
|
||||
the DNS entries in the configuration file, plus any peers not mentioned
|
||||
in the file at the same or lower than your stratum that happen to be
|
||||
configured to peer with you. Be prepared for surprises in cases where
|
||||
the peer has multiple addresses or multiple names. The <TT>refid</TT>
|
||||
entry shows the current source of synchronization for each peer, while
|
||||
the <TT>st</TT> reveals the stratum, <TT>t</TT> the type (<TT>u</TT> =
|
||||
unicast, <TT>m</TT> = multicast, <TT>l</TT> = local, <TT>-</TT> = don't
|
||||
know), and <TT>poll</TT> the polling interval in seconds. The
|
||||
<TT>when</TT> entry shows the time since the peer was last heard,
|
||||
normally in seconds, while the <TT>reach</TT> entry shows the status of
|
||||
the reachability register (see RFC-1305) in octal. The remaining entries
|
||||
show the latest delay, offset and dispersion computed for the peer in
|
||||
milliseconds. Note that in NTP Version 4 the dispersion entry includes
|
||||
only the RMS error component; earlier versions included all components.
|
||||
|
||||
<P>The tattletale character at the left margin displays the
|
||||
synchronization status of each peer. The currently selected peer is
|
||||
marked <TT>*</TT>, while additional peers designated acceptable for
|
||||
synchronization, but not currently selected, are marked <TT>+</TT>.
|
||||
Peers marked <TT>*</TT> and <TT>+</TT> are included in a weighted
|
||||
average computation to set the local clock; the data produced by peers
|
||||
marked with other symbols are discarded. See the <TT>ntpq</TT>
|
||||
documentation for the meaning of these symbols.
|
||||
|
||||
<P>Additional details for each peer separately can be determined by the
|
||||
following procedure. First, use the <TT>as</TT> command to display an
|
||||
index of association identifiers, such as
|
||||
|
||||
<PRE>ntpq>as
|
||||
ind assID status conf reach auth condition last_event cnt
|
||||
=========================================================
|
||||
1 11670 7414 no yes ok candidate reachable 1
|
||||
2 11673 7614 no yes ok sys.peer reachable 1
|
||||
3 11833 7314 no yes ok outlyer reachable 1
|
||||
4 11868 7414 no yes ok candidate reachable 1
|
||||
</PRE>
|
||||
|
||||
Each line in this billboard is associated with the corresponding line
|
||||
the <TT>pe</TT> billboard above. Next, use the <TT>rv</TT> command and
|
||||
the respective identifier to display a detailed synopsis of the selected
|
||||
peer, such as
|
||||
|
||||
<PRE>ntpq>rv 11670
|
||||
status=7414 reach, auth, sel_sync, 1 event, event_reach
|
||||
srcadr=128.4.2.6, srcport=123, dstadr=128.4.2.7, dstport=123, keyid=1,
|
||||
stratum=2, precision=-10, rootdelay=362.00, rootdispersion=21.99,
|
||||
refid=132.249.16.1,
|
||||
reftime=af00bb44.849b0000 Fri, Jan 15 1993 4:25:40.517,
|
||||
delay= 9.89, offset= 16.28,
|
||||
dispersion=23.25, reach=373, valid=8,
|
||||
hmode=2, pmode=1, hpoll=8, ppoll=10, leap=00, flash=0x0,
|
||||
org=af00bb48.31a90000 Fri, Jan 15 1993 4:25:44.193,
|
||||
rec=af00bb48.305e3000 Fri, Jan 15 1993 4:25:44.188,
|
||||
xmt=af00bb1e.16689000 Fri, Jan 15 1993 4:25:02.087,
|
||||
filtdelay= 16.40 9.89 140.08 9.63 9.72 9.22 10.79 122.99,
|
||||
filtoffset= 13.24 16.28 -49.19 16.04 16.83 16.49 16.95 -39.43,
|
||||
filterror= 16.27 20.17 27.98 31.89 35.80 39.70 43.61 47.52
|
||||
</PRE>
|
||||
|
||||
A detailed explanation of the fields in this billboard are beyond the
|
||||
scope of this discussion; however, most variables defined in the
|
||||
specification RFC-1305 can be found. The most useful portion for
|
||||
debugging is the last three lines, which give the roundtrip delay, clock
|
||||
offset and dispersion for each of the last eight measurement rounds, all
|
||||
in milliseconds. Note that the dispersion, which is an estimate of the
|
||||
error, increases as the age of the sample increases. From these data, it
|
||||
is usually possible to determine the incidence of severe packet loss,
|
||||
network congestion, and unstable local clock oscillators. There are no
|
||||
hard and fast rules here, since every case is unique; however, if one or
|
||||
more of the rounds show zeros, or if the clock offset changes
|
||||
dramatically in the same direction for each round, cause for alarm
|
||||
exists.
|
||||
|
||||
<P>Finally, the state of the local clock can be determined using the
|
||||
<TT>rv</TT> command (without the argument), such as
|
||||
|
||||
<PRE>ntpq>rv
|
||||
status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg
|
||||
system="UNIX", leap=00, stratum=2, rootdelay=280.62,
|
||||
rootdispersion=45.26, peer=11673, refid=128.4.1.20,
|
||||
reftime=af00bb42.56111000 Fri, Jan 15 1993 4:25:38.336,
|
||||
poll=8, clock=af00bbcd.8a5de000 Fri, Jan 15 1993 4:27:57.540,
|
||||
phase=21.147, freq=13319.46, compliance=2
|
||||
</PRE>
|
||||
|
||||
The most useful data in this billboard show when the clock was last
|
||||
adjusted <TT>reftime</TT>, together with its status and most recent
|
||||
exception event. An explanation of these data is in the specification
|
||||
RFC-1305.
|
||||
|
||||
<P>When nothing seems to happen in the <TT>pe</TT> billboard after some
|
||||
minutes, there may be a network problem. The most common network problem
|
||||
is an access controlled router on the path to the selected peer. No
|
||||
known public NTP time server selectively restricts access at this time,
|
||||
although this may change in future; however, many private networks do.
|
||||
It also may be the case that the server is down or running in
|
||||
unsynchronized mode due to a local problem. Use the <TT>ntpq</TT>
|
||||
program to spy on its own variables in the same way you can spy on your
|
||||
own.
|
||||
|
||||
<P>Once the daemon has set the local clock, it will continuously track
|
||||
the discrepancy between local time and NTP time and adjust the local
|
||||
clock accordingly. There are two components of this adjustment, time and
|
||||
frequency. These adjustments are automatically determined by the clock
|
||||
discipline algorithm, which functions as a hybrid phase/frequency
|
||||
feedback loop. The behavior of this algorithm is carefully controlled to
|
||||
minimize residual errors due to network jitter and frequency variations
|
||||
of the local clock hardware oscillator that normally occur in practice.
|
||||
However, when started for the first time, the algorithm may take some
|
||||
time to converge on the intrinsic frequency error of the host machine.
|
||||
|
||||
<P>It has sometimes been the experience that the local clock oscillator
|
||||
frequency error is too large for the NTP discipline algorithm, which can
|
||||
correct frequency errors as large as 43 seconds per day. There are two
|
||||
possibilities that may result in this problem. First, the hardware time-
|
||||
of-year clock chip must be disabled when using NTP, since this can
|
||||
destabilize the discipline process. This is usually done using the
|
||||
<TT><A HREF="tickadj.htm">tickadj</A></TT> program and the <TT>-s</TT>
|
||||
command line argument, but other means may be necessary. For instance,
|
||||
in the Sun Solaris kernel, this can be done using a command in the
|
||||
system startup file.
|
||||
|
||||
<P>Normally, the daemon will adjust the local clock in small steps in
|
||||
such a way that system and user programs are unaware of its operation.
|
||||
The adjustment process operates continuously as long as the apparent
|
||||
clock error exceeds 128 milliseconds, which for most Internet paths is a
|
||||
quite rare event. If the event is simply an outlyer due to an occasional
|
||||
network delay spike, the correction is simply discarded; however, if the
|
||||
apparent time error persists for an interval of about 20 minutes, the
|
||||
local clock is stepped to the new value (as an option, the daemon can be
|
||||
compiled to slew at an accelerated rate to the new value, rather than be
|
||||
stepped). This behavior is designed to resist errors due to severely
|
||||
congested network paths, as well as errors due to confused radio clocks
|
||||
upon the epoch of a leap second.
|
||||
|
||||
<H4>Debugging Checklist</H4>
|
||||
|
||||
If the <TT>ntpq</TT> or <TT>ntpdc</TT> programs do not show that
|
||||
messages are being received by the daemon or that received messages do
|
||||
not result in correct synchronization, verify the following:
|
||||
|
||||
<OL>
|
||||
|
||||
<P><LI>Verify the <TT>/etc/services</TT> file host machine is configured
|
||||
to
|
||||
accept UDP packets on the NTP port 123. NTP is specifically designed to
|
||||
use UDP and does not respond to TCP.</LI>
|
||||
|
||||
<P><LI>Check the system log for <TT>ntpd</TT> messages about
|
||||
configuration
|
||||
errors, name-lookup failures or initialization problems.</LI>
|
||||
|
||||
<P><LI>Using the <TT>ntpdc</TT> program and <TT>iostats</TT> command,
|
||||
verify that the received packets and packets sent counters are
|
||||
incrementing. If the packets send counter does not increment and the
|
||||
configuration file includes designated servers, something may be wrong
|
||||
in the network configuration of the ntpd host. If this counter does
|
||||
increment and packets are actually being sent to the network, but the
|
||||
received packets counter does not increment, something may be wrong in
|
||||
the network or the server may not be responding.</LI>
|
||||
|
||||
<P><LI>If both the packets sent counter and received packets counter do
|
||||
increment, but the <TT>rec</TT> timestamp in the <TT>pe</TT> billboard
|
||||
shows far from the current date, received packets are probably being
|
||||
discarded for some reason. There is a handy, undocumented state variable
|
||||
<TT>flash</TT> visible in the <TT>pe</TT>billboard. The value is in hex
|
||||
and normally has the value zero (OK). However, if something is wrong,
|
||||
the bits of this variable, reading from the right, correspond to the
|
||||
sanity checks listed in Section 3.4.3 of the NTP specification <A
|
||||
HREF="http://www.eecis.udel.edu/~mills/database/rfc/rfc1305/rfc1305b.ps"
|
||||
>RFC-1305</A>. A bit other than zero indicates the associated sanity
|
||||
check failed.</LI>
|
||||
|
||||
<P><LI>If the <TT>org, rec</TT> and <TT>xmt</TT> timestamps in the
|
||||
<TT>pe</TT> billboard appear current, but the local clock is not set, as
|
||||
indicated by a stratum number less than 16 in the <TT>rv</TT> command
|
||||
without arguments, verify that valid clock offset, roundtrip delay and
|
||||
dispersion are displayed for at least one peer. The clock offset should
|
||||
be less than 1000 seconds, the roundtrip delay less than one second and
|
||||
the dispersion less than one second.</LI>
|
||||
|
||||
|
||||
<P><LI>While the algorithm can tolerate a relatively large frequency
|
||||
error (up to 500 parts per million or 43 seconds per day), various
|
||||
configuration errors (and in some cases kernel bugs) can exceed this
|
||||
tolerance, leading to erratic behavior. This can result in frequent loss
|
||||
of synchronization, together with wildly swinging offsets. Use the
|
||||
<TT>ntpdc</TT> program (or temporary configuration file) and <TT>disable
|
||||
pll</TT> command to prevent the <TT>ntpd</TT> daemon from setting the
|
||||
clock. Using the <TT>ntpq</TT> or <TT>ntpdc</TT> programs, watch the
|
||||
apparent offset as it varies over time to determine the intrinsic
|
||||
frequency error. If the error increases by more than 22 milliseconds per
|
||||
64-second poll interval, the intrinsic frequency must be reduced by some
|
||||
means. The easiest way to do this is with the <TT><A
|
||||
HREF="tickadj.htm">tickadj</A></TT> program and the <TT>-t</TT>
|
||||
command line argument.</LI>
|
||||
|
||||
</OL>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
157
contrib/ntp/html/driver1.htm
Normal file
157
contrib/ntp/html/driver1.htm
Normal file
@ -0,0 +1,157 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Undisciplined Local Clock
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Undisciplined Local Clock</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.1.<I>u</I>
|
||||
<BR>Reference ID: <TT>LCL</TT>
|
||||
<BR>Driver ID: <TT>LOCAL</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver is intended for use in an isolated network where no external
|
||||
source of synchronization such as a radio clock or modem is available.
|
||||
It allows a designated time server to act as a primary server to provide
|
||||
synchronization to other clients on the network. Pick a machine that has
|
||||
a good clock oscillator (Digital machines are good, Sun machines are not)
|
||||
and configure it with this driver. Set the clock using the best means available,
|
||||
like eyeball-and-wristwatch. Then, point all the other machines at this
|
||||
one or use broadcast (not multicast) mode to distribute time.
|
||||
|
||||
<P>Another application for this driver is if a particular server clock
|
||||
is to be used as the clock of last resort when all other normal synchronization
|
||||
sources have gone away. This is especially useful if that server has an
|
||||
ovenized oscillator. For this you would configure this driver at a stratum
|
||||
greater than any other likely sources of time (say 3 or 4) to prevent the
|
||||
server taking over when legitimate sources are still available.
|
||||
|
||||
<P>A third application for this driver is when an external discipline source
|
||||
is available, such as the NIST <TT>lockclock</TT> program, which synchronizes
|
||||
the local clock via a telephone modem and the NIST Automated Computer Time
|
||||
Service (ACTS), or the Digital Time Synchronization Service (DTSS), which
|
||||
runs on DCE machines. In this case the stratum should be set at zero, indicating
|
||||
a bona fide stratum-1 source. In the case of DTSS, the local clock can
|
||||
have a rather large jitter, depending on the interval between corrections
|
||||
and the intrinsic frequency error of the clock oscillator. In extreme cases,
|
||||
this can cause clients to exceed the 128-ms slew window and drop off the
|
||||
NTP subnet.
|
||||
|
||||
<P>In the case where a NTP time server is synchronized to some device or
|
||||
protocol that is not external to the NTP daemon itself, some means should
|
||||
be provided to pass such things as error and health values to the NTP daemon
|
||||
for dissemination to its clients. If this is not done, there is a very
|
||||
real danger that the device or protocol could fail and with no means to
|
||||
tell NTP clients of the mishap. When ordinary Unix system calls like <TT>adjtime()</TT>
|
||||
are used to discipline the kernel clock, there is no obvious way this can
|
||||
be done without modifying the code for each case. However, when a modified
|
||||
kernel with the <TT>ntp_adjtime()</TT> system call is available,
|
||||
that routine can be used for the same purpose as the <TT>adjtime()</TT>
|
||||
routine and in addition provided with the estimated error, maximum error,
|
||||
and leap-indicator values. This is the preferred way to synchronize the
|
||||
kernel clock and pass information to the NTP clients.
|
||||
|
||||
<P>In the default mode the behavior of the clock selection algorithm is
|
||||
modified when this driver is in use. The algorithm is designed so that
|
||||
this driver will never be selected unless no other discipline source is
|
||||
available. This can be overridden with the <TT>prefer</TT> keyword of the
|
||||
<TT>server</TT> configuration command, in which case only this driver will
|
||||
be selected for synchronization and all other discipline sources will be
|
||||
ignored. This behavior is intended for use when an external discipline
|
||||
source controls the system clock. See the <A HREF="prefer.htm">Mitigation
|
||||
Rules and the <TT>prefer</TT> Keyword </A>page for a detailed description
|
||||
of the exact behavior.
|
||||
|
||||
<P>The stratum for this driver is set at 3 by default, but can be changed
|
||||
by the <TT>fudge</TT> configuration command and/or the <TT>ntpdc</TT> utility.
|
||||
The reference ID is <TT>LCL</TT> by default, but can be changed using the
|
||||
same mechanisms. <B>*NEVER*</B> configure this driver to operate at a stratum
|
||||
which might possibly disrupt a client with access to a bona fide primary
|
||||
server, unless the local clock oscillator is reliably disciplined by another
|
||||
source. <B>*NEVER NEVER*</B> configure a server which might devolve to
|
||||
an undisciplined local clock to use multicast mode.
|
||||
|
||||
<P>This driver provides a mechanism to trim the local clock in both time
|
||||
and frequency, as well as a way to manipulate the leap bits. The <TT>fudge
|
||||
time1</TT> parameter adjusts the time (in seconds) and the <TT>fudge time2</TT>
|
||||
parameter adjusts the frequency (in parts per million). Both parameters
|
||||
are additive and operate only once; that is, each command (as from <TT>ntpdc</TT>)
|
||||
adds signed increments in time or frequency to the nominal local clock
|
||||
time and frequency.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
No <TT>filegen clockstats</TT> monitor data are produced by this driver.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the frequency offset calibration factor, in parts per million,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 3.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>LCL</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A></DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
114
contrib/ntp/html/driver10.htm
Normal file
114
contrib/ntp/html/driver10.htm
Normal file
@ -0,0 +1,114 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Austron 2200A/2201A GPS Receivers
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Austron 2200A/2201A GPS Receivers</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.10.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_AS2201</TT>
|
||||
<BR>Serial Port: <TT>/dev/gps<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Austron 2200A/2201A GPS/LORAN Synchronized Clock
|
||||
and Timing Receiver connected via a serial port. It supports several special
|
||||
features of the clock, including the Input Buffer Module, Output Buffer
|
||||
Module, IRIG-B Interface Module and LORAN Assist Module. It requires the
|
||||
RS232 Buffered Serial Interface module for communication with the driver.
|
||||
For operation with multiple computers, it requires the <TT>ppsclock</TT>
|
||||
streams module described in the <A HREF="ldisc.htm">Line Disciplines and
|
||||
Streams Modules</A> page. The streams module requires a gadget box and
|
||||
1-PPS level converter, such as described in the <A HREF="pps.htm">Pulse-per-second
|
||||
(PPS) Signal Interfacing</A> page.
|
||||
|
||||
<P>For use with a single computer, the receiver can be connected directly
|
||||
to the receiver. For use with multiple computers, one of them is connected
|
||||
directly to the receiver and generates the polling messages. The other
|
||||
computers just listen to the receiver output directly or through a buffer
|
||||
amplifier. For computers that just listen, <TT>fudge flag2</TT> must be
|
||||
set and the <TT>ppsclock </TT>streams module configured on each of them.
|
||||
|
||||
<P>This receiver is capable of a comprehensive and large volume of statistics
|
||||
and operational data. The specific data collection commands and attributes
|
||||
are embedded in the driver source code; however, the collection process
|
||||
can be enabled or disabled using the flag4 flag. If set, collection is
|
||||
enabled; if not, which is the default, it is disabled. A comprehensive
|
||||
suite of data reduction and summary scripts is in the ./scripts/stats directory
|
||||
of the ntp3 distribution.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
is written as-is to the <TT>clockstats</TT> file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Set for computers that listen-only.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enable verbose <TT>clockstats</TT> recording if set.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
150
contrib/ntp/html/driver11.htm
Normal file
150
contrib/ntp/html/driver11.htm
Normal file
@ -0,0 +1,150 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Arbiter 1088A/B GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Arbiter 1088A/B GPS Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.11.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_ARBITER</TT>
|
||||
<BR>Serial Port: <TT>/dev/gps<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Arbiter 1088A/B Satellite Controlled Clock. The
|
||||
claimed accuracy of this clock is 100 ns relative to the PPS output when
|
||||
receiving four or more satellites.
|
||||
|
||||
<P>The receiver should be configured before starting the NTP daemon, in
|
||||
order to establish reliable position and operating conditions. It does
|
||||
not initiate surveying or hold mode. For use with NTP, the daylight savings
|
||||
time feature should be disables (<TT>D0</TT> command) and the broadcast
|
||||
mode set to operate in UTC (<TT>BU</TT> command).
|
||||
|
||||
<P>The timecode format supported by this driver is selected by the poll
|
||||
sequence <TT>B5</TT>, which initiates a line in the following format to
|
||||
be repeated once per second until turned off by the <TT>B0</TT> command.
|
||||
|
||||
<P>Format <TT>B5</TT> (24 ASCII printing characters):
|
||||
<PRE><cr><lf>i yy ddd hh:mm:ss.000bbb
|
||||
|
||||
on-time = <cr>
|
||||
i = synchronization flag (' ' = locked, '?' = unlocked)
|
||||
yy = year of century
|
||||
ddd = day of year
|
||||
hh:mm:ss = hours, minutes, seconds
|
||||
.000 = fraction of second (not used)
|
||||
bbb = tailing spaces for fill</PRE>
|
||||
The alarm condition is indicated by a '?' at i, which indicates the receiver
|
||||
is not synchronized. In normal operation, a line consisting of the timecode
|
||||
followed by the time quality character (TQ) followed by the receiver status
|
||||
string (SR) is written to the clockstats file.
|
||||
|
||||
<P>The time quality character is encoded in IEEE P1344 standard:
|
||||
|
||||
<P>Format <TT>TQ</TT> (IEEE P1344 estimated worst-case time quality)
|
||||
<PRE>0 clock locked, maximum accuracy
|
||||
F clock failure, time not reliable
|
||||
4 clock unlocked, accuracy < 1 us
|
||||
5 clock unlocked, accuracy < 10 us
|
||||
6 clock unlocked, accuracy < 100 us
|
||||
7 clock unlocked, accuracy < 1 ms
|
||||
8 clock unlocked, accuracy < 10 ms
|
||||
9 clock unlocked, accuracy < 100 ms
|
||||
A clock unlocked, accuracy < 1 s
|
||||
B clock unlocked, accuracy < 10 s</PRE>
|
||||
The status string is encoded as follows:
|
||||
|
||||
<P>Format <TT>SR</TT> (25 ASCII printing characters)
|
||||
<PRE>V=vv S=ss T=t P=pdop E=ee
|
||||
|
||||
vv = satellites visible
|
||||
ss = relative signal strength
|
||||
t = satellites tracked
|
||||
pdop = position dilution of precision (meters)
|
||||
ee = hardware errors</PRE>
|
||||
A three-stage median filter is used to reduce jitter and provide a dispersion
|
||||
measure. The driver makes no attempt to correct for the intrinsic jitter
|
||||
of the radio itself.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, an additional line containing
|
||||
the latitude, longitude, elevation and optional deviation data is written
|
||||
to the <TT>clockstats</TT> file. The deviation data operates with an external
|
||||
pulse-per-second (PPS) input, such as a cesium oscillator or another radio
|
||||
clock. The PPS input should be connected to the B event channel and the
|
||||
radio initialized for deviation data on that channel. The deviation data
|
||||
consists of the mean offset and standard deviation of the external PPS
|
||||
signal relative the GPS signal, both in microseconds over the last 16 seconds.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enable verbose <TT>clockstats</TT> recording if set.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
98
contrib/ntp/html/driver12.htm
Normal file
98
contrib/ntp/html/driver12.htm
Normal file
@ -0,0 +1,98 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>KSI/Odetics TPRO/S IRIG Interface
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
KSI/Odetics TPRO/S IRIG Interface</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.12.<I>u</I>
|
||||
<BR>Reference ID: <TT>IRIG</TT>
|
||||
<BR>Driver ID: <TT>IRIG_TPRO</TT>
|
||||
<BR>TPRO Device: <TT>/dev/tpro<I>u</I></TT>
|
||||
<BR>Requires: KSI/Odetics device driver, <TT>/usr/include/sys/tpro.h</TT> header file
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the KSI/Odetics TPRO and TPRO-SAT IRIG-B Decoder,
|
||||
which is a module connected directly to the SBus of a Sun workstation.
|
||||
The module works with the IRIG-B signal generated by several radio clocks,
|
||||
including those made by Arbiter, Austron, Odetics, Spectracom and TrueTime,
|
||||
among others, although it is generally an add- on option. In the case of
|
||||
the TPRO-SAT, the module is an integral part of a GPS receiver, which serves
|
||||
as the primary timing source.
|
||||
|
||||
<P>Using the TPRO interface as a NTP reference clock provides precision
|
||||
time only to ntpd and its clients. With suitable kernel modifications,
|
||||
it is possible to use the TPRO as the CPU system clock, avoiding errors
|
||||
introduced by the CPU clock oscillator wander. See the <A HREF="kern.htm">A
|
||||
Kernel Model for Precision Timekeeping </A>page for further details.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>IRIG</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
43
contrib/ntp/html/driver16.htm
Normal file
43
contrib/ntp/html/driver16.htm
Normal file
@ -0,0 +1,43 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="GENERATOR" content="Mozilla/4.6 [en] (Win95; U) [Netscape]">
|
||||
<meta name="Author" content="Ganesh Ramasivan">
|
||||
<title>Bancomm bc635VME Time and Frequency Processor</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>
|
||||
bc635VME/bc350VXI Time and Frequency Processor</h3>
|
||||
|
||||
<hr>
|
||||
<h4>
|
||||
Synopsis</h4>
|
||||
Address: <font size=-1>127.127.16</font>.<i>u</i>
|
||||
<br>Reference ID: <font size=-1>BTFP</font>
|
||||
<br>Driver ID: <font size=-1>GPS_BANCOMM</font>
|
||||
<br>Bancomm Device<font size=-1>: /dev/btfp0</font>
|
||||
<br>Requires<font size=-1>: Bancomm bc635 TFP device module driver for
|
||||
SunOS 4.x/SunOS 5.x</font>
|
||||
<h4>
|
||||
Description</h4>
|
||||
This is the clock driver for the Bancomm bc635VME Time and Frequency Processor.
|
||||
It requires the BANCOMM bc635VME /
|
||||
<br>bc350VXI Time and Frequency Processor Module Driver for SunOS 4.x/SunOS
|
||||
5.x UNIX Systems.
|
||||
<p>Most of this code is originally from refclock_bancomm.c with thanks.
|
||||
It has been modified and tested on an UltraSparc IIi-cEngine
|
||||
<br>running Solaris 2.6. A port for HPUX is not available henceforth.
|
||||
<br>
|
||||
<h4>
|
||||
Additional Information</h4>
|
||||
|
||||
<p><br><a href="http://www.eecis.udel.edu/~ntp/ntp_spool/html/refclock.htm">Reference
|
||||
Clock Drivers</a>
|
||||
<hr>
|
||||
<address>
|
||||
David L. Mills (mills@udel.edu)</address>
|
||||
|
||||
</body>
|
||||
</html>
|
235
contrib/ntp/html/driver18.htm
Normal file
235
contrib/ntp/html/driver18.htm
Normal file
@ -0,0 +1,235 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>NIST Modem Time Service
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
NIST Modem Time Service</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.18.<I>u</I>
|
||||
<BR>Reference ID: <TT>NIST</TT>
|
||||
<BR>Driver ID: <TT>ACTS_NIST</TT>
|
||||
<BR>Serial Port: <TT>/dev/acts<I>u</I></TT>; 1200 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<BR>Requires: <TT>/usr/include/sys/termios.h</TT> header file with modem
|
||||
control
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the NIST Automated Computer Time Service (ACTS). It
|
||||
periodically dials a prespecified telephone number, receives the NIST timecode
|
||||
data and calculates the local clock correction. It designed primarily for
|
||||
use when neither a radio clock nor connectivity to Internet time servers
|
||||
is available. For the best accuracy, the individual telephone line/modem
|
||||
delay needs to be calibrated using outside sources.
|
||||
|
||||
<P>The ACTS is located at NIST Boulder, CO, telephone 303 494 4774. A toll
|
||||
call from Newark, DE, costs between three and four cents, although it is
|
||||
not clear what carrier and time of day discounts apply. The modem dial
|
||||
string will differ depending on local telephone configuration, etc., and
|
||||
is specified by the phone command in the configuration file. The argument
|
||||
to this command is an AT command for a Hayes compatible modem.
|
||||
|
||||
<P>The driver can operate in either of two modes, as determined by the
|
||||
mode parameter in the server configuration command. In mode 0 the driver
|
||||
operates continuously at intervals determined by the fudge time1 parameter,
|
||||
as described above. In mode 1 the driver is enabled only when no other
|
||||
sources of synchronization are available and when we have gone more than
|
||||
MAXOUTAGE (3600 s) since last synchronized by other sources of synchronization.
|
||||
|
||||
<P>The accuracy produced by this driver should be in the range of a millisecond
|
||||
or two, but may need correction due to the delay characteristics of the
|
||||
individual modem involved. For undetermined reasons, some modems work with
|
||||
the ACTS echo-delay measurement scheme and some don't. This driver tries
|
||||
to do the best it can with what it gets. Initial experiments with a Practical
|
||||
Peripherals 9600SA modem here in Delaware suggest an accuracy of a millisecond
|
||||
or two can be achieved without the scheme by using a fudge time1 value
|
||||
of 65.0 ms. In either case, the dispersion for a single call involving
|
||||
ten samples is about 1.3 ms.
|
||||
|
||||
<P>For reliable call management, this driver requires a 1200-bps modem
|
||||
with a Hayes-compatible command set and control over the modem data terminal
|
||||
ready (DTR) control line. Present restrictions require the use of a POSIX-compatible
|
||||
programming interface, although other interfaces may work as well. The
|
||||
ACTS telephone number and modem setup string are hard-coded in the driver
|
||||
and may require changes for nonstandard modems or special circumstances.
|
||||
|
||||
<P>The fudge time1 parameter represents a propagation-delay correction
|
||||
factor which is added to the value computed by ACTS when the echo-delay
|
||||
scheme is used. This scheme does not work with all modems; for those that
|
||||
don't, fudge flag2 should be set to disable the feature. In this case the
|
||||
fudge time1 parameter represents the total propagation delay due to all
|
||||
causes and must be determined by external calibration.
|
||||
|
||||
<P>The ACTS call interval is determined by a counter initially set to the
|
||||
fudge time2 parameter. At each poll interval, minpoll (usually 64 s) is
|
||||
subtracted from the counter. When the counter is equal to or less than
|
||||
zero, the fudge flag1 is set, which causes up to three call attempts to
|
||||
be made to ACTS. The fudge flag1 is reset after a valid clock update has
|
||||
been determined or by a device fault, timeout or manually using <TT>ntpdc</TT>.
|
||||
After a valid clock update, the counter is reset for the next interval.
|
||||
Setting the <TT>fudge time2</TT> parameter to zero disables automatic call
|
||||
attempts. Manual call attempts can be made at any time by setting <TT>fudge
|
||||
flag1</TT> using ntpdc.
|
||||
|
||||
<P>The NIST timecode message is transmitted at 1200 bps in the following
|
||||
format:
|
||||
<PRE>
|
||||
jjjjj yy-mm-dd hh:mm:ss tt l uuu mmmmm UTC(NIST) *
|
||||
|
||||
jjjjj = modified Julian day
|
||||
yy-mm-dd = year, month, day
|
||||
hh:mm:ss = hours, minutes, seconds
|
||||
tt = DST indicator (see driver listing)
|
||||
l = leap-second warning (see driver listing)
|
||||
uuu = DUT1 correction (see driver listing)
|
||||
mmmmm = modem calibration (see driver listing)
|
||||
on-time = '*'</PRE>
|
||||
The timecode message is transmitted continuously after a signon banner,
|
||||
which this driver ignores. The driver also ignores all but the yy-mm-dd,
|
||||
hh:mm:ss and on-time character '*' fields, although it checks the format
|
||||
of all fields of the message. A timestamp is captured at the '*' character,
|
||||
as required by the ACTS specification, and used as the reference time of
|
||||
the timecode. If a message with an on-time character of '#' is received,
|
||||
the driver updates the propagation delay. The driver disconnects when (a)
|
||||
ten valid messages have been received, (b) no message has been received
|
||||
for 15 s, (c) an on-time character of '#' is received. These messages are
|
||||
processed by a trimmed-mean filter to reduce timing noise and then by the
|
||||
usual NTP algorithms to develop the clock correction.
|
||||
|
||||
<P>Since the accumulated error grows with the interval between calls, it
|
||||
is important that the intrinsic frequency error be minimized. This can
|
||||
be done by observing difference in offsets between two calls placed some
|
||||
hours apart and calculating the uncorrected frequency error. This error,
|
||||
as a fixed-point value in parts-per-million, should be installed in the
|
||||
ntp.drift file before the daemon is started. Some experimentation may be
|
||||
necessary in order to reduce the intrinsic frequency error to the order
|
||||
of 1 ppm.
|
||||
|
||||
<P>The behavior of the clock selection algorithm is modified when this
|
||||
driver is in use. The algorithm is designed so that this driver will never
|
||||
be selected unless no other discipline source is available. This can be
|
||||
overridden with the prefer keyword of the server configuration command,
|
||||
in which case only this driver will be selected for synchronization and
|
||||
all other discipline sources will be ignored.
|
||||
|
||||
<P>Unlike other drivers, each ACTS call generates one clock correction
|
||||
and that correction is processed immediately. There is no wait to allow
|
||||
the clock filter to accumulate samples. In addition, the watchdog timeout
|
||||
of the local clock algorithm is disabled, so that a correction received
|
||||
from this driver that exceeds CLOCK_MAX (128 ms) causes an immediate step/slew.
|
||||
|
||||
<P>Since the interval between updates can be much longer than used with
|
||||
ordinary NTP peers, the local clock procedure has been modified to operate
|
||||
in either of two modes, depending on whether the interval between updates
|
||||
is less than or greater than CLOCK_MAXSEC (1200 s). If less than this value,
|
||||
the local clock procedure operates using the standard NTP phase-lock loop
|
||||
as with other NTP peers. If greater than this value, the procedure operates
|
||||
using a modified frequency-lock loop suggested by Judah Levine in his lockclock
|
||||
algorithm designed specifically for ACTS.
|
||||
<H4>
|
||||
Call Management</H4>
|
||||
Since ACTS will be a toll call in most areas of the country, it is necessary
|
||||
to carefully manage the call frequency. This can be done in two ways, by
|
||||
specifying the interval between calls, or by setting a flag bit manually
|
||||
or via a cron job. The call interval is determined by a counter initially
|
||||
set to the fudge time2 parameter. At each poll interval, minpoll (usually
|
||||
64 s) is subtracted from the counter. When the counter is equal to or less
|
||||
than zero, the fudge flag1 is set, which causes up to three call attempts
|
||||
to be made. The fudge flag1 is reset after ten offset samples have been
|
||||
determined in a single call or by a device fault, timeout or manually using
|
||||
ntpdc. Upon successful completion of a call, the eight samples have been
|
||||
shifted into the clock filter, the local clock updated and the counter
|
||||
reset for the next interval. Setting the fudge time2 parameter to zero
|
||||
disables automatic call attempts.
|
||||
|
||||
<P>Manual call attempts can be made at any time by setting fudge flag1
|
||||
using ntpdc. For example, the ntpdc command
|
||||
<PRE>
|
||||
fudge 127.127.18.1 flags 1</PRE>
|
||||
will ask for a key identifier and password and, if authenticated by the
|
||||
server, will set flag1. There may be a short delay until the expiration
|
||||
of the current poll timeout.
|
||||
|
||||
<P>The flag1 can be set from a cron job in the following way. Construct
|
||||
a file with contents
|
||||
<PRE>keyid 11
|
||||
passwd dialup
|
||||
fudge 127.127.18.1 flags 1
|
||||
quit</PRE>
|
||||
Then, run the following program at specified times as required.
|
||||
<PRE>/usr/local/bin/ntpdc <file</PRE>
|
||||
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
is written as-is to the <TT>clockstats</TT> file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>NIST</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
124
contrib/ntp/html/driver19.htm
Normal file
124
contrib/ntp/html/driver19.htm
Normal file
@ -0,0 +1,124 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Heath WWV/WWVH Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Heath WWV/WWVH Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.19.<I>u</I>
|
||||
<BR>Reference ID: <TT>WWV</TT>
|
||||
<BR>Driver ID: <TT>WWV_HEATH</TT>
|
||||
<BR>Serial Port: <TT>/dev/heath<I>u</I></TT>; 1200 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<BR>Requires: <TT>/usr/include/sys/termios.h</TT> header file with modem
|
||||
control
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Heath GC-1000 Most Accurate Clock, with RS232C
|
||||
Output Accessory. This is a WWV/WWVH receiver somewhat less robust than
|
||||
other supported receivers. Its claimed accuracy is 100 ms when actually
|
||||
synchronized to the broadcast signal, but this doesn't happen even most
|
||||
of the time, due to propagation conditions, ambient noise sources, etc.
|
||||
When not synchronized, the accuracy is at the whim of the internal clock
|
||||
oscillator, which can wander into the sunset without warning. Since the
|
||||
indicated precision is 100 ms, expect a host synchronized only to this
|
||||
thing to wander to and fro, occasionally being rudely stepped when the
|
||||
offset exceeds the default CLOCK_MAX of 128 ms.
|
||||
|
||||
<P>The internal DIPswitches should be set to operate at 1200 baud in MANUAL
|
||||
mode and the current year. The external DIPswitches should be set to GMT
|
||||
and 24-hour format. It is very important that the year be set correctly
|
||||
in the DIPswitches; otherwise, the day of year will be incorrect after
|
||||
28 April of a normal or leap year.
|
||||
|
||||
<P>In MANUAL mode the clock responds to a rising edge of the request to
|
||||
send (RTS) modem control line by sending the timecode. Therefore, it is
|
||||
necessary that the operating system implement the <TT>TIOCMBIC</TT> and
|
||||
<TT>TIOCMBIS</TT> ioctl system calls and <TT>TIOCM_RTS</TT> control bit.
|
||||
Present restrictions require the use of a POSIX-compatible programming
|
||||
interface, although other interfaces may work as well.
|
||||
|
||||
<P>The clock message consists of 23 ASCII printing characters in the following
|
||||
format:
|
||||
<PRE>hh:mm:ss.f dd/mm/yr<cr>
|
||||
|
||||
hh:mm:ss.f = hours, minutes, seconds
|
||||
f = deciseconds ('?' when out of spec)
|
||||
dd/mm/yr = day, month, year</PRE>
|
||||
The alarm condition is indicated by '?', rather than a digit, at A. Note
|
||||
that 0?:??:??.? is displayed before synchronization is first established
|
||||
and hh:mm:ss.? once synchronization is established and then lost again
|
||||
for about a day.
|
||||
|
||||
<P>A fudge time1 value of .07 s appears to center the clock offset residuals.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>WWV</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
137
contrib/ntp/html/driver2.htm
Normal file
137
contrib/ntp/html/driver2.htm
Normal file
@ -0,0 +1,137 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Trak 8820 GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Trak 8820 GPS Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.2.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_TRAK</TT>
|
||||
<BR>Serial Port: <TT>/dev/trak<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Trak 8820 GPS Station Clock. The claimed accuracy
|
||||
at the 1-PPS output is 200-300 ns relative to the broadcast signal; however,
|
||||
in most cases the actual accuracy is limited by the precision of the timecode
|
||||
and the latencies of the serial interface and operating system.
|
||||
|
||||
<P>For best accuracy, this radio requires the <TT>tty_clk</TT> line discipline,
|
||||
which captures a timestamp at the <TT>*</TT> on-time character of the timecode.
|
||||
Using this discipline the jitter is in the order of 1 ms and systematic
|
||||
error about 0.5 ms. If unavailable, the buffer timestamp is used, which
|
||||
is captured at the <TT>\r</TT> ending the timecode message. This introduces
|
||||
a systematic error of 23 character times, or about 24 ms at 9600 bps, together
|
||||
with a jitter well over 8 ms on Sun IPC-class machines.
|
||||
|
||||
<P>Using the menus, the radio should be set for 9600 bps, one stop bit
|
||||
and no parity. It should be set to operate in computer (no echo) mode.
|
||||
The timecode format includes neither the year nor leap-second warning.
|
||||
|
||||
<P>In operation, this driver sends a <TT>RQTS\r</TT> request to the radio
|
||||
at initialization in order to put it in continuous time output mode. The
|
||||
radio then sends the following message once each second:
|
||||
<PRE>*RQTS U,ddd:hh:mm:ss.0,q<cr><lf>
|
||||
|
||||
on-time = '*'
|
||||
ddd = day of year
|
||||
hh:mm:ss = hours, minutes, seconds
|
||||
q = quality indicator (phase error), 0-6:
|
||||
0 > 20 us
|
||||
6 > 10 us
|
||||
5 > 1 us
|
||||
4 > 100 ns
|
||||
3 > 10 ns
|
||||
2 < 10 ns</PRE>
|
||||
The alarm condition is indicated by <TT>0</TT> at <TT>Q</TT>, which means
|
||||
the radio has a phase error greater than 20 us relative to the broadcast
|
||||
time. The absence of year, DST and leap-second warning in this format is
|
||||
also alarmed.
|
||||
|
||||
<P>The continuous time mode is disabled using the <TT>RQTX\r</TT> request,
|
||||
following which the radio sends a <TT>RQTX DONE<cr><lf></TT> response.
|
||||
In the normal mode, other control and status requests are effective, including
|
||||
the leap-second status request <TT>RQLS<cr></TT>. The radio responds
|
||||
with <TT>RQLS yy,mm,dd<cr><lf></TT>, where <TT>yy,mm,dd</TT> are
|
||||
the year, month and day. Presumably, this gives the epoch of the next leap
|
||||
second, <TT>RQLS 00,00,00</TT> if none is specified in the GPS message.
|
||||
Specified in this form, the information is generally useless and is ignored
|
||||
by the driver.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
is written as-is to the <TT>clockstats</TT> file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A></DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
131
contrib/ntp/html/driver20.htm
Normal file
131
contrib/ntp/html/driver20.htm
Normal file
@ -0,0 +1,131 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Generic NMEA GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Generic NMEA GPS Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.20.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_NMEA</TT>
|
||||
<BR>Serial Port: <TT>/dev/gps<I>u</I></TT>; 4800 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports GPS receivers with the <TT>$GPRMC</TT> NMEA output string.
|
||||
The driver expect the receiver to be set up to transmit a <TT>$GPRMC</TT>
|
||||
message every second.
|
||||
|
||||
<P>The accuracy depend on the receiver used. Inexpesive GPS models are
|
||||
available with a claimed PPS signal accuracy of 1 <FONT FACE="Symbol">m</FONT>s
|
||||
or better relative to the broadcast signal. However, in most cases the
|
||||
actual accuracy is limited by the precision of the timecode and the latencies
|
||||
of the serial interface and operating system.
|
||||
|
||||
<P>The $GPRMC message that the GPS transmits look like this:
|
||||
<PRE>$GPRMC,POS_UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CC<cr><lf>
|
||||
|
||||
POS_UTC - UTC of position. Hours, minutes and seconds. (hhmmss)
|
||||
POS_STAT - Position status. (A = Data valid, V = Data invalid)
|
||||
LAT - Latitude (llll.ll)
|
||||
LAT_REF - Latitude direction. (N = North, S = South)
|
||||
LON - Longitude (yyyyy.yy)
|
||||
LON_REF - Longitude direction (E = East, W = West)
|
||||
SPD - Speed over ground. (knots) (x.x)
|
||||
HDG - Heading/track made good (degrees True) (x.x)
|
||||
DATE - Date (ddmmyy)
|
||||
MAG_VAR - Magnetic variation (degrees) (x.x)
|
||||
MAG_REF - Magnetic variation (E = East, W = West)
|
||||
CC - Checksum (optional)
|
||||
<cr><lf> - Sentence terminator.</PRE>
|
||||
The driver will send a <TT>$PMOTG,RMC,0000*1D<cr><lf></TT> message
|
||||
each time a <TT>$GPRMC</TT> string is needed. This is not needed on most
|
||||
GPS receivers because they automatically send the <TT>$GPRMC</TT> string
|
||||
every second and will only work on GPS receivers that understand the <TT>$PMOTG</TT>
|
||||
string. Others will just ignore it.
|
||||
<H4>
|
||||
Setting up the Garmin GPS-25XL</H4>
|
||||
Switch off all output with by sending it the following string.
|
||||
<PRE>"$PGRMO,,2<cr><lf>"</PRE>
|
||||
Now switch only $GPRMC on by sending it the following string.
|
||||
<PRE>"$PGRMO,GPRMC,1<cr><lf>"</PRE>
|
||||
On some systems the PPS signal isn't switched on by default. It can be
|
||||
switched on by sending the following string.
|
||||
<PRE>"$PGRMC,,,,,,,,,,,,2<cr><lf>"</PRE>
|
||||
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
The $GPRMC string that is used is written to the clockstats file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A></DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
129
contrib/ntp/html/driver22.htm
Normal file
129
contrib/ntp/html/driver22.htm
Normal file
@ -0,0 +1,129 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>PPS Clock Discipline
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
PPS Clock Discipline</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.22.<I>u</I>
|
||||
<BR>Reference ID: <TT>PPS</TT>
|
||||
<BR>Driver ID: <TT>PPS</TT>
|
||||
<BR>Serial Port: <TT>/dev/pps<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver furnishes an interface for pulse-per-second (PPS) signals produced
|
||||
by a cesium clock, radio clock or related equipment. It can be used to
|
||||
remove accumulated jitter and retime a secondary server when synchronized
|
||||
to a primary server over a congested, wide-area network and before redistributing
|
||||
the time to local clients.
|
||||
|
||||
<P>In order for this driver to work, the local clock must be set to within
|
||||
+-500 ms by another means, such as a radio clock or NTP itself. The PPS
|
||||
signal is connected via a serial port and <A HREF="gadget.htm">gadget box</A>
|
||||
consisting of a one-shot and RS232 level converter. When operated at 38.4
|
||||
kbps with a SPARCstation IPC, this arrangement has a worst-case jitter
|
||||
less than 26 us.
|
||||
|
||||
<P>There are three ways in which this driver can be used. The first way
|
||||
uses the <TT>ppsclock</TT> line discipline and works only for the baseboard
|
||||
serial ports of the Sun SPARCstation running SunOS 4.x. The PPS signal
|
||||
is connected via the gadget box to the carrier detect (DCD) line of a serial
|
||||
port. The signal is activated for this port by a <TT>fudge flag3 1</TT>
|
||||
command following the <TT>server</TT> command in the configuration file.
|
||||
This causes the <TT>ppsclock</TT> streams module to be configured for that
|
||||
port and to capture a timestamp at the on-time transition of the PPS signal.
|
||||
This driver then reads the timestamp directly by a designated <TT>ioctl()</TT>
|
||||
system call. This provides the most accurate time and least jitter of any
|
||||
other scheme. There is no need to configure a dedicated device for this
|
||||
purpose, which ordinarily is the device used for the associated radio clock.
|
||||
|
||||
<P>The second way uses the <TT>tty_clk</TT> line discipline and works for
|
||||
any architecture supporting a serial port. If after a few seconds this
|
||||
driver finds no <TT>ppsclock</TT> module configured, it attempts to open
|
||||
a serial port device <TT>/dev/pps%d</TT>, where <TT>%d</TT> is the unit
|
||||
number, and assign the <TT>tty_clk</TT> line discipline to it. If the line
|
||||
discipline fails, no harm is done except the accuracy is reduced somewhat.
|
||||
The pulse generator in the gadget box must be adjusted to produce a start
|
||||
bit of length 26 usec at 38400 bps. Used with the <TT>tty_clk</TT> line
|
||||
discipline, this produces an ASCII DEL character ('\377') followed by a
|
||||
timestamp at the on-time transition of the PPS signal.
|
||||
|
||||
<P>The third way involves an auxiliary radio clock driver which calls the
|
||||
PPS driver with a timestamp captured by that driver. This use is documented
|
||||
in the source code for the driver(s) involved.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0. This parameter can be used to compensate for the UART
|
||||
and OS delays. Allow about 247 us for UART delays at 38400 bps and about
|
||||
1 ms for SunOS streams nonsense.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>PPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A></DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
87
contrib/ntp/html/driver23.htm
Normal file
87
contrib/ntp/html/driver23.htm
Normal file
@ -0,0 +1,87 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>PTB Modem Time Service
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
PTB Modem Time Service</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.23.<I>u</I>
|
||||
<BR>Reference ID: <TT>PTB</TT>
|
||||
<BR>Driver ID: <TT>ACTS_PTP</TT>
|
||||
<BR>Serial Port: <TT>/dev/ptb<I>u</I></TT>; 1200 baud, 8-bits, no parity
|
||||
<BR>Requires: <TT>/usr/include/sys/termios.h</TT> header file with modem
|
||||
control
|
||||
<H4>
|
||||
Description</H4>
|
||||
No further information available.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default PTB.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this drivert.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
85
contrib/ntp/html/driver24.htm
Normal file
85
contrib/ntp/html/driver24.htm
Normal file
@ -0,0 +1,85 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>USNO Modem Time Service
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
USNO Modem Time Service</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.24.<I>u</I>
|
||||
<BR>Reference ID: <TT>USNO</TT>
|
||||
<BR>Driver ID: <TT>ACTS_USNO</TT>
|
||||
<BR>Serial Port: <TT>/dev/cua<I>u</I></TT>; 1200 baud, 8-bits, no parity
|
||||
<BR>Requires: <TT>/usr/include/sys/termios.h</TT> header file with modem
|
||||
control
|
||||
<H4>
|
||||
Description</H4>
|
||||
No information available.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>USNO</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enable <TT>clockstats</TT> recording if set.</DD>
|
||||
</DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
109
contrib/ntp/html/driver26.htm
Normal file
109
contrib/ntp/html/driver26.htm
Normal file
@ -0,0 +1,109 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Hewlett Packard 58503A GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Hewlett Packard 58503A GPS Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.26.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_HP</TT>
|
||||
<BR>Serial Port: <TT>/dev/hpgps<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the HP 58503A Time and Frequency Reference Receiver.
|
||||
It uses HP SmartClock (TM) to implement an Enhanced GPS receiver. The receiver
|
||||
accuracy when locked to GPS in normal operation is better than 1 usec.
|
||||
The accuracy when operating in holdover is typically better than 10 us
|
||||
per day. It receiver should be operated with factory default settings.
|
||||
Initial driver operation: expects the receiver to be already locked to
|
||||
GPS, configured and able to output timecode format 2 messages.
|
||||
|
||||
<P>The driver uses the poll sequence <TT>:PTIME:TCODE?</TT> to get a response
|
||||
from the receiver. The receiver responds with a timecode string of ASCII
|
||||
printing characters, followed by a <cr><lf>, followed by a prompt
|
||||
string issued by the receiver, in the following format:
|
||||
<PRE>T#yyyymmddhhmmssMFLRVcc<cr><lf></PRE>
|
||||
The driver processes the response at the <cr> and <lf><cr> and
|
||||
<lf>, so what the driver sees is the prompt from the previous poll,
|
||||
followed by this timecode. The prompt from the current poll is (usually)
|
||||
left unread until the next poll. So (except on the very first poll) the
|
||||
driver sees this:
|
||||
<PRE>T#yyyymmddhhmmssMFLRVcc<cr><lf></PRE>
|
||||
The T is the on-time character, at 980 msec. before the next 1PPS edge.
|
||||
The # is the timecode format type. We look for format 2. Without any of
|
||||
the CLK or PPS stuff, then, the receiver buffer timestamp at the <cr>y
|
||||
is 24 characters later, which is about 25 msec. at 9600 bps, so the first
|
||||
approximation for fudge time1 is nominally -0.955 seconds. This number
|
||||
probably needs adjusting for each machine / OS type, so far: -0.955000
|
||||
on an HP 9000 Model 712/80 HP-UX 9.05 -0.953175 on an HP 9000 Model 370
|
||||
HP-UX 9.10
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
634
contrib/ntp/html/driver27.htm
Normal file
634
contrib/ntp/html/driver27.htm
Normal file
@ -0,0 +1,634 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Arcron MSF Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Arcron MSF Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.27.<I>u</I>
|
||||
<BR>Reference ID: <TT>MSFa</TT>
|
||||
<BR>Driver ID: <TT>MSF_ARCRON</TT>
|
||||
<BR>Serial Port: <TT>/dev/arc<I>u</I></TT>; 300 baud, 8-bits, 2-stop, no
|
||||
parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Arcron MSF receiver, and would probably also support
|
||||
the DCF77 variant of the same clock. The clock reports its ID as ``<TT>MSFa</TT>''
|
||||
to indicate MSF as a source and the use of the ARCRON driver.
|
||||
|
||||
<P>This documentation describes version V1.1 (1997/06/23) of the source
|
||||
and has been tested (amongst others) against ntpd3-5.90 on Solaris-1 (SunOS
|
||||
4.1.3_U1 on an SS1 serving as a router and firewall) and against ntpd3-5.90
|
||||
on Solaris-2.5 (on a SS1+ and TurboSPARC 170MHz). This code will probably
|
||||
work, and show increased stability, reduced jitter and more efficiency
|
||||
(fewer context switches) with the <TT>tty_clk</TT> discipline/STREAMS module
|
||||
installed, but this has not been tested. For a to-do list see the comments
|
||||
at the start of the code.
|
||||
|
||||
<P>This code has been significantly slimmed down since the V1.0 version,
|
||||
roughly halving the memory footprint of its code and data.
|
||||
|
||||
<P>This driver is designed to allow the unit to run from batteries as designed,
|
||||
for something approaching the 2.5 years expected in the usual stand-alone
|
||||
mode, but no battery-life measurements have been taken.
|
||||
|
||||
<P>Much of this code is originally from the other refclock driver files
|
||||
with thanks. The code was originally made to work with the clock by <A HREF="mailto:derek@toybox.demon.co.uk">Derek
|
||||
Mulcahy</A>, with modifications by <A HREF="mailto:d@hd.org">Damon Hart-Davis</A>.
|
||||
Thanks also to <A HREF="mailto:lyndond@sentinet.co.uk">Lyndon David</A>
|
||||
for some of the specifications of the clock.
|
||||
|
||||
<P>There is support for a Tcl/Tk monitor written by Derek Mulcahy that
|
||||
examines the output stats; see the <A HREF="http://www2.exnet.com/NTP/ARC/ARC.htm">ARC
|
||||
Rugby MSF Receiver</A> page for more details and the code.
|
||||
|
||||
<P>Look at the notes at the start of the code for further information;
|
||||
some of the more important details follow.
|
||||
|
||||
<P>The driver interrogates the clock at each poll (ie every 64s by default)
|
||||
for a timestamp. The clock responds at the start of the next second (with
|
||||
the start bit of the first byte being on-time). The time is in `local'
|
||||
format, including the daylight savings adjustment when it is in effect.
|
||||
The driver code converts the time back to UTC.
|
||||
|
||||
<P>The clock claims to be accurate to within about 20ms of the MSF-broadcast
|
||||
time, and given the low data transmission speed from clock to host, and
|
||||
the fact that the clock is not in continuous sync with MSF, it seems sensible
|
||||
to set the `precision' of this clock to -5 or -4, -4 being used in this
|
||||
code, which builds in a reported dispersion of over 63ms (ie says ``This
|
||||
clock is not very good.''). You can improve the reported precision to -4
|
||||
(and thus reduce the base dispersion to about 31ms) by setting the fudge
|
||||
<TT>flag3</TT> to <TT>1</TT>.
|
||||
|
||||
<P>Even a busy and slow IP link can yield lower dispersions than this from
|
||||
polls of primary time servers on the Internet, which reinforces the idea
|
||||
that this clock should be used as a backup in case of problems with such
|
||||
an IP link, or in the unfortunate event of failure of more accurate sources
|
||||
such as GPS.
|
||||
|
||||
<P>By default this clock reports itself to be at stratum 2 rather than
|
||||
the usual stratum 0 for a refclock, because it is not really suited to
|
||||
be used as other than a backup source. The stratum reported can be changed
|
||||
with the <TT>fudge</TT> directive to be whatever you like. After careful
|
||||
monitoring of your clock, and appropriate choice of the <TT>time1</TT>
|
||||
fudge factor to remove systematic errors in the clock's reported time,
|
||||
you might fudge the clock to stratum 1 to allow a stratum-2 secondary server
|
||||
to sync to it.
|
||||
|
||||
<P>The driver code arranges to resync the clock to MSF at intervals of
|
||||
a little less than an hour (deliberately avoiding the same time each hour
|
||||
to avoid any systematic problems with the signal or host). Whilst resyncing,
|
||||
the driver supplements the normal polls for time from the clock with polls
|
||||
for the reception signal quality reported by the clock. If the signal quality
|
||||
is too low (0--2 out of a range of 0--5), we chose not to trust the clock
|
||||
until the next resync (which we bring forward by about half an hour). If
|
||||
we don't catch the resync, and so don't know the signal quality, we do
|
||||
trust the clock (because this would generally be when the signal is very
|
||||
good and a resync happens quickly), but we still bring the next resync
|
||||
forward and reduce the reported precision (and thus increase reported dispersion).
|
||||
|
||||
<P>If we force resyncs to MSF too often we will needlessly exhaust the
|
||||
batteries the unit runs from. During clock resync this driver tries to
|
||||
take enough time samples to avoid <TT>ntpd</TT> losing sync in case this
|
||||
clock is the current peer. By default the clock would only resync to MSF
|
||||
about once per day, which would almost certainly not be acceptable for
|
||||
NTP purposes.
|
||||
|
||||
<P>The driver does not force an immediate resync of the clock to MSF when
|
||||
it starts up to avoid excessive battery drain in case <TT>ntpd</TT> is
|
||||
going to be repeatedly restarted for any reason, and also to allow enough
|
||||
samples of the clock to be taken for <TT>ntpd</TT> to sync immediately
|
||||
to this clock (and not remain unsynchronised or to sync briefly to another
|
||||
configured peer, only to hop back in a few poll times, causing unnecessary
|
||||
disturbance). This behaviour should not cause problems because the driver
|
||||
will not accept the timestamps from the clock if the status flag delivered
|
||||
with the time code indicates that the last resync attempt was unsuccessful,
|
||||
so the initial timestamps will be close to reality, even if with up to
|
||||
a day's clock drift in the worst case (the clock by default resyncs to
|
||||
MSF once per day).
|
||||
|
||||
<P>The clock has a peculiar RS232 arrangement where the transmit lines
|
||||
are powered from the receive lines, presumably to minimise battery drain.
|
||||
This arrangement has two consequences:
|
||||
<UL>
|
||||
<LI>
|
||||
Your RS232 interface must drive both +ve and -ve</LI>
|
||||
|
||||
<LI>
|
||||
You must (in theory) wait for an echo and a further 10ms between characters</LI>
|
||||
</UL>
|
||||
This driver, running on standard Sun hardware, seems to work fine; note
|
||||
the use of the <TT>send_slow()</TT> routine to queue up command characters
|
||||
to be sent once every two seconds.
|
||||
|
||||
<P>Three commands are sent to the clock by this driver. Each command consists
|
||||
of a single letter (of which only the bottom four bits are significant),
|
||||
followed by a CR (ASCII 13). Each character sent to the clock should be
|
||||
followed by a delay to allow the unit to echo the character, and then by
|
||||
a further 10ms. Following the echo of the command string, there may be
|
||||
a response (ie in the cae of the <TT>g</TT> and <TT>o</TT> commands below),
|
||||
which in the case of the <TT>o</TT> command may be delayed by up to 1 second
|
||||
so as the start bit of the first byte of the response can arrive on time.
|
||||
The commands and their responses are:
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>g</TT> CR</DT>
|
||||
|
||||
<DD>
|
||||
Request for signal quality. Answer only valid during (late part of) resync
|
||||
to MSF signal. The response consists of two characters as follows:</DD>
|
||||
|
||||
<OL>
|
||||
<DL compact>
|
||||
<DT>
|
||||
bit 7</DT>
|
||||
|
||||
<DD>
|
||||
parity</DD>
|
||||
|
||||
<DT>
|
||||
bit 6</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 5</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 4</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 3</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 2</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 1</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 0</DT>
|
||||
|
||||
<DD>
|
||||
= 0 if no reception attempt at the moment, = 1 if reception attempt (ie
|
||||
resync) in progress</DD>
|
||||
</DL>
|
||||
|
||||
<DL compact>
|
||||
<DT>
|
||||
bit 7</DT>
|
||||
|
||||
<DD>
|
||||
parity</DD>
|
||||
|
||||
<DT>
|
||||
bit 6</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 5</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 4</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 3</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 2--0</DT>
|
||||
|
||||
<DD>
|
||||
reception signal quality in the range 0--5 (very poor to very good); if
|
||||
in the range 0--2 no successful reception is to be expected. The reported
|
||||
value drops to zero when not resyncing, ie when first returned byte is
|
||||
not `3'.</DD>
|
||||
</DL>
|
||||
</OL>
|
||||
|
||||
<DT>
|
||||
<TT>h</TT> CR</DT>
|
||||
|
||||
<DD>
|
||||
Request to resync to MSF. Can take up from about 30s to 360s. Drains batteries
|
||||
so should not be used excessively. After this the clock time and date should
|
||||
be correct and the phase within 20ms of time as transmitted from Rugby
|
||||
MSF (remember to allow for propagation time). By default the clock resyncs
|
||||
once per day shortly after 2am (presumably to catch transitions to/from
|
||||
daylight saving time quickly). With this driver code we resync at least
|
||||
once per hour to minimise clock wander.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>o</TT> CR</DT>
|
||||
|
||||
<DD>
|
||||
Request timestamp. Start bit of first byte of response is on-time, so may
|
||||
be delayed up to 1 second. Note that when the BST mode is in effect the
|
||||
time is GMT/UTC +0100, ie an hour ahead of UTC to reflect local time in
|
||||
the UK. The response data is as follows:</DD>
|
||||
|
||||
<OL>
|
||||
<LI>
|
||||
hours tens (hours range from 00 to 23)</LI>
|
||||
|
||||
<LI>
|
||||
hours units</LI>
|
||||
|
||||
<LI>
|
||||
minutes tens (minutes range from 00 to 59)</LI>
|
||||
|
||||
<LI>
|
||||
minutes units</LI>
|
||||
|
||||
<LI>
|
||||
seconds tens (seconds presumed to range from 00 to 60 to allow for leap
|
||||
second)</LI>
|
||||
|
||||
<LI>
|
||||
seconds units</LI>
|
||||
|
||||
<LI>
|
||||
day of week 1 (Monday) to 7 (Sunday)</LI>
|
||||
|
||||
<LI>
|
||||
day of month tens (day ranges from 01 to 31)</LI>
|
||||
|
||||
<LI>
|
||||
day of month units</LI>
|
||||
|
||||
<LI>
|
||||
month tens (months range from 01 to 12)</LI>
|
||||
|
||||
<LI>
|
||||
month units</LI>
|
||||
|
||||
<LI>
|
||||
year tens (years range from 00 to 99)</LI>
|
||||
|
||||
<LI>
|
||||
year units</LI>
|
||||
|
||||
<LI>
|
||||
BST/UTC status</LI>
|
||||
|
||||
<DL compact>
|
||||
<DT>
|
||||
bit 7</DT>
|
||||
|
||||
<DD>
|
||||
parity</DD>
|
||||
|
||||
<DT>
|
||||
bit 6</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 5</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 4</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 3</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 2</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if UTC is in effect (reverse of bit 1)</DD>
|
||||
|
||||
<DT>
|
||||
bit 1</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if BST is in effect (reverse of bit 2)</DD>
|
||||
|
||||
<DT>
|
||||
bit 0</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if BST/UTC change pending</DD>
|
||||
</DL>
|
||||
|
||||
<LI>
|
||||
clock status</LI>
|
||||
|
||||
<DL compact>
|
||||
<DT>
|
||||
bit 7</DT>
|
||||
|
||||
<DD>
|
||||
parity</DD>
|
||||
|
||||
<DT>
|
||||
bit 6</DT>
|
||||
|
||||
<DD>
|
||||
always 0</DD>
|
||||
|
||||
<DT>
|
||||
bit 5</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 4</DT>
|
||||
|
||||
<DD>
|
||||
always 1</DD>
|
||||
|
||||
<DT>
|
||||
bit 3</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if low battery is detected</DD>
|
||||
|
||||
<DT>
|
||||
bit 2</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if last resync failed (though officially undefined for the MSF clock)</DD>
|
||||
|
||||
<DT>
|
||||
bit 1</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if at least one reception attempt since 0230 for the MSF clock was
|
||||
successful (0300 for the DCF77 clock)</DD>
|
||||
|
||||
<DT>
|
||||
bit 0</DT>
|
||||
|
||||
<DD>
|
||||
= 1 if the clock has valid time---reset to zero when clock is reset (eg
|
||||
at power-up), and set to 1 after first successful resync attempt.</DD>
|
||||
</DL>
|
||||
</OL>
|
||||
The driver only accepts time from the clock if the bottom three bits of
|
||||
the status byte are <TT>011</TT>. The leap-year logic for computing day-in-year
|
||||
is only valid until 2099, and the clock will ignore stamps from the clock
|
||||
that claim BST is in effect in the first hour of each year. If the UK parliament
|
||||
decides to move us to +0100/+0200 time as opposed to the current +0000/+0100
|
||||
time, it is not clear what effect that will have on the time broadcast
|
||||
by MSF, and therefore on this driver's usefulness.</DL>
|
||||
A typical <TT>ntp.conf</TT> configuration file for this driver might be:
|
||||
<PRE># hostname(n) means we expect (n) to be the stratum at which hostname runs.
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# SYNCHRONISATION PARTNERS
|
||||
# ========================
|
||||
|
||||
# Our betters...
|
||||
server 127.127.27.0 # ARCRON MSF radio clock(1).
|
||||
# Fudge stratum and other features as required.
|
||||
# ADJUST time1 VALUE FOR YOUR HOST, CLOCK AND LOCATION!
|
||||
fudge 127.127.27.0 stratum 1 time1 0.016 flag3 1 flag4 1
|
||||
|
||||
peer 11.22.33.9 # tick(1--2).
|
||||
peer 11.22.33.4 # tock(3), boot/NFS server.
|
||||
|
||||
# This shouldn't get swept away unless left untouched for a long time.
|
||||
driftfile /var/tmp/ntp.drift
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# RESTRICTIONS
|
||||
# ============
|
||||
|
||||
# By default, don't trust and don't allow modifications. Ignore in fact.
|
||||
restrict default ignore notrust nomodify
|
||||
|
||||
# Allow others in our subnet to check us out...
|
||||
restrict 11.22.33.0 mask 255.255.255.0 nomodify notrust
|
||||
|
||||
# Trust our peers for time. Don't trust others in case they are insane.
|
||||
restrict 127.127.27.0 nomodify
|
||||
restrict 11.22.33.4 nomodify
|
||||
restrict 11.22.33.9 nomodify
|
||||
|
||||
# Allow anything from the local host.
|
||||
restrict 127.0.0.1</PRE>
|
||||
There are a few <TT>#define</TT>s in the code that you might wish to play
|
||||
with:
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>ARCRON_KEEN</TT></DT>
|
||||
|
||||
<DD>
|
||||
With this defined, the code is relatively trusting of the clock, and assumes
|
||||
that you will have the clock as one of a few time sources, so will bend
|
||||
over backwards to use the time from the clock when available and avoid
|
||||
<TT>ntpd</TT> dropping sync from the clock where possible. You may wish
|
||||
to undefine this, especially if you have better sources of time or your
|
||||
reception is ropey. However, there are many checks built in even with this
|
||||
flag defined.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>ARCRON_OWN_FILTER</TT></DT>
|
||||
|
||||
<DD>
|
||||
When defined, the code uses its own median-filter code rather than that
|
||||
available in <TT>ntp_refclock.c</TT> since the latter seems to have a minor
|
||||
bug, at least in version 3-5.90. If this bug goes away this flag should
|
||||
be turned off to avoid duplication of code. (The bug, if that's what it
|
||||
is, causes the last raw offset to be used rather than the median offset.)</DD>
|
||||
|
||||
|
||||
<P>Without this defined (and without <TT>ARCRON_MULTIPLE_SAMPLES</TT> below)
|
||||
a typical set of offsets reported and used to drive the clock-filter algorithm
|
||||
is (oldest last):
|
||||
<PRE>filtoffset= -4.32 -34.82 -0.78 0.89 2.76 4.58 -3.92 -2.17</PRE>
|
||||
Look at that spike!
|
||||
|
||||
<P>With this defined a typical set of offsets is:
|
||||
<PRE>filtoffset= -7.06 -7.06 -2.91 -2.91 -2.91 -1.27 -9.54 -6.70</PRE>
|
||||
with the repeated values being some evidence of outlyers being discarded.
|
||||
<DT>
|
||||
<TT>ARCRON_MULTIPLE_SAMPLES</TT></DT>
|
||||
|
||||
<DD>
|
||||
When is defined, we regard each character in the returned timecode as at
|
||||
a known delay from the start of the second, and use the smallest (most
|
||||
negative) offset implied by any such character, ie with the smallest kernel-induced
|
||||
display, and use that. This helps to reduce jitter and spikes.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>ARCRON_LEAPSECOND_KEEN</TT></DT>
|
||||
|
||||
<DD>
|
||||
When is defined, we try to do a resync to MSF as soon as possible in the
|
||||
first hour of the morning of the first day of the first and seventh months,
|
||||
ie just after a leap-second insertion or deletion would happen if it is
|
||||
going to. This should help compensate for the fact that this clock does
|
||||
not continuously sample MSF, which compounds the fact that MSF itself gives
|
||||
no warning of an impending leap-second event. This code did not seem functional
|
||||
at the leap-second insertion of 30th June 1997 so is by default disabled.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>PRECISION</TT></DT>
|
||||
|
||||
<DD>
|
||||
Currently set to <TT>-4</TT>, but you may wish to set it to <TT>-5</TT>
|
||||
if you are more conservative, or to <TT>-6</TT> if you have particularly
|
||||
good experience with the clock and you live on the edge. Note that the
|
||||
<TT>flag3</TT> fudge value will improve the reported dispersion one notch
|
||||
if clock signal quality is known good. So maybe just leave this alone.
|
||||
B^)</DD>
|
||||
|
||||
<DT>
|
||||
<TT>NSAMPLES</TT></DT>
|
||||
|
||||
<DD>
|
||||
Should be at least 3 to help smooth out sampling jitters. Can be more,
|
||||
but if made too long can make <TT>ntpd</TT> overshoot on clock corrections
|
||||
and can hold onto bad samples longer than you would like. With this set
|
||||
to 4 and <TT>NKEEP</TT> set to 3 this allows the occasional bad sample
|
||||
(in my experience less than 1 value in 10) to be dropped. (Note that there
|
||||
seems to be some sort of `beat' effect in the offset with a periodicity
|
||||
of about 7 samples as of this writing (1997/05/11) still under investigation;
|
||||
a filter of approximately this length should be able to almost completely
|
||||
suppress this effect.) Note that if the fudge-factor <TT>flag3</TT> is
|
||||
set to 1, a larger <TT>NSAMPLES</TT> is used.</DD>
|
||||
</DL>
|
||||
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
Each timecode is written to the <TT>clockstats</TT> file with a signal
|
||||
quality value appended (`0'--`5' as reported by the clock, or `6' for unknown).
|
||||
|
||||
<P>Each resync and result (plus gaining or losing MSF sync) is logged to
|
||||
the system log at level <TT>LOG_NOTICE</TT>; note that each resync drains
|
||||
the unit's batteries, so the syslog entry seems justified.
|
||||
|
||||
<P>Syslog entries are of the form:
|
||||
<PRE>May 10 10:15:24 oolong ntpd[615]: ARCRON: unit 0: sending resync command
|
||||
May 10 10:17:32 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
|
||||
May 10 11:13:01 oolong ntpd[615]: ARCRON: unit 0: sending resync command
|
||||
May 10 11:14:06 oolong ntpd[615]: ARCRON: sync finished, signal quality -1: UNKNOWN, will use clock anyway
|
||||
May 10 11:41:49 oolong ntpd[615]: ARCRON: unit 0: sending resync command
|
||||
May 10 11:43:57 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
|
||||
May 10 12:39:26 oolong ntpd[615]: ARCRON: unit 0: sending resync command
|
||||
May 10 12:41:34 oolong ntpd[615]: ARCRON: sync finished, signal quality 3: OK, will use clock</PRE>
|
||||
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0. On a Sun SparcStation 1 running SunOS 4.1.3_U1, with
|
||||
the receiver in London, a value of 0.020 (20ms) seems to be appropriate.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not currently used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.
|
||||
It is suggested that the clock be fudged to stratum 1 so this it is used
|
||||
a backup time source rather than a primary when more accurate sources are
|
||||
available.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>MSFa</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
If set to 1, better precision is reported (and thus lower dispersion) while
|
||||
clock's received signal quality is known to be good.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
If set to 1, a longer-than-normal (8-stage rather than 4-stage) median
|
||||
filter is used, to provide some extra smoothing of clock output and reduction
|
||||
in jitter, at the cost of extra clock overshoot. Probably not advisable
|
||||
unless the server using this clock has other sources it can use to help
|
||||
mitigate the overshoot.</DD>
|
||||
</DL>
|
||||
|
||||
<H4>
|
||||
Additional Information</H4>
|
||||
<A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
|
||||
<P><A HREF="http://www2.exnet.com/NTP/ARC/ARC.htm">ARC Rugby MSF Receiver</A>
|
||||
page
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
Damon Hart-Davis (d@hd.org)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
133
contrib/ntp/html/driver28.htm
Normal file
133
contrib/ntp/html/driver28.htm
Normal file
@ -0,0 +1,133 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Shared memoy Driver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Shared Memory Driver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.28.<I>u</I>
|
||||
<BR>Reference ID: <TT>SHM</TT>
|
||||
<BR>Driver ID: <TT>SHM</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver receives its reference clock info from a shared memory-segment.
|
||||
The shared memory-segment is created with owner-only access for unit 0
|
||||
and 1, and world access for unit 2 and 3
|
||||
<H4>
|
||||
Structure of shared memory-segment</H4>
|
||||
|
||||
<PRE>struct shmTime {
|
||||
int mode; /* 0 - if valid set
|
||||
* use values,
|
||||
* clear valid
|
||||
* 1 - if valid set
|
||||
* if count before and after read of
|
||||
* values is equal,
|
||||
* use values
|
||||
* clear valid
|
||||
*/
|
||||
int count;
|
||||
time_t clockTimeStampSec; /* external clock */
|
||||
int clockTimeStampUSec; /* external clock */
|
||||
time_t receiveTimeStampSec; /* internal clock, when external value was received */
|
||||
int receiveTimeStampUSec; /* internal clock, when external value was received */
|
||||
int leap;
|
||||
int precision;
|
||||
int nsamples;
|
||||
int valid;
|
||||
int dummy[10];
|
||||
};</PRE>
|
||||
|
||||
<H4>
|
||||
Operation mode=0</H4>
|
||||
When the poll-method of the driver is called, the valid-flag of the shared
|
||||
memory-segment is checked:
|
||||
|
||||
<P>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec,
|
||||
receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed
|
||||
to ntp, and the valid-flag is cleared.
|
||||
|
||||
<P>If not set, a timeout is reported to ntp, nothing else happend
|
||||
<H4>
|
||||
Operation mode=1</H4>
|
||||
When the poll-method of the driver is called, the valid-flag of the shared
|
||||
memory-segment is checked:
|
||||
|
||||
<P>If set, the count-field of the record is remembered, and the values
|
||||
in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec,
|
||||
receiveTimeStampUSec, leap, precision) are read. Then, the remembered count
|
||||
is compared to the count now in the record. If both are equal, the values
|
||||
read from the record are passed to ntp. If they differ, another process
|
||||
has modified the record while it was read out (was not able to produce
|
||||
this case), and failure is reported to ntp. The valid flag is cleared.
|
||||
|
||||
<P>If not set, a timeout is reported to ntp, nothing else happend
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>SHM</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A></DL>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
1254
contrib/ntp/html/driver29.htm
Normal file
1254
contrib/ntp/html/driver29.htm
Normal file
File diff suppressed because it is too large
Load Diff
131
contrib/ntp/html/driver3.htm
Normal file
131
contrib/ntp/html/driver3.htm
Normal file
@ -0,0 +1,131 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>PSTI/Traconex 1020 WWV/WWVH Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
PSTI/Traconex 1020 WWV/WWVH Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.3.<I>u</I>
|
||||
<BR>Reference ID: <TT>WWV</TT>
|
||||
<BR>Driver ID: <TT>WWV_PST</TT>
|
||||
<BR>Serial Port: <TT>/dev/wwv<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH Receivers.
|
||||
No specific claim of accuracy is made for these receiver, but actual experience
|
||||
suggests that 10 ms would be a conservative assumption.
|
||||
|
||||
<P>The DIP-switches should be set for 9600 bps line speed, 24-hour day-of-year
|
||||
format and UTC time zone. Automatic correction for DST should be disabled.
|
||||
It is very important that the year be set correctly in the DIP-switches;
|
||||
otherwise, the day of year will be incorrect after 28 April of a normal
|
||||
or leap year. The propagation delay DIP-switches should be set according
|
||||
to the distance from the transmitter for both WWV and WWVH, as described
|
||||
in the instructions. While the delay can be set only to within 11 ms, the
|
||||
fudge time1 parameter can be used for vernier corrections.
|
||||
|
||||
<P>Using the poll sequence <TT>QTQDQM</TT>, the response timecode is in
|
||||
three sections totalling 50 ASCII printing characters, as concatenated
|
||||
by the driver, in the following format:
|
||||
<PRE>ahh:mm:ss.fffs<cr> yy/dd/mm/ddd<cr>
|
||||
frdzycchhSSFTttttuuxx<cr>
|
||||
|
||||
on-time = first <cr>
|
||||
hh:mm:ss.fff = hours, minutes, seconds, milliseconds
|
||||
a = AM/PM indicator (' ' for 24-hour mode)
|
||||
yy = year (from DIPswitches)
|
||||
dd/mm/ddd = day of month, month, day of year
|
||||
s = daylight-saving indicator (' ' for 24-hour mode)
|
||||
f = frequency enable (O = all frequencies enabled)
|
||||
r = baud rate (3 = 1200, 6 = 9600)
|
||||
d = features indicator (@ = month/day display enabled)
|
||||
z = time zone (0 = UTC)
|
||||
y = year (5 = 91)
|
||||
cc = WWV propagation delay (52 = 22 ms)
|
||||
hh = WWVH propagation delay (81 = 33 ms)
|
||||
SS = status (80 or 82 = operating correctly)
|
||||
F = current receive frequency (4 = 15 MHz)
|
||||
T = transmitter (C = WWV, H = WWVH)
|
||||
tttt = time since last update (0000 = minutes)
|
||||
uu = flush character (03 = ^c)
|
||||
xx = 94 (unknown)</PRE>
|
||||
The alarm condition is indicated by other than <TT>8</TT> at <TT>a</TT>,
|
||||
which occurs during initial synchronization and when received signal is
|
||||
lost for an extended period; unlock condition is indicated by other than
|
||||
<TT>0000</TT> in the <TT>tttt</TT> subfield.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
is written as-is to the <TT>clockstats</TT> file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>WWV</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
153
contrib/ntp/html/driver30.htm
Normal file
153
contrib/ntp/html/driver30.htm
Normal file
@ -0,0 +1,153 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-
|
||||
1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; FreeBSD
|
||||
3.0-CURRENT i386) [Netscape]">
|
||||
<TITLE>Motorola Oncore GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Motorola Oncore GPS receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
|
||||
Address: 127.127.30.0
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: ONCORE
|
||||
<BR>Serial Port: <TT>/dev/cuaa0</TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>PPS Port: <TT>/dev/xpps0</TT>; <TT>PPS_CAPTUREASSERT</TT>
|
||||
required, <TT>PPS_OFFSETASSERT</TT> supported.
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports various models of the <A
|
||||
HREF="http://www.mot.com/AECS/PNSB/products">Motorola Oncore GPS
|
||||
receivers</A>. as long as they support the <I>Motorola Binary
|
||||
Protocol</I>.
|
||||
|
||||
<P>The two most interesting version of the Oncore are the "UT+"
|
||||
and the "Remote" which is a prepackaged "UT+". The evaluation kit
|
||||
can also be recommended, it interfaces to a PC straightaway, using the
|
||||
parallel port for PPS input (supported under FreeBSD), and packs the
|
||||
receiver in a nice and sturdy box.
|
||||
<BR>
|
||||
<CENTER><TABLE NOSAVE >
|
||||
<TR NOSAVE>
|
||||
<TD NOSAVE><IMG SRC="pic/oncore_utplusbig.gif" HEIGHT=124
|
||||
WIDTH=210></TD>
|
||||
|
||||
<TD><IMG SRC="pic/oncore_evalbig.gif" HEIGHT=124 WIDTH=182></TD>
|
||||
|
||||
<TD><IMG SRC="pic/oncore_remoteant.jpg" HEIGHT=188 WIDTH=178></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>
|
||||
<CENTER>UT+ oncore</CENTER>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<CENTER>Evaluation kit</CENTER>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<CENTER>Oncore Remote</CENTER>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<P>The driver requires a standard <TT>PPS</TT> interface for the pulse-
|
||||
per-second output from the receiver. The serial data stream alone
|
||||
does not provide precision time stamps (0-50msec variance, according to
|
||||
the manual), whereas the PPS output is precise down to 50 nsec (1 sigma)
|
||||
for the UT models. <P>The driver will use the "position hold" mode if
|
||||
available, with either the receivers built-in site-survey or a similar
|
||||
algorithm implemented in this driver.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
The driver is quite chatty on stdout if ntpd is run with
|
||||
debugging.
|
||||
A manual will be required though.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default
|
||||
0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Assume GPS receiver is on a mobile platform if set.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
<B>Additional Information</B><B></B>
|
||||
<P>The driver has been developed under FreeBSD, and may still be pretty
|
||||
FreeBSD centric. Patches are most welcome.
|
||||
<P><B>Performance</B><B></B>
|
||||
<P>Really good. With the UT+, the generated PPS pulse is
|
||||
referenced
|
||||
to UTC(GPS) with better than 50 nsec (1 sigma) accuracy. The
|
||||
limiting factor will be the timebase of the computer and the precision
|
||||
with which you can timestamp the rising flank of the
|
||||
PPS signal.
|
||||
Using FreeBSD, a FPGA based Timecounter/PPS interface
|
||||
and
|
||||
an ovenized quartz oscillator, that performance has been reproduced.
|
||||
For
|
||||
more details on this aspect: <A
|
||||
HREF="http://phk.freebsd.dk/rover.html">Sub-Microsecond
|
||||
timekeeping under FreeBSD</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
Poul-Henning Kamp (phk@FreeBSD.org)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
42
contrib/ntp/html/driver32.htm
Normal file
42
contrib/ntp/html/driver32.htm
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html> <head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
|
||||
<title>Chrono-log K-series WWVB receiver</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Chrono-log K-series WWVB receiver</h3>
|
||||
|
||||
<hr>
|
||||
<h4>Synopsis</h4>
|
||||
Address: 127.127.32.<i>u</i><br>
|
||||
Reference ID: <TT>CHRONOLOG</TT><br>
|
||||
Driver ID: <tt>CHRONOLOG</tt><br>
|
||||
Serial Port: <tt>/dev/chronolog<i>u</i></tt>; 2400 bps, 8-bits,
|
||||
no parity<br>
|
||||
<br>Features: <tt>(none)</tt>
|
||||
<h4>Description</h4>
|
||||
This driver supports the Chrono-log K-series WWVB receiver. This is a
|
||||
very old receiver without provisions for leap seconds, quality codes,
|
||||
etc. It assumes output in the local time zone, and that the C library
|
||||
mktime()/localtime() routines will correctly convert back and forth
|
||||
between local and UTC. There is a hack in the driver for permitting
|
||||
UTC, but it has not been tested.
|
||||
|
||||
<P>Most of this code is originally from refclock_wwvb.c with thanks. It
|
||||
has been so mangled that wwvb is not a recognizable ancestor.
|
||||
<pre>
|
||||
Timecode format: Y yy/mm/ddCLZhh:mm:ssCL
|
||||
Y - year/month/date line indicator
|
||||
yy/mm/dd -- two-digit year/month/day
|
||||
C - \r (carriage return)
|
||||
L - \n (newline)
|
||||
Z - timestamp indicator
|
||||
hh:mm:ss - local time
|
||||
</pre>
|
||||
<hr>
|
||||
<address></address>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sun Feb 14 11:57:27 EST 1999
|
||||
<!-- hhmts end -->
|
||||
</body> </html>
|
38
contrib/ntp/html/driver33.htm
Normal file
38
contrib/ntp/html/driver33.htm
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html> <head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
|
||||
<title>Dumb Clock</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Dumb Clock</h3>
|
||||
|
||||
<hr>
|
||||
<h4>Synopsis</h4>
|
||||
Address: 127.127.33.<i>u</i><br>
|
||||
Reference ID: <TT>DUMBCLOCK</TT><br>
|
||||
Driver ID: <tt>DUMBCLOCK</tt><br>
|
||||
Serial Port: <tt>/dev/dumbclock<i>u</i></tt>; 9600 bps, 8-bits,
|
||||
no parity<br>
|
||||
<br>Features: <tt>(none)</tt>
|
||||
<h4>Description</h4>
|
||||
This driver supports a dumb ASCII clock that only emits localtime at a reliable
|
||||
interval. This has no provisions for leap seconds, quality codes,
|
||||
etc. It assumes output in the local time zone, and that the C library
|
||||
mktime()/localtime() routines will correctly convert back and forth
|
||||
between local and UTC.
|
||||
|
||||
<P>Most of this code is originally from refclock_wwvb.c with thanks. It
|
||||
has been so mangled that wwvb is not a recognizable ancestor.
|
||||
<pre>
|
||||
Timecode format: hh:mm:ssCL
|
||||
hh:mm:ss - local time
|
||||
C - \r (carriage return)
|
||||
L - \n (newline)
|
||||
</pre>
|
||||
<hr>
|
||||
<address></address>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sun Feb 14 12:07:01 EST 1999
|
||||
<!-- hhmts end -->
|
||||
</body> </html>
|
54
contrib/ntp/html/driver34.htm
Normal file
54
contrib/ntp/html/driver34.htm
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html> <head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
|
||||
<title>Dumb Clock</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Ultralink Clock</h3>
|
||||
|
||||
<hr>
|
||||
<h4>Synopsis</h4>
|
||||
Address: 127.127.34.<i>u</i><br>
|
||||
Reference ID: <TT>ULINK</TT><br>
|
||||
Driver ID: <tt>ULINK</tt><br>
|
||||
Serial Port: <tt>/dev/ulink<i>u</i></tt>; 9600 bps, 8-bits,
|
||||
no parity<br>
|
||||
<br>Features: <tt>(none)</tt>
|
||||
<h4>Description</h4>
|
||||
This driver supports the Ultralink Model 320 RS-232 powered WWVB receiver. PDF specs available on <a href="http://www.linuxfoundary.com">www.linuxfoundary.com</a>. While the unit may support them, this driver does nothing with leap seconds, quality codes, etc. (though it probably should).
|
||||
|
||||
<P>Most of this code is originally from refclock_wwvb.c with thanks. Any mistakes are mine. Any improvements are welcome.
|
||||
|
||||
<pre>
|
||||
The timecode format is:
|
||||
|
||||
<cr><lf>SQRYYYYDDD+HH:MM:SS.mmLT<cr>
|
||||
|
||||
where:
|
||||
|
||||
S = 'S' -- sync'd in last hour, '0'-'9' - hours x 10 since last update, else '?'
|
||||
Q = Number of correlating time-frames, from 0 to 5
|
||||
R = 'R' -- reception in progress, 'N' -- Noisy reception, ' ' -- standby mode
|
||||
YYYY = year from 1990 to 2089
|
||||
DDD = current day from 1 to 366
|
||||
+ = '+' if current year is a leap year, else ' '
|
||||
HH = UTC hour 0 to 23
|
||||
MM = Minutes of current hour from 0 to 59
|
||||
SS = Seconds of current minute from 0 to 59
|
||||
mm = 10's milliseconds of the current second from 00 to 99
|
||||
L = Leap second pending at end of month -- 'I' = inset, 'D'=delete
|
||||
T = DST <-> STD transition indicators
|
||||
|
||||
Note that this driver does not do anything with the L or T flags.
|
||||
|
||||
The M320 also has a 'U' command which returns UT1 correction information. It
|
||||
is not used in this driver.
|
||||
|
||||
</pre>
|
||||
<hr>
|
||||
<address><a href="mailto:dstrout@linuxfoundary.com">root</a></address>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Tue Sep 14 05:53:08 EDT 1999
|
||||
<!-- hhmts end -->
|
||||
</body> </html>
|
126
contrib/ntp/html/driver4.htm
Normal file
126
contrib/ntp/html/driver4.htm
Normal file
@ -0,0 +1,126 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Spectracom 8170 and Netclock/2 WWVB Receivers
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Spectracom 8170 and Netclock/2 WWVB Receivers
|
||||
</H3><HR>
|
||||
|
||||
<H4>Synopsis</H4>
|
||||
|
||||
Address: 127.127.4.<I>u</I>
|
||||
<BR>Reference ID: <TT>WWVB</TT>
|
||||
<BR>Driver ID: <TT>WWVB_SPEC</TT>
|
||||
<BR>Serial Port: <TT>/dev/wwvb<I>u</I></TT>; 9600 baud, 8-bits, no
|
||||
parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
|
||||
<H4>Description</H4>
|
||||
|
||||
This driver supports all known Spectracom radio and satellite clocks,
|
||||
including the Model 8170 and Netclock/2 WWVB Synchronized Clocks and the
|
||||
Netclock/GPS GPS Master Clock. The claimed accuracy of the WWVB clocks
|
||||
is 100 usec relative to the broadcast signal. These clocks have proven a
|
||||
reliable source of time, except in some parts of the country with high
|
||||
levels of conducted RF interference. WIth the GPS clock the claimed
|
||||
accuracy is 130 ns. However, in most cases the actual accuracy is
|
||||
limited by the precision of the timecode and the latencies of the serial
|
||||
interface and operating system.
|
||||
|
||||
<P>The DIPswitches on these clocks should be set to 24-hour display,
|
||||
AUTO DST off, data format 0 or 2 (see below) and baud rate 9600. If this
|
||||
clock is used as the source for the IRIG Audio Decoder
|
||||
(<tt>refclock_irig.c</tt> in this distribution), set the DIPswitches for
|
||||
AM IRIG output and IRIG format 1 (IRIG B with signature control).
|
||||
|
||||
<P>There are two timecode formats used by these clocks. Format 0, which
|
||||
is available with all clocks, and format 2, which is available with all
|
||||
clocks except the original (unmodified) Model 8170.
|
||||
|
||||
<P>Format 0 (22 ASCII printing characters):
|
||||
<br><cr><lf>i ddd hh:mm:ss TZ=zz<cr><lf>
|
||||
|
||||
<p>on-time = first <cr>
|
||||
<br>i = synchronization flag (' ' = in synch, '?' = out synch)
|
||||
<br>hh:mm:ss = hours, minutes, seconds</PRE>
|
||||
|
||||
<p>The alarm condition is indicated by other than ' ' at <TT>i</TT>,
|
||||
which occurs during initial synchronization and when received signal is
|
||||
lost for about ten hours.
|
||||
|
||||
<P>Format 2 (24 ASCII printing characters):
|
||||
<br>lt;cr>lf>iqyy ddd hh:mm:ss.fff ld
|
||||
|
||||
<p>on-time = <cr>
|
||||
<br>i = synchronization flag (' ' = in synch, '?' = out synch)
|
||||
<br>q = quality indicator (' ' = locked, 'A'...'D' = unlocked)
|
||||
<br>yy = year (as broadcast)
|
||||
<br>ddd = day of year
|
||||
<br>hh:mm:ss.fff = hours, minutes, seconds, milliseconds</PRE>
|
||||
|
||||
<p>The alarm condition is indicated by other than ' ' at <TT>i</TT>,
|
||||
which occurs during initial synchronization and when received signal is
|
||||
lost for about ten hours. The unlock condition is indicated by other
|
||||
than ' ' at <TT>q</TT>.
|
||||
|
||||
<P>The <TT>q</TT> is normally ' ' when the time error is less than 1 ms
|
||||
and a character in the set <TT>A...D</TT> when the time error is less
|
||||
than 10, 100, 500 and greater than 500 ms respectively. The <TT>l</TT>
|
||||
is normally ' ', but is set to <TT>L</TT> early in the month of an
|
||||
upcoming UTC leap second and reset to ' ' on the first day of the
|
||||
following month. The <TT>d</TT> is set to <TT>S</TT> for standard time
|
||||
<TT>S</TT>, <TT>I</TT> on the day preceding a switch to daylight time,
|
||||
<TT>D</TT> for daylight time and <TT>O</TT> on the day preceding a
|
||||
switch to standard time. The start bit of the first
|
||||
<cr> is synchronized to the indicated time as returned.
|
||||
|
||||
<P>This driver does not need to be told which format is in use - it
|
||||
figures out which one from the length of the message. A three-stage
|
||||
median filter is used to reduce jitter and provide a dispersion measure.
|
||||
The driver makes no attempt to correct for the intrinsic jitter of the
|
||||
radio itself, which is a known problem with the older radios.
|
||||
|
||||
<H4>Monitor Data</H4>
|
||||
|
||||
The driver writes each timecode as received to the <TT>clockstats</TT>
|
||||
file. When enabled by the <TT>flag4</TT> fudge flag, a table of quality
|
||||
data maintained internally by the Netclock/2 is retrieved and written to
|
||||
the <TT>clockstats</TT> file when the first timecode message of a new
|
||||
dayis received.
|
||||
|
||||
<H4>Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
|
||||
<DT><TT>time1 <I>time</I></TT></DT>
|
||||
<DD>Specifies the time offset calibration factor, in seconds and
|
||||
fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT><TT>time2 <I>time</I></TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>stratum <I>number</I></TT></DT>
|
||||
<DD>Specifies the driver stratum, in decimal from 0 to 15, with default
|
||||
0.</DD>
|
||||
|
||||
<DT><TT>refid <I>string</I></TT></DT>
|
||||
<DD>Specifies the driver reference identifier, an ASCII string from one
|
||||
to four characters, with default <TT>WWVB</TT>.</DD>
|
||||
|
||||
<DT><TT>flag1 0 | 1</TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>flag2 0 | 1</TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>flag3 0 | 1</TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>flag4 0 | 1</TT></DT>
|
||||
<DD>Enable verbose <TT>clockstats</TT> recording if set.</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR><ADDRESS>David L. Mills (mills@udel.edu)</ADDRESS></BODY></HTML>
|
159
contrib/ntp/html/driver5.htm
Normal file
159
contrib/ntp/html/driver5.htm
Normal file
@ -0,0 +1,159 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>TrueTime GPS/GOES/OMEGA Receivers
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
TrueTime GPS/GOES/OMEGA Receivers</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.5.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS, OMEGA, GOES</TT>
|
||||
<BR>Driver ID: <TT>TRUETIME</TT>
|
||||
<BR>Serial Port: <TT>/dev/true<I>u</I></TT>; 9600 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>tty_clk</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports several models models of Kinemetrics/TrueTime timing
|
||||
receivers, including 468-DC MK III GOES Synchronized Clock, GPS- DC MK
|
||||
III and GPS/TM-TMD GPS Synchronized Clock, XL-DC (a 151-602-210, reported
|
||||
by the driver as a GPS/TM-TMD), GPS-800 TCU (an 805-957 with the RS232
|
||||
Talker/Listener module), OM-DC OMEGA Synchronized Clock, and very likely
|
||||
others in the same model family that use the same timecode formats.
|
||||
|
||||
<P>Most of this code is originally from refclock_wwvb.c with thanks. It
|
||||
has been so mangled that wwvb is not a recognizable ancestor.
|
||||
<PRE>Timcode format: ADDD:HH:MM:SSQCL
|
||||
|
||||
A - control A (this is stripped before we see it)
|
||||
Q - Quality indication (see below)
|
||||
C - Carriage return
|
||||
L - Line feed
|
||||
|
||||
Quality codes indicate possible error of
|
||||
|
||||
468-DC GOES Receiver:
|
||||
GPS-TM/TMD Receiver:
|
||||
? +/- 500 milliseconds # +/- 50 milliseconds
|
||||
* +/- 5 milliseconds . +/- 1 millisecond
|
||||
space less than 1 millisecond
|
||||
|
||||
OM-DC OMEGA Receiver:
|
||||
|
||||
> +/- 5 seconds
|
||||
|
||||
? +/- 500 milliseconds # +/- 50 milliseconds
|
||||
* +/- 5 milliseconds . +/- 1 millisecond
|
||||
|
||||
A-H less than 1 millisecond. Character indicates which
|
||||
station
|
||||
is being received as follows: A = Norway, B = Liberia,
|
||||
C = Hawaii, D = North Dakota, E = La Reunion, F =
|
||||
Argentina,
|
||||
G = Australia, H = Japan.</PRE>
|
||||
The carriage return start bit begins on 0 seconds and extends to 1 bit
|
||||
time.
|
||||
|
||||
<P>Notes on 468-DC and OMEGA receiver:
|
||||
|
||||
<P>Send the clock a <TT>R</TT> or <TT>C</TT> and once per second a timestamp
|
||||
will appear. Send a <TT>R</TT> to get the satellite position once (GOES
|
||||
only).
|
||||
|
||||
<P>Notes on the 468-DC receiver:
|
||||
|
||||
<P>Since the old east/west satellite locations are only historical, you
|
||||
can't set your clock propagation delay settings correctly and still use
|
||||
automatic mode. The manual says to use a compromise when setting the switches.
|
||||
This results in significant errors. The solution; use fudge time1 and time2
|
||||
to incorporate corrections. If your clock is set for 50 and it should be
|
||||
58 for using the west and 46 for using the east, use the line
|
||||
|
||||
<P><TT>fudge 127.127.5.0 time1 +0.008 time2 -0.004</TT>
|
||||
|
||||
<P>This corrects the 4 milliseconds advance and 8 milliseconds retard needed.
|
||||
The software will ask the clock which satellite it sees.
|
||||
|
||||
<P>The PCL720 from PC Labs has an Intel 8253 look-alike, as well as a bunch
|
||||
of TTL input and output pins, all brought out to the back panel. If you
|
||||
wire a PPS signal (such as the TTL PPS coming out of a GOES or other Kinemetrics/Truetime
|
||||
clock) to the 8253's GATE0, and then also wire the 8253's OUT0 to the PCL720's
|
||||
INPUT3.BIT0, then we can read CTR0 to get the number of microseconds since
|
||||
the last PPS upward edge, mediated by reading OUT0 to find out if the counter
|
||||
has wrapped around (this happens if more than 65535us (65ms) elapses between
|
||||
the PPS event and our being called.)
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
is written as-is to the <TT>clockstats</TT> file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
to be used for the West satellite, with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
. Specifies the time offset calibration factor, in seconds and fraction,
|
||||
to be used for the East satellite, with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>TRUE</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Silence the clock side of ntpd, just reading the clock without trying to
|
||||
write to it.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Generate a debug file /tmp/true%d.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
253
contrib/ntp/html/driver6.htm
Normal file
253
contrib/ntp/html/driver6.htm
Normal file
@ -0,0 +1,253 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>IRIG Audio Decoder II for Sun SPARCstation
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
IRIG Audio Decoder</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.6.<I>u</I>
|
||||
<BR>Reference ID: <TT>IRIG</TT>
|
||||
<BR>Driver ID: <TT>IRIG_AUDIO</TT>
|
||||
<BR>Audio Device: <TT>/dev/audio</TT> and <TT>/dev/audioctl</TT>
|
||||
|
||||
<P>Note: This driver supersedes an older one of the same name, address
|
||||
and ID which required replacing the original kernel audio driver with another
|
||||
which works only on older Sun SPARCstation systems. The new driver described
|
||||
here uses the stock kernel audio driver and works in SunOS 4.1.3 and Solaris
|
||||
2.6 versions and probably all versions in between. The new driver requires
|
||||
no modification of the operating system. While it is generic and likely
|
||||
portable to other systems, it is somewhat slower than the original, since
|
||||
the extensive signal conditioning, filtering and decoding is done in user
|
||||
space, not kernel space.
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Inter-Range Instrumentation Group (IRIG) standard
|
||||
time distribution signal using the audio codec native to the Sun SPARCstation.
|
||||
This signal is generated by several radio clocks, including those made
|
||||
by Arbiter, Austron, Bancomm, Odetics, Spectracom and TrueTime, among others,
|
||||
although it is often an add-on option. The signal is connected via an optional
|
||||
attenuator box and cable to either the microphone or line-in ports on a
|
||||
Sun SPARCstation <TT>/dev/audio</TT> audio codec device. The driver receives,
|
||||
demodulates and decodes the IRIG-B and IRIG-E signal formats using internal
|
||||
filters designed to reduce the effects of noise and interfering signals.
|
||||
|
||||
<P>The IRIG signal format uses an amplitude-modulated carrier with pulse-width
|
||||
modulated data bits. For IRIG-B, the carrier frequency is 1000 Hz and bit
|
||||
rate 100 b/s; for IRIG-E, the carrier frequenchy is 100 Hz and bit rate
|
||||
10 b/s. While IRIG-B provides the best accuracy, generally within a few
|
||||
tens of microseconds relative to IRIG time, it can also generate a significant
|
||||
load on the processor with older workstations. Generally, the accuracy
|
||||
with IRIG-E is about ten times worse than IRIG-B, but the processor load
|
||||
is ten times less.
|
||||
|
||||
<P>The program processes 8000-Hz mu-law companded samples using separate
|
||||
signal filters for IRIG-B and IRIG-E, a comb filter, envelope detector
|
||||
and automatic threshold corrector. Cycle crossings relative to the corrected
|
||||
slice level determine the width of each pulse and its value - zero, one
|
||||
or position identifier. The data encode 20 BCD digits which determine the
|
||||
second, minute, hour and day of the year and sometimes the year and synchronization
|
||||
condition. The comb filter exponentially averages the corresponding samples
|
||||
of successive baud intervals in order to reliably identify the reference
|
||||
carrier cycle. A type-II phase-lock loop (PLL) performs additional integration
|
||||
and interpolation to accurately determine the zero crossing of that cycle,
|
||||
which determines the reference timestamp. A pulse-width discriminator demodulates
|
||||
the data pulses, which are then encoded as the BCD digits of the timecode.
|
||||
The timecode and reference timestamp are updated once each second with
|
||||
IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved for
|
||||
later processing. At poll intervals of 64 s, the saved samples are processed
|
||||
by a trimmed-mean filter and used to update the system clock.
|
||||
|
||||
<P>Infinite impulse response (IIR) filters are used with both IRIG-B and
|
||||
IRIG-E formats. An 800-Hz highpass filter is used for IRIG-B and a 130-Hz
|
||||
lowpass filter for IRIG-E. These are intended for use with noisy signals,
|
||||
such as might be received over a telephone line or radio circuit, or when
|
||||
interfering signals may be present in the audio passband. The driver determines
|
||||
which IRIG format is in use by sampling the amplitude of each filter output
|
||||
and selecting the one with maximum signal. An automatic gain control feature
|
||||
provides protection against overdriven or underdriven input signal amplitudes.
|
||||
It is designed to maintain adequate demodulator signal amplitude while
|
||||
avoiding occasional noise spikes. In order to assure reliable capture,
|
||||
the decompanded input signal amplitude must be greater than 100 units and
|
||||
the codec sample frequency error less than 250 PPM (.025 percent).
|
||||
|
||||
<P>The program performs a number of error checks to protect against overdriven
|
||||
or underdriven input signal levels, incorrect signal format or improper
|
||||
hardware configuration. Specifically, if any of the following errors occur
|
||||
for a timecode, the data are rejected. Secifically, if any of the following
|
||||
errors occur for a time measurement, the data are rejected.
|
||||
<OL>
|
||||
<LI>
|
||||
The peak carrier amplitude is less than 100 units. This usually means dead
|
||||
IRIG signal source, broken cable or wrong input port.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
The frequency error is greater than +-250 PPM (.025 percent). This usually
|
||||
means broken codec hardware or wrong codec configuration.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
The modulation index is less than 0.5. This usually means overdriven IRIG
|
||||
signal or wrong IRIG format.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
A frame synchronization error has occured. This usually means wrong IRIG
|
||||
signal format or the IRIG signal source has lost synchronization (signature
|
||||
control).</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
A data decoding error has occured. This usually means wrong IRIG signal
|
||||
format.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
The current second of the day is not exactly one greater than the previous
|
||||
one. This usually means a very noisy IRIG signal or insufficient CPU resources.</LI>
|
||||
|
||||
<BR>
|
||||
<LI>
|
||||
An audio codec error (overrun) occured. This usually means insufficient
|
||||
CPU resources, as sometimes happens with Sun SPARC IPCs when doing something
|
||||
useful.</LI>
|
||||
</OL>
|
||||
Note that additional checks are done elsewhere in the reference clock interface
|
||||
routines.
|
||||
|
||||
<P>Unlike other drivers, which can have multiple instantiations, this one
|
||||
supports only one. It does not seem likely that more than one audio codec
|
||||
would be useful in a single machine. More than one would probably chew
|
||||
up too much CPU time anyway.
|
||||
<H4>
|
||||
IRIG-B Timecode Format</H4>
|
||||
The 100 elements of the IRIG timecode are numbered from 0 through 99. Position
|
||||
identifiers occur at elements 0, 9, 19 and every ten thereafter to 99.
|
||||
The control function (CF) elements begin at element 50 (CF 1) and extend
|
||||
to element 78 (CF 27). The straight-binary-seconds (SBS) field, which encodes
|
||||
the seconds of the UTC day, begins at element 80 (CF 28) and extends to
|
||||
element 97 (CF 44). The encoding of elements 50 (CF 1) through 78 (CF 27)
|
||||
is device dependent. This driver presently decodes the CF elements, but
|
||||
does nothing with them.
|
||||
|
||||
<P>Where feasible, the IRIG signal source should be operated with signature
|
||||
control so that, if the signal is lost or mutilated, the source produces
|
||||
an unmodulated signal, rather than possibly random digits. The driver will
|
||||
automatically reject the data and declare itself unsynchronized in this
|
||||
case. Some devices, in particular Spectracom radio/satellite clocks, provide
|
||||
additional year and status indication in the format:
|
||||
<PRE> Element CF Function
|
||||
-------------------------------------
|
||||
55 6 time sync status
|
||||
60-63 10-13 BCD year units
|
||||
65-68 15-18 BCD year tens</PRE>
|
||||
Other devices set these elements to zero.
|
||||
<H4>
|
||||
Performance</H4>
|
||||
The mu-law companded data format allows considerable latitude in signal
|
||||
levels; however, an automatic gain control (AGC) function is implemented
|
||||
to further compensate for varying input signal levels and to avoid signal
|
||||
distortion. For proper operation, the IRIG signal source should be configured
|
||||
for analog signal levels, NOT digital TTL levels.
|
||||
|
||||
<P>The accuracy of the system clock synchronized to the IRIG-B source with
|
||||
this driver and the <TT>ntpd</TT> daemon is 10-20 microseconds with a Sun
|
||||
UltraSPARC II and maybe twice that with a Sun SPARC IPC. The processor
|
||||
resources consumed by the daemon can be significant, ranging from about
|
||||
1.2 percent on the faster UltraSPARC II to 38 percent on the slower SPARC
|
||||
IPC. However, the overall timing accuracy is limited by the resolution
|
||||
and stability of the CPU clock oscillator and the interval between clock
|
||||
corrections, which is 64 s with this driver. This performance, while probably
|
||||
the best that can be achieved by the daemon itself, can be improved with
|
||||
assist from the PPS discipline as described elsewhere in the documentation.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
The timecode format used for debugging and data recording includes data
|
||||
helpful in diagnosing problems with the IRIG signal and codec connections.
|
||||
With debugging enabled (-d -d -d on the ntpd command line), the driver
|
||||
produces one line for each timecode in the following format:
|
||||
<PRE>00 1 98 23 19:26:52 721 143 0.694 47 20 0.083 66.5 3094572411.00027</PRE>
|
||||
The first field containes the error flags in hex, where the hex bits are
|
||||
interpreted as below. This is followed by the IRIG status indicator, year
|
||||
of century, day of year and time of day. The status indicator and year
|
||||
are not produced by some IRIG devices. Following these fields are the signal
|
||||
amplitude (0-8100), codec gain (0-255), field phase (0-79), time constant
|
||||
(2-20), modulation index (0-1), carrier phase error (0+-0.5) and carrier
|
||||
frequency error (PPM). The last field is the on-time timestamp in NTP format.
|
||||
The fraction part is a good indicator of how well the driver is doing.
|
||||
With an UltrSPARC 30, this is normally within a few tens of microseconds
|
||||
relative to the IRIG-B signal and within a few hundred microseconds with
|
||||
IRIG-E.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>IRIG</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the microphone port if set to zero or the line-in port if set
|
||||
to one. It does not seem useful to specify the compact disc player port.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enables audio monitoring of the input signal. For this purpose, the speaker
|
||||
volume must be set before the driver is started.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enable verbose <TT>clockstats</TT> recording if set.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
227
contrib/ntp/html/driver7.htm
Normal file
227
contrib/ntp/html/driver7.htm
Normal file
@ -0,0 +1,227 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Canadian CHU Radio Modem/Audio Decoder
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
CHU Audio/Modem Decoder</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.7.<I>u</I>
|
||||
<BR>Reference ID: <TT>CHU</TT>
|
||||
<BR>Driver ID: <TT>CHU</TT>
|
||||
<BR>Serial Port: <TT>/dev/chu<I>u</I></TT>; 300 baud, 8-bits, no parity
|
||||
<BR>Audio Device: <TT>/dev/audio</TT> and <TT>/dev/audioctl</TT>
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver synchronizes the computer time using data encoded in radio
|
||||
transmissions from Canadian time/frequency station CHU in Ottawa, Ontario.
|
||||
Transmissions are made continuously on 3330 kHz, 7335 kHz and 14670 kHz
|
||||
in upper sideband, compatible AM mode. An ordinary shortwave receiver can
|
||||
be tuned manually to one of these frequencies or, in the case of ICOM receivers,
|
||||
the receiver can be tuned automatically using the <TT>minimuf</TT> and
|
||||
<TT>icom</TT> programs as propagation conditions change throughout the
|
||||
day and night.
|
||||
|
||||
<P>This driver replaces an earlier one built by Dennis Ferguson in 1988.
|
||||
The earlier driver required a special line discipline which preprocessed
|
||||
the signal in order to improve accuracy and avoid errors. The new driver
|
||||
includes more powerful algorithms implemented directly in the driver and
|
||||
requires no line discipline. It decodes the data using a maximum-likelihood
|
||||
technique which exploits the considerable degree of redundancy available
|
||||
to maximize accuracy and minimize errors.
|
||||
|
||||
<P>While there are currently no known commercial CHU receivers, a simple
|
||||
but effective receiver/demodulator can be constructed from an ordinary
|
||||
shortwave receiver and Bell 103 compatible, 300-bps modem or modem chip,
|
||||
as described in the <A HREF="file:///J|/ntp4/html/pps.htm">Pulse-per-second
|
||||
(PPS) Signal Interfacing</A> page. The driver can be compiled to use this
|
||||
modem to receive the radio signal and demodulate the data. Alternatively,
|
||||
the driver can be compiled to use the audio codec of the Sun workstation
|
||||
or another with compatible audio drivers. In the latter case, the driver
|
||||
implements the modem using DSP routines, so the radio can be connected
|
||||
directly to either the microphone on line input port.
|
||||
|
||||
<P>The CHU time broadcast includes an audio signal compatible with the
|
||||
Bell 103 modem standard (mark = 2225 Hz, space = 2025 Hz). It consist of
|
||||
nine, ten-character bursts transmitted at 300 bps and beginning each second
|
||||
from second 31 to second 39 of the minute. Each character consists of eight
|
||||
data bits plus one start bit and two stop bits to encode two hex digits.
|
||||
The burst data consist of five characters (ten hex digits) followed by
|
||||
a repeat of these characters. In format A, the characters are repeated
|
||||
in the same polarity; in format B, the characters are repeated in the opposite
|
||||
polarity.
|
||||
|
||||
<P>Format A bursts are sent at seconds 32 through 39 of the minute in hex
|
||||
digits
|
||||
|
||||
<P><TT> 6dddhhmmss6dddhhmmss</TT>
|
||||
|
||||
<P>The first ten digits encode a frame marker (<TT>6</TT>) followed by
|
||||
the day (<TT>ddd</TT>), hour (<TT>hh </TT>in UTC), minute (<TT>mm</TT>)
|
||||
and the second (<TT>ss</TT>). Since format A bursts are sent during the
|
||||
third decade of seconds the tens digit of <TT>ss </TT>is always 3. The
|
||||
driver uses this to determine correct burst synchronization. These digits
|
||||
are then repeated with the same polarity.
|
||||
|
||||
<P>Format B bursts are sent at second 31 of the minute in hex digits
|
||||
|
||||
<P><TT> xdyyyyttaaxdyyyyttaa</TT>
|
||||
|
||||
<P>The first ten digits encode a code (<TT>x </TT>described below) followed
|
||||
by the DUT1 (<TT>d </TT>in deciseconds), Gregorian year (<TT>yyyy</TT>),
|
||||
difference TAI - UTC (<TT>tt</TT>) and daylight time indicator (<TT>aa</TT>)
|
||||
peculiar to Canada. These digits are then repeated with inverted polarity.
|
||||
|
||||
<P>The <TT>x </TT>is coded
|
||||
|
||||
<P>1 Sign of DUT (0 = +)
|
||||
<BR>2 Leap second warning. One second will be added.
|
||||
<BR>4 Leap second warning. One second will be subtracted.
|
||||
This is not likely to happen in our universe.
|
||||
<BR>8 Even parity bit for this nibble.
|
||||
|
||||
<P>By design, the last stop bit of the last character in the burst coincides
|
||||
with 0.5 second. Since characters have 11 bits and are transmitted at 300
|
||||
bps, the last stop bit of the first character coincides with 0.5 - 10 *
|
||||
11/300 = 0.133 second. Depending on the UART, character interrupts can
|
||||
vary somewhere between the beginning of bit 9 and end of bit 11. These
|
||||
eccentricities can be corrected along with the radio propagation delay
|
||||
using <TT>fudge time1</TT>.
|
||||
<H4>
|
||||
Debugging aids</H4>
|
||||
The timecode format used for debugging and data recording includes data
|
||||
helpful in diagnosing problems with the radio signal and serial connections.
|
||||
With debugging enabled (<TT>-d -d -d</TT> on the <TT>ntpd </TT>command
|
||||
line), the driver produces one line for each burst in two formats corresponding
|
||||
to format A and B. Following is format A:
|
||||
|
||||
<P><TT> n b f s m code</TT>
|
||||
|
||||
<P>where <TT>n </TT>is the number of characters in the burst (0-11), <TT>b
|
||||
</TT>the burst distance (0-40), <TT>f </TT>the field alignment (-1, 0,
|
||||
1), <TT>s </TT>the synchronization distance (0-16), <TT>m </TT>the burst
|
||||
number (2-9) and <TT>code </TT>the burst characters as received. Note that
|
||||
the hex digits in each character are reversed, so the burst
|
||||
|
||||
<P><TT> 10 38 0 16 9 06851292930685129293</TT>
|
||||
|
||||
<P>is interpreted as containing 11 characters with burst distance 38, field
|
||||
alignment 0, synchronization distance 16 and burst number 9. The nibble-swapped
|
||||
timecode shows day 58, hour 21, minute 29 and second 39.
|
||||
|
||||
<P>When the audio driver is compiled, format A is preceded by the gain
|
||||
(0-255) and relative signal level (0-9999). The receiver volume control
|
||||
should be set so that the gain is near the middle of the range 0-255, which
|
||||
results in a signal level near 1000.
|
||||
|
||||
<P>Following is format B:
|
||||
|
||||
<P><TT> n b s code</TT>
|
||||
|
||||
<P>where <TT>n </TT>is the number of characters in the burst (0-11), <TT>b
|
||||
</TT>the burst distance (0-40), <TT>s </TT>the synchronization distance
|
||||
(0-40) and <TT>code </TT>the burst characters as received. Note that the
|
||||
hex digits in each character are reversed and the last ten digits inverted,
|
||||
so the burst
|
||||
|
||||
<P> <TT>11 40 1091891300ef6e76ecff</TT>
|
||||
|
||||
<P>is interpreted as containing 11 characters with burst distance 40. The
|
||||
nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI - UTC
|
||||
31 seconds.
|
||||
|
||||
<P>In addition to the above, the reference timecode is updated and written
|
||||
to the clockstats file and debug score after the last burst received in
|
||||
the minute. The format is
|
||||
|
||||
<P> <TT> qq yyyy ddd hh:mm:ss nn dd tt</TT>
|
||||
|
||||
<P>where <TT>qq </TT>are the error flags, as described below, <TT>yyyy
|
||||
</TT>is the year, <TT>ddd </TT>the day, <TT>hh:mm:ss </TT>the time of day,
|
||||
<TT>nn </TT>the number of format A bursts received during the previous
|
||||
minute, <TT>dd </TT>the decoding distance and <TT>tt </TT>the number of
|
||||
timestamps. The error flags are cleared after every update.
|
||||
|
||||
<P>For accuracy better than the low milliseconds, the <TT>fudge time1</TT>
|
||||
variable can be used to set the propagation delay and compensate for inherent
|
||||
latencies in the serial port hardware and operating system. This can be
|
||||
done conveniently using the <TT>minimuf</TT> program.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
When enabled by the <TT>flag4</TT> fudge flag, every received timecode
|
||||
burst in both format A or format B is written to the <TT>clockstats</TT>
|
||||
file.
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>CHU</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
When the audio driver is compiled, this flag selects the audio input
|
||||
port, where 0 is the mike port (default) and 1 is the line-in port. It
|
||||
does not seem useful to select the compact disc player port.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
When the audio driver is compiled, this flag enables audio monitoring of
|
||||
the input signal. For this purpose, the speaker volume must be set
|
||||
before the driver is started.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Enable verbose <TT>clockstats</TT> recording if set.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="file:///J|/ntp4/html/refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
343
contrib/ntp/html/driver8.htm
Normal file
343
contrib/ntp/html/driver8.htm
Normal file
@ -0,0 +1,343 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
Generic Reference Driver
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
Generic Reference Driver
|
||||
</H3><HR>
|
||||
|
||||
<H4>Synopsis</H4>
|
||||
|
||||
Address: 127.127.8.<I>u</I>
|
||||
<BR>Reference ID: <TT>PARSE</TT>
|
||||
<BR>Driver ID: <TT>GENERIC</TT>
|
||||
<BR>Serial Port: <TT>/dev/refclock-<I>u</I></TT>; TTY mode according to
|
||||
clock type
|
||||
|
||||
<H4>Description</H4>
|
||||
|
||||
The timecode of these receivers is sampled via a STREAMS module in the
|
||||
kernel (The STREAMS module has been designed for use with SUN Systems
|
||||
under SunOS 4.1.x or Solaris 2.3 - 2.6. It can be linked directly into
|
||||
the kernel or loaded via the loadable driver mechanism). This STREAMS
|
||||
module can be adapted to be able to convert different time code formats.
|
||||
If the daemon is compiled without the STREAM definition synchronization
|
||||
will work without the Sun streams module, though accuracy is
|
||||
significantly degraded. This feature allows to use PARSE also on non Sun
|
||||
machines.
|
||||
|
||||
<P>The actual receiver status is mapped into various synchronization
|
||||
states generally used by receivers. The STREAMS module is configured to
|
||||
interpret the time codes of DCF C51, PZF535, PZF509, GPS166, Trimble SV6
|
||||
GPS, ELV DCF7000, Schmid, Wharton 400A and low cost receivers (see list
|
||||
below).
|
||||
|
||||
<P>The reference clock support in ntp contains the necessary
|
||||
configuration tables for those receivers. In addition to supporting
|
||||
several different clock types and 4 devices, the generation a a PPS
|
||||
signal is also provided as an configuration option. The PPS
|
||||
configuration option uses the receiver generated time stamps for feeding
|
||||
the PPS loopfilter control for much finer clock synchronization.
|
||||
|
||||
<P>CAUTION: The PPS configuration option is different from the hardware
|
||||
PPS signal, which is also supported (see below), as it controls the way
|
||||
ntpd is synchronized to the reference clock, while the hardware PPS
|
||||
signal controls the way time offsets are determined.
|
||||
|
||||
<P>The use of the PPS option requires receivers with an accuracy of
|
||||
better than 1ms.
|
||||
|
||||
<P>Fudge factors
|
||||
|
||||
<P>Only two fudge factors are utilized. The time1 fudge factor defines
|
||||
the phase offset of the synchronization character to the actual time. On
|
||||
the availability of PPS information the time2 fudge factor defines the
|
||||
skew between the PPS time stamp and the receiver timestamp of the PPS
|
||||
signal. This parameter is usually zero, as usually the PPS signal is
|
||||
believed in time and OS delays should be corrected in the machine
|
||||
specific section of the kernel driver. time2 needs only be set when the
|
||||
actual PPS signal is delayed for some reason. The flag1 enables input
|
||||
filtering. This a median filter with continuous sampling. The flag2
|
||||
selects averaging of the samples remaining after the filtering. Leap
|
||||
second-handling is controlled with the flag3. When set a leap second
|
||||
will be deleted on receipt of a leap second indication from the
|
||||
receiver. Otherwise the leap second will be added, (which is the
|
||||
default). flag3 should never be set. PPS handling is enabled by adding
|
||||
128 to the mode parameter in the server/peer command.
|
||||
|
||||
<P>ntpq (8)
|
||||
<P>timecode variable
|
||||
|
||||
<P>The ntpq program can read clock variables command list several
|
||||
variables.
|
||||
These hold the following information: refclock_time is the local time
|
||||
with
|
||||
the offset to UTC (format HHMM). The currently active receiver flags are
|
||||
listed in refclock_status. Additional feature flags of the receiver are
|
||||
optionally listed in parentheses. The actual time code is listed in
|
||||
timecode.
|
||||
A qualification of the decoded time code format is following in
|
||||
refclock_format. The last piece of information is the overall running
|
||||
time and the accumulated times for the clock event states in
|
||||
refclock_states. When PPS information is present additional variable are
|
||||
available. refclock_ppstime lists then the PPS timestamp and
|
||||
refclock_ppsskew lists the difference between RS232
|
||||
derived timestamp and the PPS timestamp.
|
||||
|
||||
<P>Currently, fourteen clock types (devices /dev/refclock-0 -
|
||||
/dev/refclock-3) are supported by the PARSE driver.
|
||||
<BR>A note on the implementations:
|
||||
<UL><li>These implementations where mainly done <B><I>WITHOUT</I></B>
|
||||
actual access to the hardware. Thus not all implementations provide full
|
||||
support. The development was done with the help of many souls who had
|
||||
the hardware and where so kind to borrow me their time an patience
|
||||
during the development and debugging cycle. Thus for continued support
|
||||
and quality direct access to the receivers is a big help. Nevertheless i
|
||||
am not prepared to buy these reference clocks - donations to <A
|
||||
HREF="http://www4.informatik.uni-erlangen.de/~kardel">me</A>
|
||||
(<A HREF="mailto: kardel@acm.org">kardel@acm.org</A>) are welcome as
|
||||
long as they work within Europe 8-).
|
||||
|
||||
<P>Verified implementations are:
|
||||
<UL>
|
||||
<LI>
|
||||
RAWDCF variants
|
||||
|
||||
<p>These variants are tested for the decoding with my own homegrown
|
||||
receivers. Interfacing with specific commercial products may involve
|
||||
some fiddeling with cables. Especially commericial RAWDCF receivers have
|
||||
a seemingly unlimited number of ways to draw power from the RS232 port
|
||||
and to encode the DCF77 datastream. You are mainly on your own here
|
||||
unless i have a sample of the receiver.
|
||||
<LI>
|
||||
<A HREF="http://www.meinberg.de">Meinberg clocks</A>
|
||||
|
||||
<p>These implementations are verified by the Meinberg people themselves
|
||||
and i have access to one of these clocks.</UL>
|
||||
</UL>
|
||||
The pictures below refer to the respective clock and where taken from
|
||||
the vendors web pages. They are linked to the respective vendors.
|
||||
<UL>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 0</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A>PZF535/<A
|
||||
HREF="http://www.meinberg.de/english/pzf509.htm">PZF509 receiver</A> (FM
|
||||
demodulation/TCXO / 50us)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 1</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> PZF535/<A
|
||||
HREF="http://www.meinberg.de/english/pzf509.htm">PZF509
|
||||
receiver</A> (FM demodulation/OCXO / 50us)</TT></B>
|
||||
<BR><A HREF="http://www.meinberg.de/english/pzf509.htm"><IMG
|
||||
SRC="pic/pzf509.jpg" ALT="BILD PZF509" HEIGHT=300 WIDTH=260
|
||||
ALIGN=TEXTTOP></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 2</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> DCF U/A
|
||||
31/<A HREF="http://www.meinberg.de/english/c51.htm">DCF C51 receiver</A>
|
||||
(AM demodulation / 4ms)</TT></B>
|
||||
<BR><A HREF="http://www.meinberg.de/english/c51.htm"><IMG
|
||||
SRC="pic/c51.jpg" ALT="BILD C51" HEIGHT=180 WIDTH=330 ALIGN=TEXTTOP></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 3</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.elv.de">ELV</A> DCF7000 (sloppy AM
|
||||
demodulation
|
||||
/ 50ms)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 4</TT></B>
|
||||
|
||||
<p><B><TT>Walter Schmid DCF receiver Kit (AM demodulation /
|
||||
1ms)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 5</TT></B>
|
||||
|
||||
<p><B><TT>RAW DCF77 100/200ms pulses (Conrad DCF77 receiver module /
|
||||
5ms)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 6</TT></B>
|
||||
|
||||
<p><B><TT>RAW DCF77 100/200ms pulses (TimeBrick DCF77 receiver module
|
||||
/ 5ms)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 7</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> <A
|
||||
HREF="http://www.meinberg.de/english/gps167.htm">GPS166/GPS167
|
||||
receiver</A> (GPS / <<1us)</TT></B>
|
||||
<BR><A HREF="http://www.meinberg.de/english/gps167.htm"><IMG
|
||||
SRC="pic/gps167.jpg" ALT="BILD GPS167" HEIGHT=300 WIDTH=280
|
||||
ALIGN=TEXTTOP></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 8</TT></B>
|
||||
<p><B><TT><A HREF="http://www.igel.de">IGEL</A> <A
|
||||
HREF="http://www.igel.de/eigelmn.htm">clock</A></TT></B>
|
||||
<BR><A HREF="http://www.igel.de/eigelmn.htm"><IMG SRC="pic/igclock.gif"
|
||||
HEIGHT=174 WIDTH=200></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 9</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.trimble.com">Trimble</A> <A
|
||||
HREF="http://www.trimble.com/cgi/omprod.cgi/pd_om011.htm">SVeeSix
|
||||
GPS receiver</A>TAIP protocol (GPS / <<1us)</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 10</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.trimble.com">Trimble</A> <A
|
||||
HREF="http://www.trimble.com/cgi/omprod.cgi/pd_om011.htm">SVeeSix
|
||||
GPS receiver</A> TSIP protocol (GPS / <<1us) (no kernel support
|
||||
yet)</TT></B>
|
||||
<BR><A HREF="http://www.trimble.com/cgi/omprod.cgi/pd_om011.htm"><IMG
|
||||
SRC="pic/pd_om011.gif" ALT="SVeeSix-CM3" BORDER=0 HEIGHT=100 WIDTH=420
|
||||
ALIGN=TEXTTOP></A>
|
||||
<BR><A HREF="http://www.trimble.com/cgi/omprod.cgi/pd_om006.htm"><IMG
|
||||
SRC="pic/pd_om006.gif" ALT="Lassen-SK8" BORDER=0 HEIGHT=100
|
||||
WIDTH=420></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 11</TT></B>
|
||||
|
||||
<p><B><TT>Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master
|
||||
Clock
|
||||
support </TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 12</TT></B>
|
||||
|
||||
<p><B><TT><A HREF="http://www.hopf-time.com">HOPF</A> <A
|
||||
HREF="http://www.hopf-time.com/kart6021.htm">Funkuhr
|
||||
6021</A></TT></B>
|
||||
<BR><A HREF="http://www.hopf-time.com/engl/kart6021.htm"><IMG
|
||||
SRC="pic/fg6021.gif" ALT="DCF77-Interface Board" HEIGHT=207 WIDTH=238
|
||||
ALIGN=TEXTTOP></A>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 13</TT></B>
|
||||
|
||||
<p><B><TT>Diem's Computime Radio Clock</TT></B>
|
||||
<BR>
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 14</TT></B>
|
||||
|
||||
<p><B><TT>RAWDCF receiver (DTR=high/RTS=low)</TT></B>
|
||||
|
||||
<LI>
|
||||
<B><TT>server 127.127.8.0-3 mode 15</TT></B>
|
||||
|
||||
<p><B><TT>WHARTON 400A Series Clocks with a 404.2 Serial
|
||||
Interface</TT></B>
|
||||
</UL>
|
||||
<p>
|
||||
Actual data formats and set-up requirements of the various clocks can be
|
||||
found in <A HREF="parsedata.htm">NTP PARSE clock data formats</A>.
|
||||
|
||||
<P>The reference clock support carefully monitors the state transitions
|
||||
of the receiver. All state changes and exceptional events such as loss
|
||||
of time code transmission are logged via the syslog facility. Every hour
|
||||
a summary of the accumulated times for the clock states is listed via
|
||||
syslog.
|
||||
|
||||
<P>PPS support is only available when the receiver is completely
|
||||
synchronized. The receiver is believed to deliver correct time for an
|
||||
additional period of time after losing synchronizations, unless a
|
||||
disruption in time code transmission is detected (possible power loss).
|
||||
The trust period is dependent on the receiver oscillator and thus a
|
||||
function of clock type. This is one of the parameters in the clockinfo
|
||||
field of the reference clock implementation. This parameter cannot be
|
||||
configured by ntpdc.
|
||||
|
||||
<P>In addition to the PPS loopfilter control a true PPS hardware signal
|
||||
can be applied on Sun Sparc stations via the CPU serial ports on the CD
|
||||
pin. This signal is automatically detected and will be used for offset
|
||||
calculation. The input signal must be the time mark for the following
|
||||
time code. (The edge sensitivity can be selected - look into the
|
||||
appropriate kernel/parsestreams.c for details). Meinberg receivers can
|
||||
be connected by feeding the PPS pulse of the receiver via a 1488 level
|
||||
converter to Pin 8 (CD) of a Sun serial zs-port. To select PPS support
|
||||
the STREAMS driver for PARSE must be loaded and the mode parameter ist
|
||||
the mode value of above plus 128. If 128 is not added to the mode value
|
||||
PPS will be detected to be available but it will not be used. For PPS to
|
||||
be used you MUST add 128 to the mode parameter.
|
||||
|
||||
<P>For the Meinberg GPS166/GPS167 receiver is also a special firmware
|
||||
release available (Uni-Erlangen). This release should be used for proper
|
||||
operation.
|
||||
|
||||
<P>The raw DCF77 pulses can be fed via a level converter directly into
|
||||
Pin 3 (Rx) of the Sun. The telegrams will be decoded an used for
|
||||
synchronization. AM DCF77 receivers are running as low as $25. The
|
||||
accuracy is dependent on the receiver and is somewhere between 2ms
|
||||
(expensive) to 10ms (cheap). Upon bad signal reception of DCF77
|
||||
synchronizations will cease as no backup oscillator is available as
|
||||
usually found in other reference clock receivers. So it is important to
|
||||
have a good place for the DCF77 antenna. For transmitter shutdowns you
|
||||
are out of luck unless you have other NTP servers with alternate time
|
||||
sources available.
|
||||
|
||||
<H4>Monitor Data</H4>
|
||||
|
||||
Clock states statistics are written hourly the the syslog service.
|
||||
Online information can be found by examining the clock variable via the
|
||||
ntpq cv command.
|
||||
|
||||
<H4>Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
|
||||
<DT><TT>time1 <I>time</I></TT></DT>
|
||||
<DD>Specifies the time offset calibration factor, in seconds and
|
||||
fraction, with default depending on clock type.</DD>
|
||||
|
||||
<DT><TT>time2 <I>time</I></TT></DT>
|
||||
<DD>Specifies the offset if the PPS signal to the actual time. (PPS fine
|
||||
tuning).</DD>
|
||||
|
||||
<DT><TT>stratum <I>number</I></TT></DT>
|
||||
<DD>Specifies the driver stratum, in decimal from 0 to 15, with default
|
||||
0.</DD>
|
||||
|
||||
<DT><TT>refid <I>string</I></TT></DT>
|
||||
<DD>Specifies the driver reference identifier, an ASCII string from one
|
||||
to four characters, with default according to current clock type.</DD>
|
||||
|
||||
<DT><TT>flag1 0 | 1</TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>flag2 0 | 1</TT></DT>
|
||||
<DD>Not used by this driver.</DD>
|
||||
|
||||
<DT><TT>flag3 0 | 1</TT></DT>
|
||||
<DD>delete next leap second instead of adding it.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
<DD>Delete next leap second instead of adding it - flag will be re-
|
||||
defined soon - so don't use it. Statistics are provided by more common
|
||||
means (syslog, clock variable via ntpq)</DD>
|
||||
|
||||
</DL>
|
||||
|
||||
<H4>Making your own PARSE clocks</H4>
|
||||
|
||||
The parse clock mechanismis deviated from the way other ntp reference
|
||||
clocks work. For a short description how to build parse reference clocks
|
||||
see <A HREF="parsenew.htm">making PARSE clocks</A>
|
||||
|
||||
<P>Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href="mailto:mills@udel.edu"> David L. Mills <mills@udel.edu></a>
|
||||
</address></body></html>
|
133
contrib/ntp/html/driver9.htm
Normal file
133
contrib/ntp/html/driver9.htm
Normal file
@ -0,0 +1,133 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<TITLE>Magnavox MX4200 GPS Receiver
|
||||
</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H3>
|
||||
Magnavox MX4200 GPS Receiver</H3>
|
||||
|
||||
<HR>
|
||||
<H4>
|
||||
Synopsis</H4>
|
||||
Address: 127.127.9.<I>u</I>
|
||||
<BR>Reference ID: <TT>GPS</TT>
|
||||
<BR>Driver ID: <TT>GPS_MX4200</TT>
|
||||
<BR>Serial Port: <TT>/dev/gps<I>u</I></TT>; 4800 baud, 8-bits, no parity
|
||||
<BR>Features: <TT>ppsclock</TT> (required)
|
||||
<H4>
|
||||
Description</H4>
|
||||
This driver supports the Magnavox MX4200 Navigation Receiver adapted to
|
||||
precision timing applications. It requires the <TT>ppsclock</TT> line
|
||||
discipline or streams module described in the <A HREF="ldisc.htm">Line
|
||||
Disciplines and Streams Modules</A> page. It also requires a <A
|
||||
HREF="gadget.htm">gadget box</A> and 1-PPS level converter, such as
|
||||
described in the <A HREF="pps.htm">Pulse-per-second (PPS) Signal
|
||||
Interfacing</A> page.
|
||||
|
||||
<P>This driver supports all compatible receivers such as the 6-channel
|
||||
MX4200, MX4200D, and the 12-channel MX9212, MX9012R, MX9112.
|
||||
|
||||
<P>
|
||||
<A HREF="http://www.leica-gps.com/">
|
||||
<IMG SRC="pic/9400n.jpg" ALT="Leica MX9400N Navigator" ALIGN=LEFT></A>
|
||||
<A HREF="http://www.leica-gps.com/">Leica Geosystems</A> acquired
|
||||
the Magnavox commercial GPS technology business in February of 1994.
|
||||
They now market and support former Magnavox GPS products such as the
|
||||
MX4200 and its successors.</P>
|
||||
|
||||
<BR CLEAR=LEFT>
|
||||
Leica MX9400N Navigator.
|
||||
|
||||
<P>
|
||||
|
||||
<H4>
|
||||
Operating Modes</H4>
|
||||
This driver supports two modes of operation, static and mobile, controlled
|
||||
by clock flag 2.
|
||||
|
||||
<P>In static mode (the default) the driver assumes that the GPS antenna
|
||||
is in a fixed location. The receiver is initially placed in a "Static,
|
||||
3D Nav" mode, where latitude, longitude, elevation and time are calculated
|
||||
for a fixed station. A DOP-weighted running average position is calculated
|
||||
from this data. After 24 hours, the receiver is placed into a "Known Position"
|
||||
mode, initialized with the calculated position, and then solves only for
|
||||
time.
|
||||
|
||||
<P>In mobile mode, the driver assumes the GPS antenna is mounted on a moving
|
||||
platform such as a car, ship, or aircraft. The receiver is placed in "Dynamic,
|
||||
3D Nav" mode and solves for position, altitude and time while moving. No
|
||||
position averaging is performed.
|
||||
<H4>
|
||||
Monitor Data</H4>
|
||||
The driver writes each timecode as received to the <TT>clockstats</TT>
|
||||
file. Documentation for the <CITE>NMEA-0183</CITE> proprietary
|
||||
sentences produced by the MX4200 can be found in
|
||||
<A HREF="mx4200data.htm">MX4200 Receiver Data Format</A>.
|
||||
|
||||
<H4>
|
||||
Fudge Factors</H4>
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
<TT>time1 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the time offset calibration factor, in seconds and fraction,
|
||||
with default 0.0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>time2 <I>time</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>stratum <I>number</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>refid <I>string</I></TT></DT>
|
||||
|
||||
<DD>
|
||||
Specifies the driver reference identifier, an ASCII string from one to
|
||||
four characters, with default <TT>GPS</TT>.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag1 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag2 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Assume GPS receiver is on a mobile platform if set.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag3 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
|
||||
<DT>
|
||||
<TT>flag4 0 | 1</TT></DT>
|
||||
|
||||
<DD>
|
||||
Not used by this driver.</DD>
|
||||
</DL>
|
||||
Additional Information
|
||||
|
||||
<P><A HREF="refclock.htm">Reference Clock Drivers</A>
|
||||
<HR>
|
||||
<ADDRESS>
|
||||
David L. Mills (mills@udel.edu)</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
292
contrib/ntp/html/exec.htm
Normal file
292
contrib/ntp/html/exec.htm
Normal file
@ -0,0 +1,292 @@
|
||||
<html><head><title>
|
||||
Executive Summary - Computer Network Time Synchronization
|
||||
</title></head><body><H3>
|
||||
Executive Summary - Computer Network Time Synchronization
|
||||
</h3>
|
||||
|
||||
<img align=left src=pic/alice12.gif>
|
||||
from <i>Alice's Adventures in Wonderland</i>, by Lewis Carroll,
|
||||
illustrations by Sir John Tenniel
|
||||
|
||||
<p>The executive is the one on the left.
|
||||
|
||||
<br clear=left><hr>
|
||||
|
||||
<h4>Introduction</h4>
|
||||
|
||||
<p>The standard timescale used by most nations of the world is Universal
|
||||
Coordinated Time (UTC), which is based on the Earth's rotation about its
|
||||
axis, and the Gregorian Calendar, which is based on the Earth's rotation
|
||||
about the Sun. The UTC timescale is disciplined with respect to
|
||||
International Atomic Time (TAI) by inserting leap seconds at intervals
|
||||
of about 18 months. UTC time is disseminated by various means, including
|
||||
radio and satellite navigation systems, telephone modems and portable
|
||||
clocks.
|
||||
|
||||
<p>Special purpose receivers are available for many time-dissemination
|
||||
services, including the Global Position System (GPS) and other services
|
||||
operated by various national governments. For reasons of cost and
|
||||
convenience, it is not possible to equip every computer with one of
|
||||
these receivers. However, it is possible to equip some number of
|
||||
computers acting as primary time servers to synchronize a much larger
|
||||
number of secondary servers and clients connected by a common network.
|
||||
In order to do this, a distributed network clock synchronization
|
||||
protocol is required which can read a server clock, transmit the reading
|
||||
to one or more clients and adjust each client clock as required.
|
||||
Protocols that do this include the Network Time Protocol (NTP), Digital
|
||||
Time Synchronization Protocol (DTSS) and others found in the literature
|
||||
(See "Further Reading" at the end of this article.)
|
||||
|
||||
<h4>Protocol Design Issues</h4>
|
||||
|
||||
<p>The synchronization protocol determines the time offset of the server
|
||||
clock relative to the client clock. The various synchronization
|
||||
protocols in use today provide different means to do this, but they all
|
||||
follow the same general model. On request, the server sends a message
|
||||
including its current clock value or <i>timestamp</i> and the client
|
||||
records its own timestamp upon arrival of the message. For the best
|
||||
accuracy, the client needs to measure the server-client propagation
|
||||
delay to determine its clock offset relative to the server. Since it is
|
||||
not possible to determine the one-way delays, unless the actual clock
|
||||
offset is known, the protocol measures the total roundtrip delay and
|
||||
assumes the propagation times are statistically equal in each direction.
|
||||
In general, this is a useful approximation; however, in the Internet of
|
||||
today, network paths and the associated delays can differ significantly
|
||||
due to the individual service providers.
|
||||
|
||||
<p>The community served by the synchronization protocol can be very
|
||||
large. For instance, the NTP community in the Internet of 1998 includes
|
||||
over 230 primary time servers, synchronized by radio, satellite and
|
||||
modem, and well over 100,000 secondary servers and clients. In addition,
|
||||
there are many thousands of private communities in large government,
|
||||
corporate and institution networks. Each community is organized as a
|
||||
tree graph or <i>subnet</i>, with the primary servers at the root and
|
||||
secondary servers and clients at increasing hop count, or stratum level,
|
||||
in corporate, department and desktop networks. It is usually necessary
|
||||
at each stratum level to employ redundant servers and diverse network
|
||||
paths in order to protect against broken software, hardware and network
|
||||
links.
|
||||
<p>Synchronization protocols work in one or more association modes,
|
||||
depending on the protocol design. Client/server mode, also called
|
||||
master/slave mode, is supported in both DTSS and NTP. In this mode, a
|
||||
client synchronizes to a stateless server as in the conventional RPC
|
||||
model. NTP also supports symmetric mode, which allows either of two peer
|
||||
servers to synchronize to the other, in order to provide mutual backup.
|
||||
DTSS and NTP support a broadcast mode which allows many clients to
|
||||
synchronize to one or a few servers, reducing network traffic when large
|
||||
numbers of clients are involved. In NTP, IP multicast can be used when
|
||||
the subnet spans multiple networks.
|
||||
|
||||
<p>Configuration management can be a serious problem in large subnets.
|
||||
Various schemes which index public databases and network directory
|
||||
services are used in DTSS and NTP to discover servers. Both protocols
|
||||
use broadcast modes to support large client populations; but, since
|
||||
listen-only clients cannot calibrate the delay, accuracy can suffer. In
|
||||
NTP, clients determine the delay at the time a server is first
|
||||
discovered by polling the server in client/server mode and then
|
||||
reverting to listen-only mode. In addition, NTP clients can broadcast a
|
||||
special "manycast" message to solicit responses from nearby servers and
|
||||
continue in client/server mode with the respondents.
|
||||
|
||||
<h4>Computer Clock Modelling and Error Analysis</h4>
|
||||
|
||||
Most computers include a quartz resonator-stabilized oscillator and
|
||||
hardware counter that interrupts the processor at intervals of a few
|
||||
milliseconds. At each interrupt, a quantity called <i>tick</i> is added
|
||||
to a system variable representing the clock time. The clock can be read
|
||||
by system and application programs and set on occasion to an external
|
||||
reference. Once set, the clock readings increment at a nominal rate,
|
||||
depending on the value of <i>tick</i>. Typical Unix system kernels
|
||||
provide a programmable mechanism to increase or decrease the value of
|
||||
<i>tick</i> by a small, fixed amount in order to amortize a given time
|
||||
adjustment smoothly over multiple <i>tick</i> intervals.
|
||||
|
||||
<p>Clock errors are due to variations in network delay and latencies in
|
||||
computer hardware and software (jitter), as well as clock oscillator
|
||||
instability (wander). The time of a client relative to its server can be
|
||||
expressed
|
||||
|
||||
<p><center><i>T</i>(<i>t</i>) = <i>T</i>(<i>t</i><sub>0</sub>) +
|
||||
<i>R</i>(<i>t - t</i><sub>0</sub>) + 1/2 <i>D</i>(<i>t -
|
||||
T</i><sub>0</sub>)<sup>2</sup>,</center>
|
||||
|
||||
<p>where <i>t</i> is the current time, <i>T</i> is the time offset at
|
||||
the last measurement update <i>t</i><sub>0</sub>, <i>R</i> is the
|
||||
frequency offset and <i>D</i> is the drift due to resonator ageing. All
|
||||
three terms include systematic offsets that can be corrected and random
|
||||
variations that cannot. Some protocols, including DTSS, estimate only
|
||||
the first term in this expression, while others, including NTP, estimate
|
||||
the first two terms. Errors due to the third term, while important to
|
||||
model resonator aging in precision applications, are neglected, since
|
||||
they are usually dominated by errors in the first two terms.
|
||||
|
||||
<p>The synchronization protocol estimates <i>T</i>(<i>t</i><sub>0</sub>)
|
||||
(and <i>R</i>(<i>t</i><sub>0</sub>), where relevant) at regular
|
||||
intervals <font face="symbol">t</font> and adjusts the clock to minimize
|
||||
<i>T</i>(<i>t</i>) in future. In common cases, <i>R</i> can have
|
||||
systematic offsets of several hundred parts-per-million (PPM) with
|
||||
random variations of several PPM due to ambient temperature changes. If
|
||||
not corrected, the resulting errors can accumulate to seconds per day.
|
||||
In order that these errors do not exceed a nominal specification, the
|
||||
protocol must periodically re-estimate <i>T</i> and <i>R</i> and
|
||||
compensate for variations by adjusting the clock at regular intervals.
|
||||
As a practical matter, for nominal accuracies of tens of milliseconds,
|
||||
this requires clients to exchange messages with servers at intervals in
|
||||
the order of tens of minutes.
|
||||
|
||||
<p>Analysis of quartz-resonator stabilized oscillators show that errors
|
||||
are a function of the averaging time, which in turn depends on the
|
||||
interval between corrections. At correction intervals less than a few
|
||||
hundred seconds, errors are dominated by jitter, while, at intervals
|
||||
greater than this, errors are dominated by wander. As explained later,
|
||||
the characteristics of each regime determine the algorithm used to
|
||||
discipline the clock. These errors accumulate at each stratum level from
|
||||
the root to the leaves of the subnet tree. It is possible to quantify
|
||||
these errors by statistical means, as in NTP. This allows real-time
|
||||
applications to adjust audio or video playout delay, for example.
|
||||
However, the required statistics may be different for various classes of
|
||||
applications. Some applications need absolute error bounds guaranteed
|
||||
never to exceeded, as provided by the following correctness principles.
|
||||
|
||||
<h4>Correctness Principles</h4>
|
||||
|
||||
<p>Applications requiring reliable time synchronization such as air
|
||||
traffic control must have confidence that the local clock is correct
|
||||
within some bound relative to a given timescale such as UTC. There is a
|
||||
considerable body of literature that studies these issues with respect
|
||||
to various failure models such as fail-stop and Byzantine disagreement.
|
||||
While these models inspire much confidence in a theoretical setting,
|
||||
most require multiple message rounds for each measurement and would be
|
||||
impractical in a large computer network such as the Internet. However,
|
||||
it can be shown that the worst-case error in reading a remote server
|
||||
clock cannot exceed one-half the roundtrip delay measured by the client.
|
||||
This is a valuable insight, since it permits strong statements about the
|
||||
correctness of the timekeeping system.
|
||||
|
||||
<p>In the Probabilistic Clock Synchronization (PCS) scheme devised by
|
||||
Cristian, a maximum error tolerance is established in advance and time
|
||||
value samples associated with roundtrip delays that exceed twice this
|
||||
value are discarded. By the above argument, the remaining samples must
|
||||
represent time values within the specified tolerance. As the tolerance
|
||||
is decreased, more samples fail the test until a point where no samples
|
||||
survive. The tolerance can be adjusted for the best compromise between
|
||||
the highest accuracy consistent with acceptable sample survival rate.
|
||||
|
||||
<p>In a scheme devised by Marzullo and exploited in NTP and DTSS, the
|
||||
worst-case error determined for each server determines a correctness
|
||||
interval. If each of a number of servers are in fact synchronized to a
|
||||
common timescale, the actual time must be contained in the intersection
|
||||
of their correctness intervals. If some intervals do not intersect, then
|
||||
the clique containing the maximum number of intersections is assumed
|
||||
correct <i>truechimers</i> and the others assumed incorrect
|
||||
<i>false<i>tick</i>ers</i>. Only the truechimers are used to adjust the
|
||||
system
|
||||
clock.
|
||||
|
||||
<h4>Data Grooming Algorithms</h4>
|
||||
|
||||
By its very nature, clock synchronization is a continuous process,
|
||||
resulting in a sequence of measurements with each of possibly several
|
||||
servers and resulting in a clock adjustment. In some protocols, crafted
|
||||
algorithms are used to improve the time and frequency estimates and
|
||||
refine the clock adjustment. Algorithms described in the literature are
|
||||
based on trimmed-mean and median filter methods. The clock filter
|
||||
algorithm used in NTP is based on the above observation that the
|
||||
correctness interval depends on the roundtrip delay. The algorithm
|
||||
accumulates offset/delay samples in a window of several samples and
|
||||
selects the offset sample associated with the minimum delay. In general,
|
||||
larger window sizes provide better estimates; however, stability
|
||||
considerations limit the window size to about eight.
|
||||
<p>The same principle could be used when selecting the best subset of
|
||||
servers and combining their offsets to determine the clock adjustment.
|
||||
However, different servers often show different systematic offsets, so
|
||||
the best statistic for the central tendency of the server population may
|
||||
not be obvious. Various kinds of clustering algorithms have been found
|
||||
useful for this purpose. The one used in NTP sorts the offsets by a
|
||||
quality metric, then calculates the variance of all servers relative to
|
||||
each server separately. The algorithm repeatedly discards the outlyer
|
||||
with the largest variance until further discards will not improve the
|
||||
residual variance or until a minimum number of servers remain. The final
|
||||
clock adjustment is computed as a weighted average of the survivors.
|
||||
|
||||
<p>At the heart of the synchronization protocol is the algorithm used to
|
||||
adjust the system clock in accordance with the final adjustment
|
||||
determined by the above algorithms. This is called the clock discipline
|
||||
algorithm or simply the discipline. Such algorithms can be classed
|
||||
according to whether they minimize the time offset or frequency offset
|
||||
or both. For instance, the discipline used in DTSS minimizes only the
|
||||
time offset, while the one used in NTP minimizes both time and frequency
|
||||
offsets. While the DTSS algorithm cannot remove residual errors due to
|
||||
systematic frequency errors, the NTP algorithm is more complicated and
|
||||
less forgiving of design and implementation mistakes.
|
||||
|
||||
<p>All clock disciplines function as a feedback loop, with measured
|
||||
offsets used to adjust the clock oscillator phase and frequency to match
|
||||
the external synchronization source. The behavior of feedback loops is
|
||||
well understood and modelled by mathematical analysis. The significant
|
||||
design parameter is the time constant, or responsiveness to external or
|
||||
internal variations in time or frequency. Optimum selection of time
|
||||
constant depends on the interval between update messages. In general,
|
||||
the longer these intervals, the larger the time constant and vice versa.
|
||||
In practice and with typical network configurations the optimal poll
|
||||
intervals vary between one and twenty minutes for network paths to some
|
||||
thousands of minutes for modem paths.
|
||||
|
||||
<h4>Further Reading</h4>
|
||||
|
||||
<ol>
|
||||
|
||||
<p><li>Cristian, F. Probabilistic clock synchronization. In Distributed
|
||||
Computing 3, Springer Verlag, 1989, 146-158.</li>
|
||||
|
||||
<p><li>Digital Time Service Functional Specification Version T.1.0.5.
|
||||
DigitalEquipment Corporation, 1989.</li>
|
||||
|
||||
<p><li>Gusella, R., and S. Zatti. TEMPO - A network time controller for
|
||||
a distributed Berkeley UNIX system. IEEE Distributed Processing
|
||||
Technical Committee Newsletter 6, NoSI-2 (June 1984), 7-15. Also in:
|
||||
Proc. Summer 1984 USENIX (Salt Lake City, June 1984).</li>
|
||||
|
||||
<p><li>Kopetz, H., and W. Ochsenreiter. Clock synchronization in
|
||||
distributed real-time systems. IEEE Trans. Computers C-36, 8 (August
|
||||
1987), 933-939.</li>
|
||||
|
||||
<p><li>Lamport, L., and P.M. Melliar-Smith. Synchronizing clocks in the
|
||||
presence of faults. JACM 32, 1 (January 1985), 52-78.</li>
|
||||
|
||||
<p><li>Marzullo, K., and S. Owicki. Maintaining the time in a
|
||||
distributed system. ACM Operating Systems Review 19, 3 (July 1985), 44-
|
||||
54.</li>
|
||||
|
||||
<p><li>Mills, D.L. Internet time synchronization: the Network Time
|
||||
Protocol. IEEE Trans. Communications COM-39, 10 (October 1991), 1482-
|
||||
1493. Also in: Yang, Z., and T.A. Marsland (Eds.). Global States and
|
||||
Time in Distributed Systems, IEEE Press, Los Alamitos, CA, 91-102.</li>
|
||||
<p><li>Mills, D.L. Modelling and analysis of computer network clocks.
|
||||
Electrical Engineering Department Report 92-5-2, University of Delaware,
|
||||
May 1992, 29 pp.</li>
|
||||
|
||||
<p><li>NIST Time and Frequency Dissemination Services. NBS Special
|
||||
Publication432 (Revised 1990), National Institute of Science and
|
||||
Technology, U.S. Department of Commerce, 1990.</li>
|
||||
|
||||
<p><li>Schneider, F.B. A paradigm for reliable clock synchronization.
|
||||
Department of Computer Science Technical Report TR 86-735, Cornell
|
||||
University, February 1986.</li>
|
||||
|
||||
<p><li>Srikanth, T.K., and S. Toueg. Optimal clock synchronization. JACM
|
||||
34, 3 (July 1987), 626-645.</li>
|
||||
|
||||
<p><li>Stein, S.R. Frequency and time - their measurement and
|
||||
characterization (Chapter 12). In: E.A. Gerber and A. Ballato (Eds.).
|
||||
Precision Frequency Control, Vol. 2, Academic Press, New York 1985, 191-
|
||||
232, 399-416. Also in: Sullivan, D.B., D.W. Allan, D.A. Howe and F.L.
|
||||
Walls (Eds.). Characterization of Clocks and Oscillators. National
|
||||
Institute of Standards and Technology Technical Note 1337, U.S.
|
||||
Government Printing Office (January, 1990), TN61-TN119.</li>
|
||||
|
||||
</ol>
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
40
contrib/ntp/html/extern.htm
Normal file
40
contrib/ntp/html/extern.htm
Normal file
@ -0,0 +1,40 @@
|
||||
<HTML><HEAD><TITLE>
|
||||
External Clock Discipline and the Local Clock Driver
|
||||
</TITLE></HEAD><BODY><H3>
|
||||
External Clock Discipline and the Local Clock Driver
|
||||
</H3><HR>
|
||||
|
||||
<p>The NTPv4 implementation includes provisions for an external clock, where the system clock is implemented by some external hardware device. One implementation might take the form of a bus peripheral with a high resolution counter disciplined by a GPS receiver, for example. Another implementation might involve another synchronization protocol, such as the Digital Time Synchronization Service (DTSS), where the system time is disciplined to this protocol and NTP clients of the server obtain synchronization indirectly via the server. A third implementation might be a completely separate clock discipline algorithm and synchronization protocol, such as the Lockclock algorithm used with NIST Automated Computer Time Service (ACTS) modem synchronized time.
|
||||
|
||||
<p>When external clocks are used in conjunction with NTP service, some way needs to be provided for the external clock driver and NTP daemon <tt>ntpd</tt> to communicate and determine which discipline is in control. This is necessary in order to provide backup, for instance if the external clock or protocol were to fail synchronization service fall back to other means, such as a local reference clock or another NTP server. In addition, when the external clock and driver are in control, some means needs to be provided for the clock driver to pass on status information and error statistics to the NTP daemon.
|
||||
|
||||
<p>Control and monitoring functions for the external clock and driver are implemented using the Local Clock (type 1) driver and the <tt>ntp_adjtime()</tt> system call. This system call is implemented by special kernel provisions included in the kernel of several operating systems, including Solaris, Digital Unix, FreeBSD and Linux, and possibly others. When the external clock is disabled or not implemented, the system call is used to pass time and frequency information, as well as error statistics, to the kernel. Besides disciplining the system time, the same interface can be used by other applications to determine the operating parameters of the discipline. When the external clock is enabled, <tt>ntpd</tt> does not discipline the system clock, nor does it maintain the error statistics. In this case, the external clock and driver do this using mechanisms unknown to <tt>ntpd</tt>; however, in this case the kernel state variables are retrieved at 64-s intervals by the Local Clock driver and used by the clock selection and mitigation algorithms to determine the system variables presented to other NTP clients and peers. In this way, downstream clients and servers in the NTP subnet can make an intelligent choice when more than one server is available.
|
||||
|
||||
<p>In order to implement a reliable mitigation between ordinary NTP sources and the external clock source, a protocol is necessary between the local clock driver and the external clock driver. This is implemented using Boolean variables and certain bits in the kernel clock status word. The Boolean variables include the following:
|
||||
|
||||
<p>ntp__enable. set/reset by enable command. enables ntp clock discipline
|
||||
|
||||
<p>ntp_control. set during initial configuration if kernel support is available
|
||||
|
||||
kern_enable
|
||||
Set/reset by enable commandexit
|
||||
|
||||
If this switch is set, the daemon computes the offset, frequency, maximum error, estimated error, time constand and status bits, then provides them to the kernel via ntp_adjtime(). If this switch is set, these values are not passed to the kernel; however, the daemon retrieves their present values and uses them in place of the values computed by the daemon.
|
||||
|
||||
pps_update
|
||||
set in the protocol routine if the prefer peer has survived and has offset less than 128 ms; otherwise set to zero.
|
||||
|
||||
pps_control
|
||||
Updated to the current time by kernel support if the PPS signal is enabled and working correctly. Set to zero in the adjust routine if the interval since the last update exceeds 120 s.
|
||||
|
||||
|
||||
<p>The ntp_enable and kern_enable are set by the configuration module. Normally, both switches default on, so the daemon can control the time and the kernel discipline can be used, if available. The pps_update switch is set by the protocol module when it believes the PPS provider source is legitimate and operating within nominals. The ntp_control switch is set during configuration by interrogating the kernel. If both the kern_enable and ntp_control siwitches are set, the daemon disciplines the clock via the kernel and the internal daemon discipline is disabled.
|
||||
|
||||
<p>The external clock driver controls the system time and clock selection in the following way. Normally, the driver adjusts the kernel time using the ntp_adjtime() system call in the same way as the daemon. In the case where the kernel discipline is to be used intact, the clock offset is provided in this call and the loop operates as specified. In the case where the driver steers only the frequency, the offset is specified as zero
|
||||
|
||||
|
||||
d PLL/
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href="mailto:mills@udel.edu"> David L. Mills <mills@udel.edu></a>
|
||||
</address></body></html>
|
111
contrib/ntp/html/gadget.htm
Normal file
111
contrib/ntp/html/gadget.htm
Normal file
@ -0,0 +1,111 @@
|
||||
<html><head><title>
|
||||
Gadget Box PPS Level Converter and CHU Modem
|
||||
</title></head><body><h3>
|
||||
Gadget Box PPS Level Converter and CHU Modem
|
||||
</h3>
|
||||
|
||||
<img align=left src=pic/gadget.jpg>A Gadget Box built by Chuck Hanavin
|
||||
|
||||
<br clear=left><hr>
|
||||
|
||||
<p><h4>Introduction</h4>
|
||||
|
||||
<p>Many radio clocks used as a primary reference source for NTP servers
|
||||
produce a pulse-per-second (PPS) signal that can be used to improve
|
||||
accuracy to a high degree. However, the signals produced are usually
|
||||
incompatible with the modem interface signals on the serial ports used
|
||||
to connect the signal to the host. The gadget box consists of a handful
|
||||
of electronic components assembled in a small aluminum box. It includes
|
||||
level converters and a optional radio modem designed to decode the radio
|
||||
timecode signals transmitted by the Canadian time and frequency station
|
||||
CHU. A complete set of schematics, PCB artwork, drill templates can be
|
||||
obrtained via the web as the distribution <a href=
|
||||
"http://www.eecis.udel.edu/~mills/ntp/ntp">gadget.tar.Z</a>, or by
|
||||
anonymous FTP from ftp.udel.edu in the <TT>pub/ntp</TT> directory.
|
||||
|
||||
<p>The gadget box is assembled in a 5"x3"x2" aluminum
|
||||
minibox containing the level converter and modem circuitry. It includes
|
||||
two subcircuits. One of these converts a TTL positive edge into a fixed-
|
||||
width pulse at EIA levels and is for use with a timecode receiver or
|
||||
oscillator including a TTL PPS output. The other converts the timecode
|
||||
modulation broadcast by Canadian time/frequency standard station CHU
|
||||
into a 300-bps serial character stream at EIA levels and is for use with
|
||||
the <code>tty_clk</code> and <code>chu_tty</code> line disciplines in
|
||||
the ntp3 distribution.
|
||||
|
||||
<p>This archive contains complete construction details for the gadget
|
||||
box, including schematic, parts list and artwork for a two-sided,
|
||||
printed-circuit board. All files are in PostScript, with the exception
|
||||
of this file and an information file, which are in ASCII. The artwork is
|
||||
in the 1:1 scale and is suitable for direct printing on photographic
|
||||
resist for each side of the board. While a plated-through-holes process
|
||||
is most convenient, it is possible to bridge the two sides using
|
||||
soldered wires where necessary.
|
||||
|
||||
<p><h4>Circuit Description</h4>
|
||||
|
||||
<p>Following is a brief functional description of the device. See the
|
||||
schematic diagram gadget.s01 for reference. The audio output of a
|
||||
shortwave radio tuned to CHU at 3330, 7335 or 14670 kHz is connected to
|
||||
J2. A level of at least 30 mV peak-peak is required, such as provided by
|
||||
the recorder output on many receivers. The input level is adjusted by
|
||||
potentiometer R8 so that the timecode modulation broadcast at 31-39
|
||||
seconds past the minute reliably lights green LED1, but the signals
|
||||
broadcast during other seconds of the minute do not.
|
||||
|
||||
<p>Opamp U4A provides low-impedance drive for the bridged-tee bandpass
|
||||
filter U4B. The filter has a bandpass of about 600 Hz at the 6-dB points
|
||||
and a center frequency of about 2150 Hz. It is designed to avoid
|
||||
aliasing effects with receivers of relatively wide bandpass
|
||||
characteristics. The modem itself is implemented by U2 and its
|
||||
associated circuitry. Resistors R4 and R1 are a 40-dB pad which matches
|
||||
the filter output to the modem input. U2 is a TTL/EIA level converter
|
||||
with integral power supply for bipolar signals. The modem output is
|
||||
available at pin 3 (receive data) of DB25 connector J1.
|
||||
|
||||
<p>The TTL PPS signal is connected via J3 to a retriggerable one-shot
|
||||
U3A, which generates a TTL pulse of width determined by potentiometer
|
||||
R7. The pulse width is determined by the bit rate of the attached serial
|
||||
port. In the common case the width is one bit-time, such as 26 us for
|
||||
38.4 kbps, for example. This appears to the port as a single start bit
|
||||
of zero followed by eight bits of ones and a stop bit of one. The second
|
||||
one-shot U3B generates a 200-ms pulse suitable for driving the amber
|
||||
LED3 as a visual monitor. The output of U3A is converted to EIA levels
|
||||
by U1 and appears at pin 12 (secondary receive data) of J1.
|
||||
|
||||
<p>If only the PPS circuit is required, U2 and U4 can be deleted and the
|
||||
gadget box powered from the EIA modem-control signal at pin 20 (terminal
|
||||
ready) of J1, assuming this signal is placed in the on (positive
|
||||
voltage) condition by the computer program. J1 is wired to keep most
|
||||
finicky UARTs and terminal-driver programs happy. If the CHU circuit is
|
||||
required, an external 12-volt AC transformer or 9-12-volt DC supply
|
||||
connected to J4 is required. Red LED2 indicates power is supplied to the
|
||||
box.
|
||||
|
||||
<p>Files
|
||||
|
||||
<p>Following is a list of files included in this archive. All files are
|
||||
in PostScript, except the <code>README</code> and
|
||||
<code>gadget.lst</code> files, which are in ASCII. The files
|
||||
<code>gadget.s01, gadget.s02</code> and <code>gadget.lst</code> were
|
||||
generated using the Schema schematic-capture program from Omation. The
|
||||
printed-circuit files <code>*.lpr</code> were generated using Schema-
|
||||
PCB, also from Omation.
|
||||
|
||||
<p>Files
|
||||
|
||||
<p><code>README</code> - helpful information
|
||||
<br><code>gadget.s01</code> - circuit schematic
|
||||
<br><code>gadget.s02</code> - minibox assembly drawing
|
||||
<br><code>gadget.lst</code> - net list, pin list, parts list, etc.
|
||||
<br><code>gen0102.lpr</code> - pcb x-ray diagram
|
||||
<br><code>art01.lpr</code> - pcb artword side 1
|
||||
<br><code>art02.lpr</code> - pcb artwork side 2
|
||||
<br><code>adt0127.lpr</code> - pcb assembly drawing
|
||||
<br><code>dd0124.lpr</code> - pcb drill drawing
|
||||
<br><code>sm0228.lpr</code> - pcb solder mask (side 2)
|
||||
<br><code>sst0126.lpr</code> - pcb silkscreen mask (side 1)
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
26
contrib/ntp/html/hints.htm
Normal file
26
contrib/ntp/html/hints.htm
Normal file
@ -0,0 +1,26 @@
|
||||
<html><head><title>
|
||||
Hints and Kinks
|
||||
</title></head><body><h3>
|
||||
Hints and Kinks
|
||||
</h3><hr>
|
||||
|
||||
<p>This is an index for a set of troubleshooting notes contained in
|
||||
individual text files in the <tt>./hints</tt> directory. They were
|
||||
supplied by various volunteers in the form of mail messages, patches or
|
||||
just plain word of mouth. Each note applies to a specific computer and
|
||||
operating system and gives information found useful in setting up the
|
||||
NTP distribution or site configuration. The notes are very informal and
|
||||
subject to errors; no attempt has been made to verify the accuracy of
|
||||
the information contained in them.
|
||||
|
||||
<p>Additions or corrections to this list or the information contained in
|
||||
the notes is solicited. The most useful submissions include the name of
|
||||
the computer manufacturer (and model numbers where appropriate),
|
||||
operating system (specific version(s) where appropriate), problem
|
||||
description, problem solution and submitter's name and electric address.
|
||||
If the submitter is willing to continue debate on the problem, please so
|
||||
advise. Bash <a href=http:hints>here</a> for a directory listing.
|
||||
|
||||
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
|
||||
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
|
||||
</address></a></body></html>
|
195
contrib/ntp/html/hints/a-ux
Normal file
195
contrib/ntp/html/hints/a-ux
Normal file
@ -0,0 +1,195 @@
|
||||
-------------
|
||||
INTRODUCTION:
|
||||
-------------
|
||||
Last revision: 06-Jul-1994
|
||||
|
||||
Included in this distribution of XNTP V3 is a configuration file suitable
|
||||
for use under Apple's A/UX Version 3.x.x There is also one for A/UX 2.0.1
|
||||
but it has not been fully tested. To make the executables follow the steps
|
||||
outlined below.
|
||||
|
||||
*** NOTE: You must have gcc installed to successfully compile the current
|
||||
distribution; the native cc supplied with A/UX will NOT correctly compile
|
||||
this source. See the FAQ in comp.unix.aux for places to obtain gcc from
|
||||
and how to install it.
|
||||
|
||||
----------------------
|
||||
MAKING XNTPD FOR A/UX:
|
||||
----------------------
|
||||
|
||||
First, you need to create the makefiles (after you've downloaded the
|
||||
source, of course):
|
||||
|
||||
% make clean
|
||||
% make refconf
|
||||
|
||||
After that, you should edit Config.local to make sure that BINDIR is
|
||||
correct for where you wish the programs to be "installed". The default
|
||||
(and what I use) is /usr/local/etc. Make sure that DEFS_LOCAL and
|
||||
CLOCKDEFS are commented out! Presently, only the LOCAL_CLOCK/REFCLOCK
|
||||
clock is used and supported.
|
||||
|
||||
|
||||
After this is done (you should be told that your system is A/UX 3), make
|
||||
'xntpd' (the options to 'gcc' are held in compilers/aux3.gcc):
|
||||
|
||||
% make
|
||||
|
||||
I do not normally use the `make install' option and so have not verified its
|
||||
compatibility with A/UX. Rather, I pull out each of the executables and
|
||||
place them in the locally appropriate locations.
|
||||
|
||||
---------------
|
||||
STARTING XNTPD:
|
||||
---------------
|
||||
|
||||
At this point you need to set things up so that 'xntpd' is started upon
|
||||
boot-up. You can do this in 1 of 2 ways: either add entries in /etc/inittab
|
||||
or, more ideally, create and use an /etc/rc.local file. Since rc.local is
|
||||
what I recommend, here's how you do it:
|
||||
|
||||
By default, A/UX doesn't have rc.local, so you'll need to add the following to
|
||||
/etc/inittab:
|
||||
|
||||
net6:2:wait:/etc/syslogd # set to "wait" to run a syslog daemon
|
||||
+ jmj0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1 # Local stuff
|
||||
dbg2::wait:/etc/telinit v # turn off init's verbose mode
|
||||
|
||||
Now, the look of a sample /etc/rc.local is as follows:
|
||||
|
||||
#!/bin/sh
|
||||
:
|
||||
: rc.local
|
||||
:
|
||||
# @(#)Copyright Apple Computer 1987 Version 1.17 of rc.sh on 91/11/08 15:56:21 (ATT 1.12)
|
||||
|
||||
|
||||
# Push line discipline/set the device so it will print
|
||||
/etc/line_sane 1
|
||||
echo " "
|
||||
echo "Entering rc.local..."
|
||||
|
||||
set `/bin/who -r`
|
||||
if [ "$7" = 2 ]
|
||||
then
|
||||
/bin/echo " now setting the time..."
|
||||
/usr/local/etc/ntpdate -s -b <host.domain>
|
||||
sleep 5
|
||||
#
|
||||
# start up 'xntpd' if we want
|
||||
#
|
||||
if [ -f /etc/ntp.conf ]
|
||||
then
|
||||
/bin/echo " setting tick and tickadj..."
|
||||
/usr/local/etc/tickadj -t 16672 -a 54
|
||||
sleep 5
|
||||
/bin/echo " starting xntpd..."
|
||||
/usr/local/etc/xntpd <&- > /dev/null 2>&1
|
||||
sleep 5
|
||||
fi
|
||||
#
|
||||
fi
|
||||
|
||||
echo "Leaving rc.local..."
|
||||
|
||||
There are a few things to notice about the above:
|
||||
|
||||
o When run, 'ntpdate' forces your clock to the time returned by the
|
||||
host(s) specified by <host.domain> (you'll need to replace this
|
||||
be the IP address(es) of your timehosts. This is good since it gets
|
||||
things close to start off with. You can use more than one time
|
||||
server.
|
||||
|
||||
o 'tickadj' is also called. This does two things: changes the
|
||||
default value of 'tick' (which the the amount of time, in ms, that
|
||||
is added to the clock every 1/60 seconds) and changes the value
|
||||
of 'tickadj' which the the amount that is added or subtracted
|
||||
from 'tickadj' when adjtime() is called.
|
||||
|
||||
Now Mac clocks are pretty bad and tend to be slow. Sooo, instead of
|
||||
having A/UX add the default of 16666ms every 1/60th of a second, you
|
||||
may want it to add more (or less) so that it keeps better time. The
|
||||
above value works for me but your "best" value may be different and
|
||||
will likely require some fooling around to find the best value. As a
|
||||
general rule of thumb, if you see 'xntpd' make a lot of negative clock
|
||||
adjustments, then your clock is fast and you'll need to _decrease_
|
||||
the value of 'tick'. If your adjustments are positive, then you need
|
||||
to increase 'tick'. To make a guess on how fast/slow your clock is,
|
||||
use 'ntpdate' to sync your clock. Now watch 'xntpd' and see how it
|
||||
operates. If, for example, it resets your clock by 1 second every 30
|
||||
minutes, then your clock is (1/(30*60)) is about 0.056% off and you'll
|
||||
need to adjust 'tick' by 16666*0.00056 or about 9 (i.e. 'tick' should
|
||||
be ~16675 if slow or ~16657 if fast)
|
||||
|
||||
A/UX's default value of 'tickadj' is 1666 which is too big for
|
||||
'xntpd'... so it also needs to be adjusted. I like using larger
|
||||
values then the recommended value of 9 for 'tickadj' (although not
|
||||
anything near as big as 1666) since this allows for quick slews
|
||||
when adjusting the clock. Even with semi-large values of 'tickadj'
|
||||
(~200), getting 5ms (1/200 s) accuracy is easy.
|
||||
|
||||
|
||||
Finally, before A/UX and 'xntpd' will work happily together, you need to
|
||||
patch the kernel. This is due to the fact that A/UX attempts to keep the
|
||||
UNIX-software clock and the Mac-hardware clock in sync. Neither the h/w or
|
||||
the s/w clock are too accurate. Also, 'xntpd' will be attempting to adjust
|
||||
the software clock as well, so having A/UX muck around with it is asking
|
||||
for headaches. What you therefore need to do is tell the kernel _not_ to
|
||||
sync the s/w clock with the h/w one. This is done using 'adb'. The
|
||||
following is a shell script that will do the patch for you:
|
||||
|
||||
#! /bin/sh
|
||||
adb -w /unix <<!
|
||||
init_time_fix_timeout?4i
|
||||
init_time_fix_timeout?w 0x4e75
|
||||
init_time_fix_timeout?4i
|
||||
$q
|
||||
!
|
||||
|
||||
This must be done _every_ time you create a new kernel (via newconfig or
|
||||
newunix) or else 'xntpd' will go crazy.
|
||||
|
||||
--------
|
||||
HISTORY:
|
||||
--------
|
||||
|
||||
John Dundas was the original porter of 'xntpd' and a lot of the additions
|
||||
and A/UX-ports are from him. I got involved when I wanted to run 'xntpd'
|
||||
on jagubox. It was also around this time that the base-patchlevel of
|
||||
'xntpd' changed relatively (the so-called "jones" version). Since then,
|
||||
I've been maintaining 'xntpd' for A/UX for the xntp development team
|
||||
|
||||
The original kernel patch (which patched 'time_fix_timeout') was from
|
||||
Richard Todd. I suggest patching 'init_time_fix_timeout' which prevents
|
||||
'time_fix_timeout' from even being called.
|
||||
|
||||
----------------
|
||||
TECHNICAL NOTES:
|
||||
----------------
|
||||
|
||||
o As configured (see machines/aux3), 'xntpd' will log messages via syslogd
|
||||
using the LOC_LOCAL1 facility. I would suggest the following in
|
||||
/etc/syslog.conf:
|
||||
|
||||
local1.notice /usr/adm/ntpd-syslog
|
||||
|
||||
o As mentioned above, the clocks on A/UX and Macs are kinda bad. Not
|
||||
only that, but logging in and out of the MacOS mode as well as
|
||||
extensive floppy use causes A/UX to drop and lose clock interupts
|
||||
(these are sent every 1/60th of a second). So, if you do these
|
||||
activities a lot, you find out that you lose about 300ms of time
|
||||
(i.e., you become 300ms slow). 'xntpd' default way of handling this
|
||||
is to called 'settimeofday()' and step the clock to the correct
|
||||
time. I prefer having 'xntpd' slew the clock back into line by
|
||||
making gradual adjustments to the clock over a coupla minutes
|
||||
or so. It's for this reason that SLEWALWAYS is defined in
|
||||
include/ntp_machine.h for SYS_AUX3. It's also for this reason than
|
||||
I like larger values of 'tickadj'.
|
||||
|
||||
Good luck! If you have problems under A/UX feel free to contact me (e-mail
|
||||
is preferred).
|
||||
--
|
||||
Jim Jagielski | "That is no ordinary rabbit... 'tis the
|
||||
jim@jagubox.gsfc.nasa.gov | most foul, cruel and bad-tempered
|
||||
NASA/GSFC, Code 734.4 | rodent you ever set eyes on"
|
||||
Greenbelt, MD 20771 | Tim the Enchanter
|
76
contrib/ntp/html/hints/aix
Normal file
76
contrib/ntp/html/hints/aix
Normal file
@ -0,0 +1,76 @@
|
||||
Problem with recent ANSI compilers
|
||||
|
||||
On some systems, including AIX, the compiler quits on the ntp_refclock.c
|
||||
file when processing the refclock_report() routine. The problem, which
|
||||
is eithre a feature or a bug, has to do with an unwanted promotion of
|
||||
the u_char argument to an int and a failure of the compiler to recognize
|
||||
the preceding prototype. A workaround is to use ANSI syntax to delare
|
||||
the arguments. Since ANSI compilers are not universally available, this
|
||||
syntax can't be used in the stock distribution.
|
||||
|
||||
(Message # 60: 2884 bytes, New)
|
||||
Date: Sat, 19 Aug 1995 13:20:50 -0400
|
||||
From: "R. Bernstein" <rocky@panix.com>
|
||||
Newsgroups: comp.protocols.time.ntp
|
||||
to: mills@udel.edu
|
||||
return-receipt-to: rocky@panix.com
|
||||
Subject: time and AIX 3.2.5 raw tty bug
|
||||
|
||||
This posting isn't strictly about NTP, any program that may stop the
|
||||
clock or set the clock backwards is subject to the AIX 3.2.5 bug.
|
||||
|
||||
On AIX 3.2.5, there is a bug in the tty driver for a raw device which
|
||||
may crash the box under certain conditions: basically a read() on a
|
||||
raw tty in effect, a character was read but not as many as specified
|
||||
by VMIN when a read timeout occurred. VTIME specifies the timeout. See
|
||||
the AIX manual page on termios.h or that include file. for Information
|
||||
on VMIN (or MIN) VTIME (or TIME).
|
||||
|
||||
A remedy other than to not use raw tty's is to apply patch U435110.
|
||||
|
||||
Details of the problem report follow.
|
||||
|
||||
> ABSTRACT:
|
||||
> IX43779: TRAP IN PSX_TIMEO
|
||||
>
|
||||
> ORIGINATING DETAILS:
|
||||
> Stacktrace shows:
|
||||
> IAR: 01460214 posixdd:psx_timeo + 8bf4: ti 4,r12,0x0
|
||||
> *LR: 014601a0 posixdd:psx_timeo + 8b80
|
||||
> 00212c60: 014604f4 posixdd:psx_timer + 8ed4
|
||||
> 00212cc0: 0144b74c ttydd:tty_do_offlevel + 4284
|
||||
> 00212d20: 000216fc .i_offlevel + 8c
|
||||
> 00212d70: 00021d78 .i_softint + c8
|
||||
> 00001004: 00008714 .finish_interrupt + 80
|
||||
>
|
||||
> RESPONDER SUMMARY:
|
||||
> AIX asserted in psx_timeo(). Reason for the assert was that
|
||||
> the current time was behind psx_ctime. Since this state
|
||||
> can occur when the current time is changed after a character
|
||||
> is received but before the VTIME interbyte timer pops, we
|
||||
> should not assert on this.
|
||||
>
|
||||
> RESPONDER CONCLUSION:
|
||||
> Removed the requirement that current time > psx_ctime by
|
||||
> adding a new L_ntimersub macro that is used instead of the
|
||||
> ntimersub macro in time.h. Also added a test for (current
|
||||
> time - psx_ctime) being negative, in that case we do not
|
||||
> adjust the new timeout.
|
||||
>
|
||||
> Reported to Correct a PTF in Error: NO
|
||||
> Reported as a Highly pervasive problem: NO
|
||||
>
|
||||
> PE Apar?: NoPE
|
||||
> Hiper Apar?: NoHiper
|
||||
> Status: CLOSED PER
|
||||
> Component Name: AIX V3 FOR RS/6
|
||||
> Version: 320
|
||||
> Component ID: 575603001
|
||||
> Submitted: 94/05/03
|
||||
> Closed: 94/05/05
|
||||
> ChangeTeam: TX2527
|
||||
>
|
||||
> APAR FIXED BY: U431696 U432151 U432844 U432870 U432979
|
||||
> U433049 U433081 U433459 U433876 U433906 U434598 U434453
|
||||
> U434672 U434737 U435110
|
||||
|
65
contrib/ntp/html/hints/bsdi
Normal file
65
contrib/ntp/html/hints/bsdi
Normal file
@ -0,0 +1,65 @@
|
||||
hints/bsdi
|
||||
|
||||
Author: Bdale Garbee, bdale@gag.com
|
||||
Last revision: 27Oct94 (Paul Vixie)
|
||||
|
||||
Included in this distribution of XNTP is a configuration file suitable
|
||||
for use with BSDI's BSD/OS 1.1 (formerly BSD/386 1.1). On this system,
|
||||
the "cc" command is GCC 1.4x rather than PCC or GCC 2.x. It is imperative
|
||||
that "cc" be used since it predefines the symbol __bsdi__; if you want to
|
||||
use another compiler you will need to add -D__bsdi__ to catch the various
|
||||
#ifdef's required for this system.
|
||||
|
||||
The Kinemetrics/Truetime GPS-TM/TMD driver is known to work on this system.
|
||||
The GPS-805 and GOES should also work fine. Hell, they should all work fine
|
||||
but it's hard to test very many locally.
|
||||
|
||||
Due to BNR2's strict interpretation of POSIX and XNTP's use of SIGIO, BSD/OS
|
||||
can only handle one refclock per daemon. We're working this out with the
|
||||
system architects.
|
||||
|
||||
The config file is machine/bsdi, and the following steps should be all that
|
||||
are required to install and use the bits.
|
||||
|
||||
Note that you will need GNU sed; the version supplied with BSD/OS 1.1 loops
|
||||
endlessly during "make refconf". Likewise you should get GNU make, which
|
||||
the instructions below assume that you have put in /usr/local/bin/gnumake.
|
||||
|
||||
To build the software:
|
||||
|
||||
rm -f Config.local
|
||||
gnumake refconf
|
||||
gnumake MAKE=gnumake
|
||||
|
||||
To install the software:
|
||||
|
||||
gnumake install
|
||||
|
||||
This will place all of the executables in /usr/local/etc. The config
|
||||
file is expected to be /usr/local/etc/xntp.conf and the key file for
|
||||
the optional authentication is /etc/ntp.keys.
|
||||
|
||||
Craft a config file and a key file, and put them in the right places.
|
||||
There is information on how to do this elsewhere in the documentation,
|
||||
the only thing I'll mention is that I put the drift file in
|
||||
/var/log/ntp.drift, and the authdelay on my 486DX/50 system is
|
||||
0.000064. Your mileage will vary, learn to use the authspeed tools
|
||||
if you're going to authenticate.
|
||||
|
||||
In the file /etc/rc.local, make sure that the invocation of ntpd is
|
||||
commented out, and add an invocation of xntpd. Here's what I'm using:
|
||||
|
||||
echo -n 'starting local daemons:'
|
||||
|
||||
if [ -f /etc/ntp.keys -a -f /usr/local/etc/xntp.conf ]; then
|
||||
echo -n ' xntpd'; /usr/local/etc/xntpd
|
||||
fi
|
||||
|
||||
#XXX# echo -n ' ntpd'; /usr/libexec/ntpd -t
|
||||
|
||||
At this point, you should be good to go. Try running /usr/local/etc/xntpd and
|
||||
using ntpq or xntpdc to see if things are working, then pay attention the next
|
||||
time you reboot to make sure that xntpd is being invoked, and use ntpq or
|
||||
xntpdc again to make sure all is well.
|
||||
|
||||
Enjoy!
|
13
contrib/ntp/html/hints/changes
Normal file
13
contrib/ntp/html/hints/changes
Normal file
@ -0,0 +1,13 @@
|
||||
Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (xntpd/refclock_parse.c):
|
||||
- Added support to supply power from RS232 with CLOCK_RAWDCF.
|
||||
Known to work with Linux 1.2.
|
||||
- Made Linux ignore parity errors with CLOCK_RAWDCF.
|
||||
|
||||
Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/dcfd.c):
|
||||
- Removed conflicting prototype for Linux (sscanf)
|
||||
- Corrected spelling error
|
||||
- Made Linux ignore parity errors.
|
||||
- Added support to supply power from RS232 with CLOCK_RAWDCF.
|
||||
|
||||
Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/testdcf.c):
|
||||
- Made Linux ignore parity errors.
|
40
contrib/ntp/html/hints/decosf1
Normal file
40
contrib/ntp/html/hints/decosf1
Normal file
@ -0,0 +1,40 @@
|
||||
Some major changes were necessary to make xntp v3 run on the DEC Alpha
|
||||
hardware running DEC OSF/1. All "long" and "u_long" declarations and
|
||||
casts in the code were changed to "LONG" and "U_LONG" and a new header
|
||||
file (include/ntp_types.h) was added. The new header file defines
|
||||
LONG as int and U_LONG as u_int for the Alpha hardware and as long
|
||||
and u_long for anything else. A couple of #ifs where changed in
|
||||
ntpq and xntpdc to get the result of a signal defined correctly. The
|
||||
Config.decosf1 file built the programs here with no problems.
|
||||
|
||||
I don't have a radio clock here, so none of that code has been tested.
|
||||
I have run xntpd, xntpdc, xntpres, ntpq, ntpdate, and tickadj under
|
||||
DEC OSF/1 v1.2-2 (BL10).
|
||||
|
||||
Mike Iglesias Internet: iglesias@draco.acs.uci.edu
|
||||
University of California, Irvine BITNET: iglesias@uci
|
||||
Office of Academic Computing uucp: ...!ucbvax!ucivax!iglesias
|
||||
Distributed Computing Support phone: (714) 856-6926
|
||||
|
||||
Support for NTP Version 2 is included with the current OSF/1 release. If
|
||||
you are upgrading to NTP Version 3 with this distribution, you should not
|
||||
use the xntpd or ntpq programs that come with the OSF/1 release. The
|
||||
older programs should be replaced by the newer programs of the same name,
|
||||
either in situ or via a link to a tranquil spot like /usr/local/bin. The
|
||||
make install script in the this distribution don't work due to a silly
|
||||
install program incompatibility, so you will need to copy the programs by
|
||||
hand.
|
||||
|
||||
Don't use the setup utility to install or configure the xntpd installation,
|
||||
as it will cheerfully clobber your painstakingly crafted ntp.conf program.
|
||||
However, assuming you put this file in /etc/ntp.conf, you can use the
|
||||
/sbin/init.d/xntpd script to start and stop the daemon.
|
||||
|
||||
This distribution compiles with nominal mumur with the stock cc compiler
|
||||
that comes with OSF/1.
|
||||
|
||||
Dave Mills
|
||||
Electrical Engineering Department
|
||||
Unibergisty of Delabunch
|
||||
mills@udel.edu
|
||||
|
54
contrib/ntp/html/hints/decosf2
Normal file
54
contrib/ntp/html/hints/decosf2
Normal file
@ -0,0 +1,54 @@
|
||||
Problems with DEC OSF/1 V2.0
|
||||
|
||||
Compilation using gcc fails with ntp_config.c. The problem is an apparent
|
||||
error in the /usr/include/sys/procset.h and /usr/include/sys/wait.h
|
||||
include files.
|
||||
|
||||
cowbird:/usr/include/sys# diff -c wait.h.orig wait.h
|
||||
*** wait.h.orig Tue Feb 22 02:41:38 1994
|
||||
--- wait.h Thu Aug 25 14:52:57 1994
|
||||
***************
|
||||
*** 298,304 ****
|
||||
#else
|
||||
|
||||
_BEGIN_CPLUSPLUS
|
||||
! extern int waitid(idtype_t, id_t, siginfo_t *, int);
|
||||
_END_CPLUSPLUS
|
||||
#endif /* _NO_PROTO */
|
||||
|
||||
--- 298,304 ----
|
||||
#else
|
||||
|
||||
_BEGIN_CPLUSPLUS
|
||||
! extern int waitid(idtype_t, pid_t, siginfo_t *, int);
|
||||
_END_CPLUSPLUS
|
||||
#endif /* _NO_PROTO */
|
||||
|
||||
cowbird:/usr/include/sys# diff -c procset.h.orig procset.h
|
||||
*** procset.h.orig Tue Feb 22 02:41:44 1994
|
||||
--- procset.h Thu Aug 25 14:43:52 1994
|
||||
***************
|
||||
*** 86,95 ****
|
||||
*/
|
||||
|
||||
idtype_t p_lidtype; /* The id type for the left set. */
|
||||
! id_t p_lid; /* The id for the left set. */
|
||||
|
||||
idtype_t p_ridtype; /* The id type of for right set. */
|
||||
! id_t p_rid; /* The id of the right set. */
|
||||
} procset_t;
|
||||
|
||||
|
||||
--- 86,95 ----
|
||||
*/
|
||||
|
||||
idtype_t p_lidtype; /* The id type for the left set. */
|
||||
! pid_t p_lid; /* The id for the left set. */
|
||||
|
||||
idtype_t p_ridtype; /* The id type of for right set. */
|
||||
! pid_t p_rid; /* The id of the right set. */
|
||||
} procset_t;
|
||||
|
||||
Also, if using gcc from the freeware disk, either replace syscall.h
|
||||
in the directory /usr/local/lib/gcc-lib/alpha-dec-osf1/2.3.3/include
|
||||
or replace with a link to /usr/include/sys/syscall.h.
|
158
contrib/ntp/html/hints/hpux
Normal file
158
contrib/ntp/html/hints/hpux
Normal file
@ -0,0 +1,158 @@
|
||||
Last update: Sun Mar 13 15:05:31 PST 1994
|
||||
|
||||
This file hopefully describes the whatever and however of how to get xntp
|
||||
running on hpux 7.0 and later s300. s400, s700, and s800.
|
||||
|
||||
First off, all the standard disclaimers hold here ... HP doesn't have anthing
|
||||
to do with this stuff. I fool with it in my spare time because we use it and
|
||||
because I like to. We just happen to have a lot of HP machines around here :-)
|
||||
Xntpd has been in use here for several years and has a fair amount of mileage
|
||||
on various HP platforms within the company. I can't really guarantee bug fixes
|
||||
but I'd certainly like to hear about bugs and I won't hestitate to look at
|
||||
any fixes sent to me.
|
||||
|
||||
Now lets talk OS. If you don't have 7.0 or later, pretty much hang it up now.
|
||||
This stuff has run here on pretty much everything from 8.0 upward on s300,
|
||||
s700, and s800. It is known to run on 7.0 s300/s400 but all reports are
|
||||
from the field and not my personal experience.
|
||||
|
||||
If you are lucky enough to have a s300 or s400 with 9.03, then you no longer
|
||||
have to worry about adjtimed as HP-UX now has adjtime(2). The rest of you
|
||||
will have to wait on 10.0 which will have adjtime(2) and a supported though
|
||||
a bit older version of xntpd.
|
||||
|
||||
Next, let me explain a bit about how this stuff works on HP-UX's that do not
|
||||
have adjtime(2). The directory adjtime contains libadjtime.a and the adjtimed
|
||||
daemon. Instead of the adjtime(2) system call, we use a library routine to
|
||||
talk to adjtimed thru message queues. Adjtimed munges into /dev/kmem and
|
||||
causes the clock to skew properly as needed. PLEASE NOTE that the adjtime
|
||||
code provided here is NOT a general replacement for adjtime(2) ... use of
|
||||
this adjtime(3)/adjtimed(8) other than with xntpd may yield very odd results.
|
||||
|
||||
What to do to get this stuff running ?
|
||||
|
||||
* If you are running an OS less than 10.0 or do not have a s300/s400
|
||||
with 9.03 or better
|
||||
-> cd machines
|
||||
-> vi hpux
|
||||
-> (change -DSYS_HPUX=? to match whatever you are running [7,8,9])
|
||||
-> cd ..
|
||||
|
||||
* Say "make makeconfig"
|
||||
|
||||
* Say "make", sit back for a few minutes.
|
||||
|
||||
* cd authstuff
|
||||
* Say "./authcert < certdata" and check the output. Every line should
|
||||
end with "OK" ... if not, we got trouble.
|
||||
* Now try "./authspeed auth.samplekeys". What we want to
|
||||
remember here is the "authentication delay in CPU time"
|
||||
* cd ..
|
||||
|
||||
* Say "make install"
|
||||
|
||||
* I'd suggest reading the xntp docs about now :-) ... seriously !!
|
||||
|
||||
* One thing I have added to this version of xntpd is a way to select
|
||||
config files if you are sharing /usr/local thru NFS or whatever.
|
||||
If the file /usr/local/etc/xntp.conf happens to be a directory, the
|
||||
files in that directory are searched until a match is found. The
|
||||
rules for a match are:
|
||||
|
||||
1. Our hostname
|
||||
2. default.<machine id> (as in default.375 or default.850)
|
||||
3. default
|
||||
|
||||
* Ok, make sure adjtimed is running (just start it up for now with
|
||||
"/usr/local/etc/adjtimed"). Using -z as an option will get you
|
||||
a usage message.
|
||||
|
||||
* Now start up xntpd and watch it work.
|
||||
|
||||
* Make sure that adjtimed gets started at boot right before xntpd.
|
||||
We do this in /etc/netbsdsrc. They must both run as root !!
|
||||
|
||||
Possible problems ?
|
||||
|
||||
* On some 320's and 835's we have had to run adjtimed with "-p 45" or
|
||||
so to get rid of syslog messages about "last adjust did not finish".
|
||||
|
||||
* At 9.0, there is a problem with DIAGMON (patch available from the
|
||||
response center) which causes it to delete the message queue that
|
||||
adjtimed/xntpd use to communicate. (see next note for result)
|
||||
|
||||
* Xntpd has been known to get really ticked off when adjtime() fails
|
||||
which is usually only while running the emulation code on HP-UX.
|
||||
When it gets mad, it usually jumps the clock into never never land.
|
||||
Possible reasons for this are adjtimed being killed or just never
|
||||
started or adjtimed being completely swapped out on a really busy
|
||||
machine (newer adjtimed try to lock themselves in memory to prevent
|
||||
this one).
|
||||
|
||||
Anything else ... just drop me a line at ken@sdd.hp.com
|
||||
|
||||
Received: from louie.udel.edu by huey.udel.edu id aa14418; 15 Jun 95 9:19 EDT
|
||||
Received: from host5.colby.edu (host-05.colby.edu) by host-04.colby.edu with ESMTP (1.37.109.15/Colby 1.1)
|
||||
id AA165442355; Thu, 15 Jun 1995 09:19:16 -0400
|
||||
Received: by host5.colby.edu (1.37.109.15/Colby 1.1)
|
||||
id AA056252339; Thu, 15 Jun 1995 09:18:59 -0400
|
||||
Date: Thu, 15 Jun 1995 09:18:59 -0400 (EDT)
|
||||
From: "Jeff A. Earickson" <jaearick@colby.edu>
|
||||
To: Mills@huey.udel.edu
|
||||
Subject: More minor bugs in xntp3.4s
|
||||
In-Reply-To: <9506150022.aa12727@huey.udel.edu>
|
||||
Message-Id: <Pine.HPP.3.91.950615083549.4557A-100000@host5.colby.edu>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: TEXT/PLAIN; charset=US-ASCII
|
||||
|
||||
Dave,
|
||||
After reading the hpux hints file, I realized I didn't install or
|
||||
start adjtimed. In the course of doing this, I discovered that:
|
||||
|
||||
--> $(TOP) is not defined in adjtime/Makefile, so "make install" can't
|
||||
find the install.sh script.
|
||||
|
||||
--> "make install" from the main Makefile never goes into the adjtime
|
||||
directory, so I added the following two lines into the install
|
||||
target of the main Makefile:
|
||||
|
||||
@echo installing from adjtime
|
||||
@cd adjtime && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" MAKE="$(MAKE)" install
|
||||
|
||||
This twiddle may not be right for all systems, but it got adjtimed
|
||||
installed for me.
|
||||
|
||||
You might also want to add to the hpux hints file that one way to
|
||||
fire things up at boot time is to add the following lines to the localrc
|
||||
function of /etc/rc:
|
||||
|
||||
#---daemons for Network Time Protocol (version 3.4s)
|
||||
#---note that adjtimed is only needed for HP-UX 9.X, not 10.0
|
||||
#---adjtimed must be running or xntpd won't work right...
|
||||
if [ -x /usr/local/bin/adjtimed ]; then
|
||||
/usr/local/bin/adjtimed -r & echo -n ' adjtimed'
|
||||
if [ -x /usr/local/bin/xntpd ]; then
|
||||
/usr/local/bin/xntpd & echo -n ' xntpd'
|
||||
fi
|
||||
fi
|
||||
|
||||
I discovered that the "-r" option of adjtimed is needed to clear out any
|
||||
trash from a previous execution of it. Otherwise adjtimed quietly dies
|
||||
and leaves xntpd in the lurch...
|
||||
|
||||
Thanks for the help.
|
||||
|
||||
** Jeff A. Earickson, Ph.D PHONE: 207-872-3659
|
||||
** Senior UNIX Sysadmin, Information Technology EMAIL: jaearick@colby.edu
|
||||
** Colby College, 4214 Mayflower Hill, FAX: 207-872-3555
|
||||
** Waterville ME, 04901-8842
|
||||
|
||||
On Thu, 15 Jun 1995 Mills@huey.udel.edu wrote:
|
||||
|
||||
> Jeff,
|
||||
>
|
||||
> Read the hpux file in the hints directory.
|
||||
>
|
||||
> Dave
|
||||
>
|
||||
|
5
contrib/ntp/html/hints/linux
Normal file
5
contrib/ntp/html/hints/linux
Normal file
@ -0,0 +1,5 @@
|
||||
The kernel PLL interface is broken, I know.
|
||||
Update RSN.
|
||||
|
||||
Torsten
|
||||
(duwe@informatik.uni-erlangen.de)
|
119
contrib/ntp/html/hints/notes-xntp-v3
Normal file
119
contrib/ntp/html/hints/notes-xntp-v3
Normal file
@ -0,0 +1,119 @@
|
||||
Notes for NTP Version 3
|
||||
|
||||
This version operates in much the same manner as Version 2 with the
|
||||
following changes and additions:
|
||||
|
||||
1. The protocol machinery operates in conformance with the RFC1305 NTP
|
||||
Version 3 specification. The most visible characteristic of this
|
||||
version is that the poll intervals for all polls, even selected
|
||||
ones, is significantly increased. This is especially desirable when
|
||||
serving a large client population. This implementation supports
|
||||
previous versions as non-configured peers; for version-2 configured
|
||||
peers a "version 2" keyword should be included on the "peer" line.
|
||||
|
||||
2. The configuration file has a new keyword: statfile <file>, where
|
||||
<file> is the name of a statistics file." When present, each clock
|
||||
update generates an entry of the form:
|
||||
|
||||
<day> <sec>.<frac> <addr> <status> <offset> <delay> <disp>
|
||||
|
||||
where <day> is the modified Julian day, <sec>.<frac> is the time of
|
||||
day, <addr> is the peer address and <status> is the peer status.
|
||||
The <offset>, <delay> and <disp> are the measured offset, delay and
|
||||
dispersion, respectively, of the peer clock relative to the local
|
||||
clock. About once per day the current file is closed and a new one
|
||||
created with names <file>.<gen>, where <gen> starts at one and
|
||||
increments for each new generation.
|
||||
|
||||
3. A number of additional platforms are supported. See ./Config file
|
||||
for details.
|
||||
|
||||
4. A driver for the TrueTime 468DC GOES Synchronized Clock is
|
||||
included. This driver (refclock_goes.c) should also work for other
|
||||
TrueTime radio clocks, since all use the same format.
|
||||
|
||||
5. A replacement driver for the Spectracom 8170 WWVB Synchronized
|
||||
Clock is included. This driver (refclock_wwvb.c) (a) does not
|
||||
require a 1-pulse-per-second signal, (b) supports both format 0
|
||||
(original 8170) and format 2 (Netclock/2 and upgraded 8170), (c)
|
||||
can be connected to more than one computer and (d) automatically
|
||||
compensates for all serial baud rates.
|
||||
|
||||
6. A driver for the German time/frequency station DCF77 is included.
|
||||
This requires a special STREAMS module.
|
||||
|
||||
7. In Version 2 special line-discipline modules were required for the
|
||||
CHU and WWVB drivers. This code continues to work in Version 3,
|
||||
although it is no longer needed for the WWVB driver. However, this
|
||||
code does not work under STREAMS, as used in SunOS 4.1.1.
|
||||
Equivalent STREAMS modules are supplied with Version 3.
|
||||
|
||||
8. Support for an external 1-pulse-per-second (pps) signal is
|
||||
provided. The signal is connected to a serial port (see
|
||||
xntpd/ntp_loopfilter.c for details). When present the leading edge
|
||||
of the pulse establishes the on-time epoch within an interval
|
||||
established by the selected radio clock or other NTP time server.
|
||||
Use of the pps is indicated when the tattletale displayed by ntpq
|
||||
changes from "*" to "o".
|
||||
|
||||
9. The clock-selection and poll-update procedures have been modified
|
||||
slightly in order to achieve better performance on high speed LANs
|
||||
with compromise in performance on typical WANs.
|
||||
|
||||
10. In order to comply with U.S. Commerce Department regulations, the DES
|
||||
encryption routine lib/authdes.c cannot be exported. For exportable
|
||||
versions of this distribution a DES-encrypted version of this routine
|
||||
lib/authdes.c.des is included along with an unencrypted version
|
||||
lib/authdes.c.export, which allows normal operation, but without the
|
||||
NTP authentication feature. Further information is available in the
|
||||
lib/authdes.c.export file.
|
||||
|
||||
11. As an alternative to the DES-based authentication mechanism, an
|
||||
implementation of the RSA Message Digest 5 algorithm is provided.
|
||||
(see applicable copyright information in the library files).
|
||||
|
||||
12. A driver for the Magnavox MX4200 GPS clock.
|
||||
|
||||
13. A STREAMS module which captures carrier-detect data-lead transitions to
|
||||
connect a precision source of 1-pps, yet avoid the ugly overhead in the
|
||||
usual STREAMS processing. See the ppsclock subdirectory.
|
||||
|
||||
14. Support for the Apple A/UX operating system and enhanced support for the
|
||||
Hewlet-Packard HP/UX operating system. See the various README and Config
|
||||
files for further information.
|
||||
|
||||
See the COPYRIGHT file for authors and copyright information. Note that some
|
||||
modules in this distribution contain copyright information that supersedes
|
||||
the copyright information in that file.
|
||||
|
||||
If I missed something or neglected to give due credit, please advise.
|
||||
|
||||
David L. Mills
|
||||
University of Delaware
|
||||
31 May 1992, amended 23 July 1992, 25 October 1992
|
||||
|
||||
Bugs and notes
|
||||
|
||||
A bug in the original tty_clk_STREAMS.c module has been fixed.
|
||||
|
||||
The poll-interval randomization feature of poll_update (in
|
||||
xntpd/ntp_proto.c) has been extended to apply when the poll interval is
|
||||
increased, as well as reduced. This spreads the update messages in time
|
||||
and helps avoid unpleasant bursts of messages.
|
||||
|
||||
In the clock_select algorithm the peers selected for combining are
|
||||
limited to those survivors at the lowest stratum, not the entire list.
|
||||
This helps avoid whiplash when large numbers of peers are at the same
|
||||
stratum.
|
||||
|
||||
The number formerly displayed by ntpq as "compliance" is now the time
|
||||
constant of integration.
|
||||
|
||||
The DNS resolver xntpd/ntp_intres.c is now integrated into xntpd, making
|
||||
configuration of multiple hosts easier.
|
||||
|
||||
System and peer event are now written to the system log at priority
|
||||
LOG_INFO.
|
||||
|
||||
The leap-second code was fixed to avoid broadcasting leap warnings on
|
||||
all except the last day of June and December.
|
105
contrib/ntp/html/hints/parse
Normal file
105
contrib/ntp/html/hints/parse
Normal file
@ -0,0 +1,105 @@
|
||||
Compilation:
|
||||
Usual thing: rm -f Config.local ; make for vanilla
|
||||
make refconf for reference clock (e. g. DCF77)
|
||||
|
||||
Directory contents:
|
||||
|
||||
hints/PARSE - this file
|
||||
|
||||
xntpd/refclock_parse.c
|
||||
- reference clock support for DCF77/GPS in xntp
|
||||
parse/parse.c
|
||||
- Reference clock data parser framework
|
||||
parse/parse_conf.c
|
||||
- parser configuration (clock types)
|
||||
parse/clk_meinberg.c
|
||||
- Meinberg clock formats (DCF U/A 31, PZF 535, GPS166)
|
||||
parse/clk_schmid.c
|
||||
- Schmid receiver (DCF77)
|
||||
parse/clk_rawdcf.c
|
||||
- 100/200ms pulses via 50 Baud line (DCF77)
|
||||
parse/clk_dcf7000.c
|
||||
- ELV DCF7000 (DCF77)
|
||||
parse/clk_trimble.c
|
||||
- Trimble SV6 GPS receiver
|
||||
|
||||
If you want to add new clock types please check
|
||||
with kardel@informatik.uni-erlangen.de. These files
|
||||
implement the conversion of RS232 data streams into
|
||||
timing information used by refclock_parse.c which is
|
||||
mostly generic except for NTP configuration constants.
|
||||
|
||||
parse/Makefile.kernel
|
||||
- *SIMPLE* makefile to build a loadable STREAMS
|
||||
module for SunOS 4.x / SunOS 5.x systems
|
||||
|
||||
parse/parsestreams.c
|
||||
- SUN Streams module (loadable) for radio clocks
|
||||
This streams module is designed for SunOS 4.1.X.
|
||||
|
||||
parse/parsesolaris.c
|
||||
- SUN Streams module (loadable) for radio clocks.
|
||||
This streams module is designed for SunOS 5.x
|
||||
Beware this is still new - so it might crash
|
||||
your machine (we have seen it working, though).
|
||||
|
||||
parse/parsetest.c
|
||||
- simple test program for STREAMS module. Its so simple,
|
||||
that it doesn't even set TTY-modes, thus they got to
|
||||
be correct on startup - works for Meinberg receivers
|
||||
|
||||
parse/testdcf.c
|
||||
- test program for raw DCF77 (100/200ms pulses)
|
||||
receivers
|
||||
|
||||
include/parse.h - interface to "parse" module and more
|
||||
include/parse_conf.h
|
||||
- interface to "parse" configuration
|
||||
|
||||
include/sys/parsestreams.h
|
||||
- STREAMS specific definitions
|
||||
|
||||
scripts/support
|
||||
- scripts (perl & sh) for statistics and rc startup
|
||||
the startup scripts are used in Erlangen for
|
||||
starting the daemon on a variety of Suns and HPs
|
||||
and for Reference Clock startup on Suns
|
||||
These scripts may or may not be helpful to you.
|
||||
|
||||
Supported clocks:
|
||||
Meinberg DCF U/A 31
|
||||
Meinberg PZF535/TCXO (Software revision PZFUERL 4.6)
|
||||
Meinberg PZF535/OCXO (Software revision PZFUERL 4.6)
|
||||
Meinberg GPS166 (Software version for Uni-Erlangen)
|
||||
ELV DCF7000 (not recommended - casual/emergency use only)
|
||||
Conrad DCF77 receiver (email: time@informatik.uni-erlangen.de)
|
||||
+ level converter
|
||||
TimeBrick (email: time@informatik.uni-erlangen.de)
|
||||
Schmid Receiver Kit
|
||||
Trimble SV6 GPS receiver
|
||||
|
||||
Addresses:
|
||||
Meinberg Funkuhren
|
||||
Auf der Landwehr 22
|
||||
31812 Bad Pyrmont
|
||||
Germany
|
||||
Tel.: 05281/20 18
|
||||
FAX: 05281/60 81 80
|
||||
|
||||
ELV Kundenservice
|
||||
Postfach 1000
|
||||
26787 Leer
|
||||
Germany
|
||||
Tel.: 0491/60 08 88
|
||||
|
||||
Walter Schmidt
|
||||
Eichwisrain 14
|
||||
8634 Hombrechtikon
|
||||
Switzerland
|
||||
|
||||
If you have problems mail to:
|
||||
|
||||
time@informatik.uni-erlangen.de
|
||||
|
||||
We'll help (conditions permitting)
|
||||
|
35
contrib/ntp/html/hints/refclocks
Normal file
35
contrib/ntp/html/hints/refclocks
Normal file
@ -0,0 +1,35 @@
|
||||
This is a short overview for the reference clocks currently supported
|
||||
by xntp V3. (Ultimate wisdom can be obtained from xntpd/refclock_*.c
|
||||
this file was derived from that information - unfortunately some comments
|
||||
in the files tend to get stale - so use with caution)
|
||||
|
||||
Refclock address Type
|
||||
127.127.0.x no clock (fails to configure)
|
||||
127.127.1.x local clock - use local clock as reference
|
||||
127.127.2.x no clock (fails to configure)
|
||||
127.127.3.x PSTI 1010/1020 WWV Clock
|
||||
127.127.4.x SPECTRACOM WWVB receiver 8170 and Netclock/2
|
||||
127.127.5.x Kinimetric Truetime 468-DC GOES receiver
|
||||
127.127.6.x IRIG audio decode (Sun & modified BSD audio driver)
|
||||
127.127.7.x CHU Timecode (via normal receiver & Bell 103 modem)
|
||||
127.127.8.x PARSE (generic driver for a bunch of DCF/GPS clocks
|
||||
can be extended for other clocks too)
|
||||
8.0-3 Meinberg PZF535/TCXO
|
||||
8.4-7 Meinberg PZF535/OCXO
|
||||
8.8-11 Meinberg DCF U/A 31
|
||||
8.12-15 ELV DCF7000
|
||||
8.16-19 Walter Schmid DCF receiver (Kit)
|
||||
8.20-23 Conrad DCF77 receiver module + level converter (Kit)
|
||||
8.24-27 TimeBrick (limited availability ask
|
||||
time@informatik.uni-erlangen.de)
|
||||
8.28-31 Meinberg GPS166
|
||||
8.32-35 Trimble SV6 GPS receiver
|
||||
127.127.9.x MX4200 GPS receiver
|
||||
127.127.10.x Austron 2201A GPS Timing Receiver
|
||||
127.127.11.x Kinemetrics Truetime OM-DC OMEGA Receiver
|
||||
127.127.12.x KSI/Odetecs TPRO-S IRIG-B / TPRO-SAT GPS
|
||||
127.127.13.x Leitch: CSD 5300 Master Clock System Driver
|
||||
127.127.14.x MSFEES
|
||||
127/127.15.x TrueTime GPS/TM-TMD
|
||||
127.127.16.x Bancomm GPS/IRIG Ticktock
|
||||
127.127.17.x Datum Programmable Time System
|
56
contrib/ntp/html/hints/rs6000
Normal file
56
contrib/ntp/html/hints/rs6000
Normal file
@ -0,0 +1,56 @@
|
||||
15.7.1993
|
||||
xntp3 compiles now again on AIX. I have disabled prototyping and added
|
||||
the switch -D_NO_PROTO which disables prototyping in the system include
|
||||
files.
|
||||
|
||||
Matthias Ernst maer@nmr.lpc.ethz.ch
|
||||
--------------------------------------------------------------------------------
|
||||
Xntp version 3 now support the cc compiler for AIX.
|
||||
The Config.aix will now use cc by default. You can still compile xntp
|
||||
with the bsd compiler by changing "COMP= cc" to "COMP= bsdcc" and
|
||||
and removing the "-DSTUPID_SIGNAL" option from the "DEFS" option.
|
||||
|
||||
xntp and tickadj was also modified so that the value of tickadj is read
|
||||
form the kernel and can be set by tickadj. For now I would not set
|
||||
tickadj below 40 us.
|
||||
|
||||
Bill Jones
|
||||
jones@chpc.utexas.edu
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a modified version of xntp version 3 for the RS6000. It works for
|
||||
AIX 3.2 and these are the same changes as have been applied tothe version 2
|
||||
implementation of xntp. It works fine for us but I have not tested all of
|
||||
the features, especially the local clock support for the RS6000 is not tested
|
||||
at all.
|
||||
|
||||
Matthias Ernst, ETH-Zuerich, Switzerland - maer@nmr.lpc.ethz.ch
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Here the original README.rs6000 for the version 2 implementation:
|
||||
|
||||
A hacked version of xntp for the IBM RS/6000 under AIX 3.1 can be found
|
||||
in xntp.rs6000.tar.Z. [ if still available at all - Frank Kardel 93/12/3 ]
|
||||
|
||||
This will not work on older versions of AIX due to a kernel bug; to find
|
||||
out whether you have the kernel bug, compile and run testrs6000.c (see
|
||||
comments in the code for instructions).
|
||||
|
||||
xntp and testrs6000 require "bsdcc" to compile. This is simply another
|
||||
entry point into the xlc compiler with various options set for BSD
|
||||
compatibility. If your system does not have bsdcc, do the following:
|
||||
|
||||
link /bin/bsdcc to /bin/xlc
|
||||
|
||||
put the following into /etc/xlc.cfg:
|
||||
|
||||
* BSD compatibility
|
||||
bsdcc: use = DEFLT
|
||||
crt = /lib/crt0.o
|
||||
mcrt = /lib/mcrt0.o
|
||||
gcrt = /lib/gcrt0.o
|
||||
libraries = -lbsd, -lc
|
||||
proflibs = -L/lib/profiled,-L/usr/lib/profiled
|
||||
options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -tp,-B/lib/
|
||||
|
39
contrib/ntp/html/hints/sco.htm
Normal file
39
contrib/ntp/html/hints/sco.htm
Normal file
@ -0,0 +1,39 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>SCO Unix hints</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1>SCO Unix hints</H1>
|
||||
|
||||
<H2>Older SCO Unix versions</H2>
|
||||
<P>
|
||||
NTP 4.0.x does not run on SCO Unix prior to version 3.2.5.0.0. If you
|
||||
need NTP on an older SCO Unix system and don't mind to modify your
|
||||
kernel, use 3.5.91 which has patches for SCO Unix 3.2.4.x. Apply the
|
||||
kernel modifications as described in
|
||||
<A HREF="http://www.echelon.nl/en/ntp/sco3-recipe.html">XNTP on SCO
|
||||
3.2.4.2</A>.
|
||||
|
||||
<H2>Compiling NTP</H2>
|
||||
<P>
|
||||
Delete the old SCO supplied NTP programs using the "custom"
|
||||
utility. Run the NTP configure program with CFLAGS="-b elf -K
|
||||
<I>processor-type</I>" for best results.
|
||||
|
||||
<H2>Running NTP</H2>
|
||||
<P>
|
||||
Run "tickadj -As" after every reboot to set the variables
|
||||
"clock_drift" and "track_rtc" to the right values.
|
||||
<P>
|
||||
Run "ntpd" with a high negative nice-value, i.e.
|
||||
"nice --19 ntpd" for best results.
|
||||
|
||||
<H2>More information</H2>
|
||||
<P>
|
||||
More information on the way SCO Unix and NTP interact can be found in
|
||||
<A HREF="http://www.echelon.nl/en/ntp/ntp-on-sco.html">NTP on SCO Unix</A>,
|
||||
which includes links to precompiled versions of NTP.
|
||||
<P>
|
||||
<A HREF="mailto:kees@echelon.nl">Kees Hendrikse</A>, January 1999
|
||||
</BODY>
|
||||
</HTML>
|
74
contrib/ntp/html/hints/sgi
Normal file
74
contrib/ntp/html/hints/sgi
Normal file
@ -0,0 +1,74 @@
|
||||
adjtime, tick and tickadj:
|
||||
--------------------------
|
||||
|
||||
The SGI value for HZ is 100 under Irix 4, with the system clock running
|
||||
in nominal mode (ftimer off), so the value for tick is 10000 usec.
|
||||
Tickadj is a bit more tricky because of the behaviour of adjtime(),
|
||||
which seems to try to perform the correction over 100-200 seconds, with
|
||||
a rate limit of 0.04 secs/sec for large corrections. Corrections of
|
||||
less than 0.017 seconds generally complete in less than a second,
|
||||
however.
|
||||
|
||||
Some measured rates are as follows:
|
||||
|
||||
Delta Rate (sec/sec)
|
||||
|
||||
> 1 0.04
|
||||
0.75 0.04
|
||||
0.6 0.004
|
||||
0.5 0.004
|
||||
0.4 0.0026
|
||||
0.3 0.0026
|
||||
0.2 0.0013
|
||||
0.1 0.0015
|
||||
0.05 0.0015
|
||||
0.02 0.0003
|
||||
0.01 0.015
|
||||
Strange. Anyway, since adjtime will complete adjustments of less than
|
||||
17msec in less than a second, whether the fast clock is on or off, I
|
||||
have used a value of 150usec/tick for the tickadj value.
|
||||
|
||||
Fast clock:
|
||||
-----------
|
||||
|
||||
I get smoother timekeeping if I turn on the fast clock, thereby making
|
||||
the clock tick at 1kHz rather than 100Hz. With the fast clock off, I
|
||||
see a sawtooth clock offset with an amplitude of 5msec. With it on,
|
||||
the amplitude drops to 0.5msec (surprise!). This may be a consequence
|
||||
of having a local reference clock which spits out the time at exactly
|
||||
one-second intervals - I am probably seeing sampling aliasing between
|
||||
that and the machine clock. This may all be irrelevant for machines
|
||||
without a local reference clock. Fiddling with the fast clock doesn't
|
||||
seem to compromise the above choices for tick and tickadj.
|
||||
|
||||
I use the "ftimer" program to switch the fast clock on when the system
|
||||
goes into multiuser mode, but you can set the "fastclock" flag in
|
||||
/usr/sysgen/master.d/kernel to have it on by default. See ftimer(1).
|
||||
|
||||
timetrim:
|
||||
---------
|
||||
|
||||
Irix has a kernel variable called timetrim which adjusts the system
|
||||
time increment, effectively trimming the clock frequency. Xntpd could
|
||||
use this rather than adjtime() to do it's frequency trimming, but I
|
||||
haven't the time to explore this. There is a utility program,
|
||||
"timetrim", in the util directory which allows manipulation of the
|
||||
timetrim value in both SGI and xntpd native units. You can fiddle with
|
||||
default timetrim value in /usr/sysgen/master.d/kernel, but I think
|
||||
that's ugly. I just use xntpd to figure out the right value for
|
||||
timetrim for a particular CPU and then set it using "timetrim" when
|
||||
going to multiuser mode.
|
||||
|
||||
Serial I/O latency:
|
||||
-------------------
|
||||
|
||||
If you use a local clock on an RS-232 line, look into the kernel
|
||||
configuration stuff with regard to improving the input latency (check
|
||||
out /usr/sysgen/master.d/[sduart|cdsio]). I have a Kinemetrics OM-DC
|
||||
hooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI
|
||||
Crimson, and setting the duart_rsrv_duration flag to 0 improves things
|
||||
a bit.
|
||||
|
||||
|
||||
12 Jan 93
|
||||
Steve Clift, CSIRO Marine Labs, Hobart, Australia (clift@ml.csiro.au)
|
139
contrib/ntp/html/hints/solaris.html
Normal file
139
contrib/ntp/html/hints/solaris.html
Normal file
@ -0,0 +1,139 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Solaris hints and kinks</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Information on compiling and executing ntpd under Solaris.
|
||||
<BR>
|
||||
Last Updated: Sun Jun 21 01:32:18 EDT 1998,
|
||||
John Hawkinson,
|
||||
<! -- This is deliberately not a mailto -- > <jhawk@MIT.EDU>
|
||||
<P>
|
||||
If you're not running Solaris 2.5.1 or later, it is likely
|
||||
that you will have problems; upgrading would be a really good plan.
|
||||
<P>
|
||||
<H3>All Solaris versions</H3>
|
||||
<P>
|
||||
Proper operation of ntp under Solaris requires setting the kernel
|
||||
variable <I>dosynctodr</I> to zero (meaning "do not synchronize the clock
|
||||
to the hardware time-of-day clock"). This can be done with the
|
||||
tickadj utility:
|
||||
<BLOCKQUOTE><TT>
|
||||
tickadj -s
|
||||
</TT></BLOCKQUOTE>
|
||||
If you prefer, it can also be done with the native Solaris kernel debugger:
|
||||
<BLOCKQUOTE><TT>
|
||||
echo dosynctodr/W0 | adb -k -w /dev/ksyms /dev/mem
|
||||
</BLOCKQUOTE></TT>
|
||||
<P>
|
||||
Or, it can also be set by adding a line to /etc/system:
|
||||
<BLOCKQUOTE><TT>
|
||||
set dosynctodr = 0
|
||||
</BLOCKQUOTE></TT>
|
||||
<P>
|
||||
Instead of the <I>tick</I> kernel variable, which many operating
|
||||
systems use to control microseconds added to the system time every
|
||||
clock tick (c.f. <A HREF="../notes.htm#frequency_tolerance">Dealing
|
||||
with Frequency Tolerance Violations</A>), Solaris has the variables
|
||||
<I>nsec_per_tick</I> and <I>usec_per_tick</I>.
|
||||
<P>
|
||||
<I>nsec_per_tick</I> and <I>usec_per_tick</I> control the number of
|
||||
nanoseconds and microseconds, respectively, added to the system clock
|
||||
each clock interrupt. Enterprising souls may set these based on
|
||||
information collected by ntpd in the <CODE>/etc/ntp.drift</CODE> file
|
||||
to correct for individual hardware variations.
|
||||
<P>
|
||||
On UltraSPARC systems, <I>nsec_per_tick</I> and <I>usec_per_tick</I>
|
||||
are ignored in favor of the <I>cpu_tick_freq</I> variable, which
|
||||
should be automatically be determined by the PROM in an accurate
|
||||
fashion.
|
||||
<P>
|
||||
In general, the same ntp binaries should not be used across multiple
|
||||
operating system releases. There is enough variation in the core operating
|
||||
system support for timekeeping that a rebuild of ntpd for the idiosyncracies
|
||||
of your specific operating system version is advisable.
|
||||
<P>
|
||||
It is recommended that ntp be started via a script like <A
|
||||
HREF="solaris.xtra.S99ntpd">this one</A>, installed in
|
||||
<CODE>/etc/init.d/ntpd</CODE> with a symbol link from
|
||||
<CODE>/etc/rc2.d/S99ntpd</CODE>.
|
||||
|
||||
<H3>Solaris 2.6</H3>
|
||||
<P>
|
||||
Solaris 2.6 adds support for kernel PLL timekeeping, but breaks this
|
||||
support in such a fashion that using it worse than not. This is <A
|
||||
HREF="solaris.xtra.4095849"> SUN Bug ID 4095849</A>, and it is not yet
|
||||
fixed as of June 1998.
|
||||
<P>
|
||||
<H3>Solaris 2.5 and 2.5.1</H3>
|
||||
<P>
|
||||
On UltraSPARC systems, calculation of <I>cpu_tick_freq</I> is broken
|
||||
such that values that are off by significant amounts may be used
|
||||
instead. This unfortunately means that ntpd may have severe problems
|
||||
keeping synchronization. This is <A HREF="solaris.xtra.4023118"> SUN Bug ID
|
||||
4023118</A>. Bryan Cantrill <! -- <bmc@eng.sun.com> --> of Sun
|
||||
posted <A HREF="solaris.xtra.patchfreq">patchfreq</A>, a workaround script,
|
||||
to comp.protocols.time.ntp in March of 1997.
|
||||
<P>
|
||||
<HR>
|
||||
<H2>OLD DATA</H2>
|
||||
<STRONG>I can't vouch for the accuracy the information below this
|
||||
rule. It may be significantly dated or incorrect.</STRONG>
|
||||
<P>
|
||||
<P>
|
||||
<H3>Solaris 2.2</H3>
|
||||
<P>
|
||||
Solaris 2.2 and later contain completely re-written clock code to
|
||||
provide high resolution microsecond timers. A benefit of the
|
||||
re-written clock code is that adjtime does not round off its
|
||||
adjustments, so ntp does not have to compensate for this
|
||||
rounding. Under Solaris 2.2 and later, ntp #define's
|
||||
<CODE>ADJTIME_IS_ACCURATE</CODE>, and does not look for the <I>tickadj</I>
|
||||
kernel variable.
|
||||
<P>
|
||||
<H3>Solaris 2.1</H3>
|
||||
(This originally written by William L. Jones <jones@chpc.utexas.edu>)
|
||||
<P>
|
||||
Solaris 2.1 contains fairly traditional clock code, with <I>tick</I>
|
||||
and <I>tickadj</I>.
|
||||
<P>
|
||||
Since settimeofday under Solaris 2.1 only sets the seconds part of timeval
|
||||
care must be used in starting xntpd. I suggest the following start
|
||||
up script:
|
||||
<BLOCKQUOTE><TT>
|
||||
tickadj -s -a 1000
|
||||
<BR>ntpdate -v server1 server2
|
||||
<BR>sleep 20
|
||||
<BR>ntpdate -v server1 server2
|
||||
<BR>sleep 20
|
||||
<BR>tickadj -a 200
|
||||
<BR>xntpd
|
||||
</TT></BLOCKQUOTE>
|
||||
|
||||
The first tickadj turns of the time of day clock and sets the tick
|
||||
adjust value to 1 millisecond. This will insure that an adjtime value
|
||||
of at most 2 seconds will complete in 20 seconds.
|
||||
<P>
|
||||
The first ntpdate will set the time to within two seconds
|
||||
using settimeofday or it will adjust time using adjtime.
|
||||
<P>
|
||||
The first sleep insures the adjtime has completed for the first ntpdate.
|
||||
<P>
|
||||
The second ntpdate will use adjtime to set the time of day since the
|
||||
clock should be within 2 seconds of the correct time.
|
||||
<P>
|
||||
The second tickadj set the tick adjust system value to 5 microseconds.
|
||||
<P>
|
||||
The second sleeps insure that adjtime will complete before starting
|
||||
the next xntpd.
|
||||
<P>
|
||||
I tried running with a tickadj of 5 microseconds with out much success.
|
||||
200 microseconds seems to work well.
|
||||
<P>
|
||||
<HR>
|
||||
Prior versions of this file had major text contributed by:
|
||||
<MENU>
|
||||
<LI>Denny Gentry <denny@eng.sun.com>
|
||||
</MENU>
|
||||
<BODY>
|
||||
</HTML>
|
36
contrib/ntp/html/hints/solaris.xtra.4023118
Normal file
36
contrib/ntp/html/hints/solaris.xtra.4023118
Normal file
@ -0,0 +1,36 @@
|
||||
Bug Id: 4023118
|
||||
Category: kernel
|
||||
Subcategory: other
|
||||
State: integrated
|
||||
Synopsis: sun4u doesn't keep accurate time
|
||||
Description:
|
||||
|
||||
[ bmc, 12/20/96 ]
|
||||
|
||||
The clock on a sun4u drifts unacceptably. On a typical 143 mHz Ultra,
|
||||
the clock took 1.0001350 seconds to count 1 second. While this may seem
|
||||
trivial, it adds up quickly. In this case, the TOD chip will have to
|
||||
pull the clock forward by 2 seconds every 4 hours and 7 minutes.
|
||||
This drift rate is so high, that the clock is close to being too broken
|
||||
for NTP to guarantee correctness (in order for NTP's mechanism to work,
|
||||
it must be assured that the local clock drifts no more than 20 ms in 64
|
||||
seconds; this particular 143 mHz Ultra will drift by nearly 9 ms in that
|
||||
period). This problem has been reproduced on virtually all sun4u
|
||||
classes.
|
||||
|
||||
The fundamental problem lies in the kernel's perception of ticks per
|
||||
second. The PROM is responsible for determining this figure exactly,
|
||||
and the kernel extracts it into the variable cpu_tick_freq. On sun4u's,
|
||||
this number is disconcertingly round: 143000000, 167000000, 248000000,
|
||||
etc. Indeed, a simple experiment revealed that these numbers were
|
||||
quite far from the actual ticks per second. Typical was the 143 mHz
|
||||
Ultra which was discovered to tick around 142,980,806 (+/- 10) times
|
||||
per second.
|
||||
|
||||
Work around:
|
||||
|
||||
Integrated in releases: s297_27
|
||||
Duplicate of:
|
||||
Patch id:
|
||||
See also:
|
||||
Summary:
|
74
contrib/ntp/html/hints/solaris.xtra.4095849
Normal file
74
contrib/ntp/html/hints/solaris.xtra.4095849
Normal file
@ -0,0 +1,74 @@
|
||||
Bug Id: 4095849
|
||||
Category: kernel
|
||||
Subcategory: syscall
|
||||
State: evaluated
|
||||
Synopsis: time_constant value >6 with PLL in use leads to integer divide
|
||||
zero trap panic
|
||||
Description:
|
||||
If the time_constant parameter is 7 or higher, and the phase-lock looping model
|
||||
is in use, the system will take a "integer divide zero trap" panic in
|
||||
the clock routine as soon as the time_offset becomes non-zero.
|
||||
|
||||
time_constant defaults to 0. The only place it is set is in the ntp_adjtime
|
||||
system call, from the 'constant' element of the timex structure argument.
|
||||
|
||||
Work around:
|
||||
Never set the constant element of the timex structure passed to ntp_adjtime to
|
||||
a value larger than 6.
|
||||
|
||||
satish.mynam@Eng 1998-04-30
|
||||
1. Use Sun's version of NTP software instead of PD version. This problem
|
||||
is not seen with Sun's NTP version (which is mostly eqivalent to PD NTP 3.4
|
||||
plus some Sun's local functionality futures).
|
||||
|
||||
2. Workaround for the public domain NTP version ONLY:
|
||||
=====================================================
|
||||
The workaround for public domain NTP version is to disable the
|
||||
KERNEL_PLL from the NTP code. This way ntp_Adjtime() system call is
|
||||
totally bypassed without sacrificing any of the functionality of the
|
||||
NTP. The only hit you might see is the way kernel precision timminig
|
||||
is done without the PLL algorithm in the kernel.
|
||||
|
||||
The easiest way to disable ntp_adjtime option is(without changing
|
||||
any makefiles or other config files) to disable the KERNEL_PLL
|
||||
value in the ./config.h file.
|
||||
|
||||
After doing a ./configure for probing for all the necessary tools(compilers,
|
||||
os version, libraries), please comment out KERNEL_PLL macro in
|
||||
the ./config.h file. This will disable the KERNEL_PLL part of the source
|
||||
code and the newly obtained xntpd is just similar to the old one but it
|
||||
does not use ntp_adjtime() system call. This prevents it from panic'ng
|
||||
the kernel.
|
||||
|
||||
/*#define KERNEL_PLL 1*/
|
||||
|
||||
I complied a new xntpd binary this way and it does nothave any ntp_adjtime()
|
||||
related stuff.
|
||||
|
||||
Default:
|
||||
=======
|
||||
/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings
|
||||
xntpd |
|
||||
grep ntp_adjtime
|
||||
354:adj_frequency: ntp_adjtime failed: %m
|
||||
357:loop_config: ntp_adjtime() failed: %m
|
||||
435:get_kernel_info: ntp_adjtime() failed: %m
|
||||
|
||||
With KERNEL_PLL disabled in config.h file
|
||||
-=======================
|
||||
|
||||
/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings
|
||||
xntpd.nopll | grep ntp_adjtime
|
||||
|
||||
Integrated in releases:
|
||||
Duplicate of:
|
||||
Patch id:
|
||||
See also: 4133517
|
||||
Summary:
|
||||
If the time_constant parameter is 7 or higher, and the phase-lock looping model
|
||||
is in use, the system will take a "integer divide zero trap" panic in
|
||||
the clock routine as soon as the time_offset becomes non-zero.
|
||||
|
||||
time_constant defaults to 0. The only place it is set is in the ntp_adjtime
|
||||
system call, from the 'constant' element of the timex structure argument.
|
||||
----------------------------------------------------------------------------
|
20
contrib/ntp/html/hints/solaris.xtra.S99ntpd
Normal file
20
contrib/ntp/html/hints/solaris.xtra.S99ntpd
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
if [ $1 = "start" ]; then
|
||||
if [ -x /usr/local/bin/xntpd ]; then
|
||||
echo "Starting NTP daemon, takes about 1 minute... "
|
||||
# The following line is unnecessary if you turn off
|
||||
# dosynctodr in /etc/system.
|
||||
/usr/local/bin/tickadj -s
|
||||
/usr/local/bin/ntpdate -v server1 server2
|
||||
sleep 5
|
||||
/usr/local/bin/xntpd
|
||||
fi
|
||||
else
|
||||
if [ $1 = "stop" ]; then
|
||||
pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
|
||||
if [ "${pid}" != "" ]; then
|
||||
echo "Stopping Network Time Protocol daemon "
|
||||
/usr/bin/kill ${pid}
|
||||
fi
|
||||
fi
|
||||
fi
|
85
contrib/ntp/html/hints/solaris.xtra.patchfreq
Normal file
85
contrib/ntp/html/hints/solaris.xtra.patchfreq
Normal file
@ -0,0 +1,85 @@
|
||||
#!/bin/ksh
|
||||
|
||||
#
|
||||
# File: patchfreq
|
||||
# Author: Bryan Cantrill (bmc@eng.sun.com), Solaris Performance
|
||||
# Modified: Sat Apr 26 04:00:59 PDT 1997
|
||||
#
|
||||
# This is a little script to patch a 5.5 or 5.5.1 kernel to get around
|
||||
# the cpu_tick_freq inaccuracy. Before running this script, one must
|
||||
# know the true frequency of one's CPU; this can be derived by NTP,
|
||||
# or by observing the clock relative to the time-of-day chip over a
|
||||
# long period of time (the TOD will pull system time when it drifts
|
||||
# by more than two seconds).
|
||||
#
|
||||
# Patching a kernel can render a machine unbootable; do not run this
|
||||
# script unless you are prepared to accept that possibility. It
|
||||
# is advisable to have a backout path (e.g. net booting, an alternate
|
||||
# boot disk, an installation CD) should your machine fail to boot.
|
||||
#
|
||||
# This is not a product of Sun Microsystems, and is provided "as is",
|
||||
# without warranty of any kind expressed or implied including, but not
|
||||
# limited to, the suitability of this script for any purpose.
|
||||
#
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 cpu_tick_freq [ alternate_kernel ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cpu_tick_freq=$1
|
||||
kernel=/platform/sun4u/kernel/unix
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
kernel=$2
|
||||
fi
|
||||
|
||||
if [ ! -w $kernel ]; then
|
||||
echo "$0: Cannot open $kernel for writing."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
arch=`echo utsname+404?s | adb $kernel | cut -d: -f2`
|
||||
|
||||
if [ ! $arch = "sun4u" ]; then
|
||||
echo "Patch only applies to sun4u"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rel=`echo utsname+202?s | adb $kernel | cut -d: -f2`
|
||||
|
||||
if [ ! $rel = "5.5" ] && [ ! $rel = "5.5.1" ]; then
|
||||
echo "Patch only applies to 5.5 or 5.5.1..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nop="1000000" # nop
|
||||
store_mask="ffffe000" # mask out low 13 bits
|
||||
store="da256000" # st %o5, [%l5 + offset]
|
||||
|
||||
instr=`echo setcpudelay+34?X | adb $kernel | cut -d: -f 2 | nawk '{ print $1 }'`
|
||||
|
||||
if [ $instr = $nop ]; then
|
||||
echo "Instruction already patched..."
|
||||
else
|
||||
let masked="(16#$store_mask & 16#$instr) - 16#$store"
|
||||
if [ $masked -ne 0 ]; then
|
||||
echo "Couldn't find instruction to patch; aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! echo setcpudelay+34?W $nop | adb -w $kernel 1> /dev/null
|
||||
then
|
||||
echo "adb returned an unexpected error; aborting."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Patching cpu_tick_freq to $cpu_tick_freq..."
|
||||
|
||||
if ! echo cpu_tick_freq?W 0t$cpu_tick_freq | adb -w $kernel 1> /dev/null; then
|
||||
echo "adb returned an unexpected error; aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$kernel successfully patched."
|
||||
exit 0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user