xntpd version 3.3z from UDel

This commit is contained in:
Garrett Wollman 1994-02-03 22:09:07 +00:00
parent e7c996d95e
commit b9eb1bdbc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/UDEL/; revision=1081
139 changed files with 3600 additions and 1218 deletions

View file

@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
* * * *
* Copyright (c) David L. Mills 1992, 1993 * * Copyright (c) David L. Mills 1992, 1993, 1994 *
* * * *
* Permission to use, copy, modify, and distribute this software and its * * Permission to use, copy, modify, and distribute this software and its *
* documentation for any purpose and without fee is hereby granted, provided * * documentation for any purpose and without fee is hereby granted, provided *
@ -53,4 +53,6 @@
* support) * support)
* Karl Berry <karl@owl.HQ.ileaf.com> (syslog to file option) * Karl Berry <karl@owl.HQ.ileaf.com> (syslog to file option)
* Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> (Linux Port) * Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> (Linux Port)
*/ * Paul A Vixie <vixie@vix.com> (TrueTime GPS driver)
* Jim Jagielski <jim@jagubox.gsfc.nasa.gov> (A/UX port)
*/

View file

@ -27,15 +27,17 @@
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar. # -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
# #
# The -DSYSLOG_FILE defines allows logging messages that are normally # The -DSYSLOG_FILE defines allows logging messages that are normally
# reported via syslof() in a file. The file name can be configured using # reported via syslog() in a file. The file name can be configured using
# the configuration line "logfile <filename>" in CONFIG_FILE. # the configuration line "logfile <filename>" in CONFIG_FILE.
# #
# There are three serial port system software interfaces, each of # There are three serial port system software interfaces, each of
# which is peculiar to one or more Unix versions. Define # which is peculiar to one or more Unix versions. Define
# -DHAVE_SYSV_TTYS for basic System V compatibility; define -DSTREAM # -DHAVE_SYSV_TTYS for basic System V compatibility; define -DSTREAM
# for POSIX compatibility including System V Streams, and # for POSIX compatibility including System V Streams, and
# HAVE_BSD_TTYS for 4.3bsd compatibility. Only one of these three # HAVE_BSD_TTYS for 4.3bsd compatibility.
# should be defined. If none are defined, HAVE_BSD_TTYS is assumed. # Use HAVE_TERMIOS for POSIX (termios.h) without System V Streams.
# Only one of these three should be defined. If none are defined,
# HAVE_BSD_TTYS is assumed.
# Usually these defines are already set correctly. # Usually these defines are already set correctly.
# #
DEFS_OPT=-DDEBUG DEFS_OPT=-DDEBUG
@ -152,6 +154,9 @@ DEFS_LOCAL= $(DEFS_OPT) #GREEN -DREFCLOCK #TEST -DPPSPPS -DKERNEL_PLL
# a serial port. The driver does not support the CLK mode, but does # a serial port. The driver does not support the CLK mode, but does
# support the PPS mode. # support the PPS mode.
# #
# Define -DGPSTM for a Kinemetrics/TrueTime GPS-TM/TMD receiver. It
# should work in all systems with a serial port.
#
# Define -DOMEGA for a Kinemetrics/TrueTime OM-DC OMEGA receiver. It # Define -DOMEGA for a Kinemetrics/TrueTime OM-DC OMEGA receiver. It
# should work in all systems with a serial port. The driver does not # should work in all systems with a serial port. The driver does not
# support the CLK mode, but does support the PPS mode. # support the CLK mode, but does support the PPS mode.

View file

@ -66,7 +66,7 @@ TARGETS = xntpd/xntpd xntpdc/xntpdc ntpq/ntpq ntpdate/ntpdate \
OPTTARG = adjtime/adjtimed util/ntptime util/precision OPTTARG = adjtime/adjtimed util/ntptime util/precision
REFCONF= REFCONF=
COMPRESSOR=compress COMPRESSOR=compress
# Base distribution name (will be extended by <VERSION>.tar.<comperssorsuffix>) # Base distribution name (will be extended by <VERSION>.tar.<compressorsuffix>)
DISTNAME=xntp- DISTNAME=xntp-
MAKE= make MAKE= make

View file

@ -16,20 +16,20 @@ the subdirectories contain README files describing their contents. The
base directory ./ includes: base directory ./ includes:
COPYRIGHT file specifying copyright conditions, together with a COPYRIGHT file specifying copyright conditions, together with a
list of major authors and electric addresses list of major authors and electric addresses.
Config * configuration file built by the configuration script Config * configuration file built by the configuration script
"make makeconfig" and used to buile the makefiles in the "make makeconfig" and used to build the makefiles in the
various subdirectories. Do not edit. various subdirectories. Do not edit.
Config.local * Unless you have a reference clock (besides the local Config.local * Unless you have a reference clock (besides the local
computer clock) or want to change the default installlation computer clock) or want to change the default installation
directory (/usr/local/bin) not action is needed. For directory (/usr/local/bin) not action is needed. For
configuring a reference clock a "make refconf" should configuring a reference clock a "make refconf" should
suffice. Diehards can still use an editor on this file. suffice. Diehards can still use an editor on this file.
Config.local.dist file used to generate a plausible Config.local by commands Config.local.dist file used to generate a plausible Config.local by commands
such as "make Config.local.green" such as "make Config.local.green".
Config.sed * sed script used to build makefiles from the Config.sed * sed script used to build makefiles from the
configuration file. Do not edit. configuration file. Do not edit.
@ -38,17 +38,17 @@ Makefile this is the root of the makefile tree. Do not edit.
(Contents under pressure - qualified personel only 8-) (Contents under pressure - qualified personel only 8-)
PORTING contains useful information for porting to unexplored PORTING contains useful information for porting to unexplored
new systems new systems.
RELNOTES instructions for compiling and installing the daemon and RELNOTES instructions for compiling and installing the daemon and
supporting programs supporting programs.
README this file README this file.
TODO our current problems where we could need help. TODO our current problems where we could need help.
adjtime directory containing the sources for the adjtime daemon adjtime directory containing the sources for the adjtime daemon
for HP/UX systems for HP/UX systems.
authstuff directory containing sources for miscellaneous programs authstuff directory containing sources for miscellaneous programs
to test, calibrate and certify the cryptographic to test, calibrate and certify the cryptographic
@ -61,44 +61,39 @@ clockstuff directory containing sources for miscellaneous programs
kernel configurations, together with a program to kernel configurations, together with a program to
calculate propagation delays for use with radio clocks calculate propagation delays for use with radio clocks
and national time dissemination services such as and national time dissemination services such as
WWV/WWVH, WWVB and CHU WWV/WWVH, WWVB and CHU.
compilers directory containing configuration scripts for various compilers directory containing configuration scripts for various
compilers and operating systems compilers and operating systems.
conf directory containing a motley collection of conf directory containing a motley collection of
configuration files for various systems. For example configuration files for various systems. For example
only. only.
doc directory containing miscellaneous man pages and memos doc directory containing miscellaneous man pages and memos
useful for installation and subnet management useful for installation and subnet management.
gadget directory containing instructions and construction data gadget directory containing instructions and construction data
for a mysterious little box used as a CHU radio for a mysterious little box used as a CHU radio
demodulator and/or a level converter-pulse generator for demodulator and/or a level converter-pulse generator for
a precision 1-pps signal a precision 1-pps signal.
include directory containing include header files used by most include directory containing include header files used by most
programs in the distribution programs in the distribution.
hints directory containing files with hints on particular hints directory containing files with hints on particular
topics like installation on specific OS variants or topics like installation on specific OS variants or
general information general information.
historical.tar.Z
tar file with stuff believed to be old. If you find things
in there that are helpful for the current release, please
send email to mills@udel.edu.
kernel directory containing sources for kernel programs such as kernel directory containing sources for kernel programs such as
line disciplines and STREAMS modules used with the CHU line disciplines and STREAMS modules used with the CHU
decoder and precision 1-pps signals decoder and precision 1-pps signals.
lib directory containing sources for the library programs lib directory containing sources for the library programs
used by most programs in the distribution used by most programs in the distribution.
machines directory containing configuration scripts for various machines directory containing configuration scripts for various
operating systems operating systems.
ntpdate directory containing sources for a program to set the ntpdate directory containing sources for a program to set the
local machine time from one or more remote machines local machine time from one or more remote machines
@ -114,17 +109,17 @@ ntpq directory containing sources for a utility program to
ntptrace directory containing sources for a utility program that ntptrace directory containing sources for a utility program that
can be used to reveal the chain of NTP peers from a can be used to reveal the chain of NTP peers from a
designated peer to the primary server at the root of the designated peer to the primary server at the root of the
timekeeping subnet timekeeping subnet.
parse directory containing file belonging to the generic parse parse directory containing file belonging to the generic parse
reference clock driver. for reasonable simple clocks it reference clock driver. For reasonably simple clocks it
is possible to get away with about 3-4Kb of code. is possible to get away with about 3-4Kb of code.
additionally the SunOS 4.x streams module for parse is additionally the SunOS 4.x streams module for parse is
residing here. residing here.
parse/util some goodies for testing parse processing of DCF77 information. parse/util some goodies for testing parse processing of DCF77 information.
(primarily for use on Suns / although others may work (primarily for use on Suns, although others may work
also - possibly with a little porting) also - possibly with a little porting.)
one little gem is dcfd.c - DCF77 decoder with ntp loopfilter one little gem is dcfd.c - DCF77 decoder with ntp loopfilter
code for standalone DCF77 synchronisation without the full code for standalone DCF77 synchronisation without the full
works of NTP. works of NTP.
@ -135,9 +130,6 @@ ppsclock directory containing sources for modifications to the
4.1.X systems only. 4.1.X systems only.
refclocks directory containing reference clock configuration support refclocks directory containing reference clock configuration support
the file in here are still experimental. Do not expect them
to work flawlessly on all architectures. the coded dependencies
might not even be correct.
scripts directory containing scripts to build the configuration scripts directory containing scripts to build the configuration
file "config" in this directory and then the makefiles file "config" in this directory and then the makefiles
@ -147,10 +139,9 @@ scripts directory containing scripts to build the configuration
and daemon startup. and daemon startup.
util directory containing sources for various utility and util directory containing sources for various utility and
testing programs testing programs.
xntpd directory containing sources for the NTP Version 3 xntpd directory containing sources for the NTP Version 3 daemon.
daemon
xntpdc directory containing sources for a utility program to xntpdc directory containing sources for a utility program to
query local and remote NTP peers for state variables and query local and remote NTP peers for state variables and
@ -160,4 +151,4 @@ xntpdc directory containing sources for a utility program to
Specification RFC 1305. Specification RFC 1305.
xntpres directory containing sources for a name-resolution xntpres directory containing sources for a name-resolution
program used in some configurations of NTP Version 3 program used in some configurations of NTP Version 3.

View file

