update the reachover build tree for ntp-4.2.0:

-adjust for new libs, programs and source files
-replace generated config.h and mkver
-add Frederick Bruckman's awk implementation of "ntptrace" as a
 replacement for the perl program in the original tree
This commit is contained in:
drochner 2003-12-04 16:41:56 +00:00
parent d5e6f1b80b
commit 43f2108cfd
12 changed files with 904 additions and 524 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.5 2001/04/19 17:48:18 drochner Exp $ # $NetBSD: Makefile,v 1.6 2003/12/04 16:41:56 drochner Exp $
SUBDIR= html libntp libparse .WAIT ntpd ntpdate ntpdc ntpq ntptime \ SUBDIR= libisc libntp libparse .WAIT
ntptimeset ntptrace SUBDIR+= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime
SUBDIR+= ntptrace
.include <bsd.subdir.mk> .include <bsd.subdir.mk>

View File

@ -1,19 +1,18 @@
# $NetBSD: Makefile.inc,v 1.10 2003/10/21 10:01:22 lukem Exp $ # $NetBSD: Makefile.inc,v 1.11 2003/12/04 16:41:56 drochner Exp $
.if !defined(NTP_MAKEFILE_INC) .if !defined(NTP_MAKEFILE_INC)
NTP_MAKEFILE_INC=1 NTP_MAKEFILE_INC=1
.include <bsd.own.mk> .include <bsd.own.mk>
NTPDOCDIR?= ${HTMLDOCDIR}/ntp
DIST= ${NETBSDSRCDIR}/dist/ntp DIST= ${NETBSDSRCDIR}/dist/ntp
CPPFLAGS+= -I${.CURDIR}/../include -I${DIST}/include -DHAVE_CONFIG_H CPPFLAGS+= -I${.CURDIR}/../include -I${DIST}/include -DHAVE_CONFIG_H
.if defined(PROG) .if defined(PROG)
LIBNTP!= cd ${.CURDIR}/../libntp && ${PRINTOBJDIR} LIBNTP!= cd ${.CURDIR}/../libntp && ${PRINTOBJDIR}
LDADD+= -L${LIBNTP} -lntp LIBISC!= cd ${.CURDIR}/../libisc && ${PRINTOBJDIR}
LDADD+= -L${LIBNTP} -lntp -lcrypto
DPADD+= ${LIBNTP}/libntp.a DPADD+= ${LIBNTP}/libntp.a
SRCS+= version.c SRCS+= version.c

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
# $NetBSD: Makefile,v 1.1 2003/12/04 16:41:56 drochner Exp $
NOLINKLIB=# defined
NOMAN= # defined
NOPIC= # defined
NOLINT= # defined
LIB= isc
SRCS= assertions.c error.c interfaceiter.c isc_strerror.c lib.c mem.c \
msgcat.c net.c strerror.c
NTPSRCDIR=lib${LIB}
.include <bsd.lib.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2002/09/18 13:31:54 lukem Exp $ # $NetBSD: Makefile,v 1.5 2003/12/04 16:41:56 drochner Exp $
NOLINKLIB=# defined NOLINKLIB=# defined
NOMAN= # defined NOMAN= # defined
@ -7,14 +7,15 @@ NOLINT= # defined
LIB= ntp LIB= ntp
SRCS= a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \ SRCS= a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \
authencrypt.c authkeys.c authparity.c authreadkeys.c authusekey.c \ authkeys.c authreadkeys.c authusekey.c \
buftvtots.c caljulian.c calleapwhen.c caltontp.c calyearstart.c \ buftvtots.c caljulian.c calleapwhen.c caltontp.c calyearstart.c \
clocktime.c clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \ clocktime.c clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \
emalloc.c findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \ emalloc.c findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \
hextolfp.c humandate.c inttoa.c lib_strbuf.c machines.c md5c.c \ hextolfp.c humandate.c inttoa.c lib_strbuf.c machines.c md5c.c \
memmove.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \ memmove.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \
msyslog.c netof.c numtoa.c numtohost.c octtoint.c prettydate.c \ msyslog.c netof.c numtoa.c numtohost.c octtoint.c prettydate.c \
ranny.c refnumtoa.c statestr.c syssignal.c systime.c tsftomsu.c \ ranny.c refnumtoa.c socktoa.c socktohost.c statestr.c syssignal.c \
systime.c tsftomsu.c \
tstotv.c tvtoa.c tvtots.c uglydate.c uinttoa.c utvtoa.c ymd2yd.c \ tstotv.c tvtoa.c tvtots.c uglydate.c uinttoa.c utvtoa.c ymd2yd.c \
mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c \ mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c \
icom.c audio.c icom.c audio.c

