* configure.in: <netinet/ip.h> cannot be detected...
* ntpd/ntp_io.h: ...but every OS has it
* ntpd/refclock_oncore.c: Lint removal
* ntpq/ntpq_ops.c: Lint removal
* ntpq/refclock_chu.c: chu_major() is not an audio routine (?), lint
* libntp/icom.c: AIX doesn't have <sys/termios.h>
From: Marc.Brett@westgeo.com
* ntpd/refclock_chu.c: NetBSD needs sys/ioctl.h
(chu_debug): NetBSED-specific debug output.
From: Frederick Bruckman <fb@enteract.com>
bk: 3877b5e9Wqf7EszjfafXbv0VMuaNvw
+2000-01-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: <netinet/ip.h> cannot be detected...
+ * ntpd/ntp_io.h: ...but every OS has it
+ * ntpd/refclock_oncore.c: Lint removal
+ * ntpq/ntpq_ops.c: Lint removal
+ * ntpq/refclock_chu.c: chu_major() is not an audio routine (?), lint
+ * libntp/icom.c: AIX doesn't have <sys/termios.h>
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_chu.c: NetBSD needs sys/ioctl.h
+ (chu_debug): NetBSED-specific debug output.
+ From: Frederick Bruckman <fb@enteract.com>
+
2000-01-06 Harlan Stenn <stenn@whimsy.udel.edu>
* configure.in: 4.0.98m
AC_CHECK_HEADERS(bstring.h errno.h fcntl.h memory.h netdb.h poll.h resolv.h)
AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h termios.h)
AC_CHECK_HEADERS(timepps.h timex.h unistd.h utmp.h utmpx.h)
-AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in.h netinet/ip.h)
+AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h)
AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
dnl AC_CHECK_HEADERS(sys/chudefs.h)
#include "icom.h"
#include <unistd.h>
#include <stdio.h>
-#include <sys/termios.h>
+
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif /* HAVE_TERMIOS_H */
+#ifdef HAVE_SYS_TERMIOS_H
+# include <sys/termios.h>
+#endif /* HAVE_SYS_TERMIOS_H */
+
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
-#ifdef HAVE_NETINET_IP_H
+#ifdef HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
-# include <netinet/ip.h>
-#endif
+#else /* Some old linux systems at least have in_system.h instead. */
+# include <netinet/in_system.h>
+#endif /* HAVE_NETINET_IN_SYSTM_H */
+#include <netinet/ip.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#include <math.h>
#ifdef AUDIO_CHU
-#ifdef HAVE_SYS_AUDIOIO_H
-#include <sys/audioio.h>
-#endif /* HAVE_SYS_AUDIOIO_H */
-#ifdef HAVE_SUN_AUDIOIO_H
-#include <sun/audioio.h>
-#endif /* HAVE_SUN_AUDIOIO_H */
+# ifdef HAVE_SYS_AUDIOIO_H
+# include <sys/audioio.h>
+# endif /* HAVE_SYS_AUDIOIO_H */
+# ifdef HAVE_SUN_AUDIOIO_H
+# include <sun/audioio.h>
+# endif /* HAVE_SUN_AUDIOIO_H */
+# ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+# endif /* HAVE_SYS_IOCTL_H */
#endif /* AUDIO_CHU */
#include "ntpd.h"
static void chu_a P((struct peer *, int));
static void chu_b P((struct peer *, int));
static int chu_dist P((int, int));
+static int chu_major P((struct peer *));
#ifdef AUDIO_CHU
static void chu_uart P((struct surv *, double));
static void chu_rf P((struct peer *, double));
-static int chu_major P((struct peer *));
static void chu_gain P((struct peer *));
static int chu_audio P((void));
static void chu_debug P((void));
up->ident, up->tai, up->burstcnt, up->mindist, up->ntstamp);
#else
sprintf(pp->a_lastcode,
- "%c%1X %4d %3d %02d:%02d:%02d.000 %c%x %+d %d %d %s %d %d %d",
+ "%c%1X %4d %3d %02d:%02d:%02d.000 %c%x %+d %d %s %d %d %d %d",
synchar, qual, pp->year, pp->day, pp->hour, pp->minute,
pp->second, leapchar, up->dst, up->dut, minset,
up->ident, up->tai, up->burstcnt, up->mindist, up->ntstamp);
info.record.samples, info.record.eof,
info.record.pause, info.record.error,
info.record.waiting, info.record.balance);
- printf("chu: monitor %d, muted %d\n",
- info.monitor_gain, info.output_muted);
+#ifdef __NetBSD__
+ printf("chu: monitor %d, blocksize %d, hiwat %d, lowat %d, mode %d\n",
+ info.monitor_gain, info.blocksize, info.hiwat, info.lowat,
+ info.mode);
+#else /* __NetBSD__ */
+ printf("chu: monitor %d, muted %d\n",
+ info.monitor_gain, info.output_muted);
+#endif /* __NetBSD__ */
+ return;
}
#endif /* DEBUG */
#endif /* AUDIO_CHU */
exit(4);
}
free(buf);
- instance->shmem = mmap(0, oncore_shmem_length,
+ instance->shmem = (u_char *) mmap(0, oncore_shmem_length,
PROT_READ | PROT_WRITE,
#ifdef MAP_HASSEMAPHORE
MAP_HASSEMAPHORE |
/* Remove trailing space */
for (i = strlen(line);
- i > 0 && isascii(line[i - 1]) && isspace(line[i - 1]);
+ i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]);
)
line[--i] = '\0';
/* Remove leading space */
- for (cc = line; *cc && isascii(*cc) && isspace(*cc); cc++)
+ for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++)
continue;
/* Stop if nothing left */
/* Lowercase the command and find the arg */
for (ca = cc; *ca; ca++) {
- if (isascii(*ca) && islower(*ca)) {
+ if (isascii((int)*ca) && islower((int)*ca)) {
*ca = toupper(*ca);
- } else if (isascii(*ca) && isspace(*ca)) {
+ } else if (isascii((int)*ca) && isspace((int)*ca)) {
break;
} else if (*ca == '=') {
*ca = ' ';
}
/* Remove space leading the arg */
- for (; *ca && isascii(*ca) && isspace(*ca); ca++)
+ for (; *ca && isascii((int)*ca) && isspace((int)*ca); ca++)
continue;
if (!strncmp(cc, "STATUS", 6)) {
/* Uppercase argument as well */
for (cp = ca; *cp; cp++)
- if (isascii(*cp) && islower(*cp))
+ if (isascii((int)*cp) && islower((int)*cp))
*cp = toupper(*cp);
if (!strncmp(cc, "LAT", 3)) {
l_fp rec;
l_fp ts;
u_char havevar[MAXHAVE];
- u_long poll;
+ u_long poll_sec;
char type = '?';
char refid_string[10];
char whenbuf[8], pollbuf[8];
/*
* Got everything, format the line
*/
- poll = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL);
+ poll_sec = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL);
if (pktversion > NTP_OLDVERSION)
c = flash3[CTL_PEER_STATVAL(rstatus) & 0x7];
else
"%c%-15.15s %-15.15s %2ld %c %4.4s %4.4s %3lo %7.7s %8.7s %7.7s\n",
c, nntohost(srcadr), dstadr_refid, stratum, type,
prettyinterval(whenbuf, when(&ts, &rec, &reftime)),
- prettyinterval(pollbuf, (int)poll), reach,
+ prettyinterval(pollbuf, (int)poll_sec), reach,
lfptoms(&estdelay, 3), lfptoms(&estoffset, 3),
havevar[HAVE_JITTER] ? lfptoms(&estjitter, 3) :
lfptoms(&estdisp, 3));