@ -7,7 +7,7 @@ this distribution. To make these programs:
(0) Make sure that you have all necessary tools for building executables. (0) Make sure that you have all necessary tools for building executables.
These tools include cc/gcc, make, awk, sed, tr, sh, grep, egrep and These tools include cc/gcc, make, awk, sed, tr, sh, grep, egrep and
a few others. Not all of these tools exist in the standard distribution a few others. Not all of these tools exist in the standard distribution
of todays Unix versions (Compilers are likely to be an extra product). of todays UNIX versions (compilers are likely to be an extra product).
For a successful build all of these tools should be accessible via the For a successful build all of these tools should be accessible via the
current path. current path.
@ -26,7 +26,7 @@ this distribution. To make these programs:
To set up for a radio clock, type "make refconf" and answer the questions To set up for a radio clock, type "make refconf" and answer the questions
about PLL, PPS and radio clock type. about PLL, PPS and radio clock type.
If this is the first use of the ref clock, don't forget to make suitable If this is the first use of the ref clock, don't forget to make suitable
files in /dev/ files in /dev/.
For custom tailored configuration copying Config.local.dist to Config.local For custom tailored configuration copying Config.local.dist to Config.local
and editing Config.local to suit the local needs is neccessary (at most and editing Config.local to suit the local needs is neccessary (at most
@ -130,20 +130,25 @@ the meal. The converse is not always true.
Convex Convex OS 10.1 ? ? Convex Convex OS 10.1 ? ?
SGI IRIX 4.0.5F gcc no REFCLOCK (pb 93/11/10) SGI IRIX 4.0.5F gcc no REFCLOCK (pb 93/11/10)
AIX 3.2 ? ? AIX 3.2 ? ?
A/UX 2.0.1, 3.0.x ? ? A/UX 2.0.1, 3.x.x gcc LOCAL_CLOCK (jmj (94/01/26 see hints)
RS6000 AIX 3.2 gcc no REFCLOCK RS6000 AIX 3.2 gcc no REFCLOCK
MX500 Sinix-m V5.40 cc PARSE REFCLOCK MX500 Sinix-m V5.40 cc PARSE REFCLOCK
S2000 Sequent PTX 1.4 cc LOCAL_CLOCK (kd 93/11/10) S2000 Sequent PTX 1.4 cc LOCAL_CLOCK (kd 93/11/10)
S2000 Sequent PTX 1.4 gcc LOCAL_CLOCK (kd 93/11/10) S2000 Sequent PTX 1.4 gcc LOCAL_CLOCK (kd 93/11/10)
PC FreeBSD gcc LOCAL_CLOCK see "build problems" PC FreeBSD gcc LOCAL_CLOCK see "build problems"
PC NetBSD? gcc LOCAL_CLOCK possibly see "build problems" PC NetBSD? gcc LOCAL_CLOCK possibly see "build problems"
PC BSDI? gcc LOCAL_CLOCK possibly see "build problems" PC BSD/386 1.0 gcc LOCAL_CLOCK possibly see "build problems"
PC Linux (pl14) gcc LOCAL_CLOCK (dw 93/10/30) PC Linux (pl14) gcc LOCAL_CLOCK (dw 93/10/30)
PC Dell SVR4 v2.2 gcc ? (tl 93/12/30)
NCR3445 NCR SVR4 cc LOCAL_CLOCK (tm 93/11/29)
pb: Piete Brooks pb: Piete Brooks
kd: Frank Kardel kd: Frank Kardel
dw: Torsten Duwe (duwe@informatik.uni-erlangen.de) dw: Torsten Duwe (duwe@informatik.uni-erlangen.de)
dm: David Mills (mills@udel.edu) dm: David Mills (mills@udel.edu)
tl: Tony Lill <ajlill@tlill.hookup.net>
tm: Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
jmj: Jim Jagielski <jim@jagubox.gsfc.nasa.gov>
Build Problems (and workaround): Build Problems (and workaround):
@ -152,7 +157,7 @@ of "make" and "sh" and "awk" features in different implementations.
If you have problems other tha the one listed below please check for If you have problems other tha the one listed below please check for
usualy things like the latest sh compatible pd shell in your own usualy things like the latest sh compatible pd shell in your own
environment. Things like this are known to hinder compilation if environment. Things like this are known to hinder compilation if
they ate not fully compatible with sh or are buggy. they are not fully compatible with sh or are buggy.
Current build problem on (Mac) NetBSD, possibly BSDI and 386BSD: Current build problem on (Mac) NetBSD, possibly BSDI and 386BSD:
pmake (e. g. NetBSD on MAC, possible other BNR2+pmake systems) pmake (e. g. NetBSD on MAC, possible other BNR2+pmake systems)
@ -170,9 +175,17 @@ Current build problem on (Mac) NetBSD, possibly BSDI and 386BSD:
by failure to build with the message: by failure to build with the message:
"don't know how to make make". "don't know how to make make".
On BSD/386 the solution is to get GNU make and run build as:
% gnumake MAKE=gnumake
Note that BSD/386 1.0's "sed" goes into an infinite loop if
you try to make the "refconf" target -- so edit Config.local
by hand if you have a reference clock. (BSD/386 1.1 will fix
this "sed" bug.)
The NetBSD people claim that this problem goes away
when you compile make with POSIX compilation options.
The known sh and some make pecularities have already been taken care of. The known sh and some make pecularities have already been taken care of.
The pmake (in the BNR2 branches) problem seems to be real at the time of this
writing. If you know a portable(!) fix we'd like to hear from you.
Usually the vendor should fix these bugs in vital utilities. Usually the vendor should fix these bugs in vital utilities.
We try to circumvent these bugs in a hopefully portable way. We try to circumvent these bugs in a hopefully portable way.

View file

@ -1,5 +1,5 @@
# #
# TODO,v 3.3 1993/11/09 23:20:16 kardel Exp # TODO,v 3.5 1994/01/25 19:03:55 kardel Exp
# #
This file contains problems known to the authors that still need to be done. This file contains problems known to the authors that still need to be done.
We would appreciate if you could spare some of your time to look through We would appreciate if you could spare some of your time to look through
@ -19,17 +19,6 @@ Thank you for your help !
Open issues: Open issues:
HPUX:
- Time warp
During the last few month disturbing reports about xntp setting
preposterous times during periods of high load have been reported
on HPUX 8 and 9. The theory is that the adjtimed message queue
gets deleted. Symptoms are that xntp() complains about interrupted
system calls in adjtime()-emulation and the time is set to some
invalid date. Also the adjtimed seems to have problems. We could
need some help here by an experienced HPUX guru.
Files affected: adjtime/*
Apollo: Apollo:
- terminal affiliation - terminal affiliation
Check whether thing are still correct in respect to breaking Check whether thing are still correct in respect to breaking

View file

@ -1 +1 @@
version=3.3b (beta) version=3.3c (beta)

View file

@ -30,6 +30,7 @@ static char RCSid[] = "adjtimed.c,v 3.1 1993/07/06 01:04:45 jbj Exp";
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/msg.h> #include <sys/msg.h>
#include <sys/lock.h>
#include <time.h> #include <time.h>
#include <signal.h> #include <signal.h>
#include <nlist.h> #include <nlist.h>
@ -40,8 +41,8 @@ static char RCSid[] = "adjtimed.c,v 3.1 1993/07/06 01:04:45 jbj Exp";
#include "adjtime.h" #include "adjtime.h"
double atof(); double atof();
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
int InitClockRate(); int InitClockRate();
int AdjustClockRate(); int AdjustClockRate();
@ -80,9 +81,13 @@ main(argc, argv)
progname = argv[0]; progname = argv[0];
#ifdef LOG_LOCAL6
openlog("adjtimed", LOG_PID, LOG_LOCAL6); openlog("adjtimed", LOG_PID, LOG_LOCAL6);
#else
openlog("adjtimed", LOG_PID);
#endif
while ((ch = getopt(argc, argv, "hkrvdfp:")) != EOF) { while ((ch = ntp_getopt(argc, argv, "hkrvdfp:")) != EOF) {
switch (ch) { switch (ch) {
case 'k': case 'k':
case 'r': case 'r':
@ -112,7 +117,7 @@ main(argc, argv)
break; break;
case 'p': case 'p':
if ((RATE = atof(optarg)) <= 0.0 || RATE >= 100.0) { if ((RATE = atof(ntp_optarg)) <= 0.0 || RATE >= 100.0) {
fputs("adjtimed: percentage must be between 0.0 and 100.0\n", stderr); fputs("adjtimed: percentage must be between 0.0 and 100.0\n", stderr);
exit(1); exit(1);
} }
@ -202,6 +207,12 @@ main(argc, argv)
Exit(1); Exit(1);
} }
if (plock(PROCLOCK)) {
syslog(LOG_ERR, "plock: %m");
perror("adjtimed: plock");
Cleanup();
}
for (;;) { for (;;) {
if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) { if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) {
if (errno == EINTR) continue; if (errno == EINTR) continue;

View file

@ -65,12 +65,12 @@ char *argv[];
int loops; int loops;
int i; int i;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
loops = DEFLOOPS; loops = DEFLOOPS;
while ((c = getopt_l(argc, argv, "cdmn:")) != EOF) while ((c = ntp_getopt(argc, argv, "cdmn:")) != EOF)
switch (c) { switch (c) {
case 'c': case 'c':
totalcost++; totalcost++;
@ -82,11 +82,11 @@ char *argv[];
domd5 = 16; /* offset into list of keys */ domd5 = 16; /* offset into list of keys */
break; break;
case 'n': case 'n':
loops = atoi(optarg); loops = atoi(ntp_optarg);
if (loops <= 0) { if (loops <= 0) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: %s is unlikely to be a useful number of loops\n", "%s: %s is unlikely to be a useful number of loops\n",
progname, optarg); progname, ntp_optarg);
errflg++; errflg++;
} }
break; break;
@ -94,7 +94,7 @@ char *argv[];
errflg++; errflg++;
break; break;
} }
if (errflg || optind == argc) { if (errflg || ntp_optind == argc) {
(void) fprintf(stderr, (void) fprintf(stderr,
"usage: %s [-d] [-n loops] [ -c ] auth.samplekeys\n", "usage: %s [-d] [-n loops] [ -c ] auth.samplekeys\n",
progname); progname);
@ -108,7 +108,7 @@ char *argv[];
printf(" based authentication.\n"); printf(" based authentication.\n");
init_auth(); init_auth();
authreadkeys(argv[optind]); authreadkeys(argv[ntp_optind]);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
if (!auth_havekey(i + domd5)) { if (!auth_havekey(i + domd5)) {
errflg++; errflg++;

View file

@ -49,11 +49,11 @@ char *argv[];
int errflg = 0; int errflg = 0;
int keytype; int keytype;
U_LONG key[2]; U_LONG key[2];
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "adno:s")) != EOF) while ((c = ntp_getopt(argc, argv, "adno:s")) != EOF)
switch (c) { switch (c) {
case 'a': case 'a':
asciiflag = 1; asciiflag = 1;
@ -68,10 +68,10 @@ char *argv[];
stdflag = 1; stdflag = 1;
break; break;
case 'o': case 'o':
if (*optarg == 'n') { if (*ntp_optarg == 'n') {
ntpoutflag = 1; ntpoutflag = 1;
gotoopt = 1; gotoopt = 1;
} else if (*optarg == 's') { } else if (*ntp_optarg == 's') {
ntpoutflag = 0; ntpoutflag = 0;
gotoopt = 1; gotoopt = 1;
} else { } else {
@ -85,7 +85,7 @@ char *argv[];
errflg++; errflg++;
break; break;
} }
if (errflg || optind == argc) { if (errflg || ntp_optind == argc) {
(void) fprintf(stderr, (void) fprintf(stderr,
"usage: %s -n|-s [-a] [-o n|s] key [...]\n", "usage: %s -n|-s [-a] [-o n|s] key [...]\n",
progname); progname);
@ -118,11 +118,11 @@ char *argv[];
else else
keytype = KEY_TYPE_STD; keytype = KEY_TYPE_STD;
for (; optind < argc; optind++) { for (; ntp_optind < argc; ntp_optind++) {
if (!decodekey(keytype, argv[optind], key)) { if (!decodekey(keytype, argv[ntp_optind], key)) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: format of key %s invalid\n", "%s: format of key %s invalid\n",
progname, argv[optind]); progname, argv[ntp_optind]);
exit(1); exit(1);
} }
(void) parity(key); (void) parity(key);
@ -242,7 +242,7 @@ decodekey(keytype, str, key)
/* /*
* Make up key from ascii representation * Make up key from ascii representation
*/ */
bzero(keybytes, sizeof(keybytes)); memset(keybytes, 0, sizeof(keybytes));
for (i = 0; i < 8 && i < len; i++) for (i = 0; i < 8 && i < len; i++)
keybytes[i] = *cp++ << 1; keybytes[i] = *cp++ << 1;
key[0] = keybytes[0] << 24 | keybytes[1] << 16 key[0] = keybytes[0] << 24 | keybytes[1] << 16

View file

@ -28,11 +28,11 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "d")) != EOF) while ((c = ntp_getopt(argc, argv, "d")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -183,7 +183,7 @@ doit()
int ind4, ind5, ind6, ind7; int ind4, ind5, ind6, ind7;
int octbits; int octbits;
bzero((char *)bits, sizeof bits); memset((char *)bits, 0, sizeof bits);
/* /*
* Do the rounds for the IP table. We save the results of * Do the rounds for the IP table. We save the results of

View file

@ -25,11 +25,11 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "d")) != EOF) while ((c = ntp_getopt(argc, argv, "d")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -82,8 +82,8 @@ permute(bits, cp, dp)
u_char c[28]; u_char c[28];
u_char d[28]; u_char d[28];
bzero((char *)c, sizeof c); memset((char *)c, 0, sizeof c);
bzero((char *)d, sizeof d); memset((char *)d, 0, sizeof d);
for (i = 0; i < 28; i++) { for (i = 0; i < 28; i++) {
c[i] = bits[PC1_C[i]]; c[i] = bits[PC1_C[i]];
@ -140,7 +140,7 @@ doit()
U_LONG d; U_LONG d;
u_char bits[64]; u_char bits[64];
bzero((char *)bits, sizeof bits); memset((char *)bits, 0, sizeof bits);
printf("static U_LONG PC1_CL[8] = {"); printf("static U_LONG PC1_CL[8] = {");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {

View file

@ -26,11 +26,11 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "d")) != EOF) while ((c = ntp_getopt(argc, argv, "d")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -87,7 +87,7 @@ permc(bits, resp)
register U_LONG mask; register U_LONG mask;
u_char res[24]; u_char res[24];
bzero((char *)res, sizeof res); memset((char *)res, 0, sizeof res);
for (i = 0; i < 24; i++) { for (i = 0; i < 24; i++) {
res[i] = bits[PC2_C[i]]; res[i] = bits[PC2_C[i]];
@ -117,7 +117,7 @@ permd(bits, resp)
register U_LONG mask; register U_LONG mask;
u_char res[24]; u_char res[24];
bzero((char *)res, sizeof res); memset((char *)res, 0, sizeof res);
for (i = 0; i < 24; i++) { for (i = 0; i < 24; i++) {
res[i] = bits[PC2_D[i]]; res[i] = bits[PC2_D[i]];
@ -168,7 +168,7 @@ doit()
U_LONG res; U_LONG res;
u_char bits[28]; u_char bits[28];
bzero((char *)bits, sizeof bits); memset((char *)bits, 0, sizeof bits);
printf("static U_LONG PC2_C[4][64] = {"); printf("static U_LONG PC2_C[4][64] = {");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {

View file

@ -25,11 +25,11 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "d")) != EOF) while ((c = ntp_getopt(argc, argv, "d")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -165,7 +165,7 @@ doit()
U_LONG result; U_LONG result;
int sixbits; int sixbits;
bzero((char *)bits, sizeof bits); memset((char *)bits, 0, sizeof bits);
printf("static U_LONG SP[8][64] = {"); printf("static U_LONG SP[8][64] = {");
for (selno = 0; selno < 8; selno++) { for (selno = 0; selno < 8; selno++) {
for (sixbits = 0; sixbits < 64; sixbits++) { for (sixbits = 0; sixbits < 64; sixbits++) {

View file

@ -25,9 +25,9 @@
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <time.h> #include <time.h>
#ifdef __bsdi__ #ifdef SYS_BSDI
#include <sys/time.h> #include <sys/time.h>
#endif /* __bsdi__ */ #endif /* SYS_BSDI */
#include "md5.h" #include "md5.h"
#define MD5 #define MD5

View file

@ -34,14 +34,14 @@ char *argv[];
int numkeys; int numkeys;
U_LONG tmp; U_LONG tmp;
char *passwd; char *passwd;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
extern char *getpass(); extern char *getpass();
numkeys = 0; numkeys = 0;
progname = argv[0]; progname = argv[0];
passwd = NULL; passwd = NULL;
while ((c = getopt_l(argc, argv, "dnp:s")) != EOF) while ((c = ntp_getopt(argc, argv, "dnp:s")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -50,7 +50,7 @@ char *argv[];
std = 0; std = 0;
break; break;
case 'p': case 'p':
passwd = optarg; passwd = ntp_optarg;
break; break;
case 's': case 's':
std = 1; std = 1;
@ -61,11 +61,11 @@ char *argv[];
} }
numkeys = 0; numkeys = 0;
for (; !errflg && optind < argc; optind++) { for (; !errflg && ntp_optind < argc; ntp_optind++) {
c = atoi(argv[optind]); c = atoi(argv[ntp_optind]);
if (c <= 0 || c > 15) { if (c <= 0 || c > 15) {
(void) fprintf("%s: invalid key number `%s'\n", (void) fprintf(stderr, "%s: invalid key number `%s'\n",
progname, argv[optind]); progname, argv[ntp_optind]);
exit(2); exit(2);
} }
dokey[c] = 1; dokey[c] = 1;

View file

@ -34,11 +34,11 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "d")) != EOF) while ((c = ntp_getopt(argc, argv, "d")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -188,7 +188,7 @@ doit()
int ind0, ind1, ind2, ind3; int ind0, ind1, ind2, ind3;
int quadbits; int quadbits;
bzero((char *)bits, sizeof bits); memset((char *)bits, 0, sizeof bits);
/* /*
* Do the rounds for the IPL table. We save the results of * Do the rounds for the IPL table. We save the results of

View file

@ -68,12 +68,12 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
void init_chu(); void init_chu();
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "cdfpt")) != EOF) while ((c = ntp_getopt(argc, argv, "cdfpt")) != EOF)
switch (c) { switch (c) {
case 'c': case 'c':
#ifdef STREAM #ifdef STREAM
@ -107,7 +107,7 @@ char *argv[];
errflg++; errflg++;
break; break;
} }
if (errflg || optind+1 != argc) { if (errflg || ntp_optind+1 != argc) {
#ifdef STREAM #ifdef STREAM
(void) fprintf(stderr, "usage: %s [-dft] tty_device\n", (void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
progname); progname);
@ -126,7 +126,7 @@ char *argv[];
} }
(void) gettimeofday(&lasttv, (struct timezone *)0); (void) gettimeofday(&lasttv, (struct timezone *)0);
c = openterm(argv[optind]); c = openterm(argv[ntp_optind]);
init_chu(); init_chu();
#ifdef STREAM #ifdef STREAM
if (usechuldisc) if (usechuldisc)

View file

@ -105,8 +105,8 @@ char *argv[];
int fd; int fd;
struct sgttyb ttyb; struct sgttyb ttyb;
struct itimerval itimer; struct itimerval itimer;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
int alarming(); int alarming();
int ioready(); int ioready();
@ -114,13 +114,13 @@ char *argv[];
#ifdef STREAM #ifdef STREAM
magic[0] = 0; magic[0] = 0;
#endif #endif
while ((c = getopt_l(argc, argv, "a:b:c:dfs:t:")) != EOF) while ((c = ntp_getopt(argc, argv, "a:b:c:dfs:t:")) != EOF)
switch (c) { switch (c) {
#ifdef CLKLDISC #ifdef CLKLDISC
case 'a': case 'a':
#endif #endif
case 'c': case 'c':
if (!atouint(optarg, &tmp)) { if (!atouint(ntp_optarg, &tmp)) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: argument for -%c must be integer\n", "%s: argument for -%c must be integer\n",
progname, c); progname, c);
@ -139,7 +139,7 @@ char *argv[];
#endif #endif
break; break;
case 'b': case 'b':
if (!atouint(optarg, &tmp)) { if (!atouint(ntp_optarg, &tmp)) {
errflg++; errflg++;
break; break;
} }
@ -163,14 +163,14 @@ char *argv[];
ttflags |= CRMOD; ttflags |= CRMOD;
break; break;
case 's': case 's':
cmdlen = strlen(optarg); cmdlen = strlen(ntp_optarg);
if (cmdlen == 0) if (cmdlen == 0)
errflg++; errflg++;
else else
cmd = optarg; cmd = ntp_optarg;
break; break;
case 't': case 't':
if (!atouint(optarg, &tmp)) if (!atouint(ntp_optarg, &tmp))
errflg++; errflg++;
else { else {
timeout.tv_sec = (long)tmp; timeout.tv_sec = (long)tmp;
@ -181,7 +181,7 @@ char *argv[];
errflg++; errflg++;
break; break;
} }
if (errflg || optind+1 != argc) { if (errflg || ntp_optind+1 != argc) {
(void) fprintf(stderr, (void) fprintf(stderr,
#ifdef CLKLDISC #ifdef CLKLDISC
"usage: %s [-b bps] [-c magic1] [-a magic2] [-f] [-s cmd] [-t timeo] tty_device\n", "usage: %s [-b bps] [-c magic1] [-a magic2] [-f] [-s cmd] [-t timeo] tty_device\n",
@ -199,12 +199,12 @@ char *argv[];
#endif #endif
if (docmd) if (docmd)
fd = open(argv[optind], O_RDWR, 0777); fd = open(argv[ntp_optind], O_RDWR, 0777);
else else
fd = open(argv[optind], O_RDONLY, 0777); fd = open(argv[ntp_optind], O_RDONLY, 0777);
if (fd == -1) { if (fd == -1) {
(void) fprintf(stderr, "%s: open(%s): ", progname, (void) fprintf(stderr, "%s: open(%s): ", progname,
argv[optind]); argv[ntp_optind]);
perror(""); perror("");
exit(1); exit(1);
} }

View file

@ -140,21 +140,21 @@ char *argv[];
double lat1, long1; double lat1, long1;
double lat2, long2; double lat2, long2;
double lat3, long3; double lat3, long3;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "dh:CWG")) != EOF) while ((c = ntp_getopt(argc, argv, "dh:CWG")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
break; break;
case 'h': case 'h':
hflag++; hflag++;
height = atof(optarg); height = atof(ntp_optarg);
if (height <= 0.0) { if (height <= 0.0) {
(void) fprintf(stderr, "height %s unlikely\n", (void) fprintf(stderr, "height %s unlikely\n",
optarg); ntp_optarg);
errflg++; errflg++;
} }
break; break;
@ -171,8 +171,8 @@ char *argv[];
errflg++; errflg++;
break; break;
} }
if (errflg || (!(Cflag || Wflag || Gflag) && optind+4 != argc) || if (errflg || (!(Cflag || Wflag || Gflag) && ntp_optind+4 != argc) ||
((Cflag || Wflag || Gflag) && optind+2 != argc)) { ((Cflag || Wflag || Gflag) && ntp_optind+2 != argc)) {
(void) fprintf(stderr, (void) fprintf(stderr,
"usage: %s [-d] [-h height] lat1 long1 lat2 long2\n", "usage: %s [-d] [-h height] lat1 long1 lat2 long2\n",
progname); progname);
@ -185,10 +185,10 @@ char *argv[];
if (!(Cflag || Wflag || Gflag)) { if (!(Cflag || Wflag || Gflag)) {
lat1 = latlong(argv[optind], 1); lat1 = latlong(argv[ntp_optind], 1);
long1 = latlong(argv[optind + 1], 0); long1 = latlong(argv[ntp_optind + 1], 0);
lat2 = latlong(argv[optind + 2], 1); lat2 = latlong(argv[ntp_optind + 2], 1);
long2 = latlong(argv[optind + 3], 0); long2 = latlong(argv[ntp_optind + 3], 0);
if (hflag) { if (hflag) {
doit(lat1, long1, lat2, long2, height, ""); doit(lat1, long1, lat2, long2, height, "");
} else { } else {
@ -201,8 +201,8 @@ char *argv[];
/* /*
* Compute delay from WWV * Compute delay from WWV
*/ */
lat1 = latlong(argv[optind], 1); lat1 = latlong(argv[ntp_optind], 1);
long1 = latlong(argv[optind + 1], 0); long1 = latlong(argv[ntp_optind + 1], 0);
lat2 = latlong(wwvlat, 1); lat2 = latlong(wwvlat, 1);
long2 = latlong(wwvlong, 0); long2 = latlong(wwvlong, 0);
if (hflag) { if (hflag) {
@ -228,8 +228,8 @@ char *argv[];
"WWVH winter propagation, "); "WWVH winter propagation, ");
} }
} else if (Cflag) { } else if (Cflag) {
lat1 = latlong(argv[optind], 1); lat1 = latlong(argv[ntp_optind], 1);
long1 = latlong(argv[optind + 1], 0); long1 = latlong(argv[ntp_optind + 1], 0);
lat2 = latlong(chulat, 1); lat2 = latlong(chulat, 1);
long2 = latlong(chulong, 0); long2 = latlong(chulong, 0);
if (hflag) { if (hflag) {
@ -243,8 +243,8 @@ char *argv[];
} else if (Gflag) { } else if (Gflag) {
lat1 = latlong(goes_up_lat, 1); lat1 = latlong(goes_up_lat, 1);
long1 = latlong(goes_up_long, 0); long1 = latlong(goes_up_long, 0);
lat3 = latlong(argv[optind], 1); lat3 = latlong(argv[ntp_optind], 1);
long3 = latlong(argv[optind + 1], 0); long3 = latlong(argv[ntp_optind + 1], 0);
lat2 = latlong(goes_sat_lat, 1); lat2 = latlong(goes_sat_lat, 1);

View file

@ -0,0 +1 @@
COMPILER= cc

View file

@ -89,9 +89,6 @@ RANLIB= ranlib
# to configure the particular clock drivers you want in the # to configure the particular clock drivers you want in the
# CLOCKDEFS= line below. This flag affects xntpd only. # CLOCKDEFS= line below. This flag affects xntpd only.
# #
# There is an occurance of a call to rindex() in the daemon. You may
# have to include a -Drindex=strrchr to get this to load right.
#
# To change the location of the configuration file, use a # To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar. # -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
# #
@ -109,7 +106,7 @@ RANLIB= ranlib
# (for SunOS 4.1.1) that intercepts carrier-detect transitions # (for SunOS 4.1.1) that intercepts carrier-detect transitions
# generated by the pps signal. Only one of these flags should be defined. # generated by the pps signal. Only one of these flags should be defined.
# #
DEFS= -DUSELIBKVM -DDEBUG -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DPPS -DPPSDEV -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H DEFS= -DUSELIBKVM -DDEBUG -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DPPS -DPPSDEV -DXNTP_RETROFIT_STDLIB -DNTP_POSIX_SOURCE
# #
# Authentication types supported. Choose from DES and MD5. If you # Authentication types supported. Choose from DES and MD5. If you

View file

@ -84,9 +84,6 @@ RANLIB= ranlib
# to configure the particular clock drivers you want in the # to configure the particular clock drivers you want in the
# CLOCKDEFS= line below. This flag affects xntpd only. # CLOCKDEFS= line below. This flag affects xntpd only.
# #
# There is an occurance of a call to rindex() in the daemon. You may
# have to include a -Drindex=strrchr to get this to load right.
#
# To change the location of the configuration file, use a # To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar. # -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
# #
@ -104,7 +101,7 @@ RANLIB= ranlib
# the reference clock module (only one source of PPS signal should # the reference clock module (only one source of PPS signal should
# be used) # be used)
# #
DEFS= -DBSDI -DUSELIBKVM -DDEBUG -DREFCLOCK -DPPS -DCONFIG_FILE=\\"/usr/local/etc/xntp.conf\\" -DHAVE_UNISTD_H DEFS= -DBSDI -DUSELIBKVM -DDEBUG -DREFCLOCK -DPPS -DCONFIG_FILE=\\"/usr/local/etc/xntp.conf\\" -DNTP_POSIX_SOURCE
# #
# Authentication types supported. Choose from DES and MD5. If you # Authentication types supported. Choose from DES and MD5. If you

View file

@ -80,9 +80,6 @@ RANLIB= ranlib
# to configure the particular clock drivers you want in the # to configure the particular clock drivers you want in the
# CLOCKDEFS= line below. This flag affects xntpd only. # CLOCKDEFS= line below. This flag affects xntpd only.
# #
# There is an occurance of a call to rindex() in the daemon. You may
# have to include a -Drindex=strrchr to get this to load right.
#
# To change the location of the configuration file, use a # To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar. # -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
# #
@ -100,7 +97,7 @@ RANLIB= ranlib
# the reference clock module (only one source of PPS signal should # the reference clock module (only one source of PPS signal should
# be used) # be used)
# #
DEFS= -DREFCLOCK -DS_CHAR_DEFINED -DREADKMEM -DDEBUG -DPLL -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H DEFS= -DREFCLOCK -DS_CHAR_DEFINED -DREADKMEM -DDEBUG -DPLL -DXNTP_RETROFIT_STDLIB -DNTP_POSIX_SOURCE
# #
# Authentication types supported. Choose from DES and MD5. If you # Authentication types supported. Choose from DES and MD5. If you

View file

@ -86,9 +86,6 @@ RANLIB= : # ar does the work of ranlib under System V
# to configure the particular clock drivers you want in the # to configure the particular clock drivers you want in the
# CLOCKDEFS= line below. This flag affects xntpd only. # CLOCKDEFS= line below. This flag affects xntpd only.
# #
# There is an occurance of a call to rindex() in the daemon. You may
# have to include a -Drindex=strrchr to get this to load right.
#
# To change the location of the configuration file, use a # To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar. # -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
# #
@ -109,7 +106,7 @@ RANLIB= : # ar does the work of ranlib under System V
# (for SunOS 4.1.1) that intercepts carrier-detect transitions # (for SunOS 4.1.1) that intercepts carrier-detect transitions
# generated by the pps signal. Only one of these flags should be defined. # generated by the pps signal. Only one of these flags should be defined.
# #
DEFS= -DDEBUG -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DSLEWALWAYS -DSOLARIS -DPPS -DSTUPID_SIGNAL -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H DEFS= -DDEBUG -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DSLEWALWAYS -DSOLARIS -DPPS -DSTUPID_SIGNAL -DXNTP_RETROFIT_STDLIB -DNTP_POSIX_SOURCE
# #
# Authentication types supported. Choose from DES and MD5. If you # Authentication types supported. Choose from DES and MD5. If you

View file

@ -182,7 +182,7 @@ DEFS_LOCAL= $(DEFS_OPT) -DREFCLOCK -DPPSPPS -DKERNEL_PLL
# under Ultrix 4.2a/3. If the MX4200 is removed, all the rest compile on a DEC # under Ultrix 4.2a/3. If the MX4200 is removed, all the rest compile on a DEC
# OSF/1 Alpha. # OSF/1 Alpha.
# #
CLOCKDEFS= -DLOCAL_CLOCK -DAS2201PPS -DCHU -DGOES -DIRIG -DMX4200PPS -DOMEGA -DPSTCLK -DTPRO -DWWVBCLK -DMSFEESPPS -DLEITCH CLOCKDEFS= -DLOCAL_CLOCK -DAS2201PPS -DCHUPPS -DGOES -DIRIG -DMX4200PPS -DOMEGA -DPSTCLK -DTPRO -DWWVBCLK -DMSFEESPPS -DLEITCH
# #
# Directory into which binaries should be installed (default /usr/local) # Directory into which binaries should be installed (default /usr/local)

View file

@ -74,6 +74,12 @@ xntpd - Network Time Protocol daemon
] [ ] [
.B -t .B -t
.I trustedkey .I trustedkey
] [
.B -v
.I variable
] [
.B -V
.I variable
] ]
.SH DESCRIPTION .SH DESCRIPTION
.I Xntpd .I Xntpd
@ -140,6 +146,10 @@ to be used when synchronizing to broadcasts
specify a directory to be used for creating statistics files specify a directory to be used for creating statistics files
.Ip -t 8 .Ip -t 8
add a key number to the trusted key list add a key number to the trusted key list
.Ip -v 8
add a system variable
.Ip -V 8
add a system variable listed by default
.SH "CONFIGURATION FILE OPTIONS" .SH "CONFIGURATION FILE OPTIONS"
.IR Xntpd 's .IR Xntpd 's
configuration file is relatively free format. Comments, which may be configuration file is relatively free format. Comments, which may be
@ -494,6 +504,31 @@ This command is obsolete and not available in this version of
This command is obsolete and not available in this version of This command is obsolete and not available in this version of
.I xntpd. .I xntpd.
.PP .PP
.B setvar
.I variable
.I [default]
.PP
This command adds an additional system variable. These variables can be
used to distribute additional information such as the access policy. If
the variable of the from <name>=<value> is followed by the
.I default
keyword the variable will be listed as part of the default system
variables (ntpq rv command). These additional variables serve informational
purposes only. They are not related to the protocol other that they can be
listed. The known protocol variables will always overide any variables defined
via the
.I setvar
mechanism.
.PP
There are three special variables that contain the names of all variable of
the same group. The
.I sys_var_list
holds the names of all system variables. The
.I peer_var_list
holds the names of all peer variables and the
.I clock_var_list
hold the names of the reference clock variables.
.PP
.B resolver .B resolver
.I /path/xntpres .I /path/xntpres
.PP .PP
@ -1093,9 +1128,13 @@ fudge factor defines the phase offset of the sychnronisation character to the ac
time. time.
On the availability of PPS information the On the availability of PPS information the
.I time2 .I time2
fudge factor show the difference betwteen the PPS time stamp and the reception fudge factor defines the skew between the PPS time stamp and the reception
time stamp of the serial signal. This parameter is read only attempts to time stamp of the PPS signal. This parameter is usually 0 as usually
set this parameter will be ignored. the PPS signal is believed in time and OS delays should be corrected
in the machine specific section of the kernel driver.
.I time2
needs only be set when the actial PPS signal is delayed for some
reason.
The The
.I flag0 .I flag0
enables input filtering. This a median filter with continuous sampling. The enables input filtering. This a median filter with continuous sampling. The
@ -1109,13 +1148,25 @@ from the receiver. Otherwise the leap second will be added (which is the default
.I ntpq .I ntpq
timecode variable timecode variable
.PP .PP
The timecode variable in the ntpq read clock variable command contains several The ntpq read clock variables command list several variables. These
fields. The first field is the local time in Unix format. The second field is hold followinf information:
the offset to UTC (format HHMM). The currently active receiver flags are listed .I refclock_time
next. Additional feature flags of the receiver are optionally listed in paranthesis. is the local time with the offset to UTC (format HHMM).
The actual time code is enclosed in angle brackets < >. A qualification of the The currently active receiver flags are listed in
decoded time code format is following the time code. The last piece of information .I refclock_status.
is the overall running time and the accumulated times for the clock event states. Additional feature flags of the receiver are optionally listed in paranthesis.
The actual time code is listed in
.I timecode.
A qualification of the decoded time code format is following in
.I refclock_format.
The last piece of information is the overall running time and the accumulated
times for the clock event states in
.I refclock_states.
When PPS information is present additional variable are available.
.I refclock_ppstime
lists then the PPS timestamp and
.I refclock_ppsskew
lists the difference between RS232 derived timestamp and the PPS timestamp.
.PP .PP
Unit encoding Unit encoding
.PP .PP

View file

@ -0,0 +1,29 @@
Requirements: kernel 0.99.14 or newer, libc 4.5 or newer
------------
With this configuration, xntp should build an run right out of the
box (see generic hints for how-to), with one big limitation: tickadj doesn't
work yet. This is especially painful since PCs are usually equipped with
untuned, badly-drifting quartzes, values up to 200 ppm being no exception.
Because the loop filter algorithms are limited to compensating no more than
100 ppm, currently only one workaround is possible:
Compile your own kernel and adjust linux/include/linux/timex.h,
line 67 (in pl14):
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
Since this is surely not true for your hardware, adjust the hundreds
to match your quartz. Adding 100 compensates for a drift of -83.8 ppm
(1/CLOCK_TICK_RATE). The number gets rounded to the nearest 100 so don't
bother to tune any finer.
Fixing tickadj is already in my work queue, so the previous comment should be
obsolete RSN. If you really need to run xntp on any earlier versions of the
kernel or libc, or have any other question not covered in the READMEs / hint
files (sorry, necessary comment in the Linux community ;-) feel free to ask
me (duwe@informatik.uni-erlangen.de)
xntp3.3b of 1993/12/06 : remember to change #define ntp_adjtime adjtimex to
__adjtimex in the Linux section (line 316). This is hopefully done if you
(don't :-) see this paragraph in the xntp3.x distribution.

17
usr.sbin/xntpd/hints/sun4 Normal file
View file

@ -0,0 +1,17 @@
Notes on CPU clock oscillator tolerance with SunOS 4.1.1 and 4.1.3
A bug in SunOS 4.1.1 results in the kernel time losing 1 microsecond
per tick of the system clock. The bug was fixed (bugid 1094383) for
SunOS 4.1.1 and corrected in SunOS 4.1.3. The easiest way to fix this
is to replace the 4.1.1 binary clock.o with the corresponding 4.1.3
binary. Without this change it is necessary to use the tickadj program
included in this distribution with the -t 9999 option.
The tickadj option will work in all cases except when the kernel has
been modified to correct the CPU clock oscillator frequency using a
1-pps signal from a precision source. The bugfix must be installed for
this wrinkle to work properly.
Dave Mills (mills@udle.edu)

View file

@ -38,7 +38,6 @@ extern long strtol P((char *, char **, int));
#if !defined(NTP_POSIX_SOURCE) #if !defined(NTP_POSIX_SOURCE)
extern int atoi P((char *)); extern int atoi P((char *));
extern void bcopy P((char *, char *, int));
extern int dup2 P((int, int)); extern int dup2 P((int, int));
extern int execve P((char *, char **,char **)); extern int execve P((char *, char **,char **));
extern int fork P((void)); extern int fork P((void));
@ -48,11 +47,13 @@ extern int qsort P((void *, int , int,
extern int rand P((void)); extern int rand P((void));
extern int setpgrp P((int, int)); extern int setpgrp P((int, int));
extern void srand P((unsigned int)); extern void srand P((unsigned int));
extern void bcopy P((char *, char *, int));
#endif #endif
#ifndef bzero /* XXX macro prototyping clash */ #ifndef bzero /* XXX macro prototyping clash */
extern void bzero P((char *, int)); extern void bzero P((char *, int));
extern int bcmp P((char *, char *, int)); extern int bcmp P((char *, char *, int));
extern void bcopy P((char *, char *, int));
#endif #endif
extern char *mktemp P((char *)); extern char *mktemp P((char *));
@ -97,11 +98,13 @@ extern int setlinebuf P((FILE *));
#ifdef _ntp_string_h #ifdef _ntp_string_h
#ifdef NTP_POSIX_SOURCE /* these are builtins */ #ifdef NTP_POSIX_SOURCE /* these are builtins */
#ifndef NTP_NEED_BOPS /* but may be emulated by bops */
extern char *memcpy(); extern char *memcpy();
extern char *memset(); extern char *memset();
extern int memcmp(); extern int memcmp();
#endif #endif
#endif #endif
#endif
#ifdef _sys_socket_h #ifdef _sys_socket_h
extern int bind P((int, struct sockaddr *, int)); extern int bind P((int, struct sockaddr *, int));
@ -192,7 +195,6 @@ extern int nlist P((char *, struct nlist *));
#ifndef NTP_POSIX_SOURCE #ifndef NTP_POSIX_SOURCE
extern int atoi P((char *)); extern int atoi P((char *));
extern void bcopy P((char *, char *, int));
extern void bzero P((char *, int)); extern void bzero P((char *, int));
extern int bcmp P((char *, char *, int)); extern int bcmp P((char *, char *, int));
extern void bcopy P((char *, char *, int)); extern void bcopy P((char *, char *, int));
@ -224,5 +226,9 @@ extern char * getpass P((char *));
extern char * getpass P((char *)); extern char * getpass P((char *));
#endif /* VAX */ #endif /* VAX */
#ifdef SYS_DOMAINOS
extern char * getpass P((char *));
#endif /* SYS_DOMAINOS */
#endif /* l_stdlib_h */ #endif /* l_stdlib_h */

View file

@ -328,7 +328,7 @@ struct peer {
#define FLAG_PREFER 0x80 /* this is the preferred peer */ #define FLAG_PREFER 0x80 /* this is the preferred peer */
/* /*
* Definitions for the clear() routine. We use bzero() to clear * Definitions for the clear() routine. We use memset() to clear
* the parts of the peer structure which go to zero. These are * the parts of the peer structure which go to zero. These are
* used to calculate the start address and length of the area. * used to calculate the start address and length of the area.
*/ */
@ -358,7 +358,8 @@ struct peer {
#define REFCLK_OMEGA_TRUETIME 11 /* TrueTime OM-DC OMEGA */ #define REFCLK_OMEGA_TRUETIME 11 /* TrueTime OM-DC OMEGA */
#define REFCLK_IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */ #define REFCLK_IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */
#define REFCLK_ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */ #define REFCLK_ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */
#define REFCLK_MSF_EES 14 /* reserved for Piete Brooks */ #define REFCLK_MSF_EES 14 /* MSF EES M201, UK */
#define REFCLK_GPSTM_TRUETIME 15 /* TrueTime GPS/TM-TMD */
/* /*
* We tell reference clocks from real peers by giving the reference * We tell reference clocks from real peers by giving the reference

View file

@ -163,9 +163,9 @@ struct ntp_control {
#define CS_SYSTEM 17 #define CS_SYSTEM 17
#define CS_KEYID 18 #define CS_KEYID 18
#define CS_REFSKEW 19 #define CS_REFSKEW 19
#define CS_VERSION 20 #define CS_VARLIST 20
#define CS_MAXCODE CS_VERSION #define CS_MAXCODE CS_VARLIST
/* /*
* Peer variables we understand * Peer variables we understand
@ -204,8 +204,10 @@ struct ntp_control {
#define CP_SENT 32 #define CP_SENT 32
#define CP_FILTERROR 33 #define CP_FILTERROR 33
#define CP_FLASH 34 #define CP_FLASH 34
#define CP_DISP 35 #define CP_DISP 35
#define CP_MAXCODE CP_DISP #define CP_VARLIST 36
#define CP_MAXCODE CP_VARLIST
/* /*
* Clock variables we understand * Clock variables we understand
@ -222,8 +224,9 @@ struct ntp_control {
#define CC_FUDGEVAL2 10 #define CC_FUDGEVAL2 10
#define CC_FLAGS 11 #define CC_FLAGS 11
#define CC_DEVICE 12 #define CC_DEVICE 12
#define CC_VARLIST 13
#define CC_MAXCODE CC_DEVICE #define CC_MAXCODE CC_VARLIST
/* /*
* Definition of the structure used internally to hold trap information. * Definition of the structure used internally to hold trap information.

View file

@ -1,5 +1,5 @@
/* /*
* ntp_filegen.h,v 3.6 1993/09/01 21:51:24 kardel Exp * ntp_filegen.h,v 3.7 1994/01/25 19:04:16 kardel Exp
* *
* definitions for NTP file generations support * definitions for NTP file generations support
* *

View file

@ -1,4 +1,4 @@
/* ntp_compat.h,v 3.1 1993/07/06 01:06:49 jbj Exp /* ntp_machine.h,v 3.1 1993/07/06 01:06:49 jbj Exp
* Collect all machine dependent idiosyncrasies in one place. * Collect all machine dependent idiosyncrasies in one place.
*/ */
@ -41,21 +41,21 @@ Signaled IO - Signled IO defines.
UDP_BACKWARDS_SETOWN - SunOS 3.5 or Ultirx 2.0 system. UDP_BACKWARDS_SETOWN - SunOS 3.5 or Ultirx 2.0 system.
WHICH TERMINAL MODEL TO USE - I would assume HAVE_POSIX_TTYS if WHICH TERMINAL MODEL TO USE - I would assume HAVE_TERMIOS if
NTP_POSIX_SOURCE was set but cann't. The NTP_POSIX_SOURCE was set but can't. The
posix tty driver is too restrictive on most systems. posix tty driver is too restrictive on most systems.
It defined if you define STREAMS. It defined if you define STREAMS.
HAVE_SYSV_TTYS - Use SYSV termio.h HAVE_SYSV_TTYS - Use SYSV termio.h
HAVE_BSD_TTYS - Use BSD stty.h HAVE_BSD_TTYS - Use BSD stty.h
HAVE_POSIX_TTYS - "struct termios" has c_line defined HAVE_TERMIOS - Use POSIX termios.h
THIS MAKES PORTS TO NEW SYSTEMS EASY - You only have to wory about THIS MAKES PORTS TO NEW SYSTEMS EASY - You only have to wory about
kernal mucking. kernel mucking.
NTP_POSIX_SOURCE - Use POSIX functions over bsd functions and att functions. NTP_POSIX_SOURCE - Use POSIX functions over bsd functions and att functions.
This is NOT the same as _POSIX_SOURCE. This is NOT the same as _POSIX_SOURCE.
It is much weeker! It is much weaker!
STEP SLEW OR TWO STEP - The Default is to step. STEP SLEW OR TWO STEP - The Default is to step.
@ -80,11 +80,20 @@ INFO ON NEW KERNEL PLL SYS CALLS
NTP_SYSCALL_GET - SYS_ntp_gettime id NTP_SYSCALL_GET - SYS_ntp_gettime id
NTP_SYSCALL_ADJ - SYS_ntp_adjtime id NTP_SYSCALL_ADJ - SYS_ntp_adjtime id
HOW TO GET IP INTERFACE INFORMATION
Some UNIX V.4 machines implement a sockets library on top of
streams. For these systems, you must use send the SIOCGIFCONF down
the stream in an I_STR ioctl. This ususally also implies
USE_STREAMS_DEVICE FOR IF_CONFIG. Dell UNIX is a notable exception.
STREAMS_TLI - use ioctl(I_STR) to implement ioctl(SIOCGIFCONF)
WHAT DOES IOCTL(SIOCGIFCONF) RETURN IN THE BUFFER WHAT DOES IOCTL(SIOCGIFCONF) RETURN IN THE BUFFER
UNIX V.4 machines implement a sockets library on top of streams. UNIX V.4 machines implement a sockets library on top of streams.
When requesting the IP interface configuration with an ioctl(2) calll, When requesting the IP interface configuration with an ioctl(2) calll,
an arrat of ifreq structures are placed in the provided buffer. Some an array of ifreq structures are placed in the provided buffer. Some
implementations also place the length of the buffer information in implementations also place the length of the buffer information in
the first integer position of the buffer. the first integer position of the buffer.
@ -104,22 +113,28 @@ MISC
DOSYNCTODR - Resync TODR clock every hour. DOSYNCTODR - Resync TODR clock every hour.
RETSIGTYPE - Define signal function type. RETSIGTYPE - Define signal function type.
NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h
LOCK_PROCESS - Have plock. LOCK_PROCESS - Have plock.
UDP_WILDCARD_DELIVERY UDP_WILDCARD_DELIVERY
- these systems deliver broadcast pakets to the wildcard - these systems deliver broadcast packets to the wildcard
port instead to a port bound to the interface bound port instead to a port bound to the interface bound
to the correct broadcast address - are these to the correct broadcast address - are these
implementations broken or did the spec change ? implementations broken or did the spec change ?
HAVE_UNISTD_H - Maybe should be part of NTP_POSIX_SOURCE ? DEFINITIONS FOR SYSTEM && PROCESSOR
STR_SYSTEM - value of system variable
STR_PROCESSOR - value of processor variable
You could just put the defines on the DEFS line in machines/<os> file. You could just put the defines on the DEFS line in machines/<os> file.
I don't since there are lost of different types compiler that a systemm might I don't since there are lots of different types of compilers that a system might
have, some that can do proto typing and others that cannot on the saem system. have, some that can do proto typing and others that cannot on the same system.
I get a chanse to twiddle some of the configuration paramasters at compile I get a chance to twiddle some of the configuration parameters at compile
time based on compler/machine combinatsions by using this include file. time based on compiler/machine combinations by using this include file.
See convex, aix and sun configurations see how complex it get. See convex, aix and sun configurations see how complex it get.
Note that it _is_ considered reasonable to add some system-specific defines
to the machine/<os> file if it would be too inconvenient to puzzle them out
in this file.
*/ */
@ -134,14 +149,17 @@ See convex, aix and sun configurations see how complex it get.
/* /*
* Keep USE_PROTOTYPES and _NO_PROTO in step. * Keep USE_PROTOTYPES and _NO_PROTO in step.
*/ */
#if defined(_NO_PROTO)&&defined(USE_PROTOTYPES) #if defined(_NO_PROTO) && defined(USE_PROTOTYPES)
#undef USE_PROTOTYPES #undef USE_PROTOTYPES
#endif #endif
#if !defined(_NO_PROTO)&&!defined(USE_PROTOTYPES) #if !defined(_NO_PROTO) && !defined(USE_PROTOTYPES)
#define USE_PROTOTYPES #define USE_PROTOTYPES
#endif #endif
#endif /*_BSD */ #endif /*_BSD */
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/AIX"
#endif
#endif /* RS6000 */ #endif /* RS6000 */
/* /*
@ -149,6 +167,7 @@ See convex, aix and sun configurations see how complex it get.
* Note: posix version has NTP_POSIX_SOURCE and HAVE_SIGNALED_IO * Note: posix version has NTP_POSIX_SOURCE and HAVE_SIGNALED_IO
*/ */
#if defined(SYS_SUNOS4) #if defined(SYS_SUNOS4)
#define NTP_NEED_BOPS
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define HAVE_LIBKVM #define HAVE_LIBKVM
#define HAVE_MALLOC_H #define HAVE_MALLOC_H
@ -156,6 +175,9 @@ See convex, aix and sun configurations see how complex it get.
#define RETSIGTYPE void #define RETSIGTYPE void
#define NTP_SYSCALL_GET 132 #define NTP_SYSCALL_GET 132
#define NTP_SYSCALL_ADJ 147 #define NTP_SYSCALL_ADJ 147
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/SunOS 4.x"
#endif
#endif #endif
/* /*
@ -165,12 +187,16 @@ See convex, aix and sun configurations see how complex it get.
#undef HAVE_SIGNALED_IO #undef HAVE_SIGNALED_IO
#undef USE_TTY_SIGPOLL #undef USE_TTY_SIGPOLL
#undef USE_UDP_SIGPOLL #undef USE_UDP_SIGPOLL
#define STREAMS_TLI
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define STEP_SLEW /* TWO step */ #define STEP_SLEW /* TWO step */
#define RETSIGTYPE void #define RETSIGTYPE void
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#define HAVE_ATT_NICE #define HAVE_ATT_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/SINIX-M"
#endif
#endif #endif
/* /*
@ -187,12 +213,15 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#define HAVE_ATT_NICE #define HAVE_ATT_NICE
#define UDP_WILDCARD_DELIVERY #define UDP_WILDCARD_DELIVERY
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Solaris 2.x"
#endif
#endif #endif
/* /*
* Convex * Convex
*/ */
#if defined(SYS_CONVEXOS10)||defined(SYS_CONVEXOS9) #if defined(SYS_CONVEXOS10) || defined(SYS_CONVEXOS9)
#define HAVE_SIGNALED_IO #define HAVE_SIGNALED_IO
#define HAVE_N_UN #define HAVE_N_UN
#define HAVE_READKMEM #define HAVE_READKMEM
@ -201,15 +230,18 @@ See convex, aix and sun configurations see how complex it get.
#define RETSIGTYPE int #define RETSIGTYPE int
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#else #else
#if defined(__stdc__)&&!defined(USE_PROTOTYPES) #if defined(__stdc__) && !defined(USE_PROTOTYPES)
#define USE_PROTOTYPES #define USE_PROTOTYPES
#endif #endif
#if !defined(__stdc__)&&defined(USE_PROTOTYPES) #if !defined(__stdc__) && defined(USE_PROTOTYPES)
#undef USE_PROTOTYPES #undef USE_PROTOTYPES
#endif #endif
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#endif #endif
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/ConvexOS"
#endif
#endif #endif
/* /*
@ -224,6 +256,9 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/IRIX"
#endif
#endif #endif
/* /*
@ -236,12 +271,16 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#define RETSIGTYPE void #define RETSIGTYPE void
#define NTP_SYSCALLS_STD #define NTP_SYSCALLS_STD
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Ultrix"
#endif
#define HAVE_TERMIOS
#endif #endif
/* /*
* AUX * AUX
*/ */
#if defined(SYS_AUX2)||defined(SYS_AUX3) #if defined(SYS_AUX2) || defined(SYS_AUX3)
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define HAVE_READKMEM #define HAVE_READKMEM
#define HAVE_ATT_NICE #define HAVE_ATT_NICE
@ -261,6 +300,9 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_BSD_TTYS #define HAVE_BSD_TTYS
#define LOG_NTP LOG_LOCAL1 #define LOG_NTP LOG_LOCAL1
#define HAVE_SIGNALED_IO #define HAVE_SIGNALED_IO
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/AUX"
#endif
#endif #endif
/* /*
@ -272,6 +314,9 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#define HAVE_N_UN #define HAVE_N_UN
#undef NTP_POSIX_SOURCE #undef NTP_POSIX_SOURCE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Next"
#endif
#endif #endif
/* /*
@ -280,7 +325,8 @@ See convex, aix and sun configurations see how complex it get.
#if defined(SYS_HPUX) #if defined(SYS_HPUX)
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_SIGNALED_IO #define HAVE_SIGNALED_IO
#define HAVE_UNISTD_H #define getdtablesize() sysconf(_SC_OPEN_MAX)
#define setlinebuf(f) setvbuf(f, NULL, _IOLBF, 0)
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define LOCK_PROCESS #define LOCK_PROCESS
#define HAVE_NO_NICE /* HPUX uses rtprio instead */ #define HAVE_NO_NICE /* HPUX uses rtprio instead */
@ -290,6 +336,9 @@ See convex, aix and sun configurations see how complex it get.
#else #else
#define HAVE_READKMEM #define HAVE_READKMEM
#endif #endif
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/HPUX"
#endif
#endif #endif
/* /*
@ -300,6 +349,11 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_LIBKVM #define HAVE_LIBKVM
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/BSDI"
#endif
#define HAVE_BSD_TTYS
#define HAVE_TERMIOS
#endif #endif
/* /*
@ -311,8 +365,13 @@ See convex, aix and sun configurations see how complex it get.
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define ADJTIME_IS_ACCURATE #define ADJTIME_IS_ACCURATE
#define HAVE_SYS_TIMEX_H #define HAVE_SYS_TIMEX_H
#define ntp_adjtime adjtimex /* hope there will be a standard interface
* along with a standard name one day ! */
#define ntp_adjtime __adjtimex
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Linux"
#endif
#endif #endif
/* /*
@ -324,10 +383,13 @@ See convex, aix and sun configurations see how complex it get.
#define HAVE_READKMEM #define HAVE_READKMEM
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/*BSD"
#endif
#endif #endif
/* /*
* DECOSF1 * DEC AXP OSF/1
*/ */
#if defined(SYS_DECOSF1) #if defined(SYS_DECOSF1)
#define HAVE_SIGNALED_IO #define HAVE_SIGNALED_IO
@ -335,15 +397,22 @@ See convex, aix and sun configurations see how complex it get.
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define NTP_SYSCALLS_STD #define NTP_SYSCALLS_STD
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/DECOSF1"
#endif
#endif #endif
/* /*
* I386 * I386
* XXX - what OS?
*/ */
#if defined(SYS_I386) #if defined(SYS_I386)
#define HAVE_READKMEM #define HAVE_READKMEM
#define S_CHAR_DEFINED #define S_CHAR_DEFINED
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/I386"
#endif
#endif #endif
/* /*
@ -352,6 +421,9 @@ See convex, aix and sun configurations see how complex it get.
#if defined(SYS_MIPS) #if defined(SYS_MIPS)
#define NOKMEM #define NOKMEM
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Mips"
#endif
#endif #endif
/* /*
@ -359,6 +431,9 @@ See convex, aix and sun configurations see how complex it get.
*/ */
#if defined(SYS_SEQUENT) #if defined(SYS_SEQUENT)
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Sequent Dynix 3"
#endif
#endif #endif
/* /*
@ -369,6 +444,7 @@ See convex, aix and sun configurations see how complex it get.
#ifndef HAVE_SYSV_TTYS #ifndef HAVE_SYSV_TTYS
#define HAVE_SYSV_TTYS #define HAVE_SYSV_TTYS
#endif #endif
#define STREAMS_TLI
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#define HAVE_SIGNALED_IO #define HAVE_SIGNALED_IO
#define USE_UDP_SIGPOLL #define USE_UDP_SIGPOLL
@ -392,25 +468,35 @@ typedef unsigned char u_char;
typedef unsigned short u_short; typedef unsigned short u_short;
typedef unsigned long u_long; typedef unsigned long u_long;
#endif #endif
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Sequent PTX"
#endif
#endif #endif
/* /*
* Sony * Sony NEWS
*/ */
#if defined(SYS_SONY) #if defined(SYS_SONY)
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define HAVE_READKMEM #define HAVE_READKMEM
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/Sony"
#endif
#endif #endif
/* /*
* VAX * VAX
* XXX - VMS?
*/ */
#if defined(SYS_VAX) #if defined(SYS_VAX)
#define NO_SIGNED_CHAR_DECL #define NO_SIGNED_CHAR_DECL
#define HAVE_READKMEM #define HAVE_READKMEM
#define HAVE_BSD_NICE #define HAVE_BSD_NICE
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/VAX"
#endif
#endif #endif
/* /*
@ -419,11 +505,9 @@ typedef unsigned long u_long;
#if defined(SYS_SVR4) #if defined(SYS_SVR4)
#define HAVE_ATT_SETPGRP #define HAVE_ATT_SETPGRP
#define USE_PROTOTYPES #define USE_PROTOTYPES
#define HAVE_UNISTD_H
#define NTP_POSIX_SOURCE #define NTP_POSIX_SOURCE
#define HAVE_ATT_NICE #define HAVE_ATT_NICE
#define HAVE_READKMEM #define HAVE_READKMEM
#define HAVE_SIGNALED_IO
#define USE_TTY_SIGPOLL #define USE_TTY_SIGPOLL
#define USE_UDP_SIGPOLL #define USE_UDP_SIGPOLL
#define STREAM #define STREAM
@ -431,6 +515,31 @@ typedef unsigned long u_long;
#define LOCK_PROCESS #define LOCK_PROCESS
#define SYSV_TIMEOFDAY #define SYSV_TIMEOFDAY
#define SIZE_RETURNED_IN_BUFFER #define SIZE_RETURNED_IN_BUFFER
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/SysVR4"
#endif
#endif
/*
* DomainOS
*/
#if defined(SYS_DOMAINOS)
#define HAVE_BSD_NICE
#define NOKMEM
#define HAVE_SIGNALED_IO
#define HAVE_BSD_TTYS
#define NTP_SYSCALLS_STD
#define USE_PROTOTYPES
#define UDP_WILDCARD_DELIVERY
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX/DOMAINOS"
#endif
#endif
#ifdef STREAM /* STREAM implies TERMIOS */
#ifndef HAVE_TERMIOS
#define HAVE_TERMIOS
#endif
#endif #endif
#ifndef RETSIGTYPE #ifndef RETSIGTYPE
@ -450,8 +559,64 @@ typedef unsigned long u_long;
#endif #endif
#endif /* NTP_SYSCALLS_STD */ #endif /* NTP_SYSCALLS_STD */
#if !defined(HAVE_ATT_NICE) && !defined(HAVE_BSD_NICE) && !defined(HAVE_NO_NICE) #if !defined(HAVE_ATT_NICE) \
&& !defined(HAVE_BSD_NICE) \
&& !defined(HAVE_NO_NICE)
ERROR You_must_define_one_of_the_HAVE_xx_NICE_defines ERROR You_must_define_one_of_the_HAVE_xx_NICE_defines
#endif #endif
#if !defined(HAVE_SYSV_TTYS) \
&& !defined(HAVE_BSD_TTYS) \
&& !defined(HAVE_TERMIOS)
ERROR no_tty_type_defined
#endif
#if !defined(XNTP_BIG_ENDIAN) && !defined(XNTP_LITTLE_ENDIAN)
# if defined(XNTP_AUTO_ENDIAN)
# include <netinet/in.h>
# if BYTE_ORDER == BIG_ENDIAN
# define XNTP_BIG_ENDIAN
# endif
# if BYTE_ORDER == LITTLE_ENDIAN
# define XNTP_LITTLE_ENDIAN
# endif
# else /* AUTO */
# ifdef WORDS_BIGENDIAN
# define XNTP_BIG_ENDIAN 1
# else
# define XNTP_LITTLE_ENDIAN 1
# endif
# endif /* AUTO */
#endif /* !BIG && !LITTLE */
/*
* Byte order woes. The DES code is sensitive to byte order. This
* used to be resolved by calling ntohl() and htonl() to swap things
* around, but this turned out to be quite costly on Vaxes where those
* things are actual functions. The code now straightens out byte
* order troubles on its own, with no performance penalty for little
* end first machines, but at great expense to cleanliness.
*/
#if !defined(XNTP_BIG_ENDIAN) && !defined(XNTP_LITTLE_ENDIAN)
/*
* Pick one or the other.
*/
BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif
#if defined(XNTP_BIG_ENDIAN) && defined(XNTP_LITTLE_ENDIAN)
/*
* Pick one or the other.
*/
BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif
#endif /* __ntp_machine */ #endif /* __ntp_machine */

View file

@ -75,10 +75,10 @@ struct refclockstat {
LONG fudgeval2; LONG fudgeval2;
u_char currentstatus; u_char currentstatus;
u_char lastevent; u_char lastevent;
u_char unused[1]; u_char unused;
struct ctl_var *kv_list; /* additional variables */
}; };
/* /*
* Reference clock I/O structure. Used to provide an interface between * Reference clock I/O structure. Used to provide an interface between
* the reference clock drivers and the I/O module. * the reference clock drivers and the I/O module.

View file

@ -14,7 +14,7 @@
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif #endif
#endif /* _ntp_select_h */ #endif /* _ntp_select_h */

View file

@ -47,7 +47,7 @@ extern U_LONG calyearstart P((U_LONG));
extern const char *clockname P((int)); extern const char *clockname P((int));
extern int clocktime P((int, int, int, int, int, U_LONG, U_LONG *, U_LONG *)); extern int clocktime P((int, int, int, int, int, U_LONG, U_LONG *, U_LONG *));
extern char * emalloc P((u_int)); extern char * emalloc P((u_int));
extern int getopt_l P((int, char **, char *)); extern int ntp_getopt P((int, char **, char *));
extern void init_auth P((void)); extern void init_auth P((void));
extern void init_lib P((void)); extern void init_lib P((void));
extern void init_random P((void)); extern void init_random P((void));

View file

@ -1,29 +1,35 @@
/* /*
* Define bcopy, bzero, and bcmp and string op's * Define string ops: strchr strrchr memcmp memmove memset
*/ */
#ifndef _ntp_string_h #ifndef _ntp_string_h
#define _ntp_string_h #define _ntp_string_h
#ifdef NTP_POSIX_SOURCE #if defined(NTP_POSIX_SOURCE)
#if defined(HAVE_MEMORY_H) # if defined(HAVE_MEMORY_H)
#include <memory.h> # include <memory.h>
#endif # endif
#include <string.h> # include <string.h>
#define bcopy(s1,s2,n) memcpy(s2, s1, n) #else
#define bzero(s,n) memset(s, 0, n)
#define bcmp(s1,s2,n) memcmp(s1, s2, n)
#else /* NTP_POSIX_SOURCE */ # include <strings.h>
# define strchr(s,c) index(s,c)
# define strrchr(s,c) rindex(s,c)
# ifndef NTP_NEED_BOPS
# define NTP_NEED_BOPS
# endif
#endif /* NTP_POSIX_SOURCE */
#include <strings.h> #ifdef NTP_NEED_BOPS
#define strrchr rindex # define memcmp(a,b,c) bcmp(a,b,c)
#define strchr index # define memmove(t,f,c) bcopy(f,t,c)
# define memset(a,x,c) if (x == 0x00) bzero(a,c); else ntp_memset((char*)a,x,c)
void ntp_memset P((char *, int, int));
#endif /* NTP_POSIX_SOURCE */ #endif /* NTP_NEED_BOPS */
#endif /* _ntp_string_h */ #endif /* _ntp_string_h */

View file

@ -1,4 +1,4 @@
/* ntpd.h,v 3.1 1993/07/06 01:07:03 jbj Exp /*
* ntpd.h - Prototypes for xntpd. * ntpd.h - Prototypes for xntpd.
*/ */
@ -21,6 +21,35 @@ extern void init_control P((void));
extern void process_control P((struct recvbuf *, int)); extern void process_control P((struct recvbuf *, int));
extern void report_event P((int, struct peer *)); extern void report_event P((int, struct peer *));
/* ntp_control.c */
/*
* Structure for translation tables between internal system
* variable indices and text format.
*/
struct ctl_var {
u_short code;
u_short flags;
char *text;
};
/*
* Flag values
*/
#define CAN_READ 0x01
#define CAN_WRITE 0x02
#define DEF 0x20
#define PADDING 0x40
#define EOV 0x80
#define RO (CAN_READ)
#define WO (CAN_WRITE)
#define RW (CAN_READ|CAN_WRITE)
extern char * add_var P((struct ctl_var **, unsigned long, int));
extern void free_varlist P((struct ctl_var *));
extern void set_var P((struct ctl_var **, char *, unsigned long, int));
extern void set_sys_var P((char *, unsigned long, int));
/* ntp_intres.c */ /* ntp_intres.c */
extern void ntp_intres P((void)); extern void ntp_intres P((void));

View file

@ -1,9 +1,9 @@
/* /*
* /src/NTP/REPOSITORY/v3/include/parse.h,v 3.11 1993/11/11 11:20:18 kardel Exp * /src/NTP/REPOSITORY/v3/include/parse.h,v 3.13 1994/01/25 19:04:21 kardel Exp
* *
* parse.h,v 3.11 1993/11/11 11:20:18 kardel Exp * parse.h,v 3.13 1994/01/25 19:04:21 kardel Exp
* *
* Copyright (c) 1989,1990,1991,1992,1993 * Copyright (c) 1989,1990,1991,1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -15,7 +15,7 @@
#ifndef __PARSE_H__ #ifndef __PARSE_H__
#define __PARSE_H__ #define __PARSE_H__
#if !(defined(lint) || defined(__GNUC__)) #if !(defined(lint) || defined(__GNUC__))
static char parsehrcsid[]="parse.h,v 3.11 1993/11/11 11:20:18 kardel Exp FAU"; static char parsehrcsid[]="parse.h,v 3.13 1994/01/25 19:04:21 kardel Exp FAU";
#endif #endif
#include "ntp_types.h" #include "ntp_types.h"
@ -365,6 +365,12 @@ extern unsigned LONG pps_simple P((parse_t *, int status, timestamp_t *));
* History: * History:
* *
* parse.h,v * parse.h,v
* Revision 3.13 1994/01/25 19:04:21 kardel
* 94/01/23 reconcilation
*
* Revision 3.12 1994/01/23 17:23:05 kardel
* 1994 reconcilation
*
* Revision 3.11 1993/11/11 11:20:18 kardel * Revision 3.11 1993/11/11 11:20:18 kardel
* declaration fixes * declaration fixes
* *

View file

@ -1,9 +1,9 @@
/* /*
* /src/NTP/REPOSITORY/v3/include/parse_conf.h,v 3.3 1993/10/22 14:27:10 kardel Exp * /src/NTP/REPOSITORY/v3/include/parse_conf.h,v 3.5 1994/01/25 19:04:23 kardel Exp
* *
* parse_conf.h,v 3.3 1993/10/22 14:27:10 kardel Exp * parse_conf.h,v 3.5 1994/01/25 19:04:23 kardel Exp
* *
* Copyright (c) 1993 * Copyright (c) 1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -15,7 +15,7 @@
#ifndef __PARSE_CONF_H__ #ifndef __PARSE_CONF_H__
#define __PARSE_CONF_H__ #define __PARSE_CONF_H__
#if !(defined(lint) || defined(__GNUC__)) #if !(defined(lint) || defined(__GNUC__))
static char dcfhrcsid[]="parse_conf.h,v 3.3 1993/10/22 14:27:10 kardel Exp FAU"; static char dcfhrcsid[]="parse_conf.h,v 3.5 1994/01/25 19:04:23 kardel Exp FAU";
#endif #endif
/* /*

View file

@ -1,9 +1,9 @@
/* /*
* /src/NTP/REPOSITORY/v3/include/sys/parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp * /src/NTP/REPOSITORY/v3/include/sys/parsestreams.h,v 3.11 1994/01/25 19:04:30 kardel Exp
* *
* parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp * parsestreams.h,v 3.11 1994/01/25 19:04:30 kardel Exp
* *
* Copyright (c) 1989,1990,1991,1992,1993 * Copyright (c) 1989,1990,1991,1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -13,7 +13,7 @@
*/ */
#if !(defined(lint) || defined(__GNUC__)) #if !(defined(lint) || defined(__GNUC__))
static char parse77hrcsid[]="parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp"; static char parse77hrcsid[]="parsestreams.h,v 3.11 1994/01/25 19:04:30 kardel Exp";
#endif #endif
#undef PARSEKERNEL #undef PARSEKERNEL

View file

@ -1,6 +1,5 @@
# #
# /src/NTP/REPOSITORY/v3/kernel/Makefile.tmpl,v 3.4 1993/11/05 23:51:26 kardel Exp # /src/NTP/REPOSITORY/v3/kernel/Makefile.tmpl,v 3.6 1994/01/25 19:04:35 kardel Exp
#
# #
# parse routine that could be used in two places # parse routine that could be used in two places
# #
@ -28,7 +27,7 @@ all:
print "### STREAMS kernel modules ppsclock, ppsclocd or line disciplines must"; \ print "### STREAMS kernel modules ppsclock, ppsclocd or line disciplines must"; \
print "### be installed manually if needed"; \ print "### be installed manually if needed"; \
print "### see kernel/README* for details"; \ print "### see kernel/README* for details"; \
print "### The parse reclock implementation has their own support in"; \ print "### The parse refclock implementation has their own support in"; \
print "### parse/*."; } }' print "### parse/*."; } }'
clean: clean:

View file

@ -1,37 +1,54 @@
/* tty_chu_STREAMS.c,v 3.1 1993/07/06 01:07:32 jbj Exp /*
* CHU STREAMS module for SunOS 4.1.x * CHU STREAMS module for SunOS
* *
* Version 2.1 * Version 2.3
* *
* Copyright 1991-1993, Nick Sayer * Copyright 1991-1994, Nick Sayer
* *
* Special thanks to Greg Onufer for his debug assists. * Special thanks to Greg Onufer for his debug assists.
* Special thanks to Matthias Urlichs for the loadable driver support * Special thanks to Matthias Urlichs for the 4.1.x loadable driver support
* code. * code.
* Special wet-noodle whippings to Sun for not properly documenting
* ANYTHING that makes this stuff at all possible.
* *
* Should be PUSHed directly on top of a serial I/O channel. * Should be PUSHed directly on top of a serial I/O channel.
* Provides complete chucode structures to user space. * Provides complete chucode structures to user space.
* *
* COMPILATION: * COMPILATION:
* *
*
* To make a SunOS 4.1.x compatable loadable module (from the ntp kernel * To make a SunOS 4.1.x compatable loadable module (from the ntp kernel
* directory): * directory):
* *
* % cc -c -I../include -DLOADABLE tty_chu_STREAMS.c * % cc -c -I../include -DLOADABLE tty_chu_STREAMS.c
* *
* The resulting .o file is the loadable module. Modload it * The resulting .o file is the loadable module. Modload it
* with -entry _chuinit. * thusly:
* *
* You can also add it into the kernel by hacking it into the streams * % modload tty_chu_STREAMS.o -entry _chuinit
* table in the kernel, then adding it to config:
* *
* pseudo-device chuN * When none of the instances are pushed in a STREAM, you can
* modunload the driver in the usual manner if you wish.
*
* As an alternative to loading it dynamically you can compile it
* directly into the kernel by hacking str_conf.c. See the README
* file for more details on doing it the old fashioned way.
*
*
* To make a Solaris 2.x compatable module (from the ntp kernel
* directory):
*
* % {gcc,cc} -c -I../include -DSOLARIS2 tty_chu_STREAMS.c
* % ld -r -o /usr/kernel/strmod/chu tty_chu_STREAMS.o
* % chmod 755 /usr/kernel/strmod/chu
*
* The OS will load it for you automagically when it is first pushed.
* *
* where N is the maximum number of concurent chu sessions you expect
* to have.
* *
* HISTORY: * HISTORY:
* *
* v2.3 - Added support for Solaris 2.x.
* v2.2 - Added SERVICE IMMEDIATE hack.
* v2.1 - Added 'sixth byte' heuristics. * v2.1 - Added 'sixth byte' heuristics.
* v2.0 - first version with an actual version number. * v2.0 - first version with an actual version number.
* Added support for new CHU 'second 31' data format. * Added support for new CHU 'second 31' data format.
@ -39,13 +56,18 @@
* *
*/ */
#ifndef LOADABLE #ifdef SOLARIS2
# include "chu.h" # ifndef NCHU
#else # define NCHU 3
# define _KERNEL
# endif
#elif defined(LOADABLE)
# ifndef NCHU # ifndef NCHU
# define NCHU 3 # define NCHU 3
# define KERNEL # define KERNEL
# endif # endif
#else
# include "chu.h"
#endif #endif
#if NCHU > 0 #if NCHU > 0
@ -61,12 +83,35 @@
#include <sys/stream.h> #include <sys/stream.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/kernel.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/user.h> #include <sys/user.h>
#include <syslog.h>
#include <sys/tty.h>
#include <sys/chudefs.h> #include <sys/chudefs.h>
#ifdef SOLARIS2
#include <sys/conf.h>
#include <sys/strtty.h>
#include <sys/modctl.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
#endif
#ifdef LOADABLE
#include <sys/kernel.h>
#include <sys/conf.h>
#include <sys/buf.h>
#include <sundev/mbvar.h>
#include <sun/autoconf.h>
#include <sun/vddrv.h>
#endif
static struct module_info rminfo = { 0, "chu", 0, INFPSZ, 0, 0 }; static struct module_info rminfo = { 0, "chu", 0, INFPSZ, 0, 0 };
static struct module_info wminfo = { 0, "chu", 0, INFPSZ, 0, 0 }; static struct module_info wminfo = { 0, "chu", 0, INFPSZ, 0, 0 };
static int chuopen(), churput(), chuwput(), chuclose(); static int chuopen(), churput(), chuwput(), chuclose();
@ -88,14 +133,67 @@ struct priv_data
struct chucode chu_struct; struct chucode chu_struct;
} our_priv_data[NCHU]; } our_priv_data[NCHU];
#ifdef SOLARIS2
static struct fmodsw fsw =
{
"chu",
&chuinfo,
D_NEW
};
extern struct mod_ops mod_strmodops;
static struct modlstrmod modlstrmod =
{
&mod_strmodops,
"CHU timecode decoder v2.3",
&fsw
};
static struct modlinkage modlinkage =
{
MODREV_1,
(void*) &modlstrmod,
NULL
};
int _init()
{
int i;
for (i=0; i<NCHU; i++)
our_priv_data[i].in_use=0;
return mod_install(&modlinkage);
}
int _info(foo)
struct modinfo *foo;
{
return mod_info(&modlinkage,foo);
}
int _fini()
{
int dev;
for (dev = 0; dev < NCHU; dev++)
if (our_priv_data[dev].in_use)
{
/* One of the modules is still open */
/* This is likely supposed to be impossible under Solaris 2.x */
return (EBUSY);
}
return mod_remove(&modlinkage);
}
#endif /* SOLARIS2 */
#ifdef LOADABLE #ifdef LOADABLE
#ifdef sun # ifdef sun
#include <sys/conf.h>
#include <sys/buf.h>
#include <sundev/mbvar.h>
#include <sun/autoconf.h>
#include <sun/vddrv.h>
static struct vdldrv vd = static struct vdldrv vd =
{ {
@ -163,9 +261,11 @@ chuinit (fc, vdp, vdi, vds)
} }
} }
#endif # endif /* sun */
#else #endif /* LOADABLE */
#if !defined(LOADABLE) && !defined(SOLARIS2)
char chu_first_open=1; char chu_first_open=1;
@ -180,7 +280,7 @@ int sflag;
{ {
int i; int i;
#ifndef LOADABLE #if !defined(LOADABLE) && !defined(SOLARIS2)
if (chu_first_open) if (chu_first_open)
{ {
chu_first_open=0; chu_first_open=0;
@ -196,11 +296,25 @@ int sflag;
((struct priv_data *) (q->q_ptr))=&(our_priv_data[i]); ((struct priv_data *) (q->q_ptr))=&(our_priv_data[i]);
our_priv_data[i].in_use++; our_priv_data[i].in_use++;
our_priv_data[i].chu_struct.ncodechars = 0; our_priv_data[i].chu_struct.ncodechars = 0;
if (!putctl1(WR(q)->q_next, M_CTL, MC_SERVICEIMM))
{
our_priv_data[i].in_use=0;
#ifdef SOLARIS2
return (EFAULT);
#else
u.u_error = EFAULT;
return (OPENFAIL);
#endif
}
return 0; return 0;
} }
#ifdef SOLARIS2
return (EBUSY);
#else
u.u_error = EBUSY; u.u_error = EBUSY;
return (OPENFAIL); return (OPENFAIL);
#endif
} }
@ -282,7 +396,12 @@ queue_t *q;
if (mp==NULL) if (mp==NULL)
{ {
#ifdef SOLARIS2
/* XXX we can't log it because strlog() is too complicated. This isn't
supposed to happen anyway. The hell with it. */
#else
log(LOG_ERR,"chu: cannot allocate message"); log(LOG_ERR,"chu: cannot allocate message");
#endif
return; return;
} }
@ -441,4 +560,4 @@ queue_t *q;
} }
} }
#endif #endif /* NCHU > 0 */

