Virgin import of ntpd 4.1.1b
This commit is contained in:
parent
eaabcee53b
commit
ba371819a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/ntp/dist/; revision=106424
@ -29,6 +29,7 @@ EXTRA_DIST = \
|
||||
README.cvs \
|
||||
README.des \
|
||||
README.hackers \
|
||||
README.refclocks \
|
||||
README.rsa \
|
||||
README.versions \
|
||||
TODO \
|
||||
@ -78,6 +79,8 @@ $(srcdir)/version: FRC.version
|
||||
dist-hook:
|
||||
@find $(distdir) -type d -name CVS -print | xargs rm -rf
|
||||
@find $(distdir) -type d -name SCCS -print | xargs rm -rf
|
||||
@for i in `find $(distdir)/ports/winnt -type f -name '*.ds*' -print`; \
|
||||
do chmod u+w $$i ; unix2dos $$i $$i; done
|
||||
|
||||
.warning:
|
||||
@echo "Compiling with GCC now generates lots of new warnings."
|
||||
|
@ -142,6 +142,7 @@ EXTRA_DIST = \
|
||||
README.cvs \
|
||||
README.des \
|
||||
README.hackers \
|
||||
README.refclocks \
|
||||
README.rsa \
|
||||
README.versions \
|
||||
TODO \
|
||||
@ -522,6 +523,8 @@ $(srcdir)/version: FRC.version
|
||||
dist-hook:
|
||||
@find $(distdir) -type d -name CVS -print | xargs rm -rf
|
||||
@find $(distdir) -type d -name SCCS -print | xargs rm -rf
|
||||
@for i in `find $(distdir)/ports/winnt -type f -name '*.ds*' -print`; \
|
||||
do chmod u+w $$i ; unix2dos $$i $$i; done
|
||||
|
||||
.warning:
|
||||
@echo "Compiling with GCC now generates lots of new warnings."
|
||||
|
@ -1,4 +1,5 @@
|
||||
--
|
||||
* clock state machine bugfix
|
||||
* Lose the source port check on incoming packets
|
||||
* (x)ntpdc compatibility patch
|
||||
* Virtual IP improvements
|
||||
|
@ -1,8 +1,8 @@
|
||||
In order to use the BitKeeper repository version of NTP you will have
|
||||
to have the following tools installed:
|
||||
|
||||
autoconf 2.50 or later (we use 2.52)
|
||||
automake (we use 1.5)
|
||||
autoconf 2.52 or later
|
||||
automake 1.5 or later
|
||||
lynx
|
||||
|
||||
Lynx is used to generate the COPYRIGHT file. Don't ask.
|
||||
@ -17,24 +17,34 @@ please ask. The license is pretty easy to read.
|
||||
|
||||
Once you have installed bitkeeper, you can clone any NTP repository.
|
||||
|
||||
Note: as of 2002-05, ntp.bkserver.net and ntp.bkbits.net are
|
||||
being upgraded. Depending on the "phase" of the upgrade, one
|
||||
of the two machines may not answer.
|
||||
|
||||
You can get the ntp-stable repository by either of the following commands:
|
||||
|
||||
bk clone bk://www.ntp.org/home/bk/ntp-stable ntp-stable
|
||||
|
||||
bk clone bk://ntp.bkserver.net/ntp-stable ntp-stable
|
||||
|
||||
bk clone bk://ntp.bkbits.net/ntp-stable ntp-stable
|
||||
|
||||
You can get the ntp-dev repository by either of the following commands:
|
||||
|
||||
bk clone bk://www.ntp.org/home/bk/ntp-dev ntp-dev
|
||||
|
||||
bk clone bk://ntp.bkserver.net/ntp-dev ntp-dev
|
||||
|
||||
bk clone bk://ntp.bkbits.net/ntp-dev ntp-dev
|
||||
|
||||
The IPV6 patch has been applied:
|
||||
|
||||
bk clone bk://www.ntp.org/home/bk/ntp-dev-ipv6 ntp-dev-ipv6
|
||||
|
||||
bk clone bk://ntp.bkserver.net/ntp-dev-ipv6 ntp-dev-ipv6
|
||||
|
||||
bk clone bk://ntp.bkbits.net/ntp-dev-ipv6 ntp-dev-ipv6
|
||||
|
||||
The ntp-dev-ipv6 repository will be merged back in to the ntp-dev repo
|
||||
as soon as the code is stable.
|
||||
|
||||
|
50
contrib/ntp/README.refclocks
Normal file
50
contrib/ntp/README.refclocks
Normal file
@ -0,0 +1,50 @@
|
||||
This is a list of the #define REFCLK_* stuff.
|
||||
|
||||
If you want to add a new refclock let us know and we'll assign you a number.
|
||||
|
||||
Should this list also include the name of the party responsible for the
|
||||
refclock?
|
||||
|
||||
LOCALCLOCK 1 /* external (e.g., lockclock) */
|
||||
GPS_TRAK 2 /* TRAK 8810 GPS Receiver */
|
||||
WWV_PST 3 /* PST/Traconex 1020 WWV/H */
|
||||
SPECTRACOM 4 /* Spectracom (generic) Receivers */
|
||||
TRUETIME 5 /* TrueTime (generic) Receivers */
|
||||
IRIG_AUDIO 6 /* IRIG-B/W audio decoder */
|
||||
CHU_AUDIO 7 /* CHU audio demodulator/decoder */
|
||||
PARSE 8 /* generic driver (usually DCF77,GPS,MSF) */
|
||||
GPS_MX4200 9 /* Magnavox MX4200 GPS */
|
||||
GPS_AS2201 10 /* Austron 2201A GPS */
|
||||
GPS_ARBITER 11 /* Arbiter 1088A/B/ GPS */
|
||||
IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */
|
||||
ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */
|
||||
MSF_EES 14 /* EES M201 MSF Receiver */
|
||||
GPSTM_TRUE 15 /* OLD TrueTime GPS/TM-TMD Receiver */
|
||||
IRIG_BANCOMM 16 /* Bancomm GPS/IRIG Interface */
|
||||
GPS_DATUM 17 /* Datum Programmable Time System */
|
||||
NIST_ACTS 18 /* NIST Auto Computer Time Service */
|
||||
WWV_HEATH 19 /* Heath GC1000 WWV/WWVH Receiver */
|
||||
GPS_NMEA 20 /* NMEA based GPS clock */
|
||||
GPS_VME 21 /* TrueTime GPS-VME Interface */
|
||||
ATOM_PPS 22 /* 1-PPS Clock Discipline */
|
||||
PTB_ACTS 23 /* PTB Auto Computer Time Service */
|
||||
USNO 24 /* Naval Observatory dialup */
|
||||
GPS_HP 26 /* HP 58503A Time/Frequency Receiver */
|
||||
ARCRON_MSF 27 /* ARCRON MSF radio clock. */
|
||||
SHM 28 /* clock attached thru shared memory */
|
||||
PALISADE 29 /* Trimble Navigation Palisade GPS */
|
||||
ONCORE 30 /* Motorola UT Oncore GPS */
|
||||
GPS_JUPITER 31 /* Rockwell Jupiter GPS receiver */
|
||||
CHRONOLOG 32 /* Chrono-log K WWVB receiver */
|
||||
DUMBCLOCK 33 /* Dumb localtime clock */
|
||||
ULINK 34 /* Ultralink M320 WWVB receiver */
|
||||
PCF 35 /* Conrad parallel port radio clock */
|
||||
WWV_AUDIO 36 /* WWV/H audio demodulator/decoder */
|
||||
FG 37 /* Forum Graphic GPS */
|
||||
HOPF_SERIAL 38 /* hopf DCF77/GPS serial line receiver */
|
||||
HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */
|
||||
JJY 40 /* JJY receiver */
|
||||
TT560 41 /* TrueTime 560 IRIG-B decoder */
|
||||
ZYFER 42 /* Zyfer GPStarplus receiver */
|
||||
RIPENCC 43 /* RIPE NCC Trimble driver */
|
||||
??????? 44 Claas Hilbrecht (20020711)
|
@ -1,485 +1 @@
|
||||
/* 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
|
||||
|
||||
/* PARSE kernel PLL PPS support */
|
||||
#undef PPS_SYNC
|
||||
|
||||
/* 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
|
||||
|
||||
/* Diems Computime Radio Clock */
|
||||
#undef CLOCK_COMPUTIME
|
||||
|
||||
/* Chronolog K-series WWVB receiver */
|
||||
#undef CLOCK_CHRONOLOG
|
||||
|
||||
/* Datum Programmable Time System */
|
||||
#undef CLOCK_DATUM
|
||||
|
||||
/* ELV/DCF7000 clock */
|
||||
#undef CLOCK_DCF7000
|
||||
|
||||
/* Dumb generic hh:mm:ss local clock */
|
||||
#undef CLOCK_DUMBCLOCK
|
||||
|
||||
/* Forum Graphic GPS datating station driver */
|
||||
#undef CLOCK_FG
|
||||
|
||||
/* TrueTime GPS receiver/VME interface */
|
||||
#undef CLOCK_GPSVME
|
||||
|
||||
/* Heath GC-1000 WWV/WWVH receiver */
|
||||
#undef CLOCK_HEATH
|
||||
|
||||
/* HOPF 6021 clock */
|
||||
#undef CLOCK_HOPF6021
|
||||
|
||||
/* HOPF PCI clock device */
|
||||
#undef CLOCK_HOPF_PCI
|
||||
|
||||
/* HOPF serial clock device*/
|
||||
#undef CLOCK_HOPF_SERIAL
|
||||
|
||||
/* HP 58503A GPS receiver */
|
||||
#undef CLOCK_HPGPS
|
||||
|
||||
/* Sun IRIG audio decoder */
|
||||
#undef CLOCK_IRIG
|
||||
|
||||
/* JJY receiver */
|
||||
#undef CLOCK_JJY
|
||||
|
||||
/* Rockwell Jupiter GPS clock */
|
||||
#undef CLOCK_JUPITER
|
||||
|
||||
/* Leitch CSD 5300 Master Clock System Driver */
|
||||
#undef CLOCK_LEITCH
|
||||
|
||||
/* local clock reference */
|
||||
#undef CLOCK_LOCAL
|
||||
|
||||
/* Meinberg clocks */
|
||||
#undef CLOCK_MEINBERG
|
||||
|
||||
/* EES M201 MSF receiver */
|
||||
#undef CLOCK_MSFEES
|
||||
|
||||
/* Magnavox MX4200 GPS receiver */
|
||||
#undef CLOCK_MX4200
|
||||
|
||||
/* NMEA GPS receiver */
|
||||
#undef CLOCK_NMEA
|
||||
|
||||
/* Motorola UT Oncore GPS */
|
||||
#undef CLOCK_ONCORE
|
||||
|
||||
/* Palisade clock */
|
||||
#undef CLOCK_PALISADE
|
||||
|
||||
/* PARSE driver interface */
|
||||
#undef CLOCK_PARSE
|
||||
|
||||
/* Conrad parallel port radio clock */
|
||||
#undef CLOCK_PCF
|
||||
|
||||
/* PCL 720 clock support */
|
||||
#undef CLOCK_PPS720
|
||||
|
||||
/* PST/Traconex 1020 WWV/WWVH receiver */
|
||||
#undef CLOCK_PST
|
||||
|
||||
/* PTB modem service */
|
||||
#undef CLOCK_PTBACTS
|
||||
|
||||
/* DCF77 raw time code */
|
||||
#undef CLOCK_RAWDCF
|
||||
|
||||
/* RCC 8000 clock */
|
||||
#undef CLOCK_RCC8000
|
||||
|
||||
/* Schmid DCF77 clock */
|
||||
#undef CLOCK_SCHMID
|
||||
|
||||
/* clock thru shared memory */
|
||||
#undef CLOCK_SHM
|
||||
|
||||
/* Spectracom 8170/Netclock/2 WWVB receiver */
|
||||
#undef CLOCK_SPECTRACOM
|
||||
|
||||
/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
|
||||
#undef CLOCK_TPRO
|
||||
|
||||
/* TRAK 8810 GPS receiver */
|
||||
#undef CLOCK_TRAK
|
||||
|
||||
/* Trimble GPS receiver/TAIP protocol */
|
||||
#undef CLOCK_TRIMTAIP
|
||||
|
||||
/* Trimble GPS receiver/TSIP protocol */
|
||||
#undef CLOCK_TRIMTSIP
|
||||
|
||||
/* Kinemetrics/TrueTime receivers */
|
||||
#undef CLOCK_TRUETIME
|
||||
|
||||
/* Ultralink M320 WWVB receiver */
|
||||
#undef CLOCK_ULINK
|
||||
|
||||
/* USNO modem service */
|
||||
#undef CLOCK_USNO
|
||||
|
||||
/* WHARTON 400A Series protocol */
|
||||
#undef CLOCK_WHARTON_400A
|
||||
|
||||
/* WWV audio driver */
|
||||
#undef CLOCK_WWV
|
||||
|
||||
/* VARITEXT protocol */
|
||||
#undef CLOCK_VARITEXT
|
||||
|
||||
/* 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
|
||||
|
||||
/* Other needed NLIST stuff */
|
||||
#undef NLIST_STRUCT
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* 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 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
|
||||
|
||||
/* Do we have support for SHMEM_STATUS? */
|
||||
#undef ONCORE_SHMEM_STATUS
|
||||
|
||||
/***/
|
||||
|
||||
/* 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
|
||||
|
||||
/* hstrerror()? */
|
||||
#undef DECL_HSTRERROR_0
|
||||
|
||||
/* inet_ntoa()? */
|
||||
#undef DECL_INET_NTOA_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
|
||||
#undef DECL_STIME_1
|
||||
|
||||
/* 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
|
||||
|
||||
/* strerror()? */
|
||||
#undef DECL_STRERROR_0
|
||||
|
||||
#undef ULONG_CONST
|
||||
|
2
contrib/ntp/aclocal.m4
vendored
2
contrib/ntp/aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
# ./aclocal.m4 generated automatically by aclocal 1.5
|
||||
# aclocal.m4 generated automatically by aclocal 1.5
|
||||
|
||||
# Copyright 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
|
31
contrib/ntp/config.guess
vendored
31
contrib/ntp/config.guess
vendored
@ -3,7 +3,7 @@
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-06-29'
|
||||
timestamp='2001-08-21'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -227,6 +227,9 @@ EOF
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
@ -330,6 +333,9 @@ EOF
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:NetBSD:*)
|
||||
echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -639,7 +645,7 @@ EOF
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
*9??*:MPE/iX:*:*)
|
||||
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
@ -683,12 +689,13 @@ EOF
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*[A-Z]90:*:*:*)
|
||||
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
|
||||
-e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
@ -777,6 +784,9 @@ EOF
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
@ -785,7 +795,7 @@ EOF
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
@ -992,8 +1002,8 @@ EOF
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
@ -1005,6 +1015,10 @@ EOF
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:VOS:*:*)
|
||||
# From Paul.Green@stratus.com.
|
||||
echo hppa1.1-stratus-vos
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -1097,6 +1111,9 @@ EOF
|
||||
*:ITS:*:*)
|
||||
echo pdp10-unknown-its
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
|
File diff suppressed because it is too large
Load Diff
131
contrib/ntp/config.sub
vendored
131
contrib/ntp/config.sub
vendored
@ -3,7 +3,7 @@
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-06-08'
|
||||
timestamp='2001-08-13'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -223,26 +223,35 @@ esac
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
|
||||
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
|
||||
| pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 \
|
||||
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| hppa64 \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||
| alphaev6[78] \
|
||||
| we32k | ns16k | clipper | i370 | sh | sh[34] \
|
||||
| powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp10 | pdp11 \
|
||||
| mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
|
||||
| v850 | c4x \
|
||||
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
|
||||
| pj | pjl | h8500 | z8k)
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dsp16xx \
|
||||
| fr30 \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
|
||||
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
|
||||
| mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| s390 | s390x \
|
||||
| sh | sh[34] | sh[34]eb | shbe | shle \
|
||||
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| v850 \
|
||||
| we32k \
|
||||
| x86 | xscale \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
@ -265,31 +274,43 @@ case $basic_machine in
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
# FIXME: clean up the formatting here.
|
||||
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
|
||||
| hppa2.0n-* | hppa64-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| alphaev6[78]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
|
||||
| powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
|
||||
| mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
|
||||
| [cjt]90-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
|
||||
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alphapca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c54x-* \
|
||||
| clipper-* | cray2-* | cydra-* \
|
||||
| d10v-* | d30v-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| m32r-* \
|
||||
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
|
||||
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \
|
||||
| mipsle-* | mipstx39-* | mipstx39el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| s390-* | s390x-* \
|
||||
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
|
||||
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
|
||||
| v850-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@ -735,6 +756,16 @@ case $basic_machine in
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
;;
|
||||
ppc64le-* | powerpc64little-*)
|
||||
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
@ -946,7 +977,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4)
|
||||
sh3 | sh4 | sh3eb | sh4eb)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
@ -1035,7 +1066,8 @@ case $os in
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1359,6 +1391,9 @@ case $basic_machine in
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
vendor=atari
|
||||
;;
|
||||
-vos*)
|
||||
vendor=stratus
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
12806
contrib/ntp/configure
vendored
12806
contrib/ntp/configure
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,6 +18,11 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
@ -50,10 +55,12 @@ fi
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay!
|
||||
if "$@" -MT "$object" -MF "$tmpdepfile" -MD -MP; then :
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
stat=$?
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
@ -73,9 +80,10 @@ gcc)
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
if "$@" -Wp,"$gccflag$tmpdepfile"; then :
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
stat=$?
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
@ -126,19 +134,24 @@ sgi)
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5).
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
@ -150,8 +163,12 @@ sgi)
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file.
|
||||
tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
|
||||
# in a .u file. This file always lives in the current directory.
|
||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
||||
# $object doesn't have directory information.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
@ -166,21 +183,11 @@ aix)
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5).
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
|
||||
' ' ' >> $depfile
|
||||
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
@ -190,6 +197,43 @@ aix)
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
|
||||
tmpdepfile1="$object.d"
|
||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
@ -4,19 +4,20 @@ BUILD_ARGS="$@"
|
||||
PARSE="--enable-parse-clocks"
|
||||
#PARSE=
|
||||
|
||||
# * baldwin sparc-sun-solaris2.7
|
||||
# baldwin sparc-sun-solaris2.7
|
||||
# bridgeport sparc-sun-solaris2.6
|
||||
# bunnylou alpha-dec-osf4.0
|
||||
# * churchy alpha-dec-osf4.0
|
||||
# * bunnylou alpha-dec-osf4.0
|
||||
# * churchy alpha-dec-osf5.1
|
||||
# cowbird alpha-dec-osf4.0
|
||||
# grundoon sparc-sun-sunos4.1.3
|
||||
# * hepzibah freebsd-2.2.5
|
||||
# * hepzibah freebsd-4
|
||||
# malarky sparc-sun-solaris2.8
|
||||
# * pogo sparc-sun-solaris2.8
|
||||
# * porkypine mips-dec-ultrix4.4
|
||||
# * rackety sparc-sun-sunos4.1.3/cc
|
||||
# ? roogey debian
|
||||
# * snavely hppa1.1-hp-hpux10.20
|
||||
# whimsy sparc-sun-solaris2.7
|
||||
# whimsy sparc-sun-solaris2.8
|
||||
|
||||
c_d=`pwd`
|
||||
|
||||
@ -24,7 +25,7 @@ SIG=`perl -e 'print rand'`
|
||||
echo $SIG > .buildkey
|
||||
|
||||
case "$LIST" in
|
||||
'') LIST="baldwin churchy hepzibah pogo porkypine rackety snavely" ;;
|
||||
'') LIST="bunnylou churchy hepzibah pogo porkypine rackety snavely" ;;
|
||||
esac
|
||||
|
||||
for i in $LIST
|
||||
|
41
contrib/ntp/html/driver42.htm
Normal file
41
contrib/ntp/html/driver42.htm
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content=
|
||||
"HTML Tidy for Solaris (vers 1st May 2002), see www.w3.org">
|
||||
<meta http-equiv="Content-Type" content=
|
||||
"text/html; charset=iso-8859-1">
|
||||
<meta name="GENERATOR" content=
|
||||
"Mozilla/4.01 [en] (Win95; I) [Netscape]">
|
||||
<title>Zyfer GPStarplus Receiver</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Zyfer GPStarplus Receiver</h3>
|
||||
|
||||
<hr>
|
||||
<h4>Synopsis</h4>
|
||||
|
||||
Address: 127.127.42.<i>u</i> <br>
|
||||
Reference ID: <tt>GPS</tt> <br>
|
||||
Driver ID: <tt>Zyfer GPStarplus</tt> <br>
|
||||
Serial Port: <tt>/dev/zyfer<i>u</i></tt>; 9600 baud, 8-bits, no
|
||||
parity <br>
|
||||
Features: <tt>(none)</tt>
|
||||
<h4>Description</h4>
|
||||
|
||||
This driver supports the <a href="http://www.zyfer.com/">Zyfer
|
||||
GPStarplus</a> receiver.
|
||||
<p>The receiver has a DB15 port on the back which has input TxD and
|
||||
RxD lines for configuration and control, and a separate TxD line
|
||||
for the once-per-second timestamp.</p>
|
||||
|
||||
<p>Additionally, there are BNC connectors on the back for things
|
||||
like PPS and IRIG output. Additional Information</p>
|
||||
|
||||
<p><a href="refclock.htm">Reference Clock Drivers</a> </p>
|
||||
|
||||
<hr>
|
||||
<address>Harlan Stenn (stenn@whimsy.udel.edu)</address>
|
||||
</body>
|
||||
</html>
|
||||
|
109
contrib/ntp/html/driver43.htm
Normal file
109
contrib/ntp/html/driver43.htm
Normal file
@ -0,0 +1,109 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>RIPE NCC interface for Trimble Palisade</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>RIPE NCC interface for Trimble Palisade</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<img src="pic/driver43_2.jpg" alt="Trimble Acutime 2000" align="right">
|
||||
|
||||
<h4>Synopsis</h4>
|
||||
|
||||
Address: 127.127.43.<i>u</i> <br>
|
||||
Reference ID: <tt>RIPENCC</tt> <br>
|
||||
Driver ID: <tt>RIPENCC</tt>
|
||||
|
||||
<h4>Description</h4>
|
||||
|
||||
<p> This is a special driver developed to be used in conjuction with the
|
||||
RIPE NCC clock card in the RIPE NCC Test Traffic Measurements project.
|
||||
</p>
|
||||
|
||||
<h4>Why this driver?</h4>
|
||||
|
||||
<p>
|
||||
The reason why we created a seperated driver for an antenna for which
|
||||
already a (vendor supplied) driver exist is a design decision.
|
||||
To be more specific, the standard Trimble interface uses a 12 pin
|
||||
connector. The cable sold by Trimble to connect to this wire is a very
|
||||
thick cable. Certainly not something you wish to run for several 100
|
||||
meters through your building. And if you wanted to run it for 100 meters,
|
||||
you always would have to really run the cable, and didn't have the option
|
||||
to use existing wiring.<br>
|
||||
This is where we wanted more flexibility. We wanted to be able to use
|
||||
existing wiring in buildings. That leaded us to CAT-5(UTP) which only
|
||||
gives us 8 wires. Therefor we decided to redesing the use of the Trimble
|
||||
antenna. The Trimble supports two modes: EVENT driver and PPS mode. The
|
||||
default is to use the EVENT mode which needs all 12 wires. We only use the
|
||||
PPS timestamps for which we have enough with 8 wires. For our purposes
|
||||
this is more than fine.
|
||||
</p>
|
||||
|
||||
More information about the project can be found on the <a href="http://www.ripe.net/test-traffic" TARGET=_new>Test Traffic Measurements</a> website.
|
||||
|
||||
<img src="pic/driver43_1.gif" alt="RIPE NCC clock card" align="right">
|
||||
<h4> RIPE NCC clock card</h4>
|
||||
|
||||
<p>The card is very a simple PCI card. The only feature on the bus it uses
|
||||
is the power supply. It uses this power supply to power the Trimble GPS
|
||||
antenna.</p>
|
||||
|
||||
<p>The card basicly just is a RS422 to RS232 converter. It gets the
|
||||
Trimble's RS422 signal on a RJ45 connector and transforms that to RS232 on a
|
||||
DIN9 connector. This connector should be loopbacked on the back of the
|
||||
machine to the serial port. As said, the card doesn't do any PCI data
|
||||
transfers.</p>
|
||||
|
||||
<p>The schematics of the interface card is available here: <a
|
||||
href="http://www.ripe.net/ripencc/mem-services/ttm/Documents/gps_interface_schematic.pdf">gps_interface_schematic.pdf</a>.
|
||||
You are free to create this card yourself as long as you give some credit
|
||||
or reference to us. Note that we don't sell these cards on a commercial
|
||||
basis, but for interested parties we do have some spares to share.<p>
|
||||
|
||||
|
||||
<h4>Monitor Data</h4>
|
||||
|
||||
In the <tt>filegen clockstats</tt> file the following (example) data is
|
||||
collected:
|
||||
<pre>
|
||||
52445 41931.275 127.127.40.0 U1 20.6.2002 11:38:51 13 11
|
||||
52445 41931.395 127.127.40.0 C1 20062002 113851 6 364785 110.2 450 6.7 13 5222.374737 N 0453.268013 E 48 7 11 0 1 -14 20 0 -25
|
||||
52445 41931.465 127.127.40.0 S1 07 1 1 02 59.3 291.5 39.3
|
||||
52445 41931.485 127.127.40.0 S1 11 2 1 02 59.9 138.0 60.2
|
||||
52445 41931.525 127.127.40.0 S1 01 4 1 02 48.4 185.7 28.3
|
||||
52445 41931.555 127.127.40.0 S1 14 5 2 02 32.7 41.0 15.4
|
||||
52445 41931.585 127.127.40.0 S1 20 6 1 02 59.9 256.6 78.0
|
||||
52445 41931.615 127.127.40.0 S1 25 8 2 00 0.0 86.6 20.1
|
||||
</pre>
|
||||
This is in the form of:
|
||||
<pre>
|
||||
All output lines consist of a prefix and a message, the prefix is:
|
||||
[days since epoch] [sec.ms since start of day] [peer address]
|
||||
|
||||
And all individual messages:
|
||||
|
||||
*Primary UTC time packet:
|
||||
U1 [date] [time] [trackstat] [utcflags]
|
||||
|
||||
*Comprehensive time packet:
|
||||
C1 [date] [time] [mode] [bias] [biasunc] [rate] [rateunc] [utcoff] [latitude] [longtitude] [alt] [vis sat](x8)
|
||||
|
||||
*Tracking status packet:
|
||||
S1 [prn] [channel] [aqflag] [ephstat] [snr] [azinuth] [elevation]
|
||||
</pre>
|
||||
|
||||
<h4>Additional Information</h4>
|
||||
|
||||
<a href="refclock.htm">Reference Clock Drivers</a>
|
||||
|
||||
|
||||
<hr>
|
||||
<a href="index.htm"><img align="left" src="pic/home.gif" alt=
|
||||
"Home"></a>
|
||||
|
||||
<address><a href="mailto:marks@ripe.net">Mark Santcroos
|
||||
<marks@ripe.net></a></address>
|
||||
</body>
|
||||
</html>
|
131
contrib/ntp/html/driver44.htm
Executable file
131
contrib/ntp/html/driver44.htm
Executable file
@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>NeoClock4X</title>
|
||||
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html; charset=ISO-8859-15">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>NeoClock4X - DCF77 / TDF serial line receiver<br>
|
||||
</h1>
|
||||
|
||||
<hr width="100%" size="2">
|
||||
<h2>Synopsis</h2>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table cellpadding="2" cellspacing="0" border="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td valign="top">Adress<br>
|
||||
</td>
|
||||
<td valign="top">127.127.44.u<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Reference ID<br>
|
||||
</td>
|
||||
<td valign="top">neol<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Driver ID<br>
|
||||
</td>
|
||||
<td valign="top">NEOCLK4X<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Serial Port<br>
|
||||
</td>
|
||||
<td valign="top">/dev/neoclock4x-u<br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</td>
|
||||
<td valign="top" align="right"><a href="http://www.linum.com"><img
|
||||
src="pic/neoclock4x.gif" alt="NeoClock4X - DCF77 receiver" width="150"
|
||||
height="195">
|
||||
</a><br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr width="100%" size="2">
|
||||
<h2>Description</h2>
|
||||
The refclock_neoclock4x driver supports the NeoClock4X receiver available
|
||||
from <a href="http://www.linum.com">Linum Software GmbH</a>. The receiver
|
||||
is available as a <a href="http://www.dcf77.de">DCF77</a> or TDF receiver.
|
||||
Both receivers have the same output string. For more information about the
|
||||
NeoClock4X receiver please visit <a
|
||||
href="http://www.linum.com/redir/jump/id=neoclock4x&action=redir">http://www.linum.com/redir/jump/id=neoclock4x&action=redir</a>.
|
||||
|
||||
<hr width="100%" size="2">
|
||||
<h2>Fudge Factors</h2>
|
||||
|
||||
<dl>
|
||||
<dt> <b><a href="clockopt.htm">time1 time</a></b></dt>
|
||||
<dd> Specifies the time offset calibration factor with the default value
|
||||
off 0.16958333 seconds. This offset is used to correct serial line and
|
||||
operating system delays incurred in capturing time stamps. If you want to
|
||||
fudge the time1 offset <b>ALWAYS</b> add a value off 0.16958333. This is
|
||||
neccessary to compensate to delay that is caused by transmit the timestamp
|
||||
at 2400 Baud. If you want to compensate the delay that the DCF77 or TDF radio
|
||||
signal takes to travel to your site simply add the needed millisecond delay
|
||||
to the given value. Note that the time here is given in seconds.</dd>
|
||||
<dd>Default setting is 0.16958333 seconds.<br>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt> <b><a href="file:///E:/ntp-4.1.1a/html/clockopt.htm">time2 time</a></b></dt>
|
||||
<dd> Not used by this driver.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt> <a href="clockopt.htm"><b>flag1 0 | 1</b></a></dt>
|
||||
<dd>When set to 1 the driver will feed ntp with timestampe even if the
|
||||
radio signal is lost. In this case an internal backup clock generates the
|
||||
timestamps. This is ok as long as the receiver is synced once since the receiver
|
||||
is able to keep time for a long period.</dd>
|
||||
<dd>Default setting is 0 = don't synchronize to CMOS clock.<br>
|
||||
</dd>
|
||||
<dd><br>
|
||||
</dd>
|
||||
<dt> <a href="clockopt.htm"><b>flag2 0 | 1</b></a></dt>
|
||||
<dd>You can allow the NeoClock4X driver to use the quartz clock even if
|
||||
it is never synchronized to a radio clock. This is usally not a good idea
|
||||
if you want preceise timestamps since the CMOS clock is maybe not adjusted
|
||||
to a dst status change. So <b>PLEASE</b> switch this only on if you now
|
||||
what you're doing.</dd>
|
||||
<dd>Default setting is 0 = don't synchronize to unsynchronized CMOS clock.<br>
|
||||
</dd>
|
||||
<dt><br>
|
||||
</dt>
|
||||
<dt><a href="clockopt.htm"><b>flag3 0 | 1</b></a></dt>
|
||||
<dd> Not used by this driver.<tt><tt><tt><tt><tt><tt> </tt></tt></tt></tt></tt></tt></dd>
|
||||
<dd><br>
|
||||
</dd>
|
||||
<dt> <a href="clockopt.htm"><b>flag4 0 | 1</b></a></dt>
|
||||
<dd>It is recommended to allow extensive logging while you setup the NeoClock4X
|
||||
receiver. If you activate flag4 every received data is logged. You should
|
||||
turn off flag4 as soon as the clock works as expected to reduce logfile
|
||||
cluttering.</dd>
|
||||
<dd>Default setting is 0 = don't log received data and converted utc time.<br>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<hr width="100%" size="2">Please send any comments or question to <a
|
||||
href="mailto:neoclock4@linum.com">neoclock4x@linum.com</a>.<br>
|
||||
<br>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
@ -1,254 +1,202 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||||
<title>Reference Clock Drivers</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Reference Clock Drivers</h3>
|
||||
|
||||
<img align="left" src="pic/stack1a.jpg" alt="gif">Master Time
|
||||
Facility at the <a href="http://www.eecis.udel.edu/~mills/lab.htm">
|
||||
UDel Internet Research Laboratory</a>: <br clear="left">
|
||||
<hr>
|
||||
<p>Support for most of the commonly available radio and modem
|
||||
reference clocks is included in the default configuration of the
|
||||
NTP daemon for Unix <tt>ntpd</tt>. Individual clocks can be
|
||||
activated by configuration file commands, specifically the <tt>
|
||||
server</tt> and <tt>fudge</tt> commands described in the <a href=
|
||||
"ntpd.htm"><tt>ntpd</tt> program manual page</a>. The following
|
||||
discussion presents Information on how to select and configure the
|
||||
device drivers in a running Unix system.</p>
|
||||
|
||||
<p>Many radio reference clocks can be set to display local time as
|
||||
adjusted for timezone and daylight saving mode. For use with NTP
|
||||
the clock must be set for Coordinated Universal Time (UTC) only.
|
||||
Ordinarily, these adjustments are performed by the kernel, so the
|
||||
fact that the clock runs on UTC will be transparent to the
|
||||
user.</p>
|
||||
|
||||
<p>Radio and modem clocks by convention have addresses in the form
|
||||
127.127.<i>t.u</i>, where <i>t</i> is the clock type and <i>u</i>
|
||||
is a unit number in the range 0-3 used to distinguish multiple
|
||||
instances of clocks of the same type. Most of these clocks require
|
||||
support in the form of a serial port or special bus peripheral, but
|
||||
some can work directly from the audio codec found in some
|
||||
workstations. The particular device is normally specified by adding
|
||||
a soft link <tt>/dev/device<i>u</i></tt> to the particular hardware
|
||||
device involved, where <i><tt>u</tt></i> correspond to the unit
|
||||
number above.</p>
|
||||
|
||||
<p>Most clock drivers communicate with the reference clock using a
|
||||
serial port, usually at 9600 bps. There are several application
|
||||
program interfaces (API) used in the various Unix and NT systems,
|
||||
most of which can be detected at configuration time. Thus, it is
|
||||
important that the NTP daemon and utilities be compiled on the
|
||||
target system or clone. In some cases special features are
|
||||
available, such as timestamping in the kernel or pulse-per-second
|
||||
(PPS) interface. In most cases these features can be detected at
|
||||
configuration time as well; however, the kernel may have to be
|
||||
recompiled in order for them to work.</p>
|
||||
|
||||
<p>The audio drivers are a special case. These include support for
|
||||
the NIST time/frequency stations WWV and WWVH, the Canadian
|
||||
time/frequency station CHU and generic IRIG signals. Currently,
|
||||
support for the Solaris and SunOS audio API is included in the
|
||||
distribution. It is left to the volunteer corps to extend this
|
||||
support to other systems. Further information on hookup, debugging
|
||||
and monitoring is given in the <a href="audio.htm">Audio
|
||||
Drivers</a> page.</p>
|
||||
|
||||
<p>The local clock driver is also a special case. A server
|
||||
configured with this driver can operate as a primary server to
|
||||
synchronize other clients when no other external synchronization
|
||||
sources are available. If the server is connected directly or
|
||||
indirectly to the public Internet, there is some danger that it can
|
||||
adversely affect the operation of unrelated clients. Carefully read
|
||||
the <a href="driver1.htm">Undisciplined Local Clock</a> page and
|
||||
respect the stratum limit.</p>
|
||||
|
||||
<p>The local clock driver also supports an external synchronization
|
||||
source such as a high resolution counter disciplined by a GPS
|
||||
receiver, for example. Further information is on the <a href=
|
||||
"extern.htm">External Clock Discipline and the Local Clock
|
||||
Driver</a> page.</p>
|
||||
|
||||
<h4>Driver Calibration</h4>
|
||||
|
||||
<p>Some drivers depending on longwave and shortwave radio services
|
||||
need to know the radio propagation time from the transmitter to the
|
||||
receiver, which can amount to some tens of milliseconds. This must
|
||||
be calculated for each specific receiver location and requires the
|
||||
geographic coordinates of both the transmitter and receiver. The
|
||||
transmitter coordinates for various radio services are given in the
|
||||
<a href="qth.htm">Stations, Frequencies and Geographic
|
||||
Coordinates</a> page. Receiver coordinates can be obtained or
|
||||
estimated from various sources. The actual calculations are beyond
|
||||
the scope of this document.</p>
|
||||
|
||||
<p>When more than one clock driver is supported, it is often the
|
||||
case that each shows small systematic offset differences relative
|
||||
to the rest. To reduce the effects of jitter when switching from
|
||||
one driver to the another, it is useful to calibrate the drivers to
|
||||
a common ensemble offset. The <tt>enable calibrate</tt>
|
||||
configuration command in the <a href="miscopt.htm">Miscellaneous
|
||||
Options</a> page is useful for this purpose. The calibration
|
||||
function can also be enabled and disabled using the <tt>ntpdc</tt>
|
||||
program utility.</p>
|
||||
|
||||
<p>Most clock drivers use the <tt>time1</tt> value specified in the
|
||||
<tt>fudge</tt> configuration command to provide the calibration
|
||||
correction when this cannot be provided by the clock or interface.
|
||||
When the calibration function is enabled, the <tt>time1</tt> value
|
||||
is automatically adjusted to match the offset of the remote server
|
||||
or local clock driver selected for synchronization. Ordinarily, the
|
||||
NTP selection algorithm chooses the best from among all sources,
|
||||
usually the best radio clock determined on the basis of stratum,
|
||||
synchronization distance and jitter. The calibration function
|
||||
adjusts the <tt>time1</tt> values for all clock drivers except this
|
||||
source so that their indicated offsets tend to zero. If the
|
||||
selected source is the kernel PPS discipline, the <tt>fudge
|
||||
time1</tt> values for all clock drivers are adjusted.</p>
|
||||
|
||||
<p>The adjustment function is an exponential average designed to
|
||||
improve accuracy, so the function takes some time to converge. The
|
||||
recommended procedure is to enable the function, let it run for an
|
||||
hour or so, then edit the configuration file using the <tt>
|
||||
time1</tt> values displayed by the <tt>ntpq</tt> utility and <tt>
|
||||
clockvar</tt> command. Finally, disable the calibration function to
|
||||
avoid possible future disruptions due to misbehaving clocks or
|
||||
drivers.</p>
|
||||
|
||||
<h4>Performance Enhancements</h4>
|
||||
|
||||
<p>In general, performance can be improved, especially when more
|
||||
than one clock driver is supported, to use the prefer peer function
|
||||
described in the <a href="prefer.htm">Mitigation Rules and the <tt>
|
||||
prefer</tt> Keyword</a> page. The prefer peer is ordinarily
|
||||
designated the remote peer or local clock driver which provides the
|
||||
best quality time. All other things equal, only the prefer peer
|
||||
source is used to discipline the system clock and jitter-producing
|
||||
"clockhopping" between sources is avoided. This is valuable when
|
||||
more than one clock driver is present and especially valuable when
|
||||
the PPS clock driver (type 22) is used. Support for PPS signals is
|
||||
summarized in the <a href="pps.htm">Pulse-per-second (PPS) Signal
|
||||
Interfacing</a> page.</p>
|
||||
|
||||
<p>Where the highest performance is required, generally better than
|
||||
one millisecond, additional hardware and/or software functions may
|
||||
be required. Kernel modifications for precision time are described
|
||||
in the <a href="kern.htm">A Kernel Model for Precision
|
||||
Timekeeping</a> page. Special line discipline and streams modules
|
||||
for use in capturing precision timestamps are described in the <a
|
||||
href="ldisc.htm">Line Disciplines and Streams Drivers</a> page.</p>
|
||||
|
||||
<h4>Comprehensive List of Clock Drivers</h4>
|
||||
|
||||
<p>Following is a list showing the type and title of each driver
|
||||
currently implemented. The compile-time identifier for each is
|
||||
shown in parentheses. Click on a selected type for specific
|
||||
description and configuration documentation, including the clock
|
||||
address, reference ID, driver ID, device name and serial line
|
||||
speed, and features (line disciplines, etc.). For those drivers
|
||||
without specific documentation, please contact the author listed in
|
||||
the <a href="copyright.htm">Copyright Notice</a> page.</p>
|
||||
|
||||
<p><a href="driver1.htm">Type 1</a> Undisciplined Local Clock
|
||||
(<tt>LOCAL</tt>)<br>
|
||||
<a href="driver2.htm">Type 2</a> Trak 8820 GPS Receiver
|
||||
(<tt>GPS_TRAK</tt>)<br>
|
||||
<a href="driver3.htm">Type 3</a> PSTI/Traconex 1020 WWV/WWVH
|
||||
Receiver (<tt>WWV_PST</tt>)<br>
|
||||
<a href="driver4.htm">Type 4</a> Spectracom WWVB and GPS Receivers
|
||||
(<tt>WWVB_SPEC</tt>)<br>
|
||||
<a href="driver5.htm">Type 5</a> TrueTime GPS/GOES/OMEGA Receivers
|
||||
(<tt>TRUETIME</tt>)<br>
|
||||
<a href="driver6.htm">Type 6</a> IRIG Audio Decoder
|
||||
(<tt>IRIG_AUDIO</tt>)<br>
|
||||
<a href="driver7.htm">Type 7</a> Radio CHU Audio
|
||||
Demodulator/Decoder (<tt>CHU</tt>)<br>
|
||||
<a href="driver8.htm">Type 8</a> Generic Reference Driver
|
||||
(<tt>PARSE</tt>)<br>
|
||||
<a href="driver9.htm">Type 9</a> Magnavox MX4200 GPS Receiver
|
||||
(<tt>GPS_MX4200</tt>)<br>
|
||||
<a href="driver10.htm">Type 10</a> Austron 2200A/2201A GPS
|
||||
Receivers (<tt>GPS_AS2201</tt>)<br>
|
||||
<a href="driver11.htm">Type 11</a> Arbiter 1088A/B GPS Receiver
|
||||
(<tt>GPS_ARBITER</tt>)<br>
|
||||
<a href="driver12.htm">Type 12</a> KSI/Odetics TPRO/S IRIG
|
||||
Interface (<tt>IRIG_TPRO</tt>)<br>
|
||||
Type 13 Leitch CSD 5300 Master Clock Controller
|
||||
(<tt>ATOM_LEITCH</tt>)<br>
|
||||
Type 14 EES M201 MSF Receiver (<tt>MSF_EES</tt>)<br>
|
||||
<a href="driver5.htm">Type 15</a> * TrueTime generic receivers<br>
|
||||
<a href="driver16">Type 16</a> Bancomm GPS/IRIG Receiver
|
||||
(<tt>GPS_BANCOMM</tt>)<br>
|
||||
Type 17 Datum Precision Time System (<tt>GPS_DATUM</tt>)<br>
|
||||
<a href="driver18.htm">Type 18</a> NIST Modem Time Service
|
||||
(<tt>ACTS_NIST</tt>)<br>
|
||||
<a href="driver19.htm">Type 19</a> Heath WWV/WWVH Receiver
|
||||
(<tt>WWV_HEATH</tt>)<br>
|
||||
<a href="driver20.htm">Type 20</a> Generic NMEA GPS Receiver
|
||||
(<tt>NMEA</tt>)<br>
|
||||
Type 21 TrueTime GPS-VME Interface (<tt>GPS_VME</tt>)<br>
|
||||
<a href="driver22.htm">Type 22</a> PPS Clock Discipline
|
||||
(<tt>PPS</tt>)<br>
|
||||
<a href="driver23.htm">Type 23</a> PTB Modem Time Service
|
||||
(<tt>ACTS_PTB</tt>)<br>
|
||||
<a href="driver24.htm">Type 24</a> USNO Modem Time Service
|
||||
(<tt>ACTS_USNO</tt>)<br>
|
||||
<a href="driver5.htm">Type 25</a> * TrueTime generic receivers<br>
|
||||
<a href="driver26.htm">Type 26</a> Hewlett Packard 58503A GPS
|
||||
Receiver (<tt>GPS_HP</tt>)<br>
|
||||
<a href="driver27.htm">Type 27</a> Arcron MSF Receiver
|
||||
(<tt>MSF_ARCRON</tt>)<br>
|
||||
<a href="driver28.htm">Type 28</a> Shared Memory Driver
|
||||
(<tt>SHM</tt>)<br>
|
||||
<a href="driver29.htm">Type 29</a> Trimble Navigation Palisade GPS
|
||||
(<tt>GPS_PALISADE</tt>)<br>
|
||||
<a href="driver30.htm">Type 30</a> Motorola UT Oncore GPS
|
||||
(<tt>GPS_ONCORE</tt>)<br>
|
||||
Type 31 Rockwell Jupiter GPS (<tt>GPS_JUPITER</tt>)<br>
|
||||
<a href="driver32.htm">Type 32</a> Chrono-log K-series WWVB
|
||||
receiver (<tt>CHRONOLOG</tt>)<br>
|
||||
<a href="driver33.htm">Type 33</a> Dumb Clock (<tt>DUMBCLOCK</tt>)<br>
|
||||
<a href="driver34.htm">Type 34</a> Ultralink WWVB Receivers (<tt>ULINK</tt>)<br>
|
||||
<a href="driver35.htm">Type 35</a> Conrad Parallel Port Radio Clock
|
||||
(<tt>PCF</tt>)<br>
|
||||
<a href="driver36.htm">Type 36</a> Radio WWV/H Audio
|
||||
Demodulator/Decoder (<tt>WWV</tt>)<br>
|
||||
<a href="driver37.htm">Type 37</a> Forum Graphic GPS Dating station
|
||||
(<tt>FG</tt>)<br>
|
||||
<a href="driver38.htm">Type 38</a> hopf GPS/DCF77 6021/komp for
|
||||
Serial Line (<tt>HOPF_S</tt>)<br>
|
||||
<a href="driver39.htm">Type 39</a> hopf GPS/DCF77 6039 for PCI-Bus
|
||||
(<tt>HOPF_P</tt>)<br>
|
||||
<a href="driver40.htm">Type 40</a> JJY Receivers (<tt>JJY</tt>)<br>
|
||||
</p>
|
||||
|
||||
|
||||
<p>* All TrueTime receivers are now supported by one driver, type
|
||||
5. Types 15 and 25 will be retained only for a limited time and may
|
||||
be reassigned in future.</p>
|
||||
|
||||
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||||
<title>Reference Clock Drivers</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>Reference Clock Drivers</h3>
|
||||
<img align="left" src="pic/stack1a.jpg" alt="gif">
|
||||
Master Time Facility at the <a
|
||||
href="http://www.eecis.udel.edu/%7Emills/lab.htm"> UDel Internet Research
|
||||
Laboratory</a>: <br clear="left">
|
||||
|
||||
<hr>
|
||||
<p>Support for most of the commonly available radio and modem reference clocks
|
||||
is included in the default configuration of the NTP daemon for Unix <tt>ntpd</tt>.
|
||||
Individual clocks can be activated by configuration file commands, specifically
|
||||
the <tt> server</tt> and <tt>fudge</tt> commands described in the <a
|
||||
href="ntpd.htm"><tt>ntpd</tt> program manual page</a>. The following discussion
|
||||
presents Information on how to select and configure the device drivers in
|
||||
a running Unix system.</p>
|
||||
|
||||
<p>Many radio reference clocks can be set to display local time as adjusted
|
||||
for timezone and daylight saving mode. For use with NTP the clock must be
|
||||
set for Coordinated Universal Time (UTC) only. Ordinarily, these adjustments
|
||||
are performed by the kernel, so the fact that the clock runs on UTC will
|
||||
be transparent to the user.</p>
|
||||
|
||||
<p>Radio and modem clocks by convention have addresses in the form 127.127.<i>t.u</i>,
|
||||
where <i>t</i> is the clock type and <i>u</i> is a unit number in the range
|
||||
0-3 used to distinguish multiple instances of clocks of the same type. Most
|
||||
of these clocks require support in the form of a serial port or special bus
|
||||
peripheral, but some can work directly from the audio codec found in some
|
||||
workstations. The particular device is normally specified by adding a soft
|
||||
link <tt>/dev/device<i>u</i></tt> to the particular hardware device involved,
|
||||
where <i><tt>u</tt></i> correspond to the unit number above.</p>
|
||||
|
||||
<p>Most clock drivers communicate with the reference clock using a serial
|
||||
port, usually at 9600 bps. There are several application program interfaces
|
||||
(API) used in the various Unix and NT systems, most of which can be detected
|
||||
at configuration time. Thus, it is important that the NTP daemon and utilities
|
||||
be compiled on the target system or clone. In some cases special features
|
||||
are available, such as timestamping in the kernel or pulse-per-second (PPS)
|
||||
interface. In most cases these features can be detected at configuration
|
||||
time as well; however, the kernel may have to be recompiled in order for
|
||||
them to work.</p>
|
||||
|
||||
<p>The audio drivers are a special case. These include support for the NIST
|
||||
time/frequency stations WWV and WWVH, the Canadian time/frequency station
|
||||
CHU and generic IRIG signals. Currently, support for the Solaris and SunOS
|
||||
audio API is included in the distribution. It is left to the volunteer corps
|
||||
to extend this support to other systems. Further information on hookup, debugging
|
||||
and monitoring is given in the <a href="audio.htm">Audio Drivers</a> page.</p>
|
||||
|
||||
<p>The local clock driver is also a special case. A server configured with
|
||||
this driver can operate as a primary server to synchronize other clients
|
||||
when no other external synchronization sources are available. If the server
|
||||
is connected directly or indirectly to the public Internet, there is some
|
||||
danger that it can adversely affect the operation of unrelated clients. Carefully
|
||||
read the <a href="driver1.htm">Undisciplined Local Clock</a> page and respect
|
||||
the stratum limit.</p>
|
||||
|
||||
<p>The local clock driver also supports an external synchronization source
|
||||
such as a high resolution counter disciplined by a GPS receiver, for example.
|
||||
Further information is on the <a href="extern.htm">External Clock Discipline
|
||||
and the Local Clock Driver</a> page.</p>
|
||||
|
||||
<h4>Driver Calibration</h4>
|
||||
|
||||
<p>Some drivers depending on longwave and shortwave radio services need to
|
||||
know the radio propagation time from the transmitter to the receiver, which
|
||||
can amount to some tens of milliseconds. This must be calculated for each
|
||||
specific receiver location and requires the geographic coordinates of both
|
||||
the transmitter and receiver. The transmitter coordinates for various radio
|
||||
services are given in the <a href="qth.htm">Stations, Frequencies and Geographic
|
||||
Coordinates</a> page. Receiver coordinates can be obtained or estimated from
|
||||
various sources. The actual calculations are beyond the scope of this document.</p>
|
||||
|
||||
<p>When more than one clock driver is supported, it is often the case that
|
||||
each shows small systematic offset differences relative to the rest. To reduce
|
||||
the effects of jitter when switching from one driver to the another, it is
|
||||
useful to calibrate the drivers to a common ensemble offset. The <tt>enable
|
||||
calibrate</tt> configuration command in the <a href="miscopt.htm">Miscellaneous
|
||||
Options</a> page is useful for this purpose. The calibration function can
|
||||
also be enabled and disabled using the <tt>ntpdc</tt> program utility.</p>
|
||||
|
||||
<p>Most clock drivers use the <tt>time1</tt> value specified in the <tt>fudge</tt>
|
||||
configuration command to provide the calibration correction when this cannot
|
||||
be provided by the clock or interface. When the calibration function is enabled,
|
||||
the <tt>time1</tt> value is automatically adjusted to match the offset of
|
||||
the remote server or local clock driver selected for synchronization. Ordinarily,
|
||||
the NTP selection algorithm chooses the best from among all sources, usually
|
||||
the best radio clock determined on the basis of stratum, synchronization
|
||||
distance and jitter. The calibration function adjusts the <tt>time1</tt>
|
||||
values for all clock drivers except this source so that their indicated offsets
|
||||
tend to zero. If the selected source is the kernel PPS discipline, the <tt>fudge
|
||||
time1</tt> values for all clock drivers are adjusted.</p>
|
||||
|
||||
<p>The adjustment function is an exponential average designed to improve
|
||||
accuracy, so the function takes some time to converge. The recommended procedure
|
||||
is to enable the function, let it run for an hour or so, then edit the configuration
|
||||
file using the <tt> time1</tt> values displayed by the <tt>ntpq</tt> utility
|
||||
and <tt> clockvar</tt> command. Finally, disable the calibration function
|
||||
to avoid possible future disruptions due to misbehaving clocks or drivers.</p>
|
||||
|
||||
<h4>Performance Enhancements</h4>
|
||||
|
||||
<p>In general, performance can be improved, especially when more than one
|
||||
clock driver is supported, to use the prefer peer function described in the
|
||||
<a href="prefer.htm">Mitigation Rules and the <tt> prefer</tt> Keyword</a>
|
||||
page. The prefer peer is ordinarily designated the remote peer or local clock
|
||||
driver which provides the best quality time. All other things equal, only
|
||||
the prefer peer source is used to discipline the system clock and jitter-producing
|
||||
"clockhopping" between sources is avoided. This is valuable when more than
|
||||
one clock driver is present and especially valuable when the PPS clock driver
|
||||
(type 22) is used. Support for PPS signals is summarized in the <a
|
||||
href="pps.htm">Pulse-per-second (PPS) Signal Interfacing</a> page.</p>
|
||||
|
||||
<p>Where the highest performance is required, generally better than one millisecond,
|
||||
additional hardware and/or software functions may be required. Kernel modifications
|
||||
for precision time are described in the <a href="kern.htm">A Kernel Model
|
||||
for Precision Timekeeping</a> page. Special line discipline and streams modules
|
||||
for use in capturing precision timestamps are described in the <a
|
||||
href="ldisc.htm">Line Disciplines and Streams Drivers</a> page.</p>
|
||||
|
||||
<h4>Comprehensive List of Clock Drivers</h4>
|
||||
|
||||
<p>Following is a list showing the type and title of each driver currently
|
||||
implemented. The compile-time identifier for each is shown in parentheses.
|
||||
Click on a selected type for specific description and configuration documentation,
|
||||
including the clock address, reference ID, driver ID, device name and serial
|
||||
line speed, and features (line disciplines, etc.). For those drivers without
|
||||
specific documentation, please contact the author listed in the <a
|
||||
href="copyright.htm">Copyright Notice</a> page.</p>
|
||||
|
||||
<p><a href="driver1.htm">Type 1</a> Undisciplined Local Clock (<tt>LOCAL</tt>)<br>
|
||||
<a href="driver2.htm">Type 2</a> Trak 8820 GPS Receiver (<tt>GPS_TRAK</tt>)<br>
|
||||
<a href="driver3.htm">Type 3</a> PSTI/Traconex 1020 WWV/WWVH Receiver (<tt>WWV_PST</tt>)<br>
|
||||
<a href="driver4.htm">Type 4</a> Spectracom WWVB and GPS Receivers (<tt>WWVB_SPEC</tt>)<br>
|
||||
<a href="driver5.htm">Type 5</a> TrueTime GPS/GOES/OMEGA Receivers (<tt>TRUETIME</tt>)<br>
|
||||
<a href="driver6.htm">Type 6</a> IRIG Audio Decoder (<tt>IRIG_AUDIO</tt>)<br>
|
||||
<a href="driver7.htm">Type 7</a> Radio CHU Audio Demodulator/Decoder (<tt>CHU</tt>)<br>
|
||||
<a href="driver8.htm">Type 8</a> Generic Reference Driver (<tt>PARSE</tt>)<br>
|
||||
<a href="driver9.htm">Type 9</a> Magnavox MX4200 GPS Receiver (<tt>GPS_MX4200</tt>)<br>
|
||||
<a href="driver10.htm">Type 10</a> Austron 2200A/2201A GPS Receivers (<tt>GPS_AS2201</tt>)<br>
|
||||
<a href="driver11.htm">Type 11</a> Arbiter 1088A/B GPS Receiver (<tt>GPS_ARBITER</tt>)<br>
|
||||
<a href="driver12.htm">Type 12</a> KSI/Odetics TPRO/S IRIG Interface (<tt>IRIG_TPRO</tt>)<br>
|
||||
Type 13 Leitch CSD 5300 Master Clock Controller (<tt>ATOM_LEITCH</tt>)<br>
|
||||
Type 14 EES M201 MSF Receiver (<tt>MSF_EES</tt>)<br>
|
||||
<a href="driver5.htm">Type 15</a> * TrueTime generic receivers<br>
|
||||
<a href="driver16">Type 16</a> Bancomm GPS/IRIG Receiver (<tt>GPS_BANCOMM</tt>)<br>
|
||||
Type 17 Datum Precision Time System (<tt>GPS_DATUM</tt>)<br>
|
||||
<a href="driver18.htm">Type 18</a> NIST Modem Time Service (<tt>ACTS_NIST</tt>)<br>
|
||||
<a href="driver19.htm">Type 19</a> Heath WWV/WWVH Receiver (<tt>WWV_HEATH</tt>)<br>
|
||||
<a href="driver20.htm">Type 20</a> Generic NMEA GPS Receiver (<tt>NMEA</tt>)<br>
|
||||
Type 21 TrueTime GPS-VME Interface (<tt>GPS_VME</tt>)<br>
|
||||
<a href="driver22.htm">Type 22</a> PPS Clock Discipline (<tt>PPS</tt>)<br>
|
||||
<a href="driver23.htm">Type 23</a> PTB Modem Time Service (<tt>ACTS_PTB</tt>)<br>
|
||||
<a href="driver24.htm">Type 24</a> USNO Modem Time Service (<tt>ACTS_USNO</tt>)<br>
|
||||
<a href="driver5.htm">Type 25</a> * TrueTime generic receivers<br>
|
||||
<a href="driver26.htm">Type 26</a> Hewlett Packard 58503A GPS Receiver (<tt>GPS_HP</tt>)<br>
|
||||
<a href="driver27.htm">Type 27</a> Arcron MSF Receiver (<tt>MSF_ARCRON</tt>)<br>
|
||||
<a href="driver28.htm">Type 28</a> Shared Memory Driver (<tt>SHM</tt>)<br>
|
||||
<a href="driver29.htm">Type 29</a> Trimble Navigation Palisade GPS (<tt>GPS_PALISADE</tt>)<br>
|
||||
<a href="driver30.htm">Type 30</a> Motorola UT Oncore GPS (<tt>GPS_ONCORE</tt>)<br>
|
||||
Type 31 Rockwell Jupiter GPS (<tt>GPS_JUPITER</tt>)<br>
|
||||
<a href="driver32.htm">Type 32</a> Chrono-log K-series WWVB receiver (<tt>CHRONOLOG</tt>)<br>
|
||||
<a href="driver33.htm">Type 33</a> Dumb Clock (<tt>DUMBCLOCK</tt>)<br>
|
||||
<a href="driver34.htm">Type 34</a> Ultralink WWVB Receivers (<tt>ULINK</tt>)<br>
|
||||
<a href="driver35.htm">Type 35</a> Conrad Parallel Port Radio Clock (<tt>PCF</tt>)<br>
|
||||
<a href="driver36.htm">Type 36</a> Radio WWV/H Audio Demodulator/Decoder
|
||||
(<tt>WWV</tt>)<br>
|
||||
<a href="driver37.htm">Type 37</a> Forum Graphic GPS Dating station (<tt>FG</tt>)<br>
|
||||
<a href="driver38.htm">Type 38</a> hopf GPS/DCF77 6021/komp for Serial Line
|
||||
(<tt>HOPF_S</tt>)<br>
|
||||
<a href="driver39.htm">Type 39</a> hopf GPS/DCF77 6039 for PCI-Bus (<tt>HOPF_P</tt>)<br>
|
||||
<a href="driver40.htm">Type 40</a> JJY Receivers (<tt>JJY</tt>)<br>
|
||||
<a href="driver44.htm">Type 44</a> NeoClock4X DCF77 / TDF receiver<br>
|
||||
</p>
|
||||
|
||||
<p>* All TrueTime receivers are now supported by one driver, type 5. Types
|
||||
15 and 25 will be retained only for a limited time and may be reassigned
|
||||
in future.</p>
|
||||
|
||||
<p>Additional Information</p>
|
||||
|
||||
<p><a href="prefer.htm">Mitigation Rules and the <tt>prefer</tt>
|
||||
Keyword</a><br>
|
||||
<a href="rdebug.htm">Debugging Hints for Reference Clock
|
||||
Drivers</a><br>
|
||||
<a href="kern.htm">A Kernel Model for Precision Timekeeping</a><br>
|
||||
<a href="ldisc.htm">Line Disciplines and Streams Drivers</a><br>
|
||||
<a href="audio.htm">Reference Clock Audio Drivers</a><br>
|
||||
<a href="pps.htm">Pulse-per-second (PPS) Signal Interfacing</a><br>
|
||||
<a href="howto.htm">How To Write a Reference Clock Driver</a></p>
|
||||
|
||||
<hr>
|
||||
<a href="index.htm"><img align="left" src="pic/home.gif" alt=
|
||||
"gif"></a>
|
||||
|
||||
<address><a href="mailto:mills@udel.edu">David L. Mills
|
||||
<mills@udel.edu></a></address>
|
||||
|
||||
<p><a href="prefer.htm">Mitigation Rules and the <tt>prefer</tt> Keyword</a><br>
|
||||
<a href="rdebug.htm">Debugging Hints for Reference Clock Drivers</a><br>
|
||||
<a href="kern.htm">A Kernel Model for Precision Timekeeping</a><br>
|
||||
<a href="ldisc.htm">Line Disciplines and Streams Drivers</a><br>
|
||||
<a href="audio.htm">Reference Clock Audio Drivers</a><br>
|
||||
<a href="pps.htm">Pulse-per-second (PPS) Signal Interfacing</a><br>
|
||||
<a href="howto.htm">How To Write a Reference Clock Driver</a></p>
|
||||
|
||||
<hr> <a href="index.htm"><img align="left" src="pic/home.gif" alt="gif">
|
||||
</a>
|
||||
<address><a href="mailto:mills@udel.edu">David L. Mills <mills@udel.edu></a></address>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -235,7 +235,7 @@ extern int toupper P((int));
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef DECL_H_ERRNO
|
||||
#if defined(DECL_H_ERRNO) && !defined(h_errno)
|
||||
extern int h_errno;
|
||||
#endif
|
||||
|
||||
|
@ -458,8 +458,11 @@ struct peer {
|
||||
#define REFCLK_HOPF_SERIAL 38 /* hopf DCF77/GPS serial line receiver */
|
||||
#define REFCLK_HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */
|
||||
#define REFCLK_JJY 40 /* JJY receiver */
|
||||
#define REFCLK_ZYFER 41 /* Zyfer GPStarplus receiver */
|
||||
#define REFCLK_MAX 41 /* Grow as needed... */
|
||||
#define REFCLK_TT560 41 /* TrueTime 560 IRIG-B decoder */
|
||||
#define REFCLK_ZYFER 42 /* Zyfer GPStarplus receiver */
|
||||
#define REFCLK_RIPENCC 43 /* RIPE NCC Trimble driver */
|
||||
#define REFCLK_NEOCLOCK4X 44 /* NeoClock4X DCF77 or TDF receiver */
|
||||
#define REFCLK_MAX 44 /* Grow as needed... */
|
||||
|
||||
/*
|
||||
* We tell reference clocks from real peers by giving the reference
|
||||
|
@ -14,6 +14,7 @@
|
||||
# include <sys/timex.h>
|
||||
#endif
|
||||
|
||||
#ifndef NTP_SYSCALLS_LIBC
|
||||
#ifdef NTP_SYSCALLS_STD
|
||||
# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
|
||||
# define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
|
||||
@ -49,5 +50,6 @@ ntp_gettime(
|
||||
# endif
|
||||
# endif /* !HAVE_ADJTIMEX */
|
||||
#endif /* !NTP_SYSCALLS_STD */
|
||||
#endif /* !NTP_SYSCALLS_LIBC */
|
||||
|
||||
#endif /* NTP_SYSCALL_H */
|
||||
|
@ -1,15 +1,27 @@
|
||||
#! /bin/sh
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
@ -106,6 +118,7 @@ if [ x"$dir_arg" != x ]; then
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
|
@ -92,8 +92,14 @@ struct clktype clktypes[] = {
|
||||
"HOPF_P"},
|
||||
{ REFCLK_JJY, "JJY receiver (40)",
|
||||
"JJY" },
|
||||
{ REFCLK_ZYFER, "Zyfer GPStarplus receiver (41)",
|
||||
{ REFCLK_TT560, "TrueTime 560 IRIG-B decoder (41)",
|
||||
"TT_IRIG"},
|
||||
{ REFCLK_ZYFER, "Zyfer GPStarplus receiver (42)",
|
||||
"GPS_ZYFER" },
|
||||
{ REFCLK_RIPENCC, "RIPE NCC Trimble driver (43)",
|
||||
"GPS_RIPENCC" },
|
||||
{ REFCLK_NEOCLOCK4X, "NeoClock4X DCF77 / TDF receiver (44)",
|
||||
"NEOCLK4X"},
|
||||
{ -1, "", "" }
|
||||
};
|
||||
|
||||
|
@ -117,7 +117,7 @@ void msyslog(int level, const char *fmt, ...)
|
||||
*n++ = '\n';
|
||||
*n = '\0';
|
||||
|
||||
vsprintf(buf, nfmt, ap);
|
||||
vsnprintf(buf, sizeof(buf), nfmt, ap);
|
||||
#if !defined(VMS) && !defined (SYS_VXWORKS)
|
||||
if (syslogit)
|
||||
#ifndef SYS_WINNT
|
||||
|
@ -18,6 +18,11 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
@ -25,6 +30,14 @@ fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
@ -77,7 +90,7 @@ Supported PROGRAM values:
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
@ -86,7 +99,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`configure.in'. You might want to install the
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
@ -95,10 +108,10 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
@ -114,7 +127,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
@ -196,6 +209,11 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id$
|
||||
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
|
@ -37,7 +37,7 @@ ntpd_SOURCES = cmd_args.c jupiter.h map_vme.c ntp_config.c ntp_control.c \
|
||||
refclock_pcf.c refclock_pst.c refclock_ptbacts.c refclock_shm.c \
|
||||
refclock_tpro.c refclock_trak.c refclock_true.c refclock_tt560.c \
|
||||
refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c \
|
||||
refclock_zyfer.c
|
||||
refclock_zyfer.c refclock_ripencc.c refclock_neoclock4x.c
|
||||
|
||||
$(PROGRAMS): $(LDADD)
|
||||
|
||||
|
@ -146,7 +146,7 @@ ntpd_SOURCES = cmd_args.c jupiter.h map_vme.c ntp_config.c ntp_control.c \
|
||||
refclock_pcf.c refclock_pst.c refclock_ptbacts.c refclock_shm.c \
|
||||
refclock_tpro.c refclock_trak.c refclock_true.c refclock_tt560.c \
|
||||
refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c \
|
||||
refclock_zyfer.c
|
||||
refclock_zyfer.c refclock_ripencc.c refclock_neoclock4x.c
|
||||
|
||||
subdir = ntpd
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@ -190,7 +190,8 @@ am_ntpd_OBJECTS = cmd_args$U.$(OBJEXT) map_vme$U.$(OBJEXT) \
|
||||
refclock_trak$U.$(OBJEXT) refclock_true$U.$(OBJEXT) \
|
||||
refclock_tt560$U.$(OBJEXT) refclock_ulink$U.$(OBJEXT) \
|
||||
refclock_usno$U.$(OBJEXT) refclock_wwv$U.$(OBJEXT) \
|
||||
refclock_wwvb$U.$(OBJEXT) refclock_zyfer$U.$(OBJEXT)
|
||||
refclock_wwvb$U.$(OBJEXT) refclock_zyfer$U.$(OBJEXT) \
|
||||
refclock_ripencc$U.$(OBJEXT) refclock_neoclock4x$U.$(OBJEXT)
|
||||
ntpd_OBJECTS = $(am_ntpd_OBJECTS)
|
||||
ntpd_DEPENDENCIES = version.o ../libntp/libntp.a
|
||||
ntpd_LDFLAGS =
|
||||
@ -238,6 +239,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_local$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_msfees$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_mx4200$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_neoclock4x$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_nmea$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_oncore$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_palisade$U.Po \
|
||||
@ -245,6 +247,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_pcf$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_pst$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_ptbacts$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_ripencc$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_shm$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_tpro$U.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/refclock_trak$U.Po \
|
||||
@ -363,6 +366,7 @@ mostlyclean-kr:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_local$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_msfees$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_mx4200$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_neoclock4x$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_nmea$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_oncore$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_palisade$U.Po@am__quote@
|
||||
@ -370,6 +374,7 @@ mostlyclean-kr:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_pcf$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_pst$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_ptbacts$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_ripencc$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_shm$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_tpro$U.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/refclock_trak$U.Po@am__quote@
|
||||
@ -482,6 +487,8 @@ refclock_msfees_.c: refclock_msfees.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_msfees.c; then echo $(srcdir)/refclock_msfees.c; else echo refclock_msfees.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_msfees_.c || rm -f refclock_msfees_.c
|
||||
refclock_mx4200_.c: refclock_mx4200.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_mx4200.c; then echo $(srcdir)/refclock_mx4200.c; else echo refclock_mx4200.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_mx4200_.c || rm -f refclock_mx4200_.c
|
||||
refclock_neoclock4x_.c: refclock_neoclock4x.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_neoclock4x.c; then echo $(srcdir)/refclock_neoclock4x.c; else echo refclock_neoclock4x.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_neoclock4x_.c || rm -f refclock_neoclock4x_.c
|
||||
refclock_nmea_.c: refclock_nmea.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_nmea.c; then echo $(srcdir)/refclock_nmea.c; else echo refclock_nmea.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_nmea_.c || rm -f refclock_nmea_.c
|
||||
refclock_oncore_.c: refclock_oncore.c $(ANSI2KNR)
|
||||
@ -496,6 +503,8 @@ refclock_pst_.c: refclock_pst.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_pst.c; then echo $(srcdir)/refclock_pst.c; else echo refclock_pst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_pst_.c || rm -f refclock_pst_.c
|
||||
refclock_ptbacts_.c: refclock_ptbacts.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_ptbacts.c; then echo $(srcdir)/refclock_ptbacts.c; else echo refclock_ptbacts.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_ptbacts_.c || rm -f refclock_ptbacts_.c
|
||||
refclock_ripencc_.c: refclock_ripencc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_ripencc.c; then echo $(srcdir)/refclock_ripencc.c; else echo refclock_ripencc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_ripencc_.c || rm -f refclock_ripencc_.c
|
||||
refclock_shm_.c: refclock_shm.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_shm.c; then echo $(srcdir)/refclock_shm.c; else echo refclock_shm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_shm_.c || rm -f refclock_shm_.c
|
||||
refclock_tpro_.c: refclock_tpro.c $(ANSI2KNR)
|
||||
@ -534,10 +543,11 @@ refclock_hpgps_.$(OBJEXT) refclock_irig_.$(OBJEXT) \
|
||||
refclock_jjy_.$(OBJEXT) refclock_jupiter_.$(OBJEXT) \
|
||||
refclock_leitch_.$(OBJEXT) refclock_local_.$(OBJEXT) \
|
||||
refclock_msfees_.$(OBJEXT) refclock_mx4200_.$(OBJEXT) \
|
||||
refclock_nmea_.$(OBJEXT) refclock_oncore_.$(OBJEXT) \
|
||||
refclock_palisade_.$(OBJEXT) refclock_parse_.$(OBJEXT) \
|
||||
refclock_pcf_.$(OBJEXT) refclock_pst_.$(OBJEXT) \
|
||||
refclock_ptbacts_.$(OBJEXT) refclock_shm_.$(OBJEXT) \
|
||||
refclock_neoclock4x_.$(OBJEXT) refclock_nmea_.$(OBJEXT) \
|
||||
refclock_oncore_.$(OBJEXT) refclock_palisade_.$(OBJEXT) \
|
||||
refclock_parse_.$(OBJEXT) refclock_pcf_.$(OBJEXT) \
|
||||
refclock_pst_.$(OBJEXT) refclock_ptbacts_.$(OBJEXT) \
|
||||
refclock_ripencc_.$(OBJEXT) refclock_shm_.$(OBJEXT) \
|
||||
refclock_tpro_.$(OBJEXT) refclock_trak_.$(OBJEXT) \
|
||||
refclock_true_.$(OBJEXT) refclock_tt560_.$(OBJEXT) \
|
||||
refclock_ulink_.$(OBJEXT) refclock_usno_.$(OBJEXT) \
|
||||
|
@ -398,6 +398,8 @@ static u_char clocktypes[] = {
|
||||
CTL_SST_TS_LF, /* REFCLK_JJY (40) */
|
||||
CTL_SST_TS_UHF, /* REFCLK_TT560 (41) */
|
||||
CTL_SST_TS_UHF, /* REFCLK_ZYFER (42) */
|
||||
CTL_SST_TS_UHF, /* REFCLK_RIPENCC (43) */
|
||||
CTL_SST_TS_UHF, /* REFCLK_NEOCLOCK4X (44) */
|
||||
};
|
||||
|
||||
|
||||
|
@ -292,7 +292,7 @@ local_clock(
|
||||
step_systime(fp_offset);
|
||||
NLOG(NLOG_SYNCEVENT|NLOG_SYSEVENT)
|
||||
msyslog(LOG_NOTICE, "time set %.6f s", fp_offset);
|
||||
rstclock(S_FREQ, peer->epoch, fp_offset);
|
||||
rstclock(S_FREQ, peer->epoch, 0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
@ -258,6 +258,18 @@ extern struct refclock refclock_zyfer;
|
||||
#define refclock_zyfer refclock_none
|
||||
#endif
|
||||
|
||||
#ifdef CLOCK_RIPENCC
|
||||
extern struct refclock refclock_ripencc;
|
||||
#else
|
||||
#define refclock_ripencc refclock_none
|
||||
#endif
|
||||
|
||||
#ifdef CLOCK_NEOCLOCK4X
|
||||
extern struct refclock refclock_neoclock4x;
|
||||
#else
|
||||
#define refclock_neoclock4x refclock_none
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Order is clock_start(), clock_shutdown(), clock_poll(),
|
||||
* clock_control(), clock_init(), clock_buginfo, clock_flags;
|
||||
@ -307,7 +319,9 @@ struct refclock *refclock_conf[] = {
|
||||
&refclock_hopfpci, /* 39 REFCLK_HOPF_PCI */
|
||||
&refclock_jjy, /* 40 REFCLK_JJY */
|
||||
&refclock_tt560, /* 41 REFCLK_TT560 */
|
||||
&refclock_zyfer /* 42 REFCLK_ZYFER */
|
||||
&refclock_zyfer, /* 42 REFCLK_ZYFER */
|
||||
&refclock_ripencc, /* 43 REFCLK_RIPENCC */
|
||||
&refclock_neoclock4x /* 44 REFCLK_NEOCLOCK4X */
|
||||
};
|
||||
|
||||
u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);
|
||||
|
@ -701,7 +701,7 @@ jjy_poll_cdex_jst2000 ( int unit, struct peer *peer )
|
||||
* Send "<ENQ>1J<ETX>" command
|
||||
*/
|
||||
|
||||
if ( write ( pp->io.fd, "\x051J\x03", 4 ) != 4 ) {
|
||||
if ( write ( pp->io.fd, "\0051J\003", 4 ) != 4 ) {
|
||||
refclock_report ( peer, CEVNT_FAULT ) ;
|
||||
}
|
||||
|
||||
|
@ -252,6 +252,7 @@ local_poll(
|
||||
ext_enable = 0;
|
||||
}
|
||||
#endif /* KERNEL_PLL STA_CLK */
|
||||
pp->lastref = pp->lastrec;
|
||||
refclock_receive(peer);
|
||||
pp->fudgetime1 = 0;
|
||||
}
|
||||
|
864
contrib/ntp/ntpd/refclock_neoclock4x.c
Normal file
864
contrib/ntp/ntpd/refclock_neoclock4x.c
Normal file
@ -0,0 +1,864 @@
|
||||
/*
|
||||
*
|
||||
* refclock_neoclock4x.c
|
||||
* - NeoClock4X driver for DCF77 or FIA Timecode
|
||||
*
|
||||
* Date: 2002-04-27 1.0
|
||||
*
|
||||
* see http://www.linum.com/redir/jump/id=neoclock4x&action=redir
|
||||
* for details about the NeoClock4X device
|
||||
*
|
||||
* Copyright (C) 2002 by Linum Software GmbH <support@linum.com>
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(REFCLOCK) && (defined(CLOCK_NEOCLOCK4X))
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "ntpd.h"
|
||||
#include "ntp_io.h"
|
||||
#include "ntp_control.h"
|
||||
#include "ntp_refclock.h"
|
||||
#include "ntp_unixtime.h"
|
||||
#include "ntp_stdlib.h"
|
||||
|
||||
#if defined HAVE_SYS_MODEM_H
|
||||
# include <sys/modem.h>
|
||||
# define TIOCMSET MCSETA
|
||||
# define TIOCMGET MCGETA
|
||||
# define TIOCM_RTS MRTS
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# ifdef TERMIOS_NEEDS__SVID3
|
||||
# define _SVID3
|
||||
# endif
|
||||
# include <termios.h>
|
||||
# ifdef TERMIOS_NEEDS__SVID3
|
||||
# undef _SVID3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#define NEOCLOCK4X_TIMECODELEN 37
|
||||
|
||||
#define NEOCLOCK4X_OFFSET_SERIAL 3
|
||||
#define NEOCLOCK4X_OFFSET_RADIOSIGNAL 9
|
||||
#define NEOCLOCK4X_OFFSET_DAY 12
|
||||
#define NEOCLOCK4X_OFFSET_MONTH 14
|
||||
#define NEOCLOCK4X_OFFSET_YEAR 16
|
||||
#define NEOCLOCK4X_OFFSET_HOUR 18
|
||||
#define NEOCLOCK4X_OFFSET_MINUTE 20
|
||||
#define NEOCLOCK4X_OFFSET_SECOND 22
|
||||
#define NEOCLOCK4X_OFFSET_HSEC 24
|
||||
#define NEOCLOCK4X_OFFSET_DOW 26
|
||||
#define NEOCLOCK4X_OFFSET_TIMESOURCE 28
|
||||
#define NEOCLOCK4X_OFFSET_DSTSTATUS 29
|
||||
#define NEOCLOCK4X_OFFSET_QUARZSTATUS 30
|
||||
#define NEOCLOCK4X_OFFSET_ANTENNA1 31
|
||||
#define NEOCLOCK4X_OFFSET_ANTENNA2 33
|
||||
#define NEOCLOCK4X_OFFSET_CRC 35
|
||||
|
||||
struct neoclock4x_unit {
|
||||
l_fp laststamp; /* last receive timestamp */
|
||||
short unit; /* NTP refclock unit number */
|
||||
u_long polled; /* flag to detect noreplies */
|
||||
char leap_status; /* leap second flag */
|
||||
int recvnow;
|
||||
|
||||
char firmware[80];
|
||||
char serial[7];
|
||||
char radiosignal[4];
|
||||
char timesource;
|
||||
char dststatus;
|
||||
char quarzstatus;
|
||||
int antenna1;
|
||||
int antenna2;
|
||||
int utc_year;
|
||||
int utc_month;
|
||||
int utc_day;
|
||||
int utc_hour;
|
||||
int utc_minute;
|
||||
int utc_second;
|
||||
int utc_msec;
|
||||
};
|
||||
|
||||
static int neoclock4x_start P((int, struct peer *));
|
||||
static void neoclock4x_shutdown P((int, struct peer *));
|
||||
static void neoclock4x_receive P((struct recvbuf *));
|
||||
static void neoclock4x_poll P((int, struct peer *));
|
||||
static void neoclock4x_control P((int, struct refclockstat *, struct refclockstat *, struct peer *));
|
||||
|
||||
static int neol_atoi_len P((const char str[], int *, int));
|
||||
static int neol_hexatoi_len P((const char str[], int *, int));
|
||||
static void neol_jdn_to_ymd P((unsigned long, int *, int *, int *));
|
||||
static void neol_localtime P((unsigned long, int* , int*, int*, int*, int*, int*));
|
||||
static unsigned long neol_mktime P((int, int, int, int, int, int));
|
||||
static void neol_mdelay P((int));
|
||||
static int neol_query_firmware P((int, int, char *, int));
|
||||
|
||||
struct refclock refclock_neoclock4x = {
|
||||
neoclock4x_start, /* start up driver */
|
||||
neoclock4x_shutdown, /* shut down driver */
|
||||
neoclock4x_poll, /* transmit poll message */
|
||||
neoclock4x_control,
|
||||
noentry, /* initialize driver (not used) */
|
||||
noentry, /* not used */
|
||||
NOFLAGS /* not used */
|
||||
};
|
||||
|
||||
static int
|
||||
neoclock4x_start(int unit,
|
||||
struct peer *peer)
|
||||
{
|
||||
struct neoclock4x_unit *up;
|
||||
struct refclockproc *pp;
|
||||
int fd;
|
||||
char dev[20];
|
||||
int sl232;
|
||||
struct termios termsettings;
|
||||
int tries;
|
||||
|
||||
(void) sprintf(dev, "/dev/neoclock4x-%d", unit);
|
||||
|
||||
/* LDISC_STD, LDISC_RAW
|
||||
* Open serial port. Use CLK line discipline, if available.
|
||||
*/
|
||||
fd = refclock_open(dev, B2400, LDISC_CLK);
|
||||
if(fd <= 0)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
|
||||
/* turn on RTS, and DTR for power supply */
|
||||
/* NeoClock4x is powered from serial line */
|
||||
if(ioctl(fd, TIOCMGET, (caddr_t)&sl232) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m", unit);
|
||||
}
|
||||
#ifdef TIOCM_RTS
|
||||
sl232 = sl232 | TIOCM_DTR | TIOCM_RTS; /* turn on RTS, and DTR for power supply */
|
||||
#else
|
||||
sl232 = sl232 | CIOCM_DTR | CIOCM_RTS; /* turn on RTS, and DTR for power supply */
|
||||
#endif
|
||||
if(ioctl(fd, TIOCMSET, (caddr_t)&sl232) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m", unit);
|
||||
}
|
||||
|
||||
if(ioctl(fd, TCGETS, (caddr_t)&termsettings) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't query serial port settings: %m", unit);
|
||||
}
|
||||
|
||||
/* 2400 Baud mit 8N2 */
|
||||
termsettings.c_cflag &= ~PARENB;
|
||||
termsettings.c_cflag |= CSTOPB;
|
||||
termsettings.c_cflag &= ~CSIZE;
|
||||
termsettings.c_cflag |= CS8;
|
||||
|
||||
if(ioctl(fd, TCSETS, &termsettings) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't set serial port to 2400 8N2: %m", unit);
|
||||
}
|
||||
#else
|
||||
msyslog(LOG_EMERG, "NeoClock4X(%d): OS interface is incapable of setting DTR/RTS to power NeoClock4X",
|
||||
unit);
|
||||
#endif
|
||||
|
||||
up = (struct neoclock4x_unit *) emalloc(sizeof(struct neoclock4x_unit));
|
||||
if(!(up))
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): can't allocate memory for: %m",unit);
|
||||
(void) close(fd);
|
||||
return (0);
|
||||
}
|
||||
|
||||
memset((char *)up, 0, sizeof(struct neoclock4x_unit));
|
||||
pp = peer->procptr;
|
||||
pp->clockdesc = "NeoClock4X";
|
||||
pp->unitptr = (caddr_t)up;
|
||||
pp->io.clock_recv = neoclock4x_receive;
|
||||
pp->io.srcclock = (caddr_t)peer;
|
||||
pp->io.datalen = 0;
|
||||
pp->io.fd = fd;
|
||||
/* no time is given by user! use 169.583333 ms to compensate the serial line delay
|
||||
* formula is:
|
||||
* 2400 Baud / 11 bit = 218.18 charaters per second
|
||||
* (NeoClock4X timecode len)
|
||||
*/
|
||||
pp->fudgetime1 = (NEOCLOCK4X_TIMECODELEN * 11) / 2400.0;
|
||||
|
||||
if (!io_addclock(&pp->io))
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): error add peer to ntpd: %m",unit);
|
||||
(void) close(fd);
|
||||
free(up);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize miscellaneous variables
|
||||
*/
|
||||
peer->precision = -10;
|
||||
peer->burst = NSTAGE;
|
||||
memcpy((char *)&pp->refid, "neol", 4);
|
||||
|
||||
up->leap_status = 0;
|
||||
up->unit = unit;
|
||||
strcpy(up->firmware, "?");
|
||||
strcpy(up->serial, "?");
|
||||
strcpy(up->radiosignal, "?");
|
||||
up->timesource = '?';
|
||||
up->dststatus = '?';
|
||||
up->quarzstatus = '?';
|
||||
up->antenna1 = -1;
|
||||
up->antenna2 = -1;
|
||||
up->utc_year = 0;
|
||||
up->utc_month = 0;
|
||||
up->utc_day = 0;
|
||||
up->utc_hour = 0;
|
||||
up->utc_minute = 0;
|
||||
up->utc_second = 0;
|
||||
up->utc_msec = 0;
|
||||
|
||||
for(tries=0; tries < 5; tries++)
|
||||
{
|
||||
/*
|
||||
* Wait 3 second for receiver to power up
|
||||
*/
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_INFO, "NeoClock4X(%d): try query NeoClock4X firmware version (%d/5)", unit, tries);
|
||||
sleep(3);
|
||||
if(neol_query_firmware(pp->io.fd, up->unit, up->firmware, sizeof(up->firmware)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_INFO, "NeoClock4X(%d): receiver setup successful done", unit);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
static void
|
||||
neoclock4x_shutdown(int unit,
|
||||
struct peer *peer)
|
||||
{
|
||||
struct neoclock4x_unit *up;
|
||||
struct refclockproc *pp;
|
||||
int sl232;
|
||||
|
||||
pp = peer->procptr;
|
||||
up = (struct neoclock4x_unit *)pp->unitptr;
|
||||
|
||||
#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
|
||||
/* turn on RTS, and DTR for power supply */
|
||||
/* NeoClock4x is powered from serial line */
|
||||
if(ioctl(pp->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m", unit);
|
||||
}
|
||||
#ifdef TIOCM_RTS
|
||||
sl232 &= ~(TIOCM_DTR | TIOCM_RTS); /* turn on RTS, and DTR for power supply */
|
||||
#else
|
||||
sl232 &= ~(CIOCM_DTR | CIOCM_RTS); /* turn on RTS, and DTR for power supply */
|
||||
#endif
|
||||
if(ioctl(pp->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
|
||||
{
|
||||
msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m", unit);
|
||||
}
|
||||
#endif
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): shutdown", unit);
|
||||
|
||||
io_closeclock(&pp->io);
|
||||
free(up);
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_INFO, "NeoClock4X(%d): receiver shutdown done", unit);
|
||||
}
|
||||
|
||||
static void
|
||||
neoclock4x_receive(struct recvbuf *rbufp)
|
||||
{
|
||||
struct neoclock4x_unit *up;
|
||||
struct refclockproc *pp;
|
||||
struct peer *peer;
|
||||
unsigned long calc_utc;
|
||||
int day;
|
||||
int month; /* ddd conversion */
|
||||
int c;
|
||||
unsigned char calc_chksum;
|
||||
int recv_chksum;
|
||||
|
||||
peer = (struct peer *)rbufp->recv_srcclock;
|
||||
pp = peer->procptr;
|
||||
up = (struct neoclock4x_unit *)pp->unitptr;
|
||||
|
||||
/* wait till poll interval is reached */
|
||||
if(0 == up->recvnow)
|
||||
return;
|
||||
|
||||
/* reset poll interval flag */
|
||||
up->recvnow = 0;
|
||||
|
||||
/* read last received timecode */
|
||||
pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);
|
||||
|
||||
if(NEOCLOCK4X_TIMECODELEN != pp->lencode)
|
||||
{
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid length, expected %d bytes, received %d bytes: %s",
|
||||
up->unit, NEOCLOCK4X_TIMECODELEN, pp->lencode, pp->a_lastcode);
|
||||
refclock_report(peer, CEVNT_BADREPLY);
|
||||
return;
|
||||
}
|
||||
|
||||
neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_CRC], &recv_chksum, 2);
|
||||
|
||||
/* calculate checksum */
|
||||
calc_chksum = 0;
|
||||
for(c=0; c < NEOCLOCK4X_OFFSET_CRC; c++)
|
||||
{
|
||||
calc_chksum += pp->a_lastcode[c];
|
||||
}
|
||||
if(recv_chksum != calc_chksum)
|
||||
{
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid chksum: %s",
|
||||
up->unit, pp->a_lastcode);
|
||||
refclock_report(peer, CEVNT_BADREPLY);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Allow synchronization even is quartz clock is
|
||||
* never initialized.
|
||||
* WARNING: This is dangerous!
|
||||
*/
|
||||
up->quarzstatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_QUARZSTATUS];
|
||||
if(0==(pp->sloppyclockflag & CLK_FLAG2))
|
||||
{
|
||||
if('I' != up->quarzstatus)
|
||||
{
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is not initialized: %s",
|
||||
up->unit, pp->a_lastcode);
|
||||
pp->leap = LEAP_NOTINSYNC;
|
||||
refclock_report(peer, CEVNT_BADDATE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if('I' != up->quarzstatus)
|
||||
{
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_NOTICE, "NeoClock4X(%d): using uninitialized quartz clock for time synchronization: %s",
|
||||
up->unit, pp->a_lastcode);
|
||||
}
|
||||
|
||||
/*
|
||||
* If NeoClock4X is not synchronized to a radio clock
|
||||
* check if we're allowed to synchronize with the quartz
|
||||
* clock.
|
||||
*/
|
||||
up->timesource = pp->a_lastcode[NEOCLOCK4X_OFFSET_TIMESOURCE];
|
||||
if(0==(pp->sloppyclockflag & CLK_FLAG2))
|
||||
{
|
||||
if('A' != up->timesource)
|
||||
{
|
||||
/* not allowed to sync with quartz clock */
|
||||
if(0==(pp->sloppyclockflag & CLK_FLAG1))
|
||||
{
|
||||
refclock_report(peer, CEVNT_BADTIME);
|
||||
pp->leap = LEAP_NOTINSYNC;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* this should only used when first install is done */
|
||||
if(pp->sloppyclockflag & CLK_FLAG4)
|
||||
{
|
||||
msyslog(LOG_DEBUG, "NeoClock4X(%d): received data: %s",
|
||||
up->unit, pp->a_lastcode);
|
||||
}
|
||||
|
||||
/* 123456789012345678901234567890123456789012345 */
|
||||
/* S/N123456DCF1004021010001202ASX1213CR\r\n */
|
||||
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_YEAR], &pp->year, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MONTH], &month, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_DAY], &day, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HOUR], &pp->hour, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MINUTE], &pp->minute, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_SECOND], &pp->second, 2);
|
||||
neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HSEC], &pp->msec, 2);
|
||||
pp->msec *= 10; /* convert 1/100s from neoclock to real miliseconds */
|
||||
|
||||
memcpy(up->radiosignal, &pp->a_lastcode[NEOCLOCK4X_OFFSET_RADIOSIGNAL], 3);
|
||||
up->radiosignal[3] = 0;
|
||||
memcpy(up->serial, &pp->a_lastcode[NEOCLOCK4X_OFFSET_SERIAL], 6);
|
||||
up->serial[6] = 0;
|
||||
up->dststatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_DSTSTATUS];
|
||||
neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA1], &up->antenna1, 2);
|
||||
neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA2], &up->antenna2, 2);
|
||||
|
||||
/*
|
||||
Validate received values at least enough to prevent internal
|
||||
array-bounds problems, etc.
|
||||
*/
|
||||
if((pp->hour < 0) || (pp->hour > 23) ||
|
||||
(pp->minute < 0) || (pp->minute > 59) ||
|
||||
(pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
|
||||
(day < 1) || (day > 31) ||
|
||||
(month < 1) || (month > 12) ||
|
||||
(pp->year < 0) || (pp->year > 99)) {
|
||||
/* Data out of range. */
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_WARNING, "NeoClock4X(%d): date/time out of range: %s",
|
||||
up->unit, pp->a_lastcode);
|
||||
refclock_report(peer, CEVNT_BADDATE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Year-2000 check! */
|
||||
/* wrap 2-digit date into 4-digit */
|
||||
|
||||
if(pp->year < YEAR_PIVOT) /* < 98 */
|
||||
{
|
||||
pp->year += 100;
|
||||
}
|
||||
pp->year += 1900;
|
||||
|
||||
calc_utc = neol_mktime(pp->year, month, day, pp->hour, pp->minute, pp->second);
|
||||
calc_utc -= 3600;
|
||||
if('S' == up->dststatus)
|
||||
calc_utc -= 3600;
|
||||
neol_localtime(calc_utc, &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second);
|
||||
|
||||
/*
|
||||
some preparations
|
||||
*/
|
||||
pp->day = ymd2yd(pp->year,month,day);
|
||||
pp->leap = 0;
|
||||
|
||||
|
||||
if(pp->sloppyclockflag & CLK_FLAG4)
|
||||
{
|
||||
msyslog(LOG_DEBUG, "NeoClock4X(%d): calculated UTC date/time: %04d-%02d-%02d %02d:%02d:%02d.%03d",
|
||||
up->unit,
|
||||
pp->year, month, day,
|
||||
pp->hour, pp->minute, pp->second, pp->msec);
|
||||
}
|
||||
|
||||
up->utc_year = pp->year;
|
||||
up->utc_month = month;
|
||||
up->utc_day = day;
|
||||
up->utc_hour = pp->hour;
|
||||
up->utc_minute = pp->minute;
|
||||
up->utc_second = pp->second;
|
||||
up->utc_msec = pp->msec;
|
||||
|
||||
if(!refclock_process(pp))
|
||||
{
|
||||
NLOG(NLOG_CLOCKEVENT)
|
||||
msyslog(LOG_WARNING, "NeoClock4X(%d): refclock_process failed!", up->unit);
|
||||
refclock_report(peer, CEVNT_FAULT);
|
||||
return;
|
||||
}
|
||||
refclock_receive(peer);
|
||||
|
||||
record_clock_stats(&peer->srcadr, pp->a_lastcode);
|
||||
}
|
||||
|
||||
static void
|
||||
neoclock4x_poll(int unit,
|
||||
struct peer *peer)
|
||||
{
|
||||
struct neoclock4x_unit *up;
|
||||
struct refclockproc *pp;
|
||||
|
||||
pp = peer->procptr;
|
||||
up = (struct neoclock4x_unit *)pp->unitptr;
|
||||
|
||||
pp->polls++;
|
||||
up->recvnow = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
neoclock4x_control(int unit,
|
||||
struct refclockstat *in,
|
||||
struct refclockstat *out,
|
||||
struct peer *peer)
|
||||
{
|
||||
struct neoclock4x_unit *up;
|
||||
struct refclockproc *pp;
|
||||
|
||||
if(NULL == peer)
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
|
||||
return;
|
||||
}
|
||||
|
||||
pp = peer->procptr;
|
||||
if(NULL == pp)
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
|
||||
return;
|
||||
}
|
||||
|
||||
up = (struct neoclock4x_unit *)pp->unitptr;
|
||||
if(NULL == up)
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
|
||||
return;
|
||||
}
|
||||
|
||||
if(NULL != in)
|
||||
{
|
||||
/* check to see if a user supplied time offset is given */
|
||||
if(in->haveflags & CLK_HAVETIME1)
|
||||
{
|
||||
pp->fudgetime1 = in->fudgetime1;
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_NOTICE, "NeoClock4X(%d): using fudgetime1 with %0.5fs from ntp.conf.",
|
||||
unit, pp->fudgetime1);
|
||||
}
|
||||
|
||||
/* notify */
|
||||
if(pp->sloppyclockflag & CLK_FLAG1)
|
||||
{
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is used to synchronize time if radio clock has no reception.", unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_NOTICE, "NeoClock4X(%d): time is only adjusted with radio signal reception.", unit);
|
||||
}
|
||||
}
|
||||
|
||||
if(NULL != out)
|
||||
{
|
||||
static char outstatus[800]; /* status output buffer */
|
||||
char *tt;
|
||||
char tmpbuf[80];
|
||||
|
||||
outstatus[0] = '\0';
|
||||
out->kv_list = (struct ctl_var *)0;
|
||||
out->type = REFCLK_NEOCLOCK4X;
|
||||
|
||||
sprintf(tmpbuf, "%04d-%02d-%02d %02d:%02d:%02d.%03d",
|
||||
up->utc_year, up->utc_month, up->utc_day,
|
||||
up->utc_hour, up->utc_minute, up->utc_second,
|
||||
up->utc_msec);
|
||||
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "calc_utc=\"%s\"", tmpbuf);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "radiosignal=\"%s\"", up->radiosignal);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "antenna1=\"%d\"", up->antenna1);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "antenna2=\"%d\"", up->antenna2);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
if('A' == up->timesource)
|
||||
tt += sprintf(tt, "timesource=\"radio\"");
|
||||
else if('C' == up->timesource)
|
||||
tt += sprintf(tt, "timesource=\"quartz\"");
|
||||
else
|
||||
tt += sprintf(tt, "timesource=\"unknown\"");
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
if('I' == up->quarzstatus)
|
||||
tt += sprintf(tt, "quartzstatus=\"synchronized\"");
|
||||
else if('X' == up->quarzstatus)
|
||||
tt += sprintf(tt, "quartzstatus=\"not synchronized\"");
|
||||
else
|
||||
tt += sprintf(tt, "quartzstatus=\"unknown\"");
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
if('S' == up->dststatus)
|
||||
tt += sprintf(tt, "dststatus=\"summer\"");
|
||||
else if('W' == up->dststatus)
|
||||
tt += sprintf(tt, "dststatus=\"winter\"");
|
||||
else
|
||||
tt += sprintf(tt, "dststatus=\"unknown\"");
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "firmware=\"%s\"", up->firmware);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
tt += sprintf(tt, "serialnumber=\"%s\"", up->serial);
|
||||
tt = add_var(&out->kv_list, 512, RO|DEF);
|
||||
}
|
||||
}
|
||||
|
||||
static int neol_hexatoi_len(const char str[],
|
||||
int *result,
|
||||
int maxlen)
|
||||
{
|
||||
int hexdigit;
|
||||
int i;
|
||||
int n = 0;
|
||||
|
||||
for(i=0; isxdigit(str[i]) && i < maxlen; i++)
|
||||
{
|
||||
hexdigit = isdigit(str[i]) ? toupper(str[i]) - '0' : toupper(str[i]) - 'A' + 10;
|
||||
n = 16 * n + hexdigit;
|
||||
}
|
||||
*result = n;
|
||||
return (n);
|
||||
}
|
||||
|
||||
int neol_atoi_len(const char str[],
|
||||
int *result,
|
||||
int maxlen)
|
||||
{
|
||||
int digit;
|
||||
int i;
|
||||
int n = 0;
|
||||
|
||||
for(i=0; isdigit(str[i]) && i < maxlen; i++)
|
||||
{
|
||||
digit = str[i] - '0';
|
||||
n = 10 * n + digit;
|
||||
}
|
||||
*result = n;
|
||||
return (n);
|
||||
}
|
||||
|
||||
/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
|
||||
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
|
||||
* => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
|
||||
*
|
||||
* [For the Julian calendar (which was used in Russia before 1917,
|
||||
* Britain & colonies before 1752, anywhere else before 1582,
|
||||
* and is still in use by some communities) leave out the
|
||||
* -year/100+year/400 terms, and add 10.]
|
||||
*
|
||||
* This algorithm was first published by Gauss (I think).
|
||||
*
|
||||
* WARNING: this function will overflow on 2106-02-07 06:28:16 on
|
||||
* machines were long is 32-bit! (However, as time_t is signed, we
|
||||
* will already get problems at other places on 2038-01-19 03:14:08)
|
||||
*/
|
||||
static unsigned long neol_mktime(int year,
|
||||
int mon,
|
||||
int day,
|
||||
int hour,
|
||||
int min,
|
||||
int sec)
|
||||
{
|
||||
if (0 >= (int) (mon -= 2)) { /* 1..12 . 11,12,1..10 */
|
||||
mon += 12; /* Puts Feb last since it has leap day */
|
||||
year -= 1;
|
||||
}
|
||||
return (((
|
||||
(unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
|
||||
year*365 - 719499
|
||||
)*24 + hour /* now have hours */
|
||||
)*60 + min /* now have minutes */
|
||||
)*60 + sec; /* finally seconds */
|
||||
}
|
||||
|
||||
static void neol_localtime(unsigned long utc,
|
||||
int* year,
|
||||
int* month,
|
||||
int* day,
|
||||
int* hour,
|
||||
int* minute,
|
||||
int* second)
|
||||
{
|
||||
ldiv_t d;
|
||||
|
||||
/* Sekunden */
|
||||
d = ldiv(utc, 60);
|
||||
*second = d.rem;
|
||||
|
||||
/* Minute */
|
||||
d = ldiv(d.quot, 60);
|
||||
*minute = d.rem;
|
||||
|
||||
/* Stunden */
|
||||
d = ldiv(d.quot, 24);
|
||||
*hour = d.rem;
|
||||
|
||||
/* JDN Date 1/1/1970 */
|
||||
neol_jdn_to_ymd(d.quot + 2440588L, year, month, day);
|
||||
}
|
||||
|
||||
static void neol_jdn_to_ymd(unsigned long jdn,
|
||||
int *yy,
|
||||
int *mm,
|
||||
int *dd)
|
||||
{
|
||||
unsigned long x, z, m, d, y;
|
||||
unsigned long daysPer400Years = 146097UL;
|
||||
unsigned long fudgedDaysPer4000Years = 1460970UL + 31UL;
|
||||
|
||||
x = jdn + 68569UL;
|
||||
z = 4UL * x / daysPer400Years;
|
||||
x = x - (daysPer400Years * z + 3UL) / 4UL;
|
||||
y = 4000UL * (x + 1) / fudgedDaysPer4000Years;
|
||||
x = x - 1461UL * y / 4UL + 31UL;
|
||||
m = 80UL * x / 2447UL;
|
||||
d = x - 2447UL * m / 80UL;
|
||||
x = m / 11UL;
|
||||
m = m + 2UL - 12UL * x;
|
||||
y = 100UL * (z - 49UL) + y + x;
|
||||
|
||||
*yy = (int)y;
|
||||
*mm = (int)m;
|
||||
*dd = (int)d;
|
||||
}
|
||||
|
||||
/*
|
||||
* delay in milliseconds
|
||||
*/
|
||||
static void
|
||||
neol_mdelay(int milliseconds)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (milliseconds)
|
||||
{
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = milliseconds * 1000;
|
||||
select(1, NULL, NULL, NULL, &tv);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
neol_query_firmware(int fd,
|
||||
int unit,
|
||||
char *firmware,
|
||||
int maxlen)
|
||||
{
|
||||
unsigned char tmpbuf[256];
|
||||
int len;
|
||||
int lastsearch;
|
||||
unsigned char c;
|
||||
int last_c_was_crlf;
|
||||
int last_crlf_conv_len;
|
||||
int init;
|
||||
int read_tries;
|
||||
int flag = 0;
|
||||
|
||||
/* wait a little bit */
|
||||
neol_mdelay(250);
|
||||
if(-1 != write(fd, "V", 1))
|
||||
{
|
||||
/* wait a little bit */
|
||||
neol_mdelay(250);
|
||||
memset(tmpbuf, 0x00, sizeof(tmpbuf));
|
||||
|
||||
len = 0;
|
||||
lastsearch = 0;
|
||||
last_c_was_crlf = 0;
|
||||
last_crlf_conv_len = 0;
|
||||
init = 1;
|
||||
read_tries = 0;
|
||||
for(;;)
|
||||
{
|
||||
if(read_tries++ > 500)
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): can't read firmware version (timeout)", unit);
|
||||
strcpy(tmpbuf, "unknown due to timeout");
|
||||
break;
|
||||
}
|
||||
if(-1 == read(fd, &c, 1))
|
||||
{
|
||||
neol_mdelay(25);
|
||||
continue;
|
||||
}
|
||||
if(init)
|
||||
{
|
||||
if(0xA9 != c) /* wait for (c) char in input stream */
|
||||
continue;
|
||||
|
||||
strcpy(tmpbuf, "(c)");
|
||||
len = 3;
|
||||
init = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
//msyslog(LOG_NOTICE, "NeoClock4X(%d): firmware %c = %02Xh", unit, c, c);
|
||||
if(0x0A == c || 0x0D == c)
|
||||
{
|
||||
if(last_c_was_crlf)
|
||||
{
|
||||
char *ptr;
|
||||
ptr = strstr(&tmpbuf[lastsearch], "S/N");
|
||||
if(NULL != ptr)
|
||||
{
|
||||
tmpbuf[last_crlf_conv_len] = 0;
|
||||
flag = 1;
|
||||
break;
|
||||
}
|
||||
/* convert \n to / */
|
||||
last_crlf_conv_len = len;
|
||||
tmpbuf[len++] = ' ';
|
||||
tmpbuf[len++] = '/';
|
||||
tmpbuf[len++] = ' ';
|
||||
lastsearch = len;
|
||||
}
|
||||
last_c_was_crlf = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
last_c_was_crlf = 0;
|
||||
if(0x00 != c)
|
||||
tmpbuf[len++] = c;
|
||||
}
|
||||
tmpbuf[len] = '\0';
|
||||
if(len > sizeof(tmpbuf)-5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msyslog(LOG_ERR, "NeoClock4X(%d): can't query firmware version", unit);
|
||||
strcpy(tmpbuf, "unknown error");
|
||||
}
|
||||
strncpy(firmware, tmpbuf, maxlen);
|
||||
firmware[maxlen] = '\0';
|
||||
|
||||
if(flag)
|
||||
{
|
||||
NLOG(NLOG_CLOCKINFO)
|
||||
msyslog(LOG_INFO, "NeoClock4X(%d): firmware version: %s", unit, firmware);
|
||||
}
|
||||
|
||||
return (flag);
|
||||
}
|
||||
|
||||
#else
|
||||
int refclock_neoclock4x_bs;
|
||||
#endif /* REFCLOCK */
|
||||
|
||||
/*
|
||||
* History:
|
||||
* refclock_neoclock4x.c
|
||||
*
|
||||
* 2002/04/27 cjh
|
||||
* Revision 1.0 first release
|
||||
*
|
||||
* 2002/0715 cjh
|
||||
* preparing for bitkeeper reposity
|
||||
*
|
||||
*/
|
4872
contrib/ntp/ntpd/refclock_ripencc.c
Normal file
4872
contrib/ntp/ntpd/refclock_ripencc.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -233,7 +233,7 @@ zyfer_receive(
|
||||
* - wait for more data
|
||||
* Crack the beast, and if it's OK, process it.
|
||||
*
|
||||
* We use refclock_getlin() because we might use LDISC_CLK.
|
||||
* We use refclock_gtlin() because we might use LDISC_CLK.
|
||||
*
|
||||
* Under FreeBSD, we get the ! followed by two 14-byte packets.
|
||||
*/
|
||||
|
@ -1248,7 +1248,7 @@ clock_adjust(void)
|
||||
absoffset = server->soffset;
|
||||
if (absoffset < 0)
|
||||
absoffset = -absoffset;
|
||||
dostep = (absoffset >= NTPDATE_THRESHOLD);
|
||||
dostep = (absoffset >= NTPDATE_THRESHOLD || absoffset < 0);
|
||||
}
|
||||
|
||||
if (dostep) {
|
||||
|
@ -108,7 +108,9 @@
|
||||
#define dprintf(_x_)
|
||||
#endif
|
||||
|
||||
#ifdef DECL_ERRNO
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* display received data (avoids also detaching from tty)
|
||||
@ -728,7 +730,7 @@ cvt_rawdcf(
|
||||
* convert a wall clock time description of DCF77 to a Unix time (seconds
|
||||
* since 1.1. 1970 UTC)
|
||||
*/
|
||||
time_t
|
||||
static time_t
|
||||
dcf_to_unixtime(
|
||||
clocktime_t *clock_time,
|
||||
unsigned *cvtrtc
|
||||
@ -1083,7 +1085,7 @@ periodic_adjust(
|
||||
*/
|
||||
static void
|
||||
tick(
|
||||
void
|
||||
int signum
|
||||
)
|
||||
{
|
||||
static unsigned long last_notice = 0;
|
||||
@ -1217,7 +1219,7 @@ usage(
|
||||
* check_y2k() - internal check of Y2K logic
|
||||
* (a lot of this logic lifted from ../ntpd/check_y2k.c)
|
||||
*/
|
||||
int
|
||||
static int
|
||||
check_y2k( void )
|
||||
{
|
||||
int year; /* current working year */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. */
|
||||
/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
|
||||
|
||||
/*$Id$*/
|
||||
/*$Id: ansi2knr.c,v 1.3 2000/04/13 03:41:48 lpd Exp $*/
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
@ -61,6 +61,25 @@ program under the GPL.
|
||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||
* <ghost@aladdin.com>. Other authors are noted in the change history
|
||||
* that follows (in reverse chronological order):
|
||||
|
||||
lpd 2000-04-12 backs out Eggert's changes because of bugs:
|
||||
- concatlits didn't declare the type of its bufend argument;
|
||||
- concatlits didn't't recognize when it was inside a comment;
|
||||
- scanstring could scan backward past the beginning of the string; when
|
||||
- the check for \ + newline in scanstring was unnecessary.
|
||||
|
||||
2000-03-05 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Add support for concatenated string literals.
|
||||
* ansi2knr.c (concatlits): New decl.
|
||||
(main): Invoke concatlits to concatenate string literals.
|
||||
(scanstring): Handle backslash-newline correctly. Work with
|
||||
character constants. Fix bug when scanning backwards through
|
||||
backslash-quote. Check for unterminated strings.
|
||||
(convert1): Parse character constants, too.
|
||||
(appendline, concatlits): New functions.
|
||||
* ansi2knr.1: Document this.
|
||||
|
||||
lpd 1999-08-17 added code to allow preprocessor directives
|
||||
wherever comments are allowed
|
||||
lpd 1999-04-12 added minor fixes from Pavel Roskin
|
||||
|
@ -1 +1 @@
|
||||
1.791
|
||||
1.829
|
||||
|
Loading…
Reference in New Issue
Block a user