mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
xntpd version 3.3z from UDel
This commit is contained in:
parent
e7c996d95e
commit
b9eb1bdbc4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/UDEL/; revision=1081
@ -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 *
|
||||
* documentation for any purpose and without fee is hereby granted, provided *
|
||||
@ -53,4 +53,6 @@
|
||||
* support)
|
||||
* Karl Berry <karl@owl.HQ.ileaf.com> (syslog to file option)
|
||||
* 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)
|
||||
*/
|
||||
|
@ -27,15 +27,17 @@
|
||||
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# There are three serial port system software interfaces, each of
|
||||
# which is peculiar to one or more Unix versions. Define
|
||||
# -DHAVE_SYSV_TTYS for basic System V compatibility; define -DSTREAM
|
||||
# for POSIX compatibility including System V Streams, and
|
||||
# HAVE_BSD_TTYS for 4.3bsd compatibility. Only one of these three
|
||||
# should be defined. If none are defined, HAVE_BSD_TTYS is assumed.
|
||||
# HAVE_BSD_TTYS for 4.3bsd compatibility.
|
||||
# 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.
|
||||
#
|
||||
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
|
||||
# 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
|
||||
# should work in all systems with a serial port. The driver does not
|
||||
# support the CLK mode, but does support the PPS mode.
|
||||
|
@ -66,7 +66,7 @@ TARGETS = xntpd/xntpd xntpdc/xntpdc ntpq/ntpq ntpdate/ntpdate \
|
||||
OPTTARG = adjtime/adjtimed util/ntptime util/precision
|
||||
REFCONF=
|
||||
COMPRESSOR=compress
|
||||
# Base distribution name (will be extended by <VERSION>.tar.<comperssorsuffix>)
|
||||
# Base distribution name (will be extended by <VERSION>.tar.<compressorsuffix>)
|
||||
DISTNAME=xntp-
|
||||
MAKE= make
|
||||
|
||||
|
@ -16,20 +16,20 @@ the subdirectories contain README files describing their contents. The
|
||||
base directory ./ includes:
|
||||
|
||||
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
|
||||
"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.
|
||||
|
||||
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
|
||||
configuring a reference clock a "make refconf" should
|
||||
suffice. Diehards can still use an editor on this file.
|
||||
|
||||
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
|
||||
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-)
|
||||
|
||||
PORTING contains useful information for porting to unexplored
|
||||
new systems
|
||||
new systems.
|
||||
|
||||
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.
|
||||
|
||||
adjtime directory containing the sources for the adjtime daemon
|
||||
for HP/UX systems
|
||||
for HP/UX systems.
|
||||
|
||||
authstuff directory containing sources for miscellaneous programs
|
||||
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
|
||||
calculate propagation delays for use with radio clocks
|
||||
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 and operating systems
|
||||
compilers and operating systems.
|
||||
|
||||
conf directory containing a motley collection of
|
||||
configuration files for various systems. For example
|
||||
only.
|
||||
|
||||
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
|
||||
for a mysterious little box used as a CHU radio
|
||||
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
|
||||
programs in the distribution
|
||||
programs in the distribution.
|
||||
|
||||
hints directory containing files with hints on particular
|
||||
topics like installation on specific OS variants or
|
||||
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.
|
||||
general information.
|
||||
|
||||
kernel directory containing sources for kernel programs such as
|
||||
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
|
||||
used by most programs in the distribution
|
||||
used by most programs in the distribution.
|
||||
|
||||
machines directory containing configuration scripts for various
|
||||
operating systems
|
||||
operating systems.
|
||||
|
||||
ntpdate directory containing sources for a program to set the
|
||||
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
|
||||
can be used to reveal the chain of NTP peers from a
|
||||
designated peer to the primary server at the root of the
|
||||
timekeeping subnet
|
||||
timekeeping subnet.
|
||||
|
||||
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.
|
||||
additionally the SunOS 4.x streams module for parse is
|
||||
residing here.
|
||||
|
||||
parse/util some goodies for testing parse processing of DCF77 information.
|
||||
(primarily for use on Suns / although others may work
|
||||
also - possibly with a little porting)
|
||||
(primarily for use on Suns, although others may work
|
||||
also - possibly with a little porting.)
|
||||
one little gem is dcfd.c - DCF77 decoder with ntp loopfilter
|
||||
code for standalone DCF77 synchronisation without the full
|
||||
works of NTP.
|
||||
@ -135,9 +130,6 @@ ppsclock directory containing sources for modifications to the
|
||||
4.1.X systems only.
|
||||
|
||||
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
|
||||
file "config" in this directory and then the makefiles
|
||||
@ -147,10 +139,9 @@ scripts directory containing scripts to build the configuration
|
||||
and daemon startup.
|
||||
|
||||
util directory containing sources for various utility and
|
||||
testing programs
|
||||
testing programs.
|
||||
|
||||
xntpd directory containing sources for the NTP Version 3
|
||||
daemon
|
||||
xntpd directory containing sources for the NTP Version 3 daemon.
|
||||
|
||||
xntpdc directory containing sources for a utility program to
|
||||
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.
|
||||
|
||||
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.
|
||||
|
@ -7,7 +7,7 @@ this distribution. To make these programs:
|
||||
(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
|
||||
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
|
||||
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
|
||||
about PLL, PPS and radio clock type.
|
||||
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
|
||||
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 ? ?
|
||||
SGI IRIX 4.0.5F gcc no REFCLOCK (pb 93/11/10)
|
||||
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
|
||||
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 gcc LOCAL_CLOCK (kd 93/11/10)
|
||||
PC FreeBSD gcc LOCAL_CLOCK 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 Dell SVR4 v2.2 gcc ? (tl 93/12/30)
|
||||
NCR3445 NCR SVR4 cc LOCAL_CLOCK (tm 93/11/29)
|
||||
|
||||
pb: Piete Brooks
|
||||
kd: Frank Kardel
|
||||
dw: Torsten Duwe (duwe@informatik.uni-erlangen.de)
|
||||
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):
|
||||
|
||||
@ -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
|
||||
usualy things like the latest sh compatible pd shell in your own
|
||||
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:
|
||||
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:
|
||||
"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 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.
|
||||
We try to circumvent these bugs in a hopefully portable way.
|
||||
|
@ -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.
|
||||
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:
|
||||
|
||||
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:
|
||||
- terminal affiliation
|
||||
Check whether thing are still correct in respect to breaking
|
||||
|
@ -1 +1 @@
|
||||
version=3.3b (beta)
|
||||
version=3.3c (beta)
|
||||
|
@ -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/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/lock.h>
|
||||
#include <time.h>
|
||||
#include <signal.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"
|
||||
|
||||
double atof();
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
int InitClockRate();
|
||||
int AdjustClockRate();
|
||||
@ -80,9 +81,13 @@ main(argc, argv)
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
#ifdef 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) {
|
||||
case 'k':
|
||||
case 'r':
|
||||
@ -112,7 +117,7 @@ main(argc, argv)
|
||||
break;
|
||||
|
||||
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);
|
||||
exit(1);
|
||||
}
|
||||
@ -202,6 +207,12 @@ main(argc, argv)
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
if (plock(PROCLOCK)) {
|
||||
syslog(LOG_ERR, "plock: %m");
|
||||
perror("adjtimed: plock");
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) {
|
||||
if (errno == EINTR) continue;
|
||||
|
@ -65,12 +65,12 @@ char *argv[];
|
||||
int loops;
|
||||
int i;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
loops = DEFLOOPS;
|
||||
while ((c = getopt_l(argc, argv, "cdmn:")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "cdmn:")) != EOF)
|
||||
switch (c) {
|
||||
case 'c':
|
||||
totalcost++;
|
||||
@ -82,11 +82,11 @@ char *argv[];
|
||||
domd5 = 16; /* offset into list of keys */
|
||||
break;
|
||||
case 'n':
|
||||
loops = atoi(optarg);
|
||||
loops = atoi(ntp_optarg);
|
||||
if (loops <= 0) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: %s is unlikely to be a useful number of loops\n",
|
||||
progname, optarg);
|
||||
progname, ntp_optarg);
|
||||
errflg++;
|
||||
}
|
||||
break;
|
||||
@ -94,7 +94,7 @@ char *argv[];
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || optind == argc) {
|
||||
if (errflg || ntp_optind == argc) {
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s [-d] [-n loops] [ -c ] auth.samplekeys\n",
|
||||
progname);
|
||||
@ -108,7 +108,7 @@ char *argv[];
|
||||
printf(" based authentication.\n");
|
||||
|
||||
init_auth();
|
||||
authreadkeys(argv[optind]);
|
||||
authreadkeys(argv[ntp_optind]);
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (!auth_havekey(i + domd5)) {
|
||||
errflg++;
|
||||
|
@ -49,11 +49,11 @@ char *argv[];
|
||||
int errflg = 0;
|
||||
int keytype;
|
||||
U_LONG key[2];
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "adno:s")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "adno:s")) != EOF)
|
||||
switch (c) {
|
||||
case 'a':
|
||||
asciiflag = 1;
|
||||
@ -68,10 +68,10 @@ char *argv[];
|
||||
stdflag = 1;
|
||||
break;
|
||||
case 'o':
|
||||
if (*optarg == 'n') {
|
||||
if (*ntp_optarg == 'n') {
|
||||
ntpoutflag = 1;
|
||||
gotoopt = 1;
|
||||
} else if (*optarg == 's') {
|
||||
} else if (*ntp_optarg == 's') {
|
||||
ntpoutflag = 0;
|
||||
gotoopt = 1;
|
||||
} else {
|
||||
@ -85,7 +85,7 @@ char *argv[];
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || optind == argc) {
|
||||
if (errflg || ntp_optind == argc) {
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s -n|-s [-a] [-o n|s] key [...]\n",
|
||||
progname);
|
||||
@ -118,11 +118,11 @@ char *argv[];
|
||||
else
|
||||
keytype = KEY_TYPE_STD;
|
||||
|
||||
for (; optind < argc; optind++) {
|
||||
if (!decodekey(keytype, argv[optind], key)) {
|
||||
for (; ntp_optind < argc; ntp_optind++) {
|
||||
if (!decodekey(keytype, argv[ntp_optind], key)) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: format of key %s invalid\n",
|
||||
progname, argv[optind]);
|
||||
progname, argv[ntp_optind]);
|
||||
exit(1);
|
||||
}
|
||||
(void) parity(key);
|
||||
@ -242,7 +242,7 @@ decodekey(keytype, str, key)
|
||||
/*
|
||||
* Make up key from ascii representation
|
||||
*/
|
||||
bzero(keybytes, sizeof(keybytes));
|
||||
memset(keybytes, 0, sizeof(keybytes));
|
||||
for (i = 0; i < 8 && i < len; i++)
|
||||
keybytes[i] = *cp++ << 1;
|
||||
key[0] = keybytes[0] << 24 | keybytes[1] << 16
|
||||
|
@ -28,11 +28,11 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "d")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "d")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -183,7 +183,7 @@ doit()
|
||||
int ind4, ind5, ind6, ind7;
|
||||
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
|
||||
|
@ -25,11 +25,11 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "d")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "d")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -82,8 +82,8 @@ permute(bits, cp, dp)
|
||||
u_char c[28];
|
||||
u_char d[28];
|
||||
|
||||
bzero((char *)c, sizeof c);
|
||||
bzero((char *)d, sizeof d);
|
||||
memset((char *)c, 0, sizeof c);
|
||||
memset((char *)d, 0, sizeof d);
|
||||
|
||||
for (i = 0; i < 28; i++) {
|
||||
c[i] = bits[PC1_C[i]];
|
||||
@ -140,7 +140,7 @@ doit()
|
||||
U_LONG d;
|
||||
u_char bits[64];
|
||||
|
||||
bzero((char *)bits, sizeof bits);
|
||||
memset((char *)bits, 0, sizeof bits);
|
||||
|
||||
printf("static U_LONG PC1_CL[8] = {");
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
@ -26,11 +26,11 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "d")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "d")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -87,7 +87,7 @@ permc(bits, resp)
|
||||
register U_LONG mask;
|
||||
u_char res[24];
|
||||
|
||||
bzero((char *)res, sizeof res);
|
||||
memset((char *)res, 0, sizeof res);
|
||||
|
||||
for (i = 0; i < 24; i++) {
|
||||
res[i] = bits[PC2_C[i]];
|
||||
@ -117,7 +117,7 @@ permd(bits, resp)
|
||||
register U_LONG mask;
|
||||
u_char res[24];
|
||||
|
||||
bzero((char *)res, sizeof res);
|
||||
memset((char *)res, 0, sizeof res);
|
||||
|
||||
for (i = 0; i < 24; i++) {
|
||||
res[i] = bits[PC2_D[i]];
|
||||
@ -168,7 +168,7 @@ doit()
|
||||
U_LONG res;
|
||||
u_char bits[28];
|
||||
|
||||
bzero((char *)bits, sizeof bits);
|
||||
memset((char *)bits, 0, sizeof bits);
|
||||
|
||||
printf("static U_LONG PC2_C[4][64] = {");
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
@ -25,11 +25,11 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "d")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "d")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -165,7 +165,7 @@ doit()
|
||||
U_LONG result;
|
||||
int sixbits;
|
||||
|
||||
bzero((char *)bits, sizeof bits);
|
||||
memset((char *)bits, 0, sizeof bits);
|
||||
printf("static U_LONG SP[8][64] = {");
|
||||
for (selno = 0; selno < 8; selno++) {
|
||||
for (sixbits = 0; sixbits < 64; sixbits++) {
|
||||
|
@ -25,9 +25,9 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#ifdef __bsdi__
|
||||
#ifdef SYS_BSDI
|
||||
#include <sys/time.h>
|
||||
#endif /* __bsdi__ */
|
||||
#endif /* SYS_BSDI */
|
||||
#include "md5.h"
|
||||
|
||||
#define MD5
|
||||
|
@ -34,14 +34,14 @@ char *argv[];
|
||||
int numkeys;
|
||||
U_LONG tmp;
|
||||
char *passwd;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
extern char *getpass();
|
||||
|
||||
numkeys = 0;
|
||||
progname = argv[0];
|
||||
passwd = NULL;
|
||||
while ((c = getopt_l(argc, argv, "dnp:s")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "dnp:s")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -50,7 +50,7 @@ char *argv[];
|
||||
std = 0;
|
||||
break;
|
||||
case 'p':
|
||||
passwd = optarg;
|
||||
passwd = ntp_optarg;
|
||||
break;
|
||||
case 's':
|
||||
std = 1;
|
||||
@ -61,11 +61,11 @@ char *argv[];
|
||||
}
|
||||
|
||||
numkeys = 0;
|
||||
for (; !errflg && optind < argc; optind++) {
|
||||
c = atoi(argv[optind]);
|
||||
for (; !errflg && ntp_optind < argc; ntp_optind++) {
|
||||
c = atoi(argv[ntp_optind]);
|
||||
if (c <= 0 || c > 15) {
|
||||
(void) fprintf("%s: invalid key number `%s'\n",
|
||||
progname, argv[optind]);
|
||||
(void) fprintf(stderr, "%s: invalid key number `%s'\n",
|
||||
progname, argv[ntp_optind]);
|
||||
exit(2);
|
||||
}
|
||||
dokey[c] = 1;
|
||||
|
@ -34,11 +34,11 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "d")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "d")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -188,7 +188,7 @@ doit()
|
||||
int ind0, ind1, ind2, ind3;
|
||||
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
|
||||
|
@ -68,12 +68,12 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
void init_chu();
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "cdfpt")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "cdfpt")) != EOF)
|
||||
switch (c) {
|
||||
case 'c':
|
||||
#ifdef STREAM
|
||||
@ -107,7 +107,7 @@ char *argv[];
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || optind+1 != argc) {
|
||||
if (errflg || ntp_optind+1 != argc) {
|
||||
#ifdef STREAM
|
||||
(void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
|
||||
progname);
|
||||
@ -126,7 +126,7 @@ char *argv[];
|
||||
}
|
||||
|
||||
(void) gettimeofday(&lasttv, (struct timezone *)0);
|
||||
c = openterm(argv[optind]);
|
||||
c = openterm(argv[ntp_optind]);
|
||||
init_chu();
|
||||
#ifdef STREAM
|
||||
if (usechuldisc)
|
||||
|
@ -105,8 +105,8 @@ char *argv[];
|
||||
int fd;
|
||||
struct sgttyb ttyb;
|
||||
struct itimerval itimer;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
int alarming();
|
||||
int ioready();
|
||||
|
||||
@ -114,13 +114,13 @@ char *argv[];
|
||||
#ifdef STREAM
|
||||
magic[0] = 0;
|
||||
#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) {
|
||||
#ifdef CLKLDISC
|
||||
case 'a':
|
||||
#endif
|
||||
case 'c':
|
||||
if (!atouint(optarg, &tmp)) {
|
||||
if (!atouint(ntp_optarg, &tmp)) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: argument for -%c must be integer\n",
|
||||
progname, c);
|
||||
@ -139,7 +139,7 @@ char *argv[];
|
||||
#endif
|
||||
break;
|
||||
case 'b':
|
||||
if (!atouint(optarg, &tmp)) {
|
||||
if (!atouint(ntp_optarg, &tmp)) {
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
@ -163,14 +163,14 @@ char *argv[];
|
||||
ttflags |= CRMOD;
|
||||
break;
|
||||
case 's':
|
||||
cmdlen = strlen(optarg);
|
||||
cmdlen = strlen(ntp_optarg);
|
||||
if (cmdlen == 0)
|
||||
errflg++;
|
||||
else
|
||||
cmd = optarg;
|
||||
cmd = ntp_optarg;
|
||||
break;
|
||||
case 't':
|
||||
if (!atouint(optarg, &tmp))
|
||||
if (!atouint(ntp_optarg, &tmp))
|
||||
errflg++;
|
||||
else {
|
||||
timeout.tv_sec = (long)tmp;
|
||||
@ -181,7 +181,7 @@ char *argv[];
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || optind+1 != argc) {
|
||||
if (errflg || ntp_optind+1 != argc) {
|
||||
(void) fprintf(stderr,
|
||||
#ifdef CLKLDISC
|
||||
"usage: %s [-b bps] [-c magic1] [-a magic2] [-f] [-s cmd] [-t timeo] tty_device\n",
|
||||
@ -199,12 +199,12 @@ char *argv[];
|
||||
#endif
|
||||
|
||||
if (docmd)
|
||||
fd = open(argv[optind], O_RDWR, 0777);
|
||||
fd = open(argv[ntp_optind], O_RDWR, 0777);
|
||||
else
|
||||
fd = open(argv[optind], O_RDONLY, 0777);
|
||||
fd = open(argv[ntp_optind], O_RDONLY, 0777);
|
||||
if (fd == -1) {
|
||||
(void) fprintf(stderr, "%s: open(%s): ", progname,
|
||||
argv[optind]);
|
||||
argv[ntp_optind]);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -140,21 +140,21 @@ char *argv[];
|
||||
double lat1, long1;
|
||||
double lat2, long2;
|
||||
double lat3, long3;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "dh:CWG")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "dh:CWG")) != EOF)
|
||||
switch (c) {
|
||||
case 'd':
|
||||
++debug;
|
||||
break;
|
||||
case 'h':
|
||||
hflag++;
|
||||
height = atof(optarg);
|
||||
height = atof(ntp_optarg);
|
||||
if (height <= 0.0) {
|
||||
(void) fprintf(stderr, "height %s unlikely\n",
|
||||
optarg);
|
||||
ntp_optarg);
|
||||
errflg++;
|
||||
}
|
||||
break;
|
||||
@ -171,8 +171,8 @@ char *argv[];
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg || (!(Cflag || Wflag || Gflag) && optind+4 != argc) ||
|
||||
((Cflag || Wflag || Gflag) && optind+2 != argc)) {
|
||||
if (errflg || (!(Cflag || Wflag || Gflag) && ntp_optind+4 != argc) ||
|
||||
((Cflag || Wflag || Gflag) && ntp_optind+2 != argc)) {
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s [-d] [-h height] lat1 long1 lat2 long2\n",
|
||||
progname);
|
||||
@ -185,10 +185,10 @@ char *argv[];
|
||||
|
||||
|
||||
if (!(Cflag || Wflag || Gflag)) {
|
||||
lat1 = latlong(argv[optind], 1);
|
||||
long1 = latlong(argv[optind + 1], 0);
|
||||
lat2 = latlong(argv[optind + 2], 1);
|
||||
long2 = latlong(argv[optind + 3], 0);
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(argv[ntp_optind + 2], 1);
|
||||
long2 = latlong(argv[ntp_optind + 3], 0);
|
||||
if (hflag) {
|
||||
doit(lat1, long1, lat2, long2, height, "");
|
||||
} else {
|
||||
@ -201,8 +201,8 @@ char *argv[];
|
||||
/*
|
||||
* Compute delay from WWV
|
||||
*/
|
||||
lat1 = latlong(argv[optind], 1);
|
||||
long1 = latlong(argv[optind + 1], 0);
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(wwvlat, 1);
|
||||
long2 = latlong(wwvlong, 0);
|
||||
if (hflag) {
|
||||
@ -228,8 +228,8 @@ char *argv[];
|
||||
"WWVH winter propagation, ");
|
||||
}
|
||||
} else if (Cflag) {
|
||||
lat1 = latlong(argv[optind], 1);
|
||||
long1 = latlong(argv[optind + 1], 0);
|
||||
lat1 = latlong(argv[ntp_optind], 1);
|
||||
long1 = latlong(argv[ntp_optind + 1], 0);
|
||||
lat2 = latlong(chulat, 1);
|
||||
long2 = latlong(chulong, 0);
|
||||
if (hflag) {
|
||||
@ -243,8 +243,8 @@ char *argv[];
|
||||
} else if (Gflag) {
|
||||
lat1 = latlong(goes_up_lat, 1);
|
||||
long1 = latlong(goes_up_long, 0);
|
||||
lat3 = latlong(argv[optind], 1);
|
||||
long3 = latlong(argv[optind + 1], 0);
|
||||
lat3 = latlong(argv[ntp_optind], 1);
|
||||
long3 = latlong(argv[ntp_optind + 1], 0);
|
||||
|
||||
lat2 = latlong(goes_sat_lat, 1);
|
||||
|
||||
|
1
usr.sbin/xntpd/compilers/domainos.cc
Normal file
1
usr.sbin/xntpd/compilers/domainos.cc
Normal file
@ -0,0 +1 @@
|
||||
COMPILER= cc
|
@ -89,9 +89,6 @@ RANLIB= ranlib
|
||||
# to configure the particular clock drivers you want in the
|
||||
# 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
|
||||
# -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
|
||||
# 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
|
||||
|
@ -84,9 +84,6 @@ RANLIB= ranlib
|
||||
# to configure the particular clock drivers you want in the
|
||||
# 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
|
||||
# -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
|
||||
# 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
|
||||
|
@ -80,9 +80,6 @@ RANLIB= ranlib
|
||||
# to configure the particular clock drivers you want in the
|
||||
# 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
|
||||
# -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
|
||||
# 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
|
||||
|
@ -86,9 +86,6 @@ RANLIB= : # ar does the work of ranlib under System V
|
||||
# to configure the particular clock drivers you want in the
|
||||
# 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
|
||||
# -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
|
||||
# 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
|
||||
|
@ -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
|
||||
# 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)
|
||||
|
@ -74,6 +74,12 @@ xntpd - Network Time Protocol daemon
|
||||
] [
|
||||
.B -t
|
||||
.I trustedkey
|
||||
] [
|
||||
.B -v
|
||||
.I variable
|
||||
] [
|
||||
.B -V
|
||||
.I variable
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.I Xntpd
|
||||
@ -140,6 +146,10 @@ to be used when synchronizing to broadcasts
|
||||
specify a directory to be used for creating statistics files
|
||||
.Ip -t 8
|
||||
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"
|
||||
.IR Xntpd 's
|
||||
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
|
||||
.I xntpd.
|
||||
.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
|
||||
.I /path/xntpres
|
||||
.PP
|
||||
@ -1093,9 +1128,13 @@ fudge factor defines the phase offset of the sychnronisation character to the ac
|
||||
time.
|
||||
On the availability of PPS information the
|
||||
.I time2
|
||||
fudge factor show the difference betwteen the PPS time stamp and the reception
|
||||
time stamp of the serial signal. This parameter is read only attempts to
|
||||
set this parameter will be ignored.
|
||||
fudge factor defines the skew between the PPS time stamp and the reception
|
||||
time stamp of the PPS signal. This parameter is usually 0 as usually
|
||||
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
|
||||
.I flag0
|
||||
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
|
||||
timecode variable
|
||||
.PP
|
||||
The timecode variable in the ntpq read clock variable command contains several
|
||||
fields. The first field is the local time in Unix format. The second field is
|
||||
the offset to UTC (format HHMM). The currently active receiver flags are listed
|
||||
next. Additional feature flags of the receiver are optionally listed in paranthesis.
|
||||
The actual time code is enclosed in angle brackets < >. A qualification of the
|
||||
decoded time code format is following the time code. The last piece of information
|
||||
is the overall running time and the accumulated times for the clock event states.
|
||||
The ntpq read clock variables command list several variables. These
|
||||
hold followinf information:
|
||||
.I refclock_time
|
||||
is the local time with the offset to UTC (format HHMM).
|
||||
The currently active receiver flags are listed in
|
||||
.I refclock_status.
|
||||
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
|
||||
Unit encoding
|
||||
.PP
|
||||
|
29
usr.sbin/xntpd/hints/linux
Normal file
29
usr.sbin/xntpd/hints/linux
Normal 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
17
usr.sbin/xntpd/hints/sun4
Normal 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)
|
||||
|
||||
|
@ -38,7 +38,6 @@ extern long strtol P((char *, char **, int));
|
||||
|
||||
#if !defined(NTP_POSIX_SOURCE)
|
||||
extern int atoi P((char *));
|
||||
extern void bcopy P((char *, char *, int));
|
||||
extern int dup2 P((int, int));
|
||||
extern int execve P((char *, char **,char **));
|
||||
extern int fork P((void));
|
||||
@ -48,11 +47,13 @@ extern int qsort P((void *, int , int,
|
||||
extern int rand P((void));
|
||||
extern int setpgrp P((int, int));
|
||||
extern void srand P((unsigned int));
|
||||
extern void bcopy P((char *, char *, int));
|
||||
#endif
|
||||
|
||||
#ifndef bzero /* XXX macro prototyping clash */
|
||||
extern void bzero P((char *, int));
|
||||
extern int bcmp P((char *, char *, int));
|
||||
extern void bcopy P((char *, char *, int));
|
||||
#endif
|
||||
extern char *mktemp P((char *));
|
||||
|
||||
@ -97,11 +98,13 @@ extern int setlinebuf P((FILE *));
|
||||
|
||||
#ifdef _ntp_string_h
|
||||
#ifdef NTP_POSIX_SOURCE /* these are builtins */
|
||||
#ifndef NTP_NEED_BOPS /* but may be emulated by bops */
|
||||
extern char *memcpy();
|
||||
extern char *memset();
|
||||
extern int memcmp();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _sys_socket_h
|
||||
extern int bind P((int, struct sockaddr *, int));
|
||||
@ -192,7 +195,6 @@ extern int nlist P((char *, struct nlist *));
|
||||
|
||||
#ifndef NTP_POSIX_SOURCE
|
||||
extern int atoi P((char *));
|
||||
extern void bcopy P((char *, char *, int));
|
||||
extern void bzero P((char *, int));
|
||||
extern int bcmp 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 *));
|
||||
#endif /* VAX */
|
||||
|
||||
#ifdef SYS_DOMAINOS
|
||||
extern char * getpass P((char *));
|
||||
#endif /* SYS_DOMAINOS */
|
||||
|
||||
#endif /* l_stdlib_h */
|
||||
|
||||
|
@ -328,7 +328,7 @@ struct 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
|
||||
* 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_IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */
|
||||
#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
|
||||
|
@ -163,9 +163,9 @@ struct ntp_control {
|
||||
#define CS_SYSTEM 17
|
||||
#define CS_KEYID 18
|
||||
#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
|
||||
@ -204,8 +204,10 @@ struct ntp_control {
|
||||
#define CP_SENT 32
|
||||
#define CP_FILTERROR 33
|
||||
#define CP_FLASH 34
|
||||
#define CP_DISP 35
|
||||
#define CP_MAXCODE CP_DISP
|
||||
#define CP_DISP 35
|
||||
#define CP_VARLIST 36
|
||||
|
||||
#define CP_MAXCODE CP_VARLIST
|
||||
|
||||
/*
|
||||
* Clock variables we understand
|
||||
@ -222,8 +224,9 @@ struct ntp_control {
|
||||
#define CC_FUDGEVAL2 10
|
||||
#define CC_FLAGS 11
|
||||
#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.
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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.
|
||||
*/
|
||||
|
||||
@ -41,21 +41,21 @@ Signaled IO - Signled IO defines.
|
||||
UDP_BACKWARDS_SETOWN - SunOS 3.5 or Ultirx 2.0 system.
|
||||
|
||||
|
||||
WHICH TERMINAL MODEL TO USE - I would assume HAVE_POSIX_TTYS if
|
||||
NTP_POSIX_SOURCE was set but cann't. The
|
||||
WHICH TERMINAL MODEL TO USE - I would assume HAVE_TERMIOS if
|
||||
NTP_POSIX_SOURCE was set but can't. The
|
||||
posix tty driver is too restrictive on most systems.
|
||||
It defined if you define STREAMS.
|
||||
|
||||
HAVE_SYSV_TTYS - Use SYSV termio.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
|
||||
kernal mucking.
|
||||
kernel mucking.
|
||||
|
||||
NTP_POSIX_SOURCE - Use POSIX functions over bsd functions and att functions.
|
||||
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.
|
||||
@ -80,11 +80,20 @@ INFO ON NEW KERNEL PLL SYS CALLS
|
||||
NTP_SYSCALL_GET - SYS_ntp_gettime 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
|
||||
|
||||
UNIX V.4 machines implement a sockets library on top of streams.
|
||||
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
|
||||
the first integer position of the buffer.
|
||||
|
||||
@ -104,22 +113,28 @@ MISC
|
||||
DOSYNCTODR - Resync TODR clock every hour.
|
||||
RETSIGTYPE - Define signal function type.
|
||||
NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h
|
||||
LOCK_PROCESS - Have plock.
|
||||
LOCK_PROCESS - Have plock.
|
||||
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
|
||||
to the correct broadcast address - are these
|
||||
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.
|
||||
I don't since there are lost of different types compiler that a systemm might
|
||||
have, some that can do proto typing and others that cannot on the saem system.
|
||||
I get a chanse to twiddle some of the configuration paramasters at compile
|
||||
time based on compler/machine combinatsions by using this include file.
|
||||
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 same system.
|
||||
I get a chance to twiddle some of the configuration parameters at compile
|
||||
time based on compiler/machine combinations by using this include file.
|
||||
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.
|
||||
*/
|
||||
#if defined(_NO_PROTO)&&defined(USE_PROTOTYPES)
|
||||
#if defined(_NO_PROTO) && defined(USE_PROTOTYPES)
|
||||
#undef USE_PROTOTYPES
|
||||
#endif
|
||||
#if !defined(_NO_PROTO)&&!defined(USE_PROTOTYPES)
|
||||
#if !defined(_NO_PROTO) && !defined(USE_PROTOTYPES)
|
||||
#define USE_PROTOTYPES
|
||||
#endif
|
||||
#endif /*_BSD */
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/AIX"
|
||||
#endif
|
||||
#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
|
||||
*/
|
||||
#if defined(SYS_SUNOS4)
|
||||
#define NTP_NEED_BOPS
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#define HAVE_LIBKVM
|
||||
#define HAVE_MALLOC_H
|
||||
@ -156,6 +175,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define RETSIGTYPE void
|
||||
#define NTP_SYSCALL_GET 132
|
||||
#define NTP_SYSCALL_ADJ 147
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/SunOS 4.x"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -165,12 +187,16 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#undef HAVE_SIGNALED_IO
|
||||
#undef USE_TTY_SIGPOLL
|
||||
#undef USE_UDP_SIGPOLL
|
||||
#define STREAMS_TLI
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#define STEP_SLEW /* TWO step */
|
||||
#define RETSIGTYPE void
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#define HAVE_ATT_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/SINIX-M"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -187,12 +213,15 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#define HAVE_ATT_NICE
|
||||
#define UDP_WILDCARD_DELIVERY
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Solaris 2.x"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convex
|
||||
*/
|
||||
#if defined(SYS_CONVEXOS10)||defined(SYS_CONVEXOS9)
|
||||
#if defined(SYS_CONVEXOS10) || defined(SYS_CONVEXOS9)
|
||||
#define HAVE_SIGNALED_IO
|
||||
#define HAVE_N_UN
|
||||
#define HAVE_READKMEM
|
||||
@ -201,15 +230,18 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define RETSIGTYPE int
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#else
|
||||
#if defined(__stdc__)&&!defined(USE_PROTOTYPES)
|
||||
#if defined(__stdc__) && !defined(USE_PROTOTYPES)
|
||||
#define USE_PROTOTYPES
|
||||
#endif
|
||||
#if !defined(__stdc__)&&defined(USE_PROTOTYPES)
|
||||
#undef USE_PROTOTYPES
|
||||
#if !defined(__stdc__) && defined(USE_PROTOTYPES)
|
||||
#undef USE_PROTOTYPES
|
||||
#endif
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#endif
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/ConvexOS"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -224,6 +256,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#define HAVE_BSD_NICE
|
||||
#define NTP_POSIX_SOURCE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/IRIX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -236,12 +271,16 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_BSD_NICE
|
||||
#define RETSIGTYPE void
|
||||
#define NTP_SYSCALLS_STD
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Ultrix"
|
||||
#endif
|
||||
#define HAVE_TERMIOS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AUX
|
||||
*/
|
||||
#if defined(SYS_AUX2)||defined(SYS_AUX3)
|
||||
#if defined(SYS_AUX2) || defined(SYS_AUX3)
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#define HAVE_READKMEM
|
||||
#define HAVE_ATT_NICE
|
||||
@ -261,6 +300,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_BSD_TTYS
|
||||
#define LOG_NTP LOG_LOCAL1
|
||||
#define HAVE_SIGNALED_IO
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/AUX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -272,6 +314,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_BSD_NICE
|
||||
#define HAVE_N_UN
|
||||
#undef NTP_POSIX_SOURCE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Next"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -280,7 +325,8 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#if defined(SYS_HPUX)
|
||||
#define NTP_POSIX_SOURCE
|
||||
#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 LOCK_PROCESS
|
||||
#define HAVE_NO_NICE /* HPUX uses rtprio instead */
|
||||
@ -290,6 +336,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#else
|
||||
#define HAVE_READKMEM
|
||||
#endif
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/HPUX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -300,6 +349,11 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_LIBKVM
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/BSDI"
|
||||
#endif
|
||||
#define HAVE_BSD_TTYS
|
||||
#define HAVE_TERMIOS
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -311,8 +365,13 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define ADJTIME_IS_ACCURATE
|
||||
#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
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Linux"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -324,10 +383,13 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#define HAVE_READKMEM
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/*BSD"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DECOSF1
|
||||
* DEC AXP OSF/1
|
||||
*/
|
||||
#if defined(SYS_DECOSF1)
|
||||
#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_SYSCALLS_STD
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/DECOSF1"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* I386
|
||||
* XXX - what OS?
|
||||
*/
|
||||
#if defined(SYS_I386)
|
||||
#define HAVE_READKMEM
|
||||
#define S_CHAR_DEFINED
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/I386"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -352,6 +421,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#if defined(SYS_MIPS)
|
||||
#define NOKMEM
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Mips"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -359,6 +431,9 @@ See convex, aix and sun configurations see how complex it get.
|
||||
*/
|
||||
#if defined(SYS_SEQUENT)
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Sequent Dynix 3"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -369,6 +444,7 @@ See convex, aix and sun configurations see how complex it get.
|
||||
#ifndef HAVE_SYSV_TTYS
|
||||
#define HAVE_SYSV_TTYS
|
||||
#endif
|
||||
#define STREAMS_TLI
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#define HAVE_SIGNALED_IO
|
||||
#define USE_UDP_SIGPOLL
|
||||
@ -392,25 +468,35 @@ typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned long u_long;
|
||||
#endif
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Sequent PTX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Sony
|
||||
* Sony NEWS
|
||||
*/
|
||||
#if defined(SYS_SONY)
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#define HAVE_READKMEM
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/Sony"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* VAX
|
||||
* XXX - VMS?
|
||||
*/
|
||||
#if defined(SYS_VAX)
|
||||
#define NO_SIGNED_CHAR_DECL
|
||||
#define HAVE_READKMEM
|
||||
#define HAVE_BSD_NICE
|
||||
#ifndef STR_SYSTEM
|
||||
#define STR_SYSTEM "UNIX/VAX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -419,11 +505,9 @@ typedef unsigned long u_long;
|
||||
#if defined(SYS_SVR4)
|
||||
#define HAVE_ATT_SETPGRP
|
||||
#define USE_PROTOTYPES
|
||||
#define HAVE_UNISTD_H
|
||||
#define NTP_POSIX_SOURCE
|
||||
#define HAVE_ATT_NICE
|
||||
#define HAVE_READKMEM
|
||||
#define HAVE_SIGNALED_IO
|
||||
#define USE_TTY_SIGPOLL
|
||||
#define USE_UDP_SIGPOLL
|
||||
#define STREAM
|
||||
@ -431,6 +515,31 @@ typedef unsigned long u_long;
|
||||
#define LOCK_PROCESS
|
||||
#define SYSV_TIMEOFDAY
|
||||
#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
|
||||
|
||||
#ifndef RETSIGTYPE
|
||||
@ -450,8 +559,64 @@ typedef unsigned long u_long;
|
||||
#endif
|
||||
#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
|
||||
#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 */
|
||||
|
@ -75,10 +75,10 @@ struct refclockstat {
|
||||
LONG fudgeval2;
|
||||
u_char currentstatus;
|
||||
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
|
||||
* the reference clock drivers and the I/O module.
|
||||
|
@ -14,7 +14,7 @@
|
||||
#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_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 /* _ntp_select_h */
|
||||
|
@ -47,7 +47,7 @@ extern U_LONG calyearstart P((U_LONG));
|
||||
extern const char *clockname P((int));
|
||||
extern int clocktime P((int, int, int, int, int, U_LONG, U_LONG *, U_LONG *));
|
||||
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_lib P((void));
|
||||
extern void init_random P((void));
|
||||
|
@ -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
|
||||
#define _ntp_string_h
|
||||
|
||||
#ifdef NTP_POSIX_SOURCE
|
||||
#if defined(NTP_POSIX_SOURCE)
|
||||
|
||||
#if defined(HAVE_MEMORY_H)
|
||||
#include <memory.h>
|
||||
#endif
|
||||
# if defined(HAVE_MEMORY_H)
|
||||
# include <memory.h>
|
||||
# endif
|
||||
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
|
||||
#define bcopy(s1,s2,n) memcpy(s2, s1, n)
|
||||
#define bzero(s,n) memset(s, 0, n)
|
||||
#define bcmp(s1,s2,n) memcmp(s1, s2, n)
|
||||
#else
|
||||
|
||||
#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 strchr index
|
||||
# define memcmp(a,b,c) bcmp(a,b,c)
|
||||
# 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 */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* ntpd.h,v 3.1 1993/07/06 01:07:03 jbj Exp
|
||||
/*
|
||||
* 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 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 */
|
||||
extern void ntp_intres P((void));
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -15,7 +15,7 @@
|
||||
#ifndef __PARSE_H__
|
||||
#define __PARSE_H__
|
||||
#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
|
||||
|
||||
#include "ntp_types.h"
|
||||
@ -365,6 +365,12 @@ extern unsigned LONG pps_simple P((parse_t *, int status, timestamp_t *));
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* declaration fixes
|
||||
*
|
||||
|
@ -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
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -15,7 +15,7 @@
|
||||
#ifndef __PARSE_CONF_H__
|
||||
#define __PARSE_CONF_H__
|
||||
#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
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
#undef PARSEKERNEL
|
||||
|
@ -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
|
||||
#
|
||||
@ -28,7 +27,7 @@ all:
|
||||
print "### STREAMS kernel modules ppsclock, ppsclocd or line disciplines must"; \
|
||||
print "### be installed manually if needed"; \
|
||||
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/*."; } }'
|
||||
|
||||
clean:
|
||||
|
@ -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 Matthias Urlichs for the loadable driver support
|
||||
* Special thanks to Matthias Urlichs for the 4.1.x loadable driver support
|
||||
* 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.
|
||||
* Provides complete chucode structures to user space.
|
||||
*
|
||||
* COMPILATION:
|
||||
*
|
||||
*
|
||||
* To make a SunOS 4.1.x compatable loadable module (from the ntp kernel
|
||||
* directory):
|
||||
*
|
||||
* % cc -c -I../include -DLOADABLE tty_chu_STREAMS.c
|
||||
*
|
||||
* 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
|
||||
* table in the kernel, then adding it to config:
|
||||
* % modload tty_chu_STREAMS.o -entry _chuinit
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* v2.3 - Added support for Solaris 2.x.
|
||||
* v2.2 - Added SERVICE IMMEDIATE hack.
|
||||
* v2.1 - Added 'sixth byte' heuristics.
|
||||
* v2.0 - first version with an actual version number.
|
||||
* Added support for new CHU 'second 31' data format.
|
||||
@ -39,13 +56,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOADABLE
|
||||
# include "chu.h"
|
||||
#else
|
||||
#ifdef SOLARIS2
|
||||
# ifndef NCHU
|
||||
# define NCHU 3
|
||||
# define _KERNEL
|
||||
# endif
|
||||
#elif defined(LOADABLE)
|
||||
# ifndef NCHU
|
||||
# define NCHU 3
|
||||
# define KERNEL
|
||||
# endif
|
||||
#else
|
||||
# include "chu.h"
|
||||
#endif
|
||||
|
||||
#if NCHU > 0
|
||||
@ -61,12 +83,35 @@
|
||||
#include <sys/stream.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/user.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/tty.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 wminfo = { 0, "chu", 0, INFPSZ, 0, 0 };
|
||||
static int chuopen(), churput(), chuwput(), chuclose();
|
||||
@ -88,14 +133,67 @@ struct priv_data
|
||||
struct chucode chu_struct;
|
||||
} 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 sun
|
||||
#include <sys/conf.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sundev/mbvar.h>
|
||||
#include <sun/autoconf.h>
|
||||
#include <sun/vddrv.h>
|
||||
# ifdef sun
|
||||
|
||||
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;
|
||||
|
||||
@ -180,7 +280,7 @@ int sflag;
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifndef LOADABLE
|
||||
#if !defined(LOADABLE) && !defined(SOLARIS2)
|
||||
if (chu_first_open)
|
||||
{
|
||||
chu_first_open=0;
|
||||
@ -196,11 +296,25 @@ int sflag;
|
||||
((struct priv_data *) (q->q_ptr))=&(our_priv_data[i]);
|
||||
our_priv_data[i].in_use++;
|
||||
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;
|
||||
}
|
||||
|
||||
#ifdef SOLARIS2
|
||||
return (EBUSY);
|
||||
#else
|
||||
u.u_error = EBUSY;
|
||||
return (OPENFAIL);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -282,7 +396,12 @@ queue_t *q;
|
||||
|
||||
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");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -441,4 +560,4 @@ queue_t *q;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* NCHU > 0 */
|
||||
|
@ -62,7 +62,7 @@ struct priv_data_type
|
||||
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.
|
||||
*/
|
||||
|
||||
|
@ -80,7 +80,8 @@ MD5auth2crypt(keyno, pkt, length)
|
||||
MD5Update(&ctx, (char *)(pkt) + length - 8, 8);
|
||||
MD5Final(&ctx);
|
||||
|
||||
bcopy((char *)ctx.digest, (char *) &pkt[NOCRYPT_LONGS + length/sizeof(U_LONG)],
|
||||
BLOCK_OCTETS);
|
||||
return 4 + BLOCK_OCTETS;
|
||||
memmove((char *) &pkt[NOCRYPT_LONGS + length/sizeof(U_LONG)],
|
||||
(char *) ctx.digest,
|
||||
BLOCK_OCTETS);
|
||||
return (4 + BLOCK_OCTETS);
|
||||
}
|
||||
|
@ -54,5 +54,7 @@ MD5authdecrypt(keyno, pkt, length)
|
||||
MD5Update(&ctx, (char *)pkt, length);
|
||||
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));
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ MD5authencrypt(keyno, pkt, length)
|
||||
MD5Update(&ctx, (char *)pkt, length);
|
||||
MD5Final(&ctx);
|
||||
|
||||
bcopy((char *)ctx.digest, (char *) &pkt[NOCRYPT_LONGS + len], BLOCK_OCTETS);
|
||||
return 4 + BLOCK_OCTETS; /* return size of key and MAC */
|
||||
memmove((char *)&pkt[NOCRYPT_LONGS + len],
|
||||
(char *)ctx.digest,
|
||||
BLOCK_OCTETS);
|
||||
return (4 + BLOCK_OCTETS); /* return size of key and MAC */
|
||||
}
|
||||
|
@ -3,58 +3,12 @@
|
||||
*/
|
||||
#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
|
||||
* compute the encryption and decryption key schedules, while
|
||||
* 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
|
||||
* for both the encryption and decryption. Note that while the
|
||||
|
@ -15,6 +15,7 @@
|
||||
* to its exportable state, copy this file to authdes.c .
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include "ntp_stdlib.h"
|
||||
|
||||
/*
|
||||
* This routine is normally called to compute the key schedule.
|
||||
|
@ -109,7 +109,7 @@ init_auth()
|
||||
/*
|
||||
* 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;
|
||||
|
||||
authnumfreekeys = authkeynotfound = authkeylookups = 0;
|
||||
|
@ -96,7 +96,7 @@ authusekey(keyno, keytype, str)
|
||||
/*
|
||||
* 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++)
|
||||
keybytes[i] = *cp++ << 1;
|
||||
key[0] = (U_LONG)keybytes[0] << 24 | (U_LONG)keybytes[1] << 16
|
||||
|
@ -24,6 +24,7 @@ struct clktype clktypes[] = {
|
||||
{ REFCLK_IRIG_TPRO, "Odetics/KSI TPRO IRIG decoder (12)", "IRIG_TPRO" },
|
||||
{ REFCLK_ATOM_LEITCH, "Leitch CSD 5300 controller (13)", "ATOM_LEITCH" },
|
||||
{ REFCLK_MSF_EES, "MSF EES M201, UK (14)", "MSF_EES" },
|
||||
{ REFCLK_GPSTM_TRUETIME, "TrueTime GPS/TM-TMD clock (15)", "GPS_TRUE" },
|
||||
{ -1, "", "" }
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,7 @@ dofptoa(fpv, neg, ndec, msec)
|
||||
/*
|
||||
* Zero out the buffer
|
||||
*/
|
||||
bzero((char *)cbuf, sizeof cbuf);
|
||||
memset((char *)cbuf, 0, sizeof cbuf);
|
||||
|
||||
/*
|
||||
* Set the pointers to point at the first
|
||||
|
@ -32,7 +32,7 @@ dolfptoa(fpi, fpv, neg, ndec, msec)
|
||||
/*
|
||||
* 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
|
||||
|
@ -4,7 +4,9 @@
|
||||
* This is a version of the public domain getopt() implementation by
|
||||
* 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
|
||||
* 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.
|
||||
*/
|
||||
@ -20,39 +22,33 @@
|
||||
#define putc fputc
|
||||
#endif /* lint */
|
||||
|
||||
char *optarg; /* Global argument pointer. */
|
||||
#ifndef __convex__
|
||||
int optind = 0; /* Global argv index. */
|
||||
#else /* __convex__ */
|
||||
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 */
|
||||
char *ntp_optarg; /* Global argument pointer. */
|
||||
int ntp_optind = 0; /* Global argv index. */
|
||||
int ntp_opterr = 1; /* for compatibility, should error be printed? */
|
||||
int ntp_optopt; /* for compatibility, option character checked */
|
||||
|
||||
static char *scan = NULL; /* Private scan pointer. */
|
||||
static char *prog = "amnesia";
|
||||
|
||||
/*
|
||||
* Print message about a bad option. Watch this definition, it's
|
||||
* not a single statement.
|
||||
* Print message about a bad option.
|
||||
*/
|
||||
#define BADOPT(mess, ch) if (opterr) { \
|
||||
fputs(argv[0], stderr); \
|
||||
fputs(mess, stderr); \
|
||||
(void) putc(ch, stderr); \
|
||||
(void) putc('\n', stderr); \
|
||||
} \
|
||||
return('?')
|
||||
static int
|
||||
badopt(mess, ch)
|
||||
char *mess;
|
||||
int ch;
|
||||
{
|
||||
if (ntp_opterr) {
|
||||
fputs(prog, stderr);
|
||||
fputs(mess, stderr);
|
||||
(void) putc(ch, stderr);
|
||||
(void) putc('\n', stderr);
|
||||
}
|
||||
return ('?');
|
||||
}
|
||||
|
||||
int
|
||||
getopt_l(argc, argv, optstring)
|
||||
ntp_getopt(argc, argv, optstring)
|
||||
int argc;
|
||||
char *argv[];
|
||||
char *optstring;
|
||||
@ -60,47 +56,50 @@ getopt_l(argc, argv, optstring)
|
||||
register char c;
|
||||
register char *place;
|
||||
|
||||
optarg = NULL;
|
||||
prog = argv[0];
|
||||
ntp_optarg = NULL;
|
||||
|
||||
if (optind == 0) {
|
||||
if (ntp_optind == 0) {
|
||||
scan = NULL;
|
||||
optind++;
|
||||
ntp_optind++;
|
||||
}
|
||||
|
||||
if (scan == NULL || *scan == '\0') {
|
||||
if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
|
||||
return EOF;
|
||||
if (argv[optind][1] == '-' && argv[optind][2] == '\0') {
|
||||
optind++;
|
||||
return EOF;
|
||||
if (ntp_optind >= argc
|
||||
|| argv[ntp_optind][0] != '-'
|
||||
|| argv[ntp_optind][1] == '\0') {
|
||||
return (EOF);
|
||||
}
|
||||
if (argv[ntp_optind][1] == '-'
|
||||
&& argv[ntp_optind][2] == '\0') {
|
||||
ntp_optind++;
|
||||
return (EOF);
|
||||
}
|
||||
|
||||
scan = argv[optind]+1;
|
||||
optind++;
|
||||
scan = argv[ntp_optind++]+1;
|
||||
}
|
||||
|
||||
c = *scan++;
|
||||
optopt = c & 0377;
|
||||
ntp_optopt = c & 0377;
|
||||
for (place = optstring; place != NULL && *place != '\0'; ++place)
|
||||
if (*place == c)
|
||||
break;
|
||||
|
||||
if (place == NULL || *place == '\0' || c == ':' || c == '?') {
|
||||
BADOPT(": unknown option -", c);
|
||||
return (badopt(": unknown option -", c));
|
||||
}
|
||||
|
||||
place++;
|
||||
if (*place == ':') {
|
||||
if (*scan != '\0') {
|
||||
optarg = scan;
|
||||
ntp_optarg = scan;
|
||||
scan = NULL;
|
||||
} else if (optind >= argc) {
|
||||
BADOPT(": option requires argument -", c);
|
||||
} else if (ntp_optind >= argc) {
|
||||
return (badopt(": option requires argument -", c));
|
||||
} else {
|
||||
optarg = argv[optind];
|
||||
optind++;
|
||||
ntp_optarg = argv[ntp_optind++];
|
||||
}
|
||||
}
|
||||
|
||||
return c&0377;
|
||||
return (c & 0377);
|
||||
}
|
||||
|
@ -1,118 +1,43 @@
|
||||
/*
|
||||
* provide special support for peculiar architectures
|
||||
/* machines.c - provide special support for peculiar architectures
|
||||
*
|
||||
* Real bummers unite !
|
||||
*
|
||||
* $Id:$
|
||||
*/
|
||||
|
||||
#include "ntp_stdlib.h"
|
||||
|
||||
#ifdef SYS_PTX
|
||||
#include <sys/types.h>
|
||||
#include <sys/procstats.h>
|
||||
int settimeofday(tvp)
|
||||
|
||||
int
|
||||
settimeofday(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;
|
||||
{
|
||||
/*
|
||||
* hi, this is Sequents sneak path to get to a clock
|
||||
* this is also the most logical syscall for such a function
|
||||
*/
|
||||
return get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
|
||||
(struct procstats *) 0);
|
||||
return (get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
|
||||
(struct procstats *) 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SYS_HPUX
|
||||
/* hpux.c,v 3.1 1993/07/06 01:08:23 jbj Exp
|
||||
* hpux.c -- compatibility routines for HP-UX.
|
||||
* XXX many of these are not needed anymore.
|
||||
*/
|
||||
#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;
|
||||
#if !defined(NTP_POSIX_SOURCE) || defined(NTP_NEED_BOPS)
|
||||
void
|
||||
ntp_memset(a, x, c)
|
||||
char *a;
|
||||
int x, c;
|
||||
{
|
||||
return strchr (s, c);
|
||||
while (c-- > 0)
|
||||
*a++ = x;
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
#endif /*POSIX*/
|
||||
|
@ -81,7 +81,8 @@ void msyslog(va_alist)
|
||||
n += strlen(err);
|
||||
}
|
||||
}
|
||||
*n++ = '\n';
|
||||
if (!syslogit)
|
||||
*n++ = '\n';
|
||||
*n = '\0';
|
||||
|
||||
vsprintf(buf, nfmt, ap);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* numtohost.c,v 3.1 1993/07/06 01:08:40 jbj Exp
|
||||
* numtohost - convert network number to host name.
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "ntp_types.h"
|
||||
#include <netdb.h>
|
||||
|
||||
#include "ntp_fp.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
#include <sys/types.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 <utmp.h>
|
||||
#endif
|
||||
@ -238,36 +238,40 @@ adj_systime(ts)
|
||||
#endif
|
||||
}
|
||||
|
||||
sys_clock_offset.l_ui = offset_i;
|
||||
sys_clock_offset.l_uf = offset_f;
|
||||
|
||||
if (adjtime(&adjtv, &oadjtv) < 0) {
|
||||
syslog(LOG_ERR, "Can't do time adjustment: %m");
|
||||
rval = 0;
|
||||
} else
|
||||
} else {
|
||||
sys_clock_offset.l_ui = offset_i;
|
||||
sys_clock_offset.l_uf = offset_f;
|
||||
rval = 1;
|
||||
|
||||
#ifdef DEBUGRS6000
|
||||
syslog(LOG_ERR, "adj_systime(%s): offset = %s%s\n",
|
||||
mfptoa((adj<0?-1:0), adj, 9), isneg?"-":"",
|
||||
umfptoa(offset_i, offset_f, 9));
|
||||
syslog(LOG_ERR, "%d %d %d %d\n", (int) adjtv.tv_sec,
|
||||
(int) adjtv.tv_usec, (int) oadjtv.tv_sec, (int)
|
||||
oadjtv.tv_usec);
|
||||
syslog(LOG_ERR, "adj_systime(%s): offset = %s%s\n",
|
||||
mfptoa((adj<0?-1:0), adj, 9), isneg?"-":"",
|
||||
umfptoa(offset_i, offset_f, 9));
|
||||
syslog(LOG_ERR, "%d %d %d %d\n", (int) adjtv.tv_sec,
|
||||
(int) adjtv.tv_usec, (int) oadjtv.tv_sec, (int)
|
||||
oadjtv.tv_usec);
|
||||
#endif /* DEBUGRS6000 */
|
||||
|
||||
if ((oadjtv.tv_sec != 0 || oadjtv.tv_usec != 0) && (max_no_complete > 0)) {
|
||||
sTVTOTS(&oadjtv, &oadjts);
|
||||
L_ADD(&sys_clock_offset, &oadjts);
|
||||
syslog(LOG_WARNING, "Previous time adjustment didn't complete");
|
||||
if (oadjtv.tv_sec != 0 || oadjtv.tv_usec != 0) {
|
||||
sTVTOTS(&oadjtv, &oadjts);
|
||||
L_ADD(&sys_clock_offset, &oadjts);
|
||||
if (max_no_complete > 0) {
|
||||
syslog(LOG_WARNING,
|
||||
"Previous time adjustment didn't complete");
|
||||
#ifdef DEBUG
|
||||
if (debug > 4)
|
||||
syslog(LOG_DEBUG,
|
||||
"Previous adjtime() incomplete, residual = %s\n",
|
||||
tvtoa(&oadjtv));
|
||||
if (debug > 4)
|
||||
syslog(LOG_DEBUG,
|
||||
"Previous adjtime() incomplete, residual = %s\n",
|
||||
tvtoa(&oadjtv));
|
||||
#endif
|
||||
if (--max_no_complete == 0) syslog(LOG_WARNING,
|
||||
"*** No more 'Prev time adj didn't complete'");
|
||||
if (--max_no_complete == 0)
|
||||
syslog(LOG_WARNING,
|
||||
"*** No more 'Prev time adj didn't complete'");
|
||||
}
|
||||
}
|
||||
}
|
||||
return(rval);
|
||||
}
|
||||
@ -345,7 +349,7 @@ step_systime_real(ts)
|
||||
* is greater than one second.
|
||||
*/
|
||||
if (oldtime != timetv.tv_sec) {
|
||||
bzero((char *)&ut, sizeof(ut));
|
||||
memset((char *)&ut, 0, sizeof(ut));
|
||||
ut.ut_type = OLD_TIME;
|
||||
ut.ut_time = oldtime;
|
||||
(void)strcpy(ut.ut_line, OTIME_MSG);
|
||||
|
@ -2,4 +2,4 @@ README file for directory ./machines of the NTP Version 3 distribution
|
||||
|
||||
This directory contains configuration files for the various machines
|
||||
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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= :
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DRS6000 -DSYS_AIX
|
||||
DEFS= -DRS6000 -DSYS_AIX -DHAVE_TERMIOS
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS=
|
||||
|
@ -5,5 +5,4 @@ AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS= -lkvm
|
||||
RESLIB=
|
||||
COPTS= -g
|
||||
|
||||
COPTS= -g -O
|
||||
|
9
usr.sbin/xntpd/machines/dell.svr4
Normal file
9
usr.sbin/xntpd/machines/dell.svr4
Normal 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
|
7
usr.sbin/xntpd/machines/domainos
Normal file
7
usr.sbin/xntpd/machines/domainos
Normal 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=
|
@ -1,6 +1,6 @@
|
||||
RANLIB= ranlib
|
||||
DEFS_LOCAL=-DREFCLOCK
|
||||
DEFS= -DSYS_FREEBSD -DSYS_386BSD
|
||||
DEFS= -DSYS_FREEBSD -DSYS_386BSD -DHAVE_TERMIOS
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS= -lcrypt
|
||||
|
@ -1,7 +1,7 @@
|
||||
SHELL= /bin/sh
|
||||
RANLIB= ls # ar does the work of ranlib under System V
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DHAVE_SYSV_TTYS -DSYS_HPUX=8
|
||||
DEFS= -DHAVE_TERMIOS -DSYS_HPUX=8
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
COPTS=
|
||||
|
@ -1,7 +1,7 @@
|
||||
SHELL= /bin/sh
|
||||
RANLIB= ls # ar does the work of ranlib under System V
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DHAVE_SYSV_TTYS -DSYS_HPUX=10
|
||||
DEFS= -DHAVE_TERMIOS -DSYS_HPUX=10
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
COPTS=
|
||||
|
@ -1,9 +1,9 @@
|
||||
SHELL= /bin/sh
|
||||
RANLIB= ls # ar does the work of ranlib under System V
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DSYS_SVR4
|
||||
DEFS= -DSYS_SVR4 -DSTREAMS_TLI
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS= -lnsl -lsocket -lelf
|
||||
DAEMONLIBS=
|
||||
RESLIB= -lnsl -lsocket -lelf
|
||||
INSTALL= /usr/ucb/install
|
||||
|
@ -1,6 +1,6 @@
|
||||
SHELL= /bin/sh
|
||||
RANLIB= ranlib
|
||||
DEFS= -DSYS_LINUX -DHAVE_SYSV_TTYS
|
||||
DEFS= -DSYS_LINUX -DHAVE_TERMIOS
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
INCL= -I../include -I/usr/include/bsd
|
||||
CLOCKDEFS=
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= ranlib
|
||||
DEFS_LOCAL=-DREFCLOCK
|
||||
DEFS= -DSYS_NETBSD -DSYS_386BSD
|
||||
DEFS= -DSYS_NETBSD -DSYS_386BSD -DHAVE_TERMIOS
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS= -lcrypt -lutil
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= :
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DREADKMEM -DSYS_PTX -DHAVE_SYSV_TTYS
|
||||
DEFS= -DREADKMEM -DSYS_PTX -DHAVE_TERMIOS
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS=
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= ranlib
|
||||
DEFS_LOCAL= -DREFCLOCK
|
||||
DEFS= -DREADKMEM -DSYS_SEQUENT
|
||||
DEFS= -DHAVE_READ_KMEM -DSYS_SEQUENT
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS=
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= :
|
||||
DEFS_LOCAL=-DREFCLOCK
|
||||
DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS
|
||||
DEFS= -DSTREAM -DSOLARIS -DSYS_SOLARIS -DNTP_POSIX_SOURCE
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS=
|
||||
|
@ -1,6 +1,6 @@
|
||||
RANLIB= :
|
||||
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
|
||||
CLOCKDEFS= -DLOCAL_CLOCK
|
||||
DAEMONLIBS=
|
||||
|
@ -1,6 +1,6 @@
|
||||
SHELL= /bin/sh
|
||||
RANLIB= ls # ar does the work of ranlib under System V
|
||||
DEFS= -DSYS_SVR4
|
||||
DEFS= -DSYS_SVR4 -DSTREAMS_TLI
|
||||
AUTHDEFS= -DDES -DMD5
|
||||
CLOCKDEFS=
|
||||
DAEMONLIBS= -lnet -lnsl -lsocket -lelf
|
||||
|
@ -167,8 +167,8 @@ main(argc, argv)
|
||||
l_fp tmp;
|
||||
int errflg;
|
||||
int c;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern char *ntp_optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *Version;
|
||||
|
||||
errflg = 0;
|
||||
@ -178,10 +178,10 @@ main(argc, argv)
|
||||
/*
|
||||
* 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) {
|
||||
case 'a':
|
||||
c = atoi(optarg);
|
||||
c = atoi(ntp_optarg);
|
||||
sys_authenticate = 1;
|
||||
sys_authkey = (U_LONG)c;
|
||||
break;
|
||||
@ -192,24 +192,24 @@ main(argc, argv)
|
||||
++debug;
|
||||
break;
|
||||
case 'e':
|
||||
if (!atolfp(optarg, &tmp)
|
||||
if (!atolfp(ntp_optarg, &tmp)
|
||||
|| tmp.l_ui != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: encryption delay %s is unlikely\n",
|
||||
progname, optarg);
|
||||
progname, ntp_optarg);
|
||||
errflg++;
|
||||
} else {
|
||||
sys_authdelay = tmp.l_uf;
|
||||
}
|
||||
break;
|
||||
case 'k':
|
||||
key_file = optarg;
|
||||
key_file = ntp_optarg;
|
||||
break;
|
||||
case 'o':
|
||||
sys_version = atoi(optarg);
|
||||
sys_version = atoi(ntp_optarg);
|
||||
break;
|
||||
case 'p':
|
||||
c = atoi(optarg);
|
||||
c = atoi(ntp_optarg);
|
||||
if (c <= 0 || c > NTP_SHIFT) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: number of samples (%d) is invalid\n",
|
||||
@ -226,10 +226,10 @@ main(argc, argv)
|
||||
syslogit = 1;
|
||||
break;
|
||||
case 't':
|
||||
if (!atolfp(optarg, &tmp)) {
|
||||
if (!atolfp(ntp_optarg, &tmp)) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: timeout %s is undecodeable\n",
|
||||
progname, optarg);
|
||||
progname, ntp_optarg);
|
||||
errflg++;
|
||||
} else {
|
||||
sys_timeout = ((LFPTOFP(&tmp) * TIMER_HZ)
|
||||
@ -248,7 +248,7 @@ main(argc, argv)
|
||||
break;
|
||||
}
|
||||
|
||||
sys_maxservers = argc - optind;
|
||||
sys_maxservers = argc - ntp_optind;
|
||||
if (errflg || sys_maxservers == 0) {
|
||||
(void) fprintf(stderr,
|
||||
"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
|
||||
*/
|
||||
for ( ; optind < argc; optind++)
|
||||
addserver(argv[optind]);
|
||||
for ( ; ntp_optind < argc; ntp_optind++)
|
||||
addserver(argv[ntp_optind]);
|
||||
|
||||
if (sys_numservers == 0) {
|
||||
syslog(LOG_ERR, "no servers can be used, exiting");
|
||||
@ -520,16 +520,8 @@ receive(rbufp)
|
||||
}
|
||||
|
||||
rpkt = &(rbufp->recv_pkt);
|
||||
if (PKT_VERSION(rpkt->li_vn_mode) == NTP_OLDVERSION) {
|
||||
#ifdef notdef
|
||||
/*
|
||||
* 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) {
|
||||
if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION ||
|
||||
PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1038,7 +1030,7 @@ addserver(serv)
|
||||
}
|
||||
|
||||
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_addr.s_addr = netnum;
|
||||
@ -1196,7 +1188,7 @@ init_io()
|
||||
if (!debug && !simple_query) {
|
||||
struct sockaddr_in addr;
|
||||
|
||||
bzero((char *)&addr, sizeof addr);
|
||||
memset((char *)&addr, 0, sizeof addr);
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(NTP_PORT);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
@ -1490,10 +1482,10 @@ getnetnum(host, num)
|
||||
if (decodenetnum(host, num)) {
|
||||
return 1;
|
||||
} else if ((hp = gethostbyname(host)) != 0) {
|
||||
bcopy(hp->h_addr, (char *)num, sizeof(U_LONG));
|
||||
return 1;
|
||||
memmove((char *)num, hp->h_addr, sizeof(U_LONG));
|
||||
return (1);
|
||||
}
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */
|
||||
@ -1527,7 +1519,7 @@ printserver(pp, fp)
|
||||
|
||||
if (pp->stratum == 1) {
|
||||
junk[4] = 0;
|
||||
bcopy((char *)&pp->refid, junk, 4);
|
||||
memmove(junk, (char *)&pp->refid, 4);
|
||||
str = junk;
|
||||
} else {
|
||||
str = numtoa(pp->refid);
|
||||
|
@ -301,7 +301,7 @@ static int decodereach P((char *, U_LONG *));
|
||||
static int decodearr P((char *, int *, l_fp *));
|
||||
static char * getcode P((int, struct codestring *));
|
||||
static void help P((struct parse *, FILE *));
|
||||
#if defined(sgi)
|
||||
#if defined(sgi) || defined(SYS_BSDI)
|
||||
static int helpsort P((const void *, const void *));
|
||||
#else
|
||||
static int helpsort P((char **, char **));
|
||||
@ -335,11 +335,11 @@ static void output P((FILE *, char *, char *));
|
||||
static void endoutput P((FILE *));
|
||||
static void outputarr P((FILE *, char *, int, l_fp *));
|
||||
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 *));
|
||||
#else
|
||||
static int assoccmp P((struct association *, struct association *));
|
||||
#endif /* sgi */
|
||||
#endif /* sgi || bsdi */
|
||||
|
||||
|
||||
/*
|
||||
@ -509,17 +509,17 @@ char *argv[];
|
||||
{
|
||||
int c;
|
||||
int errflg = 0;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *ntp_optarg;
|
||||
|
||||
delay_time.l_ui = 0;
|
||||
delay_time.l_uf = DEFDELAY;
|
||||
|
||||
progname = argv[0];
|
||||
while ((c = getopt_l(argc, argv, "c:dinp")) != EOF)
|
||||
while ((c = ntp_getopt(argc, argv, "c:dinp")) != EOF)
|
||||
switch (c) {
|
||||
case 'c':
|
||||
ADDCMD(optarg);
|
||||
ADDCMD(ntp_optarg);
|
||||
break;
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -543,11 +543,11 @@ char *argv[];
|
||||
progname);
|
||||
exit(2);
|
||||
}
|
||||
if (optind == argc) {
|
||||
if (ntp_optind == argc) {
|
||||
ADDHOST(DEFHOST);
|
||||
} else {
|
||||
for (; optind < argc; optind++)
|
||||
ADDHOST(argv[optind]);
|
||||
for (; ntp_optind < argc; ntp_optind++)
|
||||
ADDHOST(argv[ntp_optind]);
|
||||
}
|
||||
|
||||
if (numcmds == 0 && interactive == 0
|
||||
@ -982,7 +982,7 @@ getresponse(opcode, associd, rstatus, rsize, rdata, timeo)
|
||||
/*
|
||||
* 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.
|
||||
@ -1050,7 +1050,7 @@ sendrequest(opcode, associd, auth, qsize, qdata)
|
||||
* bit boundary.
|
||||
*/
|
||||
if (qsize > 0) {
|
||||
bcopy(qdata, (char *)qpkt.data, qsize);
|
||||
memmove((char *)qpkt.data, qdata, qsize);
|
||||
pktsize = qsize + CTL_HEADER_LEN;
|
||||
while (pktsize & (sizeof(U_LONG)-1)) {
|
||||
qpkt.data[qsize++] = 0;
|
||||
@ -1541,7 +1541,7 @@ getnetnum(host, num, fullhost)
|
||||
}
|
||||
return 1;
|
||||
} 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)
|
||||
(void) strcpy(fullhost, hp->h_name);
|
||||
return 1;
|
||||
@ -1888,11 +1888,11 @@ help(pcmd, fp)
|
||||
for (xcp = opcmds; xcp->keyword != 0; xcp++)
|
||||
cmdsort[n++] = xcp->keyword;
|
||||
|
||||
#if defined(sgi)
|
||||
#if defined(sgi) || defined(SYS_BSDI)
|
||||
qsort((void *)cmdsort, n, sizeof(char *), helpsort);
|
||||
#else
|
||||
qsort((char *)cmdsort, n, sizeof(char *), helpsort);
|
||||
#endif /* sgi */
|
||||
#endif /* sgi || bsdi */
|
||||
|
||||
maxlength = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
@ -1934,7 +1934,7 @@ help(pcmd, fp)
|
||||
* helpsort - do hostname qsort comparisons
|
||||
*/
|
||||
static int
|
||||
#if defined(sgi)
|
||||
#if defined(sgi) || defined(SYS_BSDI)
|
||||
helpsort(t1, t2)
|
||||
const void *t1;
|
||||
const void *t2;
|
||||
@ -1946,7 +1946,7 @@ helpsort(name1, name2)
|
||||
char **name1;
|
||||
char **name2;
|
||||
{
|
||||
#endif /* sgi */
|
||||
#endif /* sgi || bsdi */
|
||||
return strcmp(*name1, *name2);
|
||||
}
|
||||
|
||||
@ -2577,6 +2577,7 @@ nextvar(datalen, datap, vname, vvalue)
|
||||
register char *cp;
|
||||
register char *np;
|
||||
register char *cpend;
|
||||
int quoted = 0;
|
||||
static char name[MAXVARLEN];
|
||||
static char value[MAXVALLEN];
|
||||
|
||||
@ -2623,8 +2624,11 @@ nextvar(datalen, datap, vname, vvalue)
|
||||
while (cp < cpend && (isspace(*cp) && *cp != '\r' && *cp != '\n'))
|
||||
cp++;
|
||||
np = value;
|
||||
while (cp < cpend && *cp != ',')
|
||||
*np++ = *cp++;
|
||||
while (cp < cpend && ((*cp != ',') || quoted))
|
||||
{
|
||||
quoted ^= ((*np++ = *cp++) == '"');
|
||||
}
|
||||
|
||||
while (np > value && isspace(*(np-1)))
|
||||
np--;
|
||||
*np = '\0';
|
||||
@ -3024,13 +3028,13 @@ void
|
||||
sortassoc()
|
||||
{
|
||||
if (numassoc > 1)
|
||||
#if defined(sgi)
|
||||
#if defined(sgi) || defined(SYS_BSDI)
|
||||
qsort((void *)assoc_cache, numassoc,
|
||||
sizeof(struct association), assoccmp);
|
||||
#else
|
||||
qsort((char *)assoc_cache, numassoc,
|
||||
sizeof(struct association), assoccmp);
|
||||
#endif /* sgi */
|
||||
#endif /* sgi || bsdi */
|
||||
}
|
||||
|
||||
|
||||
@ -3038,7 +3042,7 @@ sortassoc()
|
||||
* assoccmp - compare two associations
|
||||
*/
|
||||
static int
|
||||
#if defined(sgi)
|
||||
#if defined(sgi) || defined(SYS_BSDI)
|
||||
assoccmp(t1, t2)
|
||||
const void *t1;
|
||||
const void *t2;
|
||||
@ -3050,7 +3054,7 @@ assoccmp(ass1, ass2)
|
||||
struct association *ass1;
|
||||
struct association *ass2;
|
||||
{
|
||||
#endif /* sgi */
|
||||
#endif /* sgi || bsdi */
|
||||
if (ass1->assid < ass2->assid)
|
||||
return -1;
|
||||
if (ass1->assid > ass2->assid)
|
||||
|
@ -217,6 +217,7 @@ checkassocid(value)
|
||||
|
||||
/*
|
||||
* strsave - save a string
|
||||
* XXX - should be in libntp.a
|
||||
*/
|
||||
static char *
|
||||
strsave(str)
|
||||
@ -231,8 +232,8 @@ strsave(str)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
bcopy(str, cp, len);
|
||||
return cp;
|
||||
memmove(cp, str, len);
|
||||
return (cp);
|
||||
}
|
||||
|
||||
|
||||
@ -372,11 +373,11 @@ makequerydata(vlist, datalen, data)
|
||||
|
||||
if (cp != data)
|
||||
*cp++ = ',';
|
||||
bcopy(vl->name, cp, namelen);
|
||||
memmove(cp, vl->name, namelen);
|
||||
cp += namelen;
|
||||
if (valuelen != 0) {
|
||||
*cp++ = '=';
|
||||
bcopy(vl->value, cp, valuelen);
|
||||
memmove(cp, vl->value, valuelen);
|
||||
cp += valuelen;
|
||||
}
|
||||
}
|
||||
@ -600,7 +601,7 @@ readvar(pcmd, fp)
|
||||
else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
|
||||
return;
|
||||
|
||||
bzero((char *)tmplist, sizeof(tmplist));
|
||||
memset((char *)tmplist, 0, sizeof(tmplist));
|
||||
if (pcmd->nargs >= 2)
|
||||
doaddvlist(tmplist, pcmd->argval[1].string);
|
||||
|
||||
@ -631,7 +632,7 @@ writevar(pcmd, fp)
|
||||
else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
|
||||
return;
|
||||
|
||||
bzero((char *)tmplist, sizeof(tmplist));
|
||||
memset((char *)tmplist, 0, sizeof(tmplist));
|
||||
doaddvlist(tmplist, pcmd->argval[1].string);
|
||||
|
||||
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)
|
||||
return;
|
||||
|
||||
bzero((char *)tmplist, sizeof(tmplist));
|
||||
memset((char *)tmplist, 0, sizeof(tmplist));
|
||||
if (pcmd->nargs >= 2)
|
||||
doaddvlist(tmplist, pcmd->argval[1].string);
|
||||
|
||||
@ -802,7 +803,7 @@ mreadvar(pcmd, fp)
|
||||
&from, &to))
|
||||
return;
|
||||
|
||||
bzero((char *)tmplist, sizeof(tmplist));
|
||||
memset((char *)tmplist, 0, sizeof(tmplist));
|
||||
if (pcmd->nargs >= 3)
|
||||
doaddvlist(tmplist, pcmd->argval[2].string);
|
||||
|
||||
@ -1282,7 +1283,7 @@ doprintpeers(pvl, associd, rstatus, datalen, data, fp)
|
||||
char refid_string[10];
|
||||
extern struct ctl_var peer_var[];
|
||||
|
||||
bzero((char *)havevar, sizeof(havevar));
|
||||
memset((char *)havevar, 0, sizeof(havevar));
|
||||
gettstamp(&ts);
|
||||
|
||||
while (nextvar(&datalen, &data, &name, &value)) {
|
||||
|
@ -111,8 +111,8 @@ main(argc, argv)
|
||||
struct server *firstserver;
|
||||
int errflg;
|
||||
int c;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern char *ntp_optarg;
|
||||
extern int ntp_optind;
|
||||
extern char *Version;
|
||||
|
||||
errflg = 0;
|
||||
@ -121,7 +121,7 @@ main(argc, argv)
|
||||
/*
|
||||
* 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) {
|
||||
case 'd':
|
||||
++debug;
|
||||
@ -130,10 +130,10 @@ main(argc, argv)
|
||||
nonames = 1;
|
||||
break;
|
||||
case 'o':
|
||||
sys_version = atoi(optarg);
|
||||
sys_version = atoi(ntp_optarg);
|
||||
break;
|
||||
case 'r':
|
||||
sys_retries = atoi(optarg);
|
||||
sys_retries = atoi(ntp_optarg);
|
||||
if (sys_retries < 1) {
|
||||
(void)fprintf(stderr,
|
||||
"%s: retries (%d) too small\n",
|
||||
@ -142,7 +142,7 @@ main(argc, argv)
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
sys_timeout = atoi(optarg);
|
||||
sys_timeout = atoi(ntp_optarg);
|
||||
if (sys_timeout < 1) {
|
||||
(void)fprintf(stderr,
|
||||
"%s: timeout (%d) too short\n",
|
||||
@ -160,7 +160,7 @@ main(argc, argv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (errflg || (argc - optind) > 1) {
|
||||
if (errflg || (argc - ntp_optind) > 1) {
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s [-vnd] [-r retries] [-t timeout] [server]\n",
|
||||
progname);
|
||||
@ -182,8 +182,8 @@ main(argc, argv)
|
||||
if (debug || verbose)
|
||||
syslog(LOG_NOTICE, "%s", Version);
|
||||
|
||||
if ((argc - optind) == 1)
|
||||
firstserver = addservbyname(argv[optind]);
|
||||
if ((argc - ntp_optind) == 1)
|
||||
firstserver = addservbyname(argv[ntp_optind]);
|
||||
else
|
||||
firstserver = addservbyname("localhost");
|
||||
|
||||
@ -502,7 +502,7 @@ struct in_addr *iap;
|
||||
}
|
||||
|
||||
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_addr = *iap;
|
||||
@ -616,7 +616,7 @@ getipaddr(host, num)
|
||||
if (decodeipaddr(host, num)) {
|
||||
return 1;
|
||||
} 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 0;
|
||||
@ -735,7 +735,7 @@ struct server *pp;
|
||||
|
||||
if (pp->stratum == 1) {
|
||||
junk[4] = 0;
|
||||
bcopy((char *)&pp->refid, junk, 4);
|
||||
memmove(junk, (char *)&pp->refid, 4);
|
||||
str = junk;
|
||||
(void) fprintf(fp, "'%s'", str);
|
||||
} else {
|
||||
|
@ -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
|
||||
@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
|
||||
ld -r -o $@ parsestreams.o ../lib/libntp.a libparse_kernel.a \
|
||||
microtime.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
|
||||
ld -r -o $@ $@ ../lib/libntp.a libparse_kernel.a
|
||||
@echo "--- You may load parsestreams.o via 'modload parsestreams.o' into the kernel"
|
||||
ld -r -o $@ parsestreams.o ../lib/libntp.a libparse_kernel.a
|
||||
rm -f parsestreams.o
|
||||
|
||||
microtime.o: $(MICROTIME) assym.s
|
||||
cc -E -I. $(MICROTIME) | sed -e '/\.global _uniqtime/d' > $@.i
|
||||
|
@ -92,7 +92,7 @@ depend:
|
||||
|
||||
clean:
|
||||
-@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
|
||||
|
||||
distclean: clean
|
||||
|
@ -1,12 +1,12 @@
|
||||
#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
|
||||
*
|
||||
* Copyright (c) 1992,1993
|
||||
* Copyright (c) 1992,1993,1994
|
||||
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -1,12 +1,12 @@
|
||||
#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
|
||||
*
|
||||
* Copyright (c) 1992,1993
|
||||
* Copyright (c) 1992,1993,1994
|
||||
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -414,6 +414,12 @@ cvt_mgps(buffer, size, format, clock)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* conditional compilation flag cleanup
|
||||
*
|
||||
|
@ -1,12 +1,12 @@
|
||||
#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
|
||||
*
|
||||
* Copyright (c) 1992,1993
|
||||
* Copyright (c) 1992,1993,1994
|
||||
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* 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 timestamp_t *ptime;
|
||||
{
|
||||
if (status == SYNC_ONE)
|
||||
if (!status)
|
||||
{
|
||||
parseio->parse_dtime.parse_ptime = *ptime;
|
||||
parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
|
||||
@ -529,6 +529,12 @@ static unsigned LONG snt_rawdcf(parseio, ptime)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* conditional compilation flag cleanup
|
||||
*
|
||||
|
@ -1,12 +1,12 @@
|
||||
#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
|
||||
*
|
||||
* Copyright (c) 1992,1993
|
||||
* Copyright (c) 1992,1993,1994
|
||||
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -168,6 +168,12 @@ cvt_schmid(buffer, size, format, clock)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* parse Solaris support (initial version)
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
#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
|
||||
*/
|
||||
@ -106,6 +106,9 @@ cvt_trimsv6(buffer, size, format, clock)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* conditional compilation flag cleanup
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
#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
|
||||
*
|
||||
@ -12,7 +12,7 @@
|
||||
* a struct timeval.
|
||||
* 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
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -22,30 +22,39 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
#include "sys/types.h"
|
||||
#include "sys/time.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_unixtime.h"
|
||||
#include "ntp_calendar.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"
|
||||
|
||||
#ifdef PARSESTREAM
|
||||
@ -1139,6 +1148,12 @@ parse_setcs(dct, parse)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* declaration fixes
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
#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
|
||||
*
|
||||
@ -12,7 +12,7 @@
|
||||
* a struct timeval.
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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
|
||||
* parse Solaris support (initial version)
|
||||
*
|
||||
|
@ -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
|
||||
* (SunOS5.x - not fully tested - buyer beware ! - OS KILLERS may still be
|
||||
* lurking in the code!)
|
||||
*
|
||||
* Copyright (c) 1993
|
||||
* Copyright (c) 1993,1994
|
||||
* derived work from parsestreams.c ((c) 1991-1993, Frank Kardel) and
|
||||
* dcf77sync.c((c) Frank Kardel)
|
||||
* Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
/*
|
||||
@ -139,7 +139,7 @@ int Strcmp(s, t)
|
||||
/*ARGSUSED*/
|
||||
int _init(void)
|
||||
{
|
||||
static char revision[] = "3.4";
|
||||
static char revision[] = "3.9";
|
||||
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
|
||||
*/
|
||||
parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type));
|
||||
|
||||
if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
|
||||
{
|
||||
putnext(q, mp);
|
||||
@ -701,8 +702,9 @@ static int parserput(queue_t *q, mblk_t *imp)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK"));
|
||||
|
||||
#endif
|
||||
if (type == M_DATA)
|
||||
{
|
||||
/*
|
||||
@ -787,7 +789,15 @@ static int parserput(queue_t *q, mblk_t *imp)
|
||||
else
|
||||
if (nmp) freemsg(nmp);
|
||||
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)
|
||||
{
|
||||
@ -929,6 +939,11 @@ static int init_zs_linemon(queue_t *q, queue_t *my_q)
|
||||
emergencyzs = zs->zs_ops;
|
||||
|
||||
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);
|
||||
|
||||
@ -961,6 +976,11 @@ static void close_zs_linemon(queue_t *q, queue_t *my_q)
|
||||
mutex_enter(zs->zs_excl);
|
||||
|
||||
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);
|
||||
|
||||
@ -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 */
|
||||
|
||||
/*
|
||||
@ -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
|
||||
@ -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
|
||||
* interrupts.
|
||||
@ -1154,6 +1179,21 @@ static void zs_xsisr(struct zscom *zs)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* parse Solaris support (initial version)
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
@ -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
|
||||
* (SunOS4.x)
|
||||
*
|
||||
* Copyright (c) 1989,1990,1991,1992,1993
|
||||
* Copyright (c) 1989,1990,1991,1992,1993,1994
|
||||
* Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
#include "sys/types.h"
|
||||
@ -195,7 +195,7 @@ int xxxinit(fc, vdp, vdi, vds)
|
||||
}
|
||||
else
|
||||
{
|
||||
static char revision[] = "3.9";
|
||||
static char revision[] = "3.12";
|
||||
char *s, *S, *t;
|
||||
|
||||
strncpy(ifm->f_name, mname, FMNAMESZ);
|
||||
@ -884,7 +884,15 @@ static int parserput(q, mp)
|
||||
else
|
||||
if (nmp) freemsg(nmp);
|
||||
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)
|
||||
{
|
||||
@ -1250,6 +1258,15 @@ static void zs_xsisr(zs)
|
||||
* History:
|
||||
*
|
||||
* 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
|
||||
* shut up nice feature detection
|
||||
*
|
||||
|
@ -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
|
||||
DEFS=
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* /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
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -198,7 +198,7 @@ main(argc, argv)
|
||||
parsetime_t parsetime;
|
||||
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)
|
||||
;
|
||||
|
@ -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)
|
||||
*
|
||||
* Copyright (c) 1993
|
||||
* Copyright (c) 1993,1994
|
||||
* Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -352,7 +352,7 @@ main(argc, argv)
|
||||
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_cflag = B50|CS8|CREAD|CLOCAL;
|
||||
term.c_iflag = 0;
|
||||
|
@ -11,14 +11,16 @@ WWVB WWVB
|
||||
WWVBCLK /LD/||/STREAM/ PPSPPS LD||STREAM(tty_clock||tty_clk_streams)
|
||||
WWVBPPS /PPSPPS/
|
||||
CHU CHU /SUNOS4/ none
|
||||
PARSE PARSE /SYS_V_TTYS/||/STREAM/ PPS any||STREAM(parse||ppsclock||ppsclocd)
|
||||
PARSEPPS /SYS_V_TTYS/||/STREAM/ PPS any||STREAM(parse||ppsclock||ppsclocd)
|
||||
PARSE PARSE /SYSV_TTYS/||/STREAM/||/TERMIOS/ PPS any||STREAM(parse||ppsclock||ppsclocd)
|
||||
PARSEPPS /SYSV_TTYS/||/STREAM/||/TERMIOS/ PPS any||STREAM(parse||ppsclock||ppsclocd)
|
||||
CLOCK_*
|
||||
MX4200 MX4200PPS /PPSPPS/
|
||||
AS2201 AS2201
|
||||
AS2201PPS /PPSPPS/
|
||||
GOES GOES
|
||||
GOESPPS /PPSPPS/
|
||||
GPSTM GPSTM
|
||||
GPSTTMPPS /PPSPPS/
|
||||
OMEGA OMEGA
|
||||
OMEGAPPS /PPSPPS/
|
||||
TPRO TPRO /SUNOS/
|
||||
|
33
usr.sbin/xntpd/refclocks/rclk.GPSTM
Normal file
33
usr.sbin/xntpd/refclocks/rclk.GPSTM
Normal 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
|
@ -4,7 +4,7 @@ shift;
|
||||
|
||||
. 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
|
||||
info)
|
||||
echo " PARSE - GENERIC refence clock driver"
|
||||
|
@ -81,11 +81,11 @@ else
|
||||
for i in $rcfg
|
||||
do
|
||||
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
|
||||
fi
|
||||
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"
|
||||
fi
|
||||
CLOCKDEFS="`tr '\012' ' ' < $RCONFIG`"
|
||||
|
@ -19,7 +19,8 @@ if [ -f /bin/uname -o -f /usr/bin/uname ]; then
|
||||
sinix-m)
|
||||
guess=sinix-m
|
||||
;;
|
||||
sunos) case "$3" in
|
||||
sunos|solaris)
|
||||
case "$3" in
|
||||
4.1*) guess="sunos4" ;;
|
||||
5.1) guess="sunos5.1" ;;
|
||||
5.*) guess="sunos5.2" ;;
|
||||
@ -59,7 +60,7 @@ if [ -f /bin/uname -o -f /usr/bin/uname ]; then
|
||||
guess="netbsd"
|
||||
;;
|
||||
# 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
|
||||
# that nobody else had this marvellous idea.
|
||||
# I am not willing to mention the vendor explicitly
|
||||
@ -109,6 +110,11 @@ if [ -f /netbsd ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f /lib/clib -a -f /lib/libc ]; then
|
||||
echo domainos
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$guess" in
|
||||
'') guess="none"
|
||||
esac
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user