View file

@ -62,7 +62,7 @@ struct priv_data_type
char first_open=1; char first_open=1;
/* /*
* God only knows why, but linking with strchr() and index() fail * God only knows why, but linking with strchr() fails
* on my system, so here's a renamed copy. * on my system, so here's a renamed copy.
*/ */

View file

@ -80,7 +80,8 @@ MD5auth2crypt(keyno, pkt, length)
MD5Update(&ctx, (char *)(pkt) + length - 8, 8); MD5Update(&ctx, (char *)(pkt) + length - 8, 8);
MD5Final(&ctx); MD5Final(&ctx);
bcopy((char *)ctx.digest, (char *) &pkt[NOCRYPT_LONGS + length/sizeof(U_LONG)], memmove((char *) &pkt[NOCRYPT_LONGS + length/sizeof(U_LONG)],
BLOCK_OCTETS); (char *) ctx.digest,
return 4 + BLOCK_OCTETS; BLOCK_OCTETS);
return (4 + BLOCK_OCTETS);
} }

View file

@ -54,5 +54,7 @@ MD5authdecrypt(keyno, pkt, length)
MD5Update(&ctx, (char *)pkt, length); MD5Update(&ctx, (char *)pkt, length);
MD5Final(&ctx); MD5Final(&ctx);
return (0 == bcmp((char *)ctx.digest, (char *)pkt + length + 4, BLOCK_OCTETS)); return (!memcmp((char *)ctx.digest,
(char *)pkt + length + 4,
BLOCK_OCTETS));
} }