View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1 2003/12/04 16:41:57 drochner Exp $
PROG= ntp-keygen
NOMAN= #defined
SRCS= ntp-keygen.c
NTPSRCDIR= util
.include <bsd.prog.mk>

View File

@ -1,28 +1,31 @@
# $NetBSD: Makefile,v 1.8 2002/01/13 15:49:11 manu Exp $ # $NetBSD: Makefile,v 1.9 2003/12/04 16:41:57 drochner Exp $
PROG= ntpd PROG= ntpd
MAN= ntpd.8 MAN= ntpd.8
SRCS= jupiter.h map_vme.c ntp_config.c ntp_control.c ntp_crypto.c \ SRCS= jupiter.h cmd_args.c map_vme.c ntp_config.c ntp_control.c \
ntp_filegen.c \ ntp_crypto.c ntp_filegen.c \
ntp_intres.c ntp_io.c ntp_loopfilter.c ntp_monitor.c ntp_peer.c \ ntp_intres.c ntp_io.c ntp_loopfilter.c ntp_monitor.c ntp_peer.c \
ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \ ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
ntp_util.c ntpd.c refclock_acts.c refclock_arbiter.c refclock_arc.c \ ntp_util.c ntpd.c refclock_acts.c refclock_arbiter.c refclock_arc.c \
refclock_as2201.c refclock_atom.c refclock_bancomm.c \ refclock_as2201.c refclock_atom.c refclock_bancomm.c \
refclock_chronolog.c refclock_chu.c refclock_conf.c refclock_datum.c \ refclock_chronolog.c refclock_chu.c refclock_conf.c refclock_datum.c \
refclock_dumbclock.c refclock_fg.c refclock_gpsvme.c refclock_heath.c \ refclock_dumbclock.c refclock_fg.c refclock_gpsvme.c refclock_heath.c \
refclock_hpgps.c refclock_irig.c refclock_jupiter.c refclock_leitch.c \ refclock_hopfser.c refclock_hopfpci.c \
refclock_local.c refclock_msfees.c refclock_mx4200.c refclock_nmea.c \ refclock_hpgps.c refclock_irig.c refclock_jjy.c refclock_jupiter.c \
refclock_leitch.c \
refclock_local.c refclock_msfees.c refclock_mx4200.c \
refclock_neoclock4x.c refclock_nmea.c \
refclock_oncore.c refclock_palisade.c refclock_palisade.h \ refclock_oncore.c refclock_palisade.c refclock_palisade.h \
refclock_parse.c refclock_pcf.c refclock_pst.c refclock_ptbacts.c \ refclock_parse.c refclock_pcf.c refclock_pst.c refclock_ptbacts.c \
refclock_shm.c refclock_tpro.c refclock_trak.c refclock_true.c \ refclock_shm.c refclock_tpro.c refclock_trak.c refclock_true.c \
refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c \
refclock_zyfer.c
.include <bsd.own.mk> .include <bsd.own.mk>
CFLAGS+= -DHAVE_CLOCKCTL
LIBPARSE!= cd ${.CURDIR}/../libparse && ${PRINTOBJDIR} LIBPARSE!= cd ${.CURDIR}/../libparse && ${PRINTOBJDIR}
LDADD+= -L${LIBPARSE} -lparse LDADD+= -L${LIBPARSE} -lparse -L${LIBISC} -lisc
DPADD+= ${LIBPARSE}/libparse.a DPADD+= ${LIBPARSE}/libparse.a ${LIBISC}/libisc.a
LDADD+= -lm LDADD+= -lm
DPADD+= ${LIBM} DPADD+= ${LIBM}

View File