View file

@ -63,6 +63,8 @@ MD5authencrypt(keyno, pkt, length)
MD5Update(&ctx, (char *)pkt, length); MD5Update(&ctx, (char *)pkt, length);
MD5Final(&ctx); MD5Final(&ctx);
bcopy((char *)ctx.digest, (char *) &pkt[NOCRYPT_LONGS + len], BLOCK_OCTETS); memmove((char *)&pkt[NOCRYPT_LONGS + len],
return 4 + BLOCK_OCTETS; /* return size of key and MAC */ (char *)ctx.digest,
BLOCK_OCTETS);
return (4 + BLOCK_OCTETS); /* return size of key and MAC */
} }

View file

@ -3,58 +3,12 @@
*/ */
#include "ntp_stdlib.h" #include "ntp_stdlib.h"
#if !defined(XNTP_BIG_ENDIAN) && !defined(XNTP_LITTLE_ENDIAN)
#if defined(XNTP_AUTO_ENDIAN)
#include <netinet/in.h>
#if BYTE_ORDER == BIG_ENDIAN
#define XNTP_BIG_ENDIAN
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
#define XNTP_LITTLE_ENDIAN
#endif
#else /* AUTO */
#ifdef WORDS_BIGENDIAN
#define XNTP_BIG_ENDIAN 1
#else
#define XNTP_LITTLE_ENDIAN 1
#endif
#endif /* AUTO */
#endif /* !BIG && !LITTLE */
/* /*
* There are two entries in here. auth_subkeys() called to * There are two entries in here. auth_subkeys() called to
* compute the encryption and decryption key schedules, while * compute the encryption and decryption key schedules, while
* auth_des() is called to do the actual encryption/decryption * auth_des() is called to do the actual encryption/decryption
*/ */
/*
* Byte order woes. The DES code is sensitive to byte order. This
* used to be resolved by calling ntohl() and htonl() to swap things
* around, but this turned out to be quite costly on Vaxes where those
* things are actual functions. The code now straightens out byte
* order troubles on its own, with no performance penalty for little
* end first machines, but at great expense to cleanliness.
*/
#if !defined(XNTP_BIG_ENDIAN) && !defined(XNTP_LITTLE_ENDIAN)
/*
* Pick one or the other.
*/
BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif
#if defined(XNTP_BIG_ENDIAN) && defined(XNTP_LITTLE_ENDIAN)
/*
* Pick one or the other.
*/
BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif
/* /*
* Key setup. Here we entirely permute a key, saving the results * Key setup. Here we entirely permute a key, saving the results
* for both the encryption and decryption. Note that while the * for both the encryption and decryption. Note that while the

View file

@ -15,6 +15,7 @@
* to its exportable state, copy this file to authdes.c . * to its exportable state, copy this file to authdes.c .
*/ */
#include <sys/types.h> #include <sys/types.h>
#include "ntp_stdlib.h"
/* /*
* This routine is normally called to compute the key schedule. * This routine is normally called to compute the key schedule.

View file

@ -109,7 +109,7 @@ init_auth()
/* /*
* Initialize hash table and free list * Initialize hash table and free list
*/ */
bzero((char *)key_hash, sizeof key_hash); memset((char *)key_hash, 0, sizeof key_hash);
cache_flags = cache_keyid = 0; cache_flags = cache_keyid = 0;
authnumfreekeys = authkeynotfound = authkeylookups = 0; authnumfreekeys = authkeynotfound = authkeylookups = 0;

View file

@ -96,7 +96,7 @@ authusekey(keyno, keytype, str)
/* /*
* Make up key from ascii representation * Make up key from ascii representation
*/ */
bzero((char *) keybytes, sizeof(keybytes)); memset((char *) keybytes, 0, sizeof(keybytes));
for (i = 0; i < 8 && i < len; i++) for (i = 0; i < 8 && i < len; i++)
keybytes[i] = *cp++ << 1; keybytes[i] = *cp++ << 1;
key[0] = (U_LONG)keybytes[0] << 24 | (U_LONG)keybytes[1] << 16 key[0] = (U_LONG)keybytes[0] << 24 | (U_LONG)keybytes[1] << 16

View file

@ -24,6 +24,7 @@ struct clktype clktypes[] = {
{ REFCLK_IRIG_TPRO, "Odetics/KSI TPRO IRIG decoder (12)", "IRIG_TPRO" }, { REFCLK_IRIG_TPRO, "Odetics/KSI TPRO IRIG decoder (12)", "IRIG_TPRO" },
{ REFCLK_ATOM_LEITCH, "Leitch CSD 5300 controller (13)", "ATOM_LEITCH" }, { REFCLK_ATOM_LEITCH, "Leitch CSD 5300 controller (13)", "ATOM_LEITCH" },
{ REFCLK_MSF_EES, "MSF EES M201, UK (14)", "MSF_EES" }, { REFCLK_MSF_EES, "MSF EES M201, UK (14)", "MSF_EES" },
{ REFCLK_GPSTM_TRUETIME, "TrueTime GPS/TM-TMD clock (15)", "GPS_TRUE" },
{ -1, "", "" } { -1, "", "" }
}; };

View file

@ -31,7 +31,7 @@ dofptoa(fpv, neg, ndec, msec)
/* /*
* Zero out the buffer * Zero out the buffer
*/ */
bzero((char *)cbuf, sizeof cbuf); memset((char *)cbuf, 0, sizeof cbuf);
/* /*
* Set the pointers to point at the first * Set the pointers to point at the first

View file

@ -32,7 +32,7 @@ dolfptoa(fpi, fpv, neg, ndec, msec)
/* /*
* Zero the character buffer * Zero the character buffer
*/ */
bzero((char *) cbuf, sizeof(cbuf)); memset((char *) cbuf, 0, sizeof(cbuf));
/* /*
* Work on the integral part. This is biased by what I know * Work on the integral part. This is biased by what I know

View file

@ -4,7 +4,9 @@
* This is a version of the public domain getopt() implementation by * This is a version of the public domain getopt() implementation by
* Henry Spencer, changed for 4.3BSD compatibility (in addition to System V). * Henry Spencer, changed for 4.3BSD compatibility (in addition to System V).
* It allows rescanning of an option list by setting optind to 0 before * It allows rescanning of an option list by setting optind to 0 before
* calling. Thanks to Dennis Ferguson for the appropriate modifications. * calling, which is why we use it even if the system has its own (in fact,
* this one has a unique name so as not to conflict with the system's).
* Thanks to Dennis Ferguson for the appropriate modifications.
* *
* This file is in the Public Domain. * This file is in the Public Domain.
*/ */
@ -20,39 +22,33 @@
#define putc fputc #define putc fputc
#endif /* lint */ #endif /* lint */
char *optarg; /* Global argument pointer. */ char *ntp_optarg; /* Global argument pointer. */
#ifndef __convex__ int ntp_optind = 0; /* Global argv index. */
int optind = 0; /* Global argv index. */ int ntp_opterr = 1; /* for compatibility, should error be printed? */
#else /* __convex__ */ int ntp_optopt; /* for compatibility, option character checked */
extern int optind; /* Global argv index. */
#endif /* __convex__ */
/*
* N.B. use following at own risk
*/
#ifndef __convex__
int opterr = 1; /* for compatibility, should error be printed? */
#else /* __convex__ */
extern int opterr; /* for compatibility, should error be printed? */
#endif /* __convex__ */
int optopt; /* for compatibility, option character checked */
static char *scan = NULL; /* Private scan pointer. */ static char *scan = NULL; /* Private scan pointer. */
static char *prog = "amnesia";
/* /*
* Print message about a bad option. Watch this definition, it's * Print message about a bad option.
* not a single statement.
*/ */
#define BADOPT(mess, ch) if (opterr) { \ static int
fputs(argv[0], stderr); \ badopt(mess, ch)
fputs(mess, stderr); \ char *mess;
(void) putc(ch, stderr); \ int ch;
(void) putc('\n', stderr); \ {
} \ if (ntp_opterr) {
return('?') fputs(prog, stderr);
fputs(mess, stderr);
(void) putc(ch, stderr);
(void) putc('\n', stderr);
}
return ('?');
}
int int
getopt_l(argc, argv, optstring) ntp_getopt(argc, argv, optstring)
int argc; int argc;
char *argv[]; char *argv[];
char *optstring; char *optstring;
@ -60,47 +56,50 @@ getopt_l(argc, argv, optstring)
register char c; register char c;
register char *place; register char *place;
optarg = NULL; prog = argv[0];
ntp_optarg = NULL;
if (optind == 0) { if (ntp_optind == 0) {
scan = NULL; scan = NULL;
optind++; ntp_optind++;
} }
if (scan == NULL || *scan == '\0') { if (scan == NULL || *scan == '\0') {
if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') if (ntp_optind >= argc
return EOF; || argv[ntp_optind][0] != '-'
if (argv[optind][1] == '-' && argv[optind][2] == '\0') { || argv[ntp_optind][1] == '\0') {
optind++; return (EOF);
return EOF; }
if (argv[ntp_optind][1] == '-'
&& argv[ntp_optind][2] == '\0') {
ntp_optind++;
return (EOF);
} }
scan = argv[optind]+1; scan = argv[ntp_optind++]+1;
optind++;
} }
c = *scan++; c = *scan++;
optopt = c & 0377; ntp_optopt = c & 0377;
for (place = optstring; place != NULL && *place != '\0'; ++place) for (place = optstring; place != NULL && *place != '\0'; ++place)
if (*place == c) if (*place == c)
break; break;
if (place == NULL || *place == '\0' || c == ':' || c == '?') { if (place == NULL || *place == '\0' || c == ':' || c == '?') {
BADOPT(": unknown option -", c); return (badopt(": unknown option -", c));
} }
place++; place++;
if (*place == ':') { if (*place == ':') {
if (*scan != '\0') { if (*scan != '\0') {
optarg = scan; ntp_optarg = scan;
scan = NULL; scan = NULL;
} else if (optind >= argc) { } else if (ntp_optind >= argc) {
BADOPT(": option requires argument -", c); return (badopt(": option requires argument -", c));
} else { } else {
optarg = argv[optind]; ntp_optarg = argv[ntp_optind++];
optind++;
} }
} }
return c&0377; return (c & 0377);
} }

View file

@ -1,118 +1,43 @@
/* /* machines.c - provide special support for peculiar architectures
* provide special support for peculiar architectures
* *
* Real bummers unite ! * Real bummers unite !
*
* $Id:$
*/ */
#include "ntp_stdlib.h"
#ifdef SYS_PTX #ifdef SYS_PTX
#include <sys/types.h> #include <sys/types.h>
#include <sys/procstats.h> #include <sys/procstats.h>
int settimeofday(tvp)
int
settimeofday(tvp)
struct timeval *tvp; struct timeval *tvp;
{ {
return stime(&tvp->tv_sec); /* lie as bad as SysVR4 */ return (stime(&tvp->tv_sec)); /* lie as bad as SysVR4 */
} }
int gettimeofday(tvp) int
gettimeofday(tvp)
struct timeval *tvp; struct timeval *tvp;
{ {
/* /*
* hi, this is Sequents sneak path to get to a clock * hi, this is Sequents sneak path to get to a clock
* this is also the most logical syscall for such a function * this is also the most logical syscall for such a function
*/ */
return get_process_stats(tvp, PS_SELF, (struct procstats *) 0, return (get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
(struct procstats *) 0); (struct procstats *) 0));
} }
#endif #endif
#ifdef SYS_HPUX #if !defined(NTP_POSIX_SOURCE) || defined(NTP_NEED_BOPS)
/* hpux.c,v 3.1 1993/07/06 01:08:23 jbj Exp void
* hpux.c -- compatibility routines for HP-UX. ntp_memset(a, x, c)
* XXX many of these are not needed anymore. char *a;
*/ int x, c;
#include "ntp_machine.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include "ntp_stdlib.h"
#if (SYS_HPUX < 8)
char
*index(s, c)
register char *s;
register int c;
{ {
return strchr (s, c); while (c-- > 0)
*a++ = x;
} }
#endif /*POSIX*/
char
*rindex(s, c)
register char *s;
register int c;
{
return strrchr (s, c);
}
int
bcmp(a, b, count)
register char *a, *b;
register int count;
{
return memcmp (a, b, count);
}
void
bcopy(from, to, count)
register char *from;
register char *to;
register int count;
{
if ((to == from) || (count <= 0))
return;
if ((to > from) && (to <= (from + count))) {
to += count;
from += count;
do {
*--to = *--from;
} while (--count);
}
else {
do {
*to++ = *from++;
} while (--count);
}
}
void
bzero(area, count)
register char *area;
register int count;
{
memset(area, 0, count);
}
#endif
getdtablesize()
{
return(sysconf(_SC_OPEN_MAX));
}
int
setlinebuf(a_stream)
FILE *a_stream;
{
return setvbuf(a_stream, (char *) NULL, _IOLBF, 0);
}
#endif