@ -1,7 +1,11 @@
# $NetBSD: Makefile,v 1.4 2001/02/27 19:07:53 cgd Exp $ # $NetBSD: Makefile,v 1.5 2003/12/04 16:41:57 drochner Exp $
PROG= ntpdc PROG= ntpdc
MAN= ntpdc.8 MAN= ntpdc.8
SRCS= ntpdc.c ntpdc_ops.c SRCS= ntpdc.c ntpdc_ops.c
LDADD+= -L${LIBISC} -lisc
LDADD+= -ledit -ltermcap
DPADD+= ${LIBISC}/libisc.a
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,7 +1,11 @@
# $NetBSD: Makefile,v 1.3 2000/06/12 13:57:43 simonb Exp $ # $NetBSD: Makefile,v 1.4 2003/12/04 16:41:57 drochner Exp $
PROG= ntpq PROG= ntpq
MAN= ntpq.8 MAN= ntpq.8
SRCS= ntpq.c ntpq_ops.c SRCS= ntpq.c ntpq_ops.c
LDADD+= -L${LIBISC} -lisc
LDADD+= -ledit -ltermcap
DPADD+= ${LIBISC}/libisc.a
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.3 2000/06/12 13:57:44 simonb Exp $ # $NetBSD: Makefile,v 1.4 2003/12/04 16:41:57 drochner Exp $
PROG= ntptrace
MAN= ntptrace.8 MAN= ntptrace.8
SRCS= ntptrace.c SCRIPTS=ntptrace.awk
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -0,0 +1,128 @@
#!/usr/bin/awk -f
#
# Based on a perl script by
# John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org
#
# awk version by Frederick Bruckman <fbruckman@ntp.org>
function usage() {
print "usage: ntptrace [-nv] [-r retries] [host]"
exit 1
}
function getargs( command, i, argc, argv, done) {
host = "localhost"
retries = 1
command = "getopt nr:v"
for (i = 2; i <= ARGC; i++)
command = command " " ARGV[i-1]
command | getline
argc = split($0, argv)
for (i = 1; i <= argc; i++) {
if (argv[i] == "-n") use_numeric = 1
if (argv[i] == "-v") do_verbose = 1
if (argv[i] == "-r") retries = argv[++i]
if (done == 1) host = argv[i]
if (argv[i] == "--") done = 1
}
if (retries != retries + 0)
usage()
}
function do_one_server( command, i, nvars, vars, stratum, peer, offset,
rootdelay, rootdispersion, refid, srcadr) {
rootdelay = 0
rootdispersion = 0
srcadr = ""
stratum = 255
command = "ntpq -n -c rv " host
while (command | getline) {
gsub(/,/,"")
nvars = split($0, vars)
for (i = 1; i <= nvars; i++) {
if (vars[i] ~ /stratum=/) {
stratum = vars[i]
sub(/stratum=/, "", stratum)
}
if (vars[i] ~ /peer=/) {
peer = vars[i]
sub(/peer=/, "", peer)
}
if (vars[i] ~ /offset=/) {
offset = vars[i]
sub(/offset=/, "", offset)
}
if (vars[i] ~ /phase=/) {
offset = vars[i]
sub(/phase=/, "", offset)
}
if (vars[i] ~ /rootdelay=/) {
rootdelay = vars[i]
sub(/rootdelay=/, "", rootdelay)
}
if (vars[i] ~ /rootdispersion=/) {
rootdispersion = vars[i]
sub(/rootdispersion=/, "", rootdispersion)
}
if (vars[i] ~ /refid=/) {
refid = vars[i]
sub(/refid=/, "", refid)
}
}
}
if (stratum == 255)
exit 1
offset = offset / 1000
syncdistance = (rootdispersion + (rootdelay / 2)) / 1000
printf("%s: stratum %d, offset %f, synch distance %f",
dhost(host), stratum, offset, syncdistance)
if ($stratum == 1) printf(", refid '%s'", refid)
printf("\n")
if (stratum == 0 || stratum == 1 || stratum == 16)
exit 0
if (refid ~ /127\.127\.[0-9]{1,3}\.[0-9]{1,3}/)
exit 0
command = "ntpq -n -c 'pstat " peer "' " host
while (command | getline) {
gsub(/,/,"")
nvars = split($0, vars)
for (i = 1; i <= nvars; i++) {
if (vars[i] ~ /srcadr=/) {
srcadr = vars[i]
sub(/srcadr=/, "", srcadr)
}
}
}
if (srcadr ~ /127\.127\.[0-9]{1,3}\.[0-9]{1,3}/ || srcadr == "")
exit 0
host = srcadr
do_one_server()
}
function dhost(myhost, command) {
command = "host " myhost
while (command | getline) {
if (use_numeric) {
if (/address/) return $NF
} else {
if (/pointer/) return $NF
}
}
return myhost
}
BEGIN {
getargs()
do_one_server()
}

View File

@ -1,16 +1,28 @@
#!/bin/sh #!/bin/sh
# $NetBSD: mkver,v 1.3 2003/12/04 16:41:57 drochner Exp $
PROG=${1-UNKNOWN} PROG=${1-UNKNOWN}
ConfStr="$PROG" ConfStr="$PROG"
ConfStr="$ConfStr 4.0.99i" ConfStr="$ConfStr 4.2.0"
case "" in case "$CSET" in
'') ;; '') ;;
*) ConfStr="$ConfStr@$CSET" ;;
esac
case "@LIBRSAREF@" in
'')
case "@AUTOKEY@" in
'') ;;
*) ConfStr="${ConfStr}-a" ;;
esac
;;
*) ConfStr="${ConfStr}-r" ;; *) ConfStr="${ConfStr}-r" ;;
esac esac
ConfStr="$ConfStr `date`" ConfStr="$ConfStr `LC_TIME=C date`"
if [ ! -f .version ]; then if [ ! -f .version ]; then
echo 0 > .version echo 0 > .version