View file

@ -81,7 +81,8 @@ void msyslog(va_alist)
n += strlen(err); n += strlen(err);
} }
} }
*n++ = '\n'; if (!syslogit)
*n++ = '\n';
*n = '\0'; *n = '\0';
vsprintf(buf, nfmt, ap); vsprintf(buf, nfmt, ap);

View file

@ -1,7 +1,7 @@
/* numtohost.c,v 3.1 1993/07/06 01:08:40 jbj Exp /* numtohost.c,v 3.1 1993/07/06 01:08:40 jbj Exp
* numtohost - convert network number to host name. * numtohost - convert network number to host name.
*/ */
#include <string.h> #include "ntp_types.h"
#include <netdb.h> #include <netdb.h>
#include "ntp_fp.h" #include "ntp_fp.h"

View file

@ -3,7 +3,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#if defined(SYS_HPUX) || defined(sgi) || defined(__bsdi__) #if defined(SYS_HPUX) || defined(sgi) || defined(SYS_BSDI)
#include <sys/param.h> #include <sys/param.h>
#include <utmp.h> #include <utmp.h>
#endif #endif
@ -238,36 +238,40 @@ adj_systime(ts)
#endif #endif
} }
sys_clock_offset.l_ui = offset_i;
sys_clock_offset.l_uf = offset_f;
if (adjtime(&adjtv, &oadjtv) < 0) { if (adjtime(&adjtv, &oadjtv) < 0) {
syslog(LOG_ERR, "Can't do time adjustment: %m"); syslog(LOG_ERR, "Can't do time adjustment: %m");
rval = 0; rval = 0;
} else } else {
sys_clock_offset.l_ui = offset_i;
sys_clock_offset.l_uf = offset_f;
rval = 1; rval = 1;
#ifdef DEBUGRS6000 #ifdef DEBUGRS6000
syslog(LOG_ERR, "adj_systime(%s): offset = %s%s\n", syslog(LOG_ERR, "adj_systime(%s): offset = %s%s\n",
mfptoa((adj<0?-1:0), adj, 9), isneg?"-":"", mfptoa((adj<0?-1:0), adj, 9), isneg?"-":"",
umfptoa(offset_i, offset_f, 9)); umfptoa(offset_i, offset_f, 9));
syslog(LOG_ERR, "%d %d %d %d\n", (int) adjtv.tv_sec, syslog(LOG_ERR, "%d %d %d %d\n", (int) adjtv.tv_sec,
(int) adjtv.tv_usec, (int) oadjtv.tv_sec, (int) (int) adjtv.tv_usec, (int) oadjtv.tv_sec, (int)
oadjtv.tv_usec); oadjtv.tv_usec);
#endif /* DEBUGRS6000 */ #endif /* DEBUGRS6000 */
if ((oadjtv.tv_sec != 0 || oadjtv.tv_usec != 0) && (max_no_complete > 0)) { if (oadjtv.tv_sec != 0 || oadjtv.tv_usec != 0) {
sTVTOTS(&oadjtv, &oadjts); sTVTOTS(&oadjtv, &oadjts);
L_ADD(&sys_clock_offset, &oadjts); L_ADD(&sys_clock_offset, &oadjts);
syslog(LOG_WARNING, "Previous time adjustment didn't complete"); if (max_no_complete > 0) {
syslog(LOG_WARNING,
"Previous time adjustment didn't complete");
#ifdef DEBUG #ifdef DEBUG
if (debug > 4) if (debug > 4)
syslog(LOG_DEBUG, syslog(LOG_DEBUG,
"Previous adjtime() incomplete, residual = %s\n", "Previous adjtime() incomplete, residual = %s\n",
tvtoa(&oadjtv)); tvtoa(&oadjtv));
#endif #endif
if (--max_no_complete == 0) syslog(LOG_WARNING, if (--max_no_complete == 0)
"*** No more 'Prev time adj didn't complete'"); syslog(LOG_WARNING,
"*** No more 'Prev time adj didn't complete'");
}
}
} }
return(rval); return(rval);
} }
@ -345,7 +349,7 @@ step_systime_real(ts)
* is greater than one second. * is greater than one second.
*/ */
if (oldtime != timetv.tv_sec) { if (oldtime != timetv.tv_sec) {
bzero((char *)&ut, sizeof(ut)); memset((char *)&ut, 0, sizeof(ut));
ut.ut_type = OLD_TIME; ut.ut_type = OLD_TIME;
ut.ut_time = oldtime; ut.ut_time = oldtime;
(void)strcpy(ut.ut_line, OTIME_MSG); (void)strcpy(ut.ut_line, OTIME_MSG);

View file

@ -2,4 +2,4 @@ README file for directory ./machines of the NTP Version 3 distribution
This directory contains configuration files for the various machines This directory contains configuration files for the various machines
and compilers supported by the distribution. README and RELNOTES files in the and compilers supported by the distribution. README and RELNOTES files in the
parent directory for directions on how to use these files. parent directory contain directions on how to use these files.

View file

@ -1,6 +1,6 @@
RANLIB= : RANLIB= :
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DRS6000 -DSYS_AIX DEFS= -DRS6000 -DSYS_AIX -DHAVE_TERMIOS
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= DAEMONLIBS=

View file

@ -5,5 +5,4 @@ AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= -lkvm DAEMONLIBS= -lkvm
RESLIB= RESLIB=
COPTS= -g COPTS= -g -O

View file

@ -0,0 +1,9 @@
SHELL= /bin/sh
RANLIB= ls # ar does the work of ranlib under System V
DEFS_LOCAL= -DREFCLOCK
DEFS= -DSYS_SVR4
AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS=
RESLIB= -lnsl -lsocket -lelf
INSTALL= /usr/ucb/install

View file

@ -0,0 +1,7 @@
RANLIB= ranlib
DEFS_LOCAL= -DREFCLOCK
DEFS= -DSYS_DOMAINOS -D_INCLUDE_BSD_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_POSIX_SOURCE
AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS=
COMPAT=

View file

@ -1,6 +1,6 @@
RANLIB= ranlib RANLIB= ranlib
DEFS_LOCAL=-DREFCLOCK DEFS_LOCAL=-DREFCLOCK
DEFS= -DSYS_FREEBSD -DSYS_386BSD DEFS= -DSYS_FREEBSD -DSYS_386BSD -DHAVE_TERMIOS
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= -lcrypt DAEMONLIBS= -lcrypt

View file

@ -1,7 +1,7 @@
SHELL= /bin/sh SHELL= /bin/sh
RANLIB= ls # ar does the work of ranlib under System V RANLIB= ls # ar does the work of ranlib under System V
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DHAVE_SYSV_TTYS -DSYS_HPUX=8 DEFS= -DHAVE_TERMIOS -DSYS_HPUX=8
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
COPTS= COPTS=

View file

@ -1,7 +1,7 @@
SHELL= /bin/sh SHELL= /bin/sh
RANLIB= ls # ar does the work of ranlib under System V RANLIB= ls # ar does the work of ranlib under System V
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DHAVE_SYSV_TTYS -DSYS_HPUX=10 DEFS= -DHAVE_TERMIOS -DSYS_HPUX=10
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
COPTS= COPTS=

View file

@ -1,9 +1,9 @@
SHELL= /bin/sh SHELL= /bin/sh
RANLIB= ls # ar does the work of ranlib under System V RANLIB= ls # ar does the work of ranlib under System V
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DSYS_SVR4 DEFS= -DSYS_SVR4 -DSTREAMS_TLI
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= -lnsl -lsocket -lelf DAEMONLIBS=
RESLIB= -lnsl -lsocket -lelf RESLIB= -lnsl -lsocket -lelf
INSTALL= /usr/ucb/install INSTALL= /usr/ucb/install

View file

@ -1,6 +1,6 @@
SHELL= /bin/sh SHELL= /bin/sh
RANLIB= ranlib RANLIB= ranlib
DEFS= -DSYS_LINUX -DHAVE_SYSV_TTYS DEFS= -DSYS_LINUX -DHAVE_TERMIOS
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
INCL= -I../include -I/usr/include/bsd INCL= -I../include -I/usr/include/bsd
CLOCKDEFS= CLOCKDEFS=

View file

@ -1,6 +1,6 @@
RANLIB= ranlib RANLIB= ranlib
DEFS_LOCAL=-DREFCLOCK DEFS_LOCAL=-DREFCLOCK
DEFS= -DSYS_NETBSD -DSYS_386BSD DEFS= -DSYS_NETBSD -DSYS_386BSD -DHAVE_TERMIOS
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= -lcrypt -lutil DAEMONLIBS= -lcrypt -lutil

View file

@ -1,6 +1,6 @@
RANLIB= : RANLIB= :
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DREADKMEM -DSYS_PTX -DHAVE_SYSV_TTYS DEFS= -DREADKMEM -DSYS_PTX -DHAVE_TERMIOS
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= DAEMONLIBS=

View file

@ -1,6 +1,6 @@
RANLIB= ranlib RANLIB= ranlib
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DREADKMEM -DSYS_SEQUENT DEFS= -DHAVE_READ_KMEM -DSYS_SEQUENT
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= DAEMONLIBS=

View file

@ -1,6 +1,6 @@
RANLIB= : RANLIB= :
DEFS_LOCAL=-DREFCLOCK DEFS_LOCAL=-DREFCLOCK
DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS -DNTP_POSIX_SOURCE
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= DAEMONLIBS=

View file

@ -1,6 +1,6 @@
RANLIB= : RANLIB= :
DEFS_LOCAL= -DREFCLOCK DEFS_LOCAL= -DREFCLOCK
DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS -DADJTIME_IS_ACCURATE DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS -DADJTIME_IS_ACCURATE -DNTP_POSIX_SOURCE
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= -DLOCAL_CLOCK CLOCKDEFS= -DLOCAL_CLOCK
DAEMONLIBS= DAEMONLIBS=

View file

@ -1,6 +1,6 @@
SHELL= /bin/sh SHELL= /bin/sh
RANLIB= ls # ar does the work of ranlib under System V RANLIB= ls # ar does the work of ranlib under System V
DEFS= -DSYS_SVR4 DEFS= -DSYS_SVR4 -DSTREAMS_TLI
AUTHDEFS= -DDES -DMD5 AUTHDEFS= -DDES -DMD5
CLOCKDEFS= CLOCKDEFS=
DAEMONLIBS= -lnet -lnsl -lsocket -lelf DAEMONLIBS= -lnet -lnsl -lsocket -lelf

View file

@ -167,8 +167,8 @@ main(argc, argv)
l_fp tmp; l_fp tmp;
int errflg; int errflg;
int c; int c;
extern char *optarg; extern char *ntp_optarg;
extern int optind; extern int ntp_optind;
extern char *Version; extern char *Version;
errflg = 0; errflg = 0;
@ -178,10 +178,10 @@ main(argc, argv)
/* /*
* Decode argument list * Decode argument list
*/ */
while ((c = getopt_l(argc, argv, "a:bde:k:o:p:qst:v")) != EOF) while ((c = ntp_getopt(argc, argv, "a:bde:k:o:p:qst:v")) != EOF)
switch (c) { switch (c) {
case 'a': case 'a':
c = atoi(optarg); c = atoi(ntp_optarg);
sys_authenticate = 1; sys_authenticate = 1;
sys_authkey = (U_LONG)c; sys_authkey = (U_LONG)c;
break; break;
@ -192,24 +192,24 @@ main(argc, argv)
++debug; ++debug;
break; break;
case 'e': case 'e':
if (!atolfp(optarg, &tmp) if (!atolfp(ntp_optarg, &tmp)
|| tmp.l_ui != 0) { || tmp.l_ui != 0) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: encryption delay %s is unlikely\n", "%s: encryption delay %s is unlikely\n",
progname, optarg); progname, ntp_optarg);
errflg++; errflg++;
} else { } else {
sys_authdelay = tmp.l_uf; sys_authdelay = tmp.l_uf;
} }
break; break;
case 'k': case 'k':
key_file = optarg; key_file = ntp_optarg;
break; break;
case 'o': case 'o':
sys_version = atoi(optarg); sys_version = atoi(ntp_optarg);
break; break;
case 'p': case 'p':
c = atoi(optarg); c = atoi(ntp_optarg);
if (c <= 0 || c > NTP_SHIFT) { if (c <= 0 || c > NTP_SHIFT) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: number of samples (%d) is invalid\n", "%s: number of samples (%d) is invalid\n",
@ -226,10 +226,10 @@ main(argc, argv)
syslogit = 1; syslogit = 1;
break; break;
case 't': case 't':
if (!atolfp(optarg, &tmp)) { if (!atolfp(ntp_optarg, &tmp)) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: timeout %s is undecodeable\n", "%s: timeout %s is undecodeable\n",
progname, optarg); progname, ntp_optarg);
errflg++; errflg++;
} else { } else {
sys_timeout = ((LFPTOFP(&tmp) * TIMER_HZ) sys_timeout = ((LFPTOFP(&tmp) * TIMER_HZ)
@ -248,7 +248,7 @@ main(argc, argv)
break; break;
} }
sys_maxservers = argc - optind; sys_maxservers = argc - ntp_optind;
if (errflg || sys_maxservers == 0) { if (errflg || sys_maxservers == 0) {
(void) fprintf(stderr, (void) fprintf(stderr,
"usage: %s [-bqs] [-a key#] [-k file] [-p samples] [-t timeo] server ...\n", "usage: %s [-bqs] [-a key#] [-k file] [-p samples] [-t timeo] server ...\n",
@ -293,8 +293,8 @@ main(argc, argv)
/* /*
* Add servers we are going to be polling * Add servers we are going to be polling
*/ */
for ( ; optind < argc; optind++) for ( ; ntp_optind < argc; ntp_optind++)
addserver(argv[optind]); addserver(argv[ntp_optind]);
if (sys_numservers == 0) { if (sys_numservers == 0) {
syslog(LOG_ERR, "no servers can be used, exiting"); syslog(LOG_ERR, "no servers can be used, exiting");
@ -520,16 +520,8 @@ receive(rbufp)
} }
rpkt = &(rbufp->recv_pkt); rpkt = &(rbufp->recv_pkt);
if (PKT_VERSION(rpkt->li_vn_mode) == NTP_OLDVERSION) { if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION ||
#ifdef notdef PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) {
/*
* Fuzzballs do encryption but still claim
* to be version 1.
*/
if (has_mac)
return;
#endif
} else if (PKT_VERSION(rpkt->li_vn_mode) != NTP_VERSION) {
return; return;
} }
@ -1038,7 +1030,7 @@ addserver(serv)
} }
server = (struct server *)emalloc(sizeof(struct server)); server = (struct server *)emalloc(sizeof(struct server));
bzero((char *)server, sizeof(struct server)); memset((char *)server, 0, sizeof(struct server));
server->srcadr.sin_family = AF_INET; server->srcadr.sin_family = AF_INET;
server->srcadr.sin_addr.s_addr = netnum; server->srcadr.sin_addr.s_addr = netnum;
@ -1196,7 +1188,7 @@ init_io()
if (!debug && !simple_query) { if (!debug && !simple_query) {
struct sockaddr_in addr; struct sockaddr_in addr;
bzero((char *)&addr, sizeof addr); memset((char *)&addr, 0, sizeof addr);
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons(NTP_PORT); addr.sin_port = htons(NTP_PORT);
addr.sin_addr.s_addr = INADDR_ANY; addr.sin_addr.s_addr = INADDR_ANY;
@ -1490,10 +1482,10 @@ getnetnum(host, num)
if (decodenetnum(host, num)) { if (decodenetnum(host, num)) {
return 1; return 1;
} else if ((hp = gethostbyname(host)) != 0) { } else if ((hp = gethostbyname(host)) != 0) {
bcopy(hp->h_addr, (char *)num, sizeof(U_LONG)); memmove((char *)num, hp->h_addr, sizeof(U_LONG));
return 1; return (1);
} }
return 0; return (0);
} }
/* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */ /* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */
@ -1527,7 +1519,7 @@ printserver(pp, fp)
if (pp->stratum == 1) { if (pp->stratum == 1) {
junk[4] = 0; junk[4] = 0;
bcopy((char *)&pp->refid, junk, 4); memmove(junk, (char *)&pp->refid, 4);
str = junk; str = junk;
} else { } else {
str = numtoa(pp->refid); str = numtoa(pp->refid);

View file

@ -301,7 +301,7 @@ static int decodereach P((char *, U_LONG *));
static int decodearr P((char *, int *, l_fp *)); static int decodearr P((char *, int *, l_fp *));
static char * getcode P((int, struct codestring *)); static char * getcode P((int, struct codestring *));
static void help P((struct parse *, FILE *)); static void help P((struct parse *, FILE *));
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
static int helpsort P((const void *, const void *)); static int helpsort P((const void *, const void *));
#else #else
static int helpsort P((char **, char **)); static int helpsort P((char **, char **));
@ -335,11 +335,11 @@ static void output P((FILE *, char *, char *));
static void endoutput P((FILE *)); static void endoutput P((FILE *));
static void outputarr P((FILE *, char *, int, l_fp *)); static void outputarr P((FILE *, char *, int, l_fp *));
static void cookedprint P((int, int, char *, int, FILE *)); static void cookedprint P((int, int, char *, int, FILE *));
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
static int assoccmp P((const void *, const void *)); static int assoccmp P((const void *, const void *));
#else #else
static int assoccmp P((struct association *, struct association *)); static int assoccmp P((struct association *, struct association *));
#endif /* sgi */ #endif /* sgi || bsdi */
/* /*
@ -509,17 +509,17 @@ char *argv[];
{ {
int c; int c;
int errflg = 0; int errflg = 0;
extern int optind; extern int ntp_optind;
extern char *optarg; extern char *ntp_optarg;
delay_time.l_ui = 0; delay_time.l_ui = 0;
delay_time.l_uf = DEFDELAY; delay_time.l_uf = DEFDELAY;
progname = argv[0]; progname = argv[0];
while ((c = getopt_l(argc, argv, "c:dinp")) != EOF) while ((c = ntp_getopt(argc, argv, "c:dinp")) != EOF)
switch (c) { switch (c) {
case 'c': case 'c':
ADDCMD(optarg); ADDCMD(ntp_optarg);
break; break;
case 'd': case 'd':
++debug; ++debug;
@ -543,11 +543,11 @@ char *argv[];
progname); progname);
exit(2); exit(2);
} }
if (optind == argc) { if (ntp_optind == argc) {
ADDHOST(DEFHOST); ADDHOST(DEFHOST);
} else { } else {
for (; optind < argc; optind++) for (; ntp_optind < argc; ntp_optind++)
ADDHOST(argv[optind]); ADDHOST(argv[ntp_optind]);
} }
if (numcmds == 0 && interactive == 0 if (numcmds == 0 && interactive == 0
@ -982,7 +982,7 @@ getresponse(opcode, associd, rstatus, rsize, rdata, timeo)
/* /*
* Copy the data into the data buffer. * Copy the data into the data buffer.
*/ */
bcopy((char *)rpkt.data, (char *)pktdata + offset, count); memmove((char *)pktdata + offset, (char *)rpkt.data, count);
/* /*
* If we've seen the last fragment, look for holes in the sequence. * If we've seen the last fragment, look for holes in the sequence.
@ -1050,7 +1050,7 @@ sendrequest(opcode, associd, auth, qsize, qdata)
* bit boundary. * bit boundary.
*/ */
if (qsize > 0) { if (qsize > 0) {
bcopy(qdata, (char *)qpkt.data, qsize); memmove((char *)qpkt.data, qdata, qsize);
pktsize = qsize + CTL_HEADER_LEN; pktsize = qsize + CTL_HEADER_LEN;
while (pktsize & (sizeof(U_LONG)-1)) { while (pktsize & (sizeof(U_LONG)-1)) {
qpkt.data[qsize++] = 0; qpkt.data[qsize++] = 0;
@ -1541,7 +1541,7 @@ getnetnum(host, num, fullhost)
} }
return 1; return 1;
} else if ((hp = gethostbyname(host)) != 0) { } else if ((hp = gethostbyname(host)) != 0) {
bcopy(hp->h_addr, (char *)num, sizeof(U_LONG)); memmove((char *)num, hp->h_addr, sizeof(U_LONG));
if (fullhost != 0) if (fullhost != 0)
(void) strcpy(fullhost, hp->h_name); (void) strcpy(fullhost, hp->h_name);
return 1; return 1;
@ -1888,11 +1888,11 @@ help(pcmd, fp)
for (xcp = opcmds; xcp->keyword != 0; xcp++) for (xcp = opcmds; xcp->keyword != 0; xcp++)
cmdsort[n++] = xcp->keyword; cmdsort[n++] = xcp->keyword;
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
qsort((void *)cmdsort, n, sizeof(char *), helpsort); qsort((void *)cmdsort, n, sizeof(char *), helpsort);
#else #else
qsort((char *)cmdsort, n, sizeof(char *), helpsort); qsort((char *)cmdsort, n, sizeof(char *), helpsort);
#endif /* sgi */ #endif /* sgi || bsdi */
maxlength = 0; maxlength = 0;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
@ -1934,7 +1934,7 @@ help(pcmd, fp)
* helpsort - do hostname qsort comparisons * helpsort - do hostname qsort comparisons
*/ */
static int static int
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
helpsort(t1, t2) helpsort(t1, t2)
const void *t1; const void *t1;
const void *t2; const void *t2;
@ -1946,7 +1946,7 @@ helpsort(name1, name2)
char **name1; char **name1;
char **name2; char **name2;
{ {
#endif /* sgi */ #endif /* sgi || bsdi */
return strcmp(*name1, *name2); return strcmp(*name1, *name2);
} }
@ -2577,6 +2577,7 @@ nextvar(datalen, datap, vname, vvalue)
register char *cp; register char *cp;
register char *np; register char *np;
register char *cpend; register char *cpend;
int quoted = 0;
static char name[MAXVARLEN]; static char name[MAXVARLEN];
static char value[MAXVALLEN]; static char value[MAXVALLEN];
@ -2623,8 +2624,11 @@ nextvar(datalen, datap, vname, vvalue)
while (cp < cpend && (isspace(*cp) && *cp != '\r' && *cp != '\n')) while (cp < cpend && (isspace(*cp) && *cp != '\r' && *cp != '\n'))
cp++; cp++;
np = value; np = value;
while (cp < cpend && *cp != ',') while (cp < cpend && ((*cp != ',') || quoted))
*np++ = *cp++; {
quoted ^= ((*np++ = *cp++) == '"');
}
while (np > value && isspace(*(np-1))) while (np > value && isspace(*(np-1)))
np--; np--;
*np = '\0'; *np = '\0';
@ -3024,13 +3028,13 @@ void
sortassoc() sortassoc()
{ {
if (numassoc > 1) if (numassoc > 1)
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
qsort((void *)assoc_cache, numassoc, qsort((void *)assoc_cache, numassoc,
sizeof(struct association), assoccmp); sizeof(struct association), assoccmp);
#else #else
qsort((char *)assoc_cache, numassoc, qsort((char *)assoc_cache, numassoc,
sizeof(struct association), assoccmp); sizeof(struct association), assoccmp);
#endif /* sgi */ #endif /* sgi || bsdi */
} }
@ -3038,7 +3042,7 @@ sortassoc()
* assoccmp - compare two associations * assoccmp - compare two associations
*/ */
static int static int
#if defined(sgi) #if defined(sgi) || defined(SYS_BSDI)
assoccmp(t1, t2) assoccmp(t1, t2)
const void *t1; const void *t1;
const void *t2; const void *t2;
@ -3050,7 +3054,7 @@ assoccmp(ass1, ass2)
struct association *ass1; struct association *ass1;
struct association *ass2; struct association *ass2;
{ {
#endif /* sgi */ #endif /* sgi || bsdi */
if (ass1->assid < ass2->assid) if (ass1->assid < ass2->assid)
return -1; return -1;
if (ass1->assid > ass2->assid) if (ass1->assid > ass2->assid)

View file

@ -217,6 +217,7 @@ checkassocid(value)
/* /*
* strsave - save a string * strsave - save a string
* XXX - should be in libntp.a
*/ */
static char * static char *
strsave(str) strsave(str)
@ -231,8 +232,8 @@ strsave(str)
exit(1); exit(1);
} }
bcopy(str, cp, len); memmove(cp, str, len);
return cp; return (cp);
} }
@ -372,11 +373,11 @@ makequerydata(vlist, datalen, data)
if (cp != data) if (cp != data)
*cp++ = ','; *cp++ = ',';
bcopy(vl->name, cp, namelen); memmove(cp, vl->name, namelen);
cp += namelen; cp += namelen;
if (valuelen != 0) { if (valuelen != 0) {
*cp++ = '='; *cp++ = '=';
bcopy(vl->value, cp, valuelen); memmove(cp, vl->value, valuelen);
cp += valuelen; cp += valuelen;
} }
} }
@ -600,7 +601,7 @@ readvar(pcmd, fp)
else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
return; return;
bzero((char *)tmplist, sizeof(tmplist)); memset((char *)tmplist, 0, sizeof(tmplist));
if (pcmd->nargs >= 2) if (pcmd->nargs >= 2)
doaddvlist(tmplist, pcmd->argval[1].string); doaddvlist(tmplist, pcmd->argval[1].string);
@ -631,7 +632,7 @@ writevar(pcmd, fp)
else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
return; return;
bzero((char *)tmplist, sizeof(tmplist)); memset((char *)tmplist, 0, sizeof(tmplist));
doaddvlist(tmplist, pcmd->argval[1].string); doaddvlist(tmplist, pcmd->argval[1].string);
res = doquerylist(tmplist, CTL_OP_WRITEVAR, associd, 0, &rstatus, res = doquerylist(tmplist, CTL_OP_WRITEVAR, associd, 0, &rstatus,
@ -690,7 +691,7 @@ clockvar(pcmd, fp)
else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
return; return;
bzero((char *)tmplist, sizeof(tmplist)); memset((char *)tmplist, 0, sizeof(tmplist));
if (pcmd->nargs >= 2) if (pcmd->nargs >= 2)
doaddvlist(tmplist, pcmd->argval[1].string); doaddvlist(tmplist, pcmd->argval[1].string);
@ -802,7 +803,7 @@ mreadvar(pcmd, fp)
&from, &to)) &from, &to))
return; return;
bzero((char *)tmplist, sizeof(tmplist)); memset((char *)tmplist, 0, sizeof(tmplist));
if (pcmd->nargs >= 3) if (pcmd->nargs >= 3)
doaddvlist(tmplist, pcmd->argval[2].string); doaddvlist(tmplist, pcmd->argval[2].string);
@ -1282,7 +1283,7 @@ doprintpeers(pvl, associd, rstatus, datalen, data, fp)
char refid_string[10]; char refid_string[10];
extern struct ctl_var peer_var[]; extern struct ctl_var peer_var[];
bzero((char *)havevar, sizeof(havevar)); memset((char *)havevar, 0, sizeof(havevar));
gettstamp(&ts); gettstamp(&ts);
while (nextvar(&datalen, &data, &name, &value)) { while (nextvar(&datalen, &data, &name, &value)) {

View file

@ -111,8 +111,8 @@ main(argc, argv)
struct server *firstserver; struct server *firstserver;
int errflg; int errflg;
int c; int c;
extern char *optarg; extern char *ntp_optarg;
extern int optind; extern int ntp_optind;
extern char *Version; extern char *Version;
errflg = 0; errflg = 0;
@ -121,7 +121,7 @@ main(argc, argv)
/* /*
* Decode argument list * Decode argument list
*/ */
while ((c = getopt_l(argc, argv, "do:nr:t:v")) != EOF) while ((c = ntp_getopt(argc, argv, "do:nr:t:v")) != EOF)
switch (c) { switch (c) {
case 'd': case 'd':
++debug; ++debug;
@ -130,10 +130,10 @@ main(argc, argv)
nonames = 1; nonames = 1;
break; break;
case 'o': case 'o':
sys_version = atoi(optarg); sys_version = atoi(ntp_optarg);
break; break;
case 'r': case 'r':
sys_retries = atoi(optarg); sys_retries = atoi(ntp_optarg);
if (sys_retries < 1) { if (sys_retries < 1) {
(void)fprintf(stderr, (void)fprintf(stderr,
"%s: retries (%d) too small\n", "%s: retries (%d) too small\n",
@ -142,7 +142,7 @@ main(argc, argv)
} }
break; break;
case 't': case 't':
sys_timeout = atoi(optarg); sys_timeout = atoi(ntp_optarg);
if (sys_timeout < 1) { if (sys_timeout < 1) {
(void)fprintf(stderr, (void)fprintf(stderr,
"%s: timeout (%d) too short\n", "%s: timeout (%d) too short\n",
@ -160,7 +160,7 @@ main(argc, argv)
break; break;
} }
if (errflg || (argc - optind) > 1) { if (errflg || (argc - ntp_optind) > 1) {
(void) fprintf(stderr, (void) fprintf(stderr,
"usage: %s [-vnd] [-r retries] [-t timeout] [server]\n", "usage: %s [-vnd] [-r retries] [-t timeout] [server]\n",
progname); progname);
@ -182,8 +182,8 @@ main(argc, argv)
if (debug || verbose) if (debug || verbose)
syslog(LOG_NOTICE, "%s", Version); syslog(LOG_NOTICE, "%s", Version);
if ((argc - optind) == 1) if ((argc - ntp_optind) == 1)
firstserver = addservbyname(argv[optind]); firstserver = addservbyname(argv[ntp_optind]);
else else
firstserver = addservbyname("localhost"); firstserver = addservbyname("localhost");
@ -502,7 +502,7 @@ struct in_addr *iap;
} }
server = (struct server *)emalloc(sizeof(struct server)); server = (struct server *)emalloc(sizeof(struct server));
bzero((char *)server, sizeof(struct server)); memset((char *)server, 0, sizeof(struct server));
server->srcadr.sin_family = AF_INET; server->srcadr.sin_family = AF_INET;
server->srcadr.sin_addr = *iap; server->srcadr.sin_addr = *iap;
@ -616,7 +616,7 @@ getipaddr(host, num)
if (decodeipaddr(host, num)) { if (decodeipaddr(host, num)) {
return 1; return 1;
} else if ((hp = gethostbyname(host)) != 0) { } else if ((hp = gethostbyname(host)) != 0) {
bcopy(hp->h_addr, (char *)num, sizeof(U_LONG)); memmove((char *)num, hp->h_addr, sizeof(U_LONG));
return 1; return 1;
} }
return 0; return 0;
@ -735,7 +735,7 @@ struct server *pp;
if (pp->stratum == 1) { if (pp->stratum == 1) {
junk[4] = 0; junk[4] = 0;
bcopy((char *)&pp->refid, junk, 4); memmove(junk, (char *)&pp->refid, 4);
str = junk; str = junk;
(void) fprintf(fp, "'%s'", str); (void) fprintf(fp, "'%s'", str);
} else { } else {

View file

@ -30,17 +30,22 @@ parse: parsesolaris.c libparse_kernel.a ../lib/libntp.a
ld -r -o parse parsesolaris.o libparse_kernel.a ../lib/libntp.a ld -r -o parse parsesolaris.o libparse_kernel.a ../lib/libntp.a
@echo "--- Install 'parse' in /kernel/strmod for automatic loading" @echo "--- Install 'parse' in /kernel/strmod for automatic loading"
mparsestreams.o: parsestreams.c microtime.o ../lib/libntp.a libparse_kernel.a ../include/parse.h ../include/sys/parsestreams.h mparsestreams.o: mparsestreams.o.$(KARCH)
@echo "--- You may load mparsestreams.o.$(KARCH) via 'modload mparsestreams.o.$(KARCH)' into the kernel"
mparsestreams.o.$(KARCH): parsestreams.c microtime.o ../lib/libntp.a libparse_kernel.a ../include/parse.h ../include/sys/parsestreams.h
cc -c -DMICROTIME $(DEFS) -I../include parsestreams.c cc -c -DMICROTIME $(DEFS) -I../include parsestreams.c
ld -r -o $@ parsestreams.o ../lib/libntp.a libparse_kernel.a \ ld -r -o $@ parsestreams.o ../lib/libntp.a libparse_kernel.a \
microtime.o microtime.o
rm -f parsestreams.o rm -f parsestreams.o
@echo "--- You may load mparsestreams.o via 'modload mparsestreams.o' into the kernel"
parsestreams.o: parsestreams.c ../lib/libntp.a libparse_kernel.a ../include/parse.h ../include/sys/parsestreams.h parsestreams.o: parsestreams.o.$(KARCH)
@echo "--- You may load parsestreams.o.$(KARCH) via 'modload parsestreams.o.$(KARCH)' into the kernel"
parsestreams.o.$(KARCH): parsestreams.c ../lib/libntp.a libparse_kernel.a ../include/parse.h ../include/sys/parsestreams.h
cc -c $(DEFS) -I../include parsestreams.c cc -c $(DEFS) -I../include parsestreams.c
ld -r -o $@ $@ ../lib/libntp.a libparse_kernel.a ld -r -o $@ parsestreams.o ../lib/libntp.a libparse_kernel.a
@echo "--- You may load parsestreams.o via 'modload parsestreams.o' into the kernel" rm -f parsestreams.o
microtime.o: $(MICROTIME) assym.s microtime.o: $(MICROTIME) assym.s
cc -E -I. $(MICROTIME) | sed -e '/\.global _uniqtime/d' > $@.i cc -E -I. $(MICROTIME) | sed -e '/\.global _uniqtime/d' > $@.i

View file

@ -92,7 +92,7 @@ depend:
clean: clean:
-@rm -f $(LIBNAME).a $(KLIBNAME).a *.o *.out *.ln make.log Makefile.bak \ -@rm -f $(LIBNAME).a $(KLIBNAME).a *.o *.out *.ln make.log Makefile.bak \
lintlib.errs lint.errs genassym assym.s parsestreams parse lintlib.errs lint.errs genassym assym.s parsestreams parse parsestreams.o.*
-@cd util && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" -f Makefile.tmpl clean -@cd util && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" -f Makefile.tmpl clean
distclean: clean distclean: clean

View file

@ -1,12 +1,12 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_DCF7000) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_DCF7000)
/* /*
* /src/NTP/REPOSITORY/v3/parse/clk_dcf7000.c,v 3.8 1993/10/30 09:44:35 kardel Exp * /src/NTP/REPOSITORY/v3/parse/clk_dcf7000.c,v 3.10 1994/01/25 19:05:07 kardel Exp
* *
* clk_dcf7000.c,v 3.8 1993/10/30 09:44:35 kardel Exp * clk_dcf7000.c,v 3.10 1994/01/25 19:05:07 kardel Exp
* *
* ELV DCF7000 module * ELV DCF7000 module
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,

View file

@ -1,12 +1,12 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_MEINBERG) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_MEINBERG)
/* /*
* /src/NTP/REPOSITORY/v3/parse/clk_meinberg.c,v 3.9 1993/10/30 09:44:38 kardel Exp * /src/NTP/REPOSITORY/v3/parse/clk_meinberg.c,v 3.11 1994/01/25 19:05:10 kardel Exp
* *
* clk_meinberg.c,v 3.9 1993/10/30 09:44:38 kardel Exp * clk_meinberg.c,v 3.11 1994/01/25 19:05:10 kardel Exp
* *
* Meinberg clock support * Meinberg clock support
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -414,6 +414,12 @@ cvt_mgps(buffer, size, format, clock)
* History: * History:
* *
* clk_meinberg.c,v * clk_meinberg.c,v
* Revision 3.11 1994/01/25 19:05:10 kardel
* 94/01/23 reconcilation
*
* Revision 3.10 1994/01/23 17:21:54 kardel
* 1994 reconcilation
*
* Revision 3.9 1993/10/30 09:44:38 kardel * Revision 3.9 1993/10/30 09:44:38 kardel
* conditional compilation flag cleanup * conditional compilation flag cleanup
* *

View file

@ -1,12 +1,12 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_RAWDCF) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_RAWDCF)
/* /*
* /src/NTP/REPOSITORY/v3/parse/clk_rawdcf.c,v 3.7 1993/10/30 09:44:41 kardel Exp * /src/NTP/REPOSITORY/v3/parse/clk_rawdcf.c,v 3.9 1994/01/25 19:05:12 kardel Exp
* *
* clk_rawdcf.c,v 3.7 1993/10/30 09:44:41 kardel Exp * clk_rawdcf.c,v 3.9 1994/01/25 19:05:12 kardel Exp
* *
* Raw DCF77 pulse clock support * Raw DCF77 pulse clock support
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -469,7 +469,7 @@ static unsigned LONG pps_rawdcf(parseio, status, ptime)
register int status; register int status;
register timestamp_t *ptime; register timestamp_t *ptime;
{ {
if (status == SYNC_ONE) if (!status)
{ {
parseio->parse_dtime.parse_ptime = *ptime; parseio->parse_dtime.parse_ptime = *ptime;
parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
@ -529,6 +529,12 @@ static unsigned LONG snt_rawdcf(parseio, ptime)
* History: * History:
* *
* clk_rawdcf.c,v * clk_rawdcf.c,v
* Revision 3.9 1994/01/25 19:05:12 kardel
* 94/01/23 reconcilation
*
* Revision 3.8 1994/01/22 11:24:11 kardel
* fixed PPS handling
*
* Revision 3.7 1993/10/30 09:44:41 kardel * Revision 3.7 1993/10/30 09:44:41 kardel
* conditional compilation flag cleanup * conditional compilation flag cleanup
* *

View file

@ -1,12 +1,12 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_SCHMID) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_SCHMID)
/* /*
* /src/NTP/REPOSITORY/v3/parse/clk_schmid.c,v 3.8 1993/11/01 20:00:18 kardel Exp * /src/NTP/REPOSITORY/v3/parse/clk_schmid.c,v 3.10 1994/01/25 19:05:15 kardel Exp
* *
* clk_schmid.c,v 3.8 1993/11/01 20:00:18 kardel Exp * clk_schmid.c,v 3.10 1994/01/25 19:05:15 kardel Exp
* *
* Schmid clock support * Schmid clock support
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -168,6 +168,12 @@ cvt_schmid(buffer, size, format, clock)
* History: * History:
* *
* clk_schmid.c,v * clk_schmid.c,v
* Revision 3.10 1994/01/25 19:05:15 kardel
* 94/01/23 reconcilation
*
* Revision 3.9 1994/01/23 17:21:56 kardel
* 1994 reconcilation
*
* Revision 3.8 1993/11/01 20:00:18 kardel * Revision 3.8 1993/11/01 20:00:18 kardel
* parse Solaris support (initial version) * parse Solaris support (initial version)
* *

View file

@ -1,6 +1,6 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_TRIMSV6) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) && defined(CLOCK_TRIMSV6)
/* /*
* /src/NTP/REPOSITORY/v3/parse/clk_trimble.c,v 3.6 1993/10/30 09:44:45 kardel Exp * /src/NTP/REPOSITORY/v3/parse/clk_trimble.c,v 3.7 1994/01/25 19:05:17 kardel Exp
* *
* Trimble SV6 clock support * Trimble SV6 clock support
*/ */
@ -106,6 +106,9 @@ cvt_trimsv6(buffer, size, format, clock)
* History: * History:
* *
* clk_trimble.c,v * clk_trimble.c,v
* Revision 3.7 1994/01/25 19:05:17 kardel
* 94/01/23 reconcilation
*
* Revision 3.6 1993/10/30 09:44:45 kardel * Revision 3.6 1993/10/30 09:44:45 kardel
* conditional compilation flag cleanup * conditional compilation flag cleanup
* *

View file

@ -1,8 +1,8 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS))
/* /*
* /src/NTP/REPOSITORY/v3/parse/parse.c,v 3.17 1993/11/11 11:20:29 kardel Exp * /src/NTP/REPOSITORY/v3/parse/parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp
* *
* parse.c,v 3.17 1993/11/11 11:20:29 kardel Exp * parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp
* *
* Parser module for reference clock * Parser module for reference clock
* *
@ -12,7 +12,7 @@
* a struct timeval. * a struct timeval.
* when PARSEKERNEL is not defined NTP time stamps will be used. * when PARSEKERNEL is not defined NTP time stamps will be used.
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -22,30 +22,39 @@
*/ */
#if !(defined(lint) || defined(__GNUC__)) #if !(defined(lint) || defined(__GNUC__))
static char rcsid[] = "parse.c,v 3.17 1993/11/11 11:20:29 kardel Exp"; static char rcsid[] = "parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp";
#endif #endif
#include "sys/types.h" #include "sys/types.h"
#include "sys/time.h" #include "sys/time.h"
#include "sys/errno.h" #include "sys/errno.h"
#include "ntp_machine.h"
#if defined(PARSESTREAM) && (defined(SYS_SUNOS4) || defined(SYS_SOLARIS)) && defined(STREAM)
/*
* Sorry, but in SunOS 4.x AND Solaris 2.x kernels there are no
* mem* operations. I don't want them - bcopy, bzero
* are fine in the kernel
*/
#ifndef NTP_NEED_BOPS
#define NTP_NEED_BOPS
#endif
#else
#ifndef NTP_NEED_BOPS
#ifndef bzero
#define bzero(_X_, _Y_) memset(_X_, 0, _Y_)
#define bcopy(_X_, _Y_, _Z_) memmove(_Y_, _X_, _Z_)
#endif
#endif
#endif
#include "ntp_fp.h" #include "ntp_fp.h"
#include "ntp_unixtime.h" #include "ntp_unixtime.h"
#include "ntp_calendar.h" #include "ntp_calendar.h"
#include "parse.h" #include "parse.h"
#if defined(PARSESTREAM) && (defined(SYS_SUNOS4) || defined(SYS_SOLARIS)) && defined(STREAM)
/*
* Sorry, but in SunOS 4.x kernels there are no
* mem* operations. I don't want them - bcopy, bzero
* are fine in the kernel
*/
#define _ntp_string_h
extern void bcopy();
extern void bzero();
#endif
#include "ntp_stdlib.h" #include "ntp_stdlib.h"
#ifdef PARSESTREAM #ifdef PARSESTREAM
@ -1139,6 +1148,12 @@ parse_setcs(dct, parse)
* History: * History:
* *
* parse.c,v * parse.c,v
* Revision 3.19 1994/01/25 19:05:20 kardel
* 94/01/23 reconcilation
*
* Revision 3.18 1994/01/23 17:21:59 kardel
* 1994 reconcilation
*
* Revision 3.17 1993/11/11 11:20:29 kardel * Revision 3.17 1993/11/11 11:20:29 kardel
* declaration fixes * declaration fixes
* *

View file

@ -1,8 +1,8 @@
#if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS))
/* /*
* /src/NTP/REPOSITORY/v3/parse/parse_conf.c,v 3.11 1993/11/01 20:00:24 kardel Exp * /src/NTP/REPOSITORY/v3/parse/parse_conf.c,v 3.13 1994/01/25 19:05:23 kardel Exp
* *
* parse_conf.c,v 3.11 1993/11/01 20:00:24 kardel Exp * parse_conf.c,v 3.13 1994/01/25 19:05:23 kardel Exp
* *
* Parser configuration module for reference clocks * Parser configuration module for reference clocks
* *
@ -12,7 +12,7 @@
* a struct timeval. * a struct timeval.
* when STREAM is not defined NTP time stamps will be used. * when STREAM is not defined NTP time stamps will be used.
* *
* Copyright (c) 1992,1993 * Copyright (c) 1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -81,6 +81,12 @@ unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1;
* History: * History:
* *
* parse_conf.c,v * parse_conf.c,v
* Revision 3.13 1994/01/25 19:05:23 kardel
* 94/01/23 reconcilation
*
* Revision 3.12 1994/01/23 17:22:02 kardel
* 1994 reconcilation
*
* Revision 3.11 1993/11/01 20:00:24 kardel * Revision 3.11 1993/11/01 20:00:24 kardel
* parse Solaris support (initial version) * parse Solaris support (initial version)
* *

View file

@ -1,13 +1,13 @@
/* /*
* /src/NTP/REPOSITORY/v3/parse/parsesolaris.c,v 3.4 1993/11/13 11:13:17 kardel Exp * /src/NTP/REPOSITORY/v3/parse/parsesolaris.c,v 3.9 1994/01/25 19:05:26 kardel Exp
* *
* parsesolaris.c,v 3.4 1993/11/13 11:13:17 kardel Exp * parsesolaris.c,v 3.9 1994/01/25 19:05:26 kardel Exp
* *
* STREAMS module for reference clocks * STREAMS module for reference clocks
* (SunOS5.x - not fully tested - buyer beware ! - OS KILLERS may still be * (SunOS5.x - not fully tested - buyer beware ! - OS KILLERS may still be
* lurking in the code!) * lurking in the code!)
* *
* Copyright (c) 1993 * Copyright (c) 1993,1994
* derived work from parsestreams.c ((c) 1991-1993, Frank Kardel) and * derived work from parsestreams.c ((c) 1991-1993, Frank Kardel) and
* dcf77sync.c((c) Frank Kardel) * dcf77sync.c((c) Frank Kardel)
* Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg
@ -19,7 +19,7 @@
*/ */
#ifndef lint #ifndef lint
static char rcsid[] = "parsesolaris.c,v 3.4 1993/11/13 11:13:17 kardel Exp"; static char rcsid[] = "parsesolaris.c,v 3.9 1994/01/25 19:05:26 kardel Exp";
#endif #endif
/* /*
@ -139,7 +139,7 @@ int Strcmp(s, t)
/*ARGSUSED*/ /*ARGSUSED*/
int _init(void) int _init(void)
{ {
static char revision[] = "3.4"; static char revision[] = "3.9";
char *s, *S, *t; char *s, *S, *t;
/* /*
@ -668,6 +668,7 @@ static int parserput(queue_t *q, mblk_t *imp)
* the service routine will move it to the next one * the service routine will move it to the next one
*/ */
parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type)); parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type));
if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
{ {
putnext(q, mp); putnext(q, mp);
@ -701,8 +702,9 @@ static int parserput(queue_t *q, mblk_t *imp)
} }
else else
{ {
#if 0
parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK")); parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK"));
#endif
if (type == M_DATA) if (type == M_DATA)
{ {
/* /*
@ -787,7 +789,15 @@ static int parserput(queue_t *q, mblk_t *imp)
else else
if (nmp) freemsg(nmp); if (nmp) freemsg(nmp);
parse_iodone(&parse->parse_io); parse_iodone(&parse->parse_io);
freemsg(mp);
} }
else
if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
{
putnext(q, mp);
}
else
putq(q, mp);
if (status) if (status)
{ {
@ -929,6 +939,11 @@ static int init_zs_linemon(queue_t *q, queue_t *my_q)
emergencyzs = zs->zs_ops; emergencyzs = zs->zs_ops;
zs->zs_ops = &szs->zsops; /* hook it up */ zs->zs_ops = &szs->zsops; /* hook it up */
/*
* XXX: this is usually done via zsopinit()
* - have yet to find a way to call that routine
*/
zs->zs_xsint = (void (*)())zs_xsisr;
mutex_exit(zs->zs_excl); mutex_exit(zs->zs_excl);
@ -961,6 +976,11 @@ static void close_zs_linemon(queue_t *q, queue_t *my_q)
mutex_enter(zs->zs_excl); mutex_enter(zs->zs_excl);
zs->zs_ops = szs->oldzsops; /* reset to previous handler functions */ zs->zs_ops = szs->oldzsops; /* reset to previous handler functions */
/*
* XXX: revert xsint (usually done via zsopinit() - have still to find
* a way to call that bugger
*/
zs->zs_xsint = zs->zs_ops->zsop_xsint;
mutex_exit(zs->zs_excl); mutex_exit(zs->zs_excl);
@ -971,6 +991,8 @@ static void close_zs_linemon(queue_t *q, queue_t *my_q)
} }
} }
#define ZSRR0_IGNORE (ZSRR0_CD|ZSRR0_SYNC|ZSRR0_CTS)
#define MAXDEPTH 50 /* maximum allowed stream crawl */ #define MAXDEPTH 50 /* maximum allowed stream crawl */
/* /*
@ -1072,11 +1094,12 @@ static void zs_xsisr(struct zscom *zs)
} }
/* /*
* only pretend that CD has been handled * only pretend that CD and ignored transistion (SYNC,CTS)
* have been handled
*/ */
za->za_rr0 = za->za_rr0 & ~ZSRR0_CD | zsstatus & ZSRR0_CD; za->za_rr0 = (za->za_rr0 & ~ZSRR0_IGNORE) | (zsstatus & ZSRR0_IGNORE);
if (!((za->za_rr0 ^ zsstatus) & ~ZSRR0_CD)) if (((za->za_rr0 ^ zsstatus) & ~ZSRR0_IGNORE) == 0)
{ {
/* /*
* all done - kill status indication and return * all done - kill status indication and return
@ -1086,6 +1109,8 @@ static void zs_xsisr(struct zscom *zs)
} }
} }
parseprintf(DD_ISR, ("zs_xsisr: non CD event 0x%x for \"%s\"\n",
(za->za_rr0 ^ zsstatus) & ~ZSRR0_CD,dname));
/* /*
* we are now gathered here to process some unusual external status * we are now gathered here to process some unusual external status
* interrupts. * interrupts.
@ -1154,6 +1179,21 @@ static void zs_xsisr(struct zscom *zs)
* History: * History:
* *
* parsesolaris.c,v * parsesolaris.c,v
* Revision 3.9 1994/01/25 19:05:26 kardel
* 94/01/23 reconcilation
*
* Revision 3.8 1994/01/23 17:22:04 kardel
* 1994 reconcilation
*
* Revision 3.7 1993/12/15 18:24:41 kardel
* Now also ignoring state changes on ZSRR0_{SYNC,CTS} to avoid zs driver bugs (Solaris 2.3)
*
* Revision 3.6 1993/12/15 12:48:53 kardel
* fixed message loss on M_*HANHUP messages
*
* Revision 3.5 1993/12/14 21:05:12 kardel
* PPS working now for SunOS 5.x zs external status hook
*
* Revision 3.4 1993/11/13 11:13:17 kardel * Revision 3.4 1993/11/13 11:13:17 kardel
* Solaris 2.3 additional includes * Solaris 2.3 additional includes
* *
@ -1166,5 +1206,4 @@ static void zs_xsisr(struct zscom *zs)
* Revision 3.1 1993/11/01 20:00:29 kardel * Revision 3.1 1993/11/01 20:00:29 kardel
* parse Solaris support (initial version) * parse Solaris support (initial version)
* *
*
*/ */

View file

@ -1,12 +1,12 @@
/* /*
* /src/NTP/REPOSITORY/v3/parse/parsestreams.c,v 3.9 1993/11/05 15:34:55 kardel Exp * /src/NTP/REPOSITORY/v3/parse/parsestreams.c,v 3.12 1994/01/25 19:05:30 kardel Exp
* *
* parsestreams.c,v 3.9 1993/11/05 15:34:55 kardel Exp * parsestreams.c,v 3.12 1994/01/25 19:05:30 kardel Exp
* *
* STREAMS module for reference clocks * STREAMS module for reference clocks
* (SunOS4.x) * (SunOS4.x)
* *
* Copyright (c) 1989,1990,1991,1992,1993 * Copyright (c) 1989,1990,1991,1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -16,7 +16,7 @@
*/ */
#ifndef lint #ifndef lint
static char rcsid[] = "parsestreams.c,v 3.9 1993/11/05 15:34:55 kardel Exp"; static char rcsid[] = "parsestreams.c,v 3.12 1994/01/25 19:05:30 kardel Exp";
#endif #endif
#include "sys/types.h" #include "sys/types.h"
@ -195,7 +195,7 @@ int xxxinit(fc, vdp, vdi, vds)
} }
else else
{ {
static char revision[] = "3.9"; static char revision[] = "3.12";
char *s, *S, *t; char *s, *S, *t;
strncpy(ifm->f_name, mname, FMNAMESZ); strncpy(ifm->f_name, mname, FMNAMESZ);
@ -884,7 +884,15 @@ static int parserput(q, mp)
else else
if (nmp) freemsg(nmp); if (nmp) freemsg(nmp);
parse_iodone(&parse->parse_io); parse_iodone(&parse->parse_io);
freemsg(mp);
} }
else
if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
{
putnext(q, mp);
}
else
putq(q, mp);
if (status) if (status)
{ {
@ -1250,6 +1258,15 @@ static void zs_xsisr(zs)
* History: * History:
* *
* parsestreams.c,v * parsestreams.c,v
* Revision 3.12 1994/01/25 19:05:30 kardel
* 94/01/23 reconcilation
*
* Revision 3.11 1994/01/23 17:22:07 kardel
* 1994 reconcilation
*
* Revision 3.10 1993/12/15 12:48:58 kardel
* fixed message loss on M_*HANHUP messages
*
* Revision 3.9 1993/11/05 15:34:55 kardel * Revision 3.9 1993/11/05 15:34:55 kardel
* shut up nice feature detection * shut up nice feature detection
* *

View file

@ -1,5 +1,5 @@
# #
# /src/NTP/REPOSITORY/v3/parse/util/Makefile.tmpl,v 3.11 1993/11/17 13:34:12 kardel Exp # /src/NTP/REPOSITORY/v3/parse/util/Makefile.tmpl,v 3.12 1994/01/25 19:05:39 kardel Exp
# #
COMPILER= cc COMPILER= cc
DEFS= DEFS=

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
/* /*
* /src/NTP/REPOSITORY/v3/kernel/parsetest.c,v 3.4 1993/03/17 17:16:57 kardel Exp * /src/NTP/REPOSITORY/v3/kernel/parsetest.c,v 3.4 1993/03/17 17:16:57 kardel Exp
* *
* parsetest.c,v 3.4 1993/03/17 17:16:57 kardel Exp * parsetest.c,v 3.10 1994/01/23 17:22:18 kardel Exp
* *
* Copyright (c) 1989,1990,1991,1992,1993 * Copyright (c) 1989,1990,1991,1992,1993,1994
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -198,7 +198,7 @@ main(argc, argv)
parsetime_t parsetime; parsetime_t parsetime;
struct strioctl strioc; struct strioctl strioc;
printf("parsetest.c,v 3.9 1993/10/10 21:18:49 kardel Exp\n"); printf("parsetest.c,v 3.10 1994/01/23 17:22:18 kardel Exp\n");
while (ioctl(fd, I_POP, 0) == 0) while (ioctl(fd, I_POP, 0) == 0)
; ;

View file

@ -1,11 +1,11 @@
/* /*
* /src/NTP/REPOSITORY/v3/parse/util/testdcf.c,v 3.7 1993/10/10 22:44:48 kardel Exp * /src/NTP/REPOSITORY/v3/parse/util/testdcf.c,v 3.9 1994/01/25 19:05:45 kardel Exp
* *
* testdcf.c,v 3.7 1993/10/10 22:44:48 kardel Exp * testdcf.c,v 3.9 1994/01/25 19:05:45 kardel Exp
* *
* simple DCF77 100/200ms pulse test program (via 50Baud serial line) * simple DCF77 100/200ms pulse test program (via 50Baud serial line)
* *
* Copyright (c) 1993 * Copyright (c) 1993,1994
* Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg * Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -352,7 +352,7 @@ main(argc, argv)
exit(1); exit(1);
} }
bzero(term.c_cc, sizeof(term.c_cc)); memset(term.c_cc, 0, sizeof(term.c_cc));
term.c_cc[VMIN] = 1; term.c_cc[VMIN] = 1;
term.c_cflag = B50|CS8|CREAD|CLOCAL; term.c_cflag = B50|CS8|CREAD|CLOCAL;
term.c_iflag = 0; term.c_iflag = 0;

View file

@ -11,14 +11,16 @@ WWVB WWVB
WWVBCLK /LD/||/STREAM/ PPSPPS LD||STREAM(tty_clock||tty_clk_streams) WWVBCLK /LD/||/STREAM/ PPSPPS LD||STREAM(tty_clock||tty_clk_streams)
WWVBPPS /PPSPPS/ WWVBPPS /PPSPPS/
CHU CHU /SUNOS4/ none CHU CHU /SUNOS4/ none
PARSE PARSE /SYS_V_TTYS/||/STREAM/ PPS any||STREAM(parse||ppsclock||ppsclocd) PARSE PARSE /SYSV_TTYS/||/STREAM/||/TERMIOS/ PPS any||STREAM(parse||ppsclock||ppsclocd)
PARSEPPS /SYS_V_TTYS/||/STREAM/ PPS any||STREAM(parse||ppsclock||ppsclocd) PARSEPPS /SYSV_TTYS/||/STREAM/||/TERMIOS/ PPS any||STREAM(parse||ppsclock||ppsclocd)
CLOCK_* CLOCK_*
MX4200 MX4200PPS /PPSPPS/ MX4200 MX4200PPS /PPSPPS/
AS2201 AS2201 AS2201 AS2201
AS2201PPS /PPSPPS/ AS2201PPS /PPSPPS/
GOES GOES GOES GOES
GOESPPS /PPSPPS/ GOESPPS /PPSPPS/
GPSTM GPSTM
GPSTTMPPS /PPSPPS/
OMEGA OMEGA OMEGA OMEGA
OMEGAPPS /PPSPPS/ OMEGAPPS /PPSPPS/
TPRO TPRO /SUNOS/ TPRO TPRO /SUNOS/

View file

@ -0,0 +1,33 @@
#!/bin/sh -
CMD="$1"
shift;
. refclocks/setup
case "$CMD" in
info)
echo " GPSTM - Kinemetrics/TrueTime GPS-TM/TMD receiver"
;;
check)
if check "$RCONFIG" '$0 ~ /GPSTM/'; then
echo "GPSTM - Kinemetrics/TrueTime GPS-TM/TMD receiver"
fi
;;
config)
if check "$REFCONF" '$0 ~ /GPSTM/' ||
( [ ! "$REFCONF" ] &&
query "Include Kinemetrics/TrueTime GPS-TM/TMD receiver (GPSTM)" n); then
if check "$PPSFEATURES" '$0 ~ /CD/'; then
if [ "$PPSOK" -eq 1 ] &&
(check "$REFCONF" '$0 ~ /GPSTMPPS/' ||
( [ ! "$REFCONF" ] && query " Use GPSTM for PPS" n)); then
echo "-DGPSTMPPS" >> $RCONFIG
else
echo "-DGPSTM" >> $RCONFIG
fi
else
echo "-DGPSTM" >> $RCONFIG
fi
fi
;;
esac

View file

@ -4,7 +4,7 @@ shift;
. refclocks/setup . refclocks/setup
if check "$DEFS" '$0 ~ /HAVE_SYSV_TTYS|STREAM/'; then if check "$DEFS" '$0 ~ /HAVE_SYSV_TTYS|STREAM|HAVE_TERMIOS/'; then
case "$CMD" in case "$CMD" in
info) info)
echo " PARSE - GENERIC refence clock driver" echo " PARSE - GENERIC refence clock driver"

View file

@ -81,11 +81,11 @@ else
for i in $rcfg for i in $rcfg
do do
sh $i config "$RCONFIG" "$PPSFEATURES" "$PPSOK" "$DEFS" "$REFCONF" sh $i config "$RCONFIG" "$PPSFEATURES" "$PPSOK" "$DEFS" "$REFCONF"
if [ "$PPSOK" -eq 1 ] && egrep -s -e '-D..*PPS' "$RCONFIG" >/dev/null 2>&1; then if [ "$PPSOK" -eq 1 ] && egrep -e '-D..*PPS' "$RCONFIG" >/dev/null 2>&1; then
PPSOK=0 PPSOK=0
fi fi
done done
if egrep -s -e '-D..*PPS' "$RCONFIG" >/dev/null 2>&1; then if egrep -e '-D..*PPS' "$RCONFIG" >/dev/null 2>&1; then
PPS="-DPPSPPS $PPS" PPS="-DPPSPPS $PPS"
fi fi
CLOCKDEFS="`tr '\012' ' ' < $RCONFIG`" CLOCKDEFS="`tr '\012' ' ' < $RCONFIG`"

View file

@ -19,7 +19,8 @@ if [ -f /bin/uname -o -f /usr/bin/uname ]; then
sinix-m) sinix-m)
guess=sinix-m guess=sinix-m
;; ;;
sunos) case "$3" in sunos|solaris)
case "$3" in
4.1*) guess="sunos4" ;; 4.1*) guess="sunos4" ;;
5.1) guess="sunos5.1" ;; 5.1) guess="sunos5.1" ;;
5.*) guess="sunos5.2" ;; 5.*) guess="sunos5.2" ;;
@ -59,7 +60,7 @@ if [ -f /bin/uname -o -f /usr/bin/uname ]; then
guess="netbsd" guess="netbsd"
;; ;;
# now the fun starts - there are vendors that # now the fun starts - there are vendors that
# do not really identify their OS un uname. # do not really identify their OS in uname.
# Fine - now I look at our version and hope # Fine - now I look at our version and hope
# that nobody else had this marvellous idea. # that nobody else had this marvellous idea.
# I am not willing to mention the vendor explicitly # I am not willing to mention the vendor explicitly
@ -109,6 +110,11 @@ if [ -f /netbsd ]; then
exit 0 exit 0
fi fi
if [ -f /lib/clib -a -f /lib/libc ]; then
echo domainos
exit 0
fi
case "$guess" in case "$guess" in
'') guess="none" '') guess="none"
esac esac

Some files were not shown because too many files have changed in this diff Show more