diff options
536 files changed, 18175 insertions, 12192 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index a8a9f9091e071..1f762f4c93cc0 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,31 @@ # xargs -n1 | sort | uniq -d; # done +# 20150506 +OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz +# 20150504 +OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib32/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib32/private/libunbound.so.5 +OLD_LIBS+=usr/lib32/private/libatf-c.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib32/private/libldns.so.5 +OLD_LIBS+=usr/lib32/private/libssh.so.5 +OLD_LIBS+=usr/lib32/private/libucl.so.1 +OLD_DIRS+=usr/lib32/private +OLD_LIBS+=usr/lib/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib/private/libunbound.so.5 +OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib/private/libldns.so.5 +OLD_LIBS+=usr/lib/private/libssh.so.5 +OLD_LIBS+=usr/lib/private/libucl.so.1 +OLD_DIRS+=usr/lib/private # 20150501 OLD_FILES+=usr/bin/soeliminate OLD_FILES+=usr/share/man/man1/soeliminate.1.gz @@ -407,10 +432,6 @@ OLD_FILES+=usr/lib/debug/usr/lib32/i18n OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz -.if ${MK_GCC} == "no" -# 20141009: gperf disabled by default -OLD_FILES+=usr/bin/gperf -.endif # 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz diff --git a/bin/cp/cp.c b/bin/cp/cp.c index b83eeadc86ae5..2ad5f4a434140 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -90,7 +90,6 @@ volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); -static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void siginfo(int __unused); int @@ -274,7 +273,7 @@ copy(char *argv[], enum op type, int fts_options) mask = ~umask(0777); umask(~mask); - if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL) + if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) err(1, "fts_open"); for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) { switch (curr->fts_info) { @@ -488,32 +487,6 @@ copy(char *argv[], enum op type, int fts_options) return (rval); } -/* - * mastercmp -- - * The comparison function for the copy order. The order is to copy - * non-directory files before directory files. The reason for this - * is because files tend to be in the same cylinder group as their - * parent directory, whereas directories tend not to be. Copying the - * files first reduces seeking. - */ -static int -mastercmp(const FTSENT * const *a, const FTSENT * const *b) -{ - int a_info, b_info; - - a_info = (*a)->fts_info; - if (a_info == FTS_ERR || a_info == FTS_NS || a_info == FTS_DNR) - return (0); - b_info = (*b)->fts_info; - if (b_info == FTS_ERR || b_info == FTS_NS || b_info == FTS_DNR) - return (0); - if (a_info == FTS_D) - return (-1); - if (b_info == FTS_D) - return (1); - return (0); -} - static void siginfo(int sig __unused) { diff --git a/bin/date/date.1 b/bin/date/date.1 index 5e9e6648d6d00..dd791ec7b78fb 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 26, 2014 +.Dd May 7, 2015 .Dt DATE 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl jRu -.Op Fl r Ar seconds +.Op Fl r Ar seconds | Ar filename .Oo .Fl v .Sm off @@ -150,6 +150,9 @@ is the number of seconds since the Epoch see .Xr time 3 ) , and can be specified in decimal, octal, or hex. +.It Fl r Ar filename +Print the date and time of the last modification of +.Ar filename . .It Fl t Ar minutes_west Set the system's value for minutes west of .Tn GMT . diff --git a/bin/date/date.c b/bin/date/date.c index 2c09848a151e0..9ae6502e2a7ec 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/time.h> +#include <sys/stat.h> #include <ctype.h> #include <err.h> @@ -85,6 +86,7 @@ main(int argc, char *argv[]) struct vary *v; const struct vary *badv; struct tm lt; + struct stat sb; v = NULL; fmt = NULL; @@ -116,8 +118,12 @@ main(int argc, char *argv[]) case 'r': /* user specified seconds */ rflag = 1; tval = strtoq(optarg, &tmp, 0); - if (*tmp != 0) - usage(); + if (*tmp != 0) { + if (stat(optarg, &sb) == 0) + tval = sb.st_mtim.tv_sec; + else + usage(); + } break; case 't': /* minutes west of UTC */ /* error check; don't allow "PST" */ diff --git a/contrib/binutils/bfd/elf32-arm.c b/contrib/binutils/bfd/elf32-arm.c index 4d7b4866c9e6b..ca40eac0497f6 100644 --- a/contrib/binutils/bfd/elf32-arm.c +++ b/contrib/binutils/bfd/elf32-arm.c @@ -6794,15 +6794,31 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i; else if (in_attr[Tag_ABI_FP_number_model].i != 0) { + bfd *hasbfd, *hasnotbfd; + + if (in_attr[Tag_ABI_VFP_args].i) + { + hasbfd = ibfd; + hasnotbfd = obfd; + } + else + { + hasbfd = obfd; + hasnotbfd = ibfd; + } + _bfd_error_handler (_("ERROR: %B uses VFP register arguments, %B does not"), - ibfd, obfd); + hasbfd, hasnotbfd); return FALSE; } } for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { + if (out_attr[i].type == 0) + out_attr[i].type = in_attr[i].type; + /* Merge this attribute with existing attributes. */ switch (i) { @@ -9359,6 +9375,16 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT if (globals->byteswap_code) i_ehdrp->e_flags |= EF_ARM_BE8; } + + /* + * For EABI 5, we have to tag dynamic binaries and execs as either + * soft float or hard float. + */ + if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_VER5 && + (i_ehdrp->e_type == ET_DYN || i_ehdrp->e_type == ET_EXEC)) + i_ehdrp->e_flags |= + bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args) ? + EF_ARM_VFP_FLOAT : EF_ARM_SOFT_FLOAT; } static enum elf_reloc_type_class diff --git a/contrib/netcat/netcat.c b/contrib/netcat/netcat.c index bb853c9198434..041fff8bd856d 100644 --- a/contrib/netcat/netcat.c +++ b/contrib/netcat/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.122 2014/07/20 01:38:40 guenther Exp $ */ +/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -42,7 +42,6 @@ #include <sys/un.h> #include <netinet/in.h> -#include <netinet/in_systm.h> #ifdef IPSEC #include <netipsec/ipsec.h> #endif @@ -73,6 +72,12 @@ #define PORT_MAX_LEN 6 #define UNIX_DG_TMP_SOCKET_SIZE 19 +#define POLL_STDIN 0 +#define POLL_NETOUT 1 +#define POLL_NETIN 2 +#define POLL_STDOUT 3 +#define BUFSIZE 16384 + /* Command Line Options */ int dflag; /* detached, no stdin */ int Fflag; /* fdpass sock to stdout */ @@ -117,10 +122,12 @@ int udptest(int); int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); -void set_common_sockopts(int); +void set_common_sockopts(int, int); int map_tos(char *, int *); void report_connect(const struct sockaddr *, socklen_t); void usage(int); +ssize_t drainbuf(int, unsigned char *, size_t *); +ssize_t fillbuf(int, unsigned char *, size_t *); #ifdef IPSEC void add_ipsec_policy(int, char *); @@ -436,7 +443,7 @@ main(int argc, char *argv[]) &len); if (connfd == -1) { /* For now, all errnos are fatal */ - err(1, "accept"); + err(1, "accept"); } if (vflag) report_connect((struct sockaddr *)&cliaddr, len); @@ -663,7 +670,7 @@ remote_connect(const char *host, const char *port, struct addrinfo hints) freeaddrinfo(ares); } - set_common_sockopts(s); + set_common_sockopts(s, res0->ai_family); if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -767,6 +774,8 @@ local_listen(char *host, char *port, struct addrinfo hints) err(1, "disable TCP options"); } + set_common_sockopts(s, res0->ai_family); + if (bind(s, (struct sockaddr *)res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -790,68 +799,224 @@ local_listen(char *host, char *port, struct addrinfo hints) * Loop that polls on the network file descriptor and stdin. */ void -readwrite(int nfd) +readwrite(int net_fd) { - struct pollfd pfd[2]; - unsigned char buf[16 * 1024]; - int n, wfd = fileno(stdin); - int lfd = fileno(stdout); - int plen; + struct pollfd pfd[4]; + int stdin_fd = STDIN_FILENO; + int stdout_fd = STDOUT_FILENO; + unsigned char netinbuf[BUFSIZE]; + size_t netinbufpos = 0; + unsigned char stdinbuf[BUFSIZE]; + size_t stdinbufpos = 0; + int n, num_fds; + ssize_t ret; + + /* don't read from stdin if requested */ + if (dflag) + stdin_fd = -1; - plen = sizeof(buf); + /* stdin */ + pfd[POLL_STDIN].fd = stdin_fd; + pfd[POLL_STDIN].events = POLLIN; - /* Setup Network FD */ - pfd[0].fd = nfd; - pfd[0].events = POLLIN; + /* network out */ + pfd[POLL_NETOUT].fd = net_fd; + pfd[POLL_NETOUT].events = 0; - /* Set up STDIN FD. */ - pfd[1].fd = wfd; - pfd[1].events = POLLIN; + /* network in */ + pfd[POLL_NETIN].fd = net_fd; + pfd[POLL_NETIN].events = POLLIN; - while (pfd[0].fd != -1) { + /* stdout */ + pfd[POLL_STDOUT].fd = stdout_fd; + pfd[POLL_STDOUT].events = 0; + + while (1) { + /* both inputs are gone, buffers are empty, we are done */ + if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { + close(net_fd); + return; + } + /* both outputs are gone, we can't continue */ + if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { + close(net_fd); + return; + } + /* listen and net in gone, queues empty, done */ + if (lflag && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { + close(net_fd); + return; + } + + /* help says -i is for "wait between lines sent". We read and + * write arbitrary amounts of data, and we don't want to start + * scanning for newlines, so this is as good as it gets */ if (iflag) sleep(iflag); - if ((n = poll(pfd, 2 - dflag, timeout)) < 0) { - int saved_errno = errno; - close(nfd); - errc(1, saved_errno, "Polling Error"); + /* poll */ + num_fds = poll(pfd, 4, timeout); + + /* treat poll errors */ + if (num_fds == -1) { + close(net_fd); + err(1, "polling error"); } - if (n == 0) + /* timeout happened */ + if (num_fds == 0) return; - if (pfd[0].revents & POLLIN) { - if ((n = read(nfd, buf, plen)) < 0) - return; - else if (n == 0) { - shutdown(nfd, SHUT_RD); - pfd[0].fd = -1; - pfd[0].events = 0; - } else { - if (tflag) - atelnet(nfd, buf, n); - if (atomicio(vwrite, lfd, buf, n) != n) - return; + /* treat socket error conditions */ + for (n = 0; n < 4; n++) { + if (pfd[n].revents & (POLLERR|POLLNVAL)) { + pfd[n].fd = -1; } } + /* reading is possible after HUP */ + if (pfd[POLL_STDIN].events & POLLIN && + pfd[POLL_STDIN].revents & POLLHUP && + ! (pfd[POLL_STDIN].revents & POLLIN)) + pfd[POLL_STDIN].fd = -1; - if (!dflag && pfd[1].revents & POLLIN) { - if ((n = read(wfd, buf, plen)) < 0) - return; - else if (n == 0) { - if (Nflag) - shutdown(nfd, SHUT_WR); - pfd[1].fd = -1; - pfd[1].events = 0; - } else { - if (atomicio(vwrite, nfd, buf, n) != n) - return; + if (pfd[POLL_NETIN].events & POLLIN && + pfd[POLL_NETIN].revents & POLLHUP && + ! (pfd[POLL_NETIN].revents & POLLIN)) + pfd[POLL_NETIN].fd = -1; + + if (pfd[POLL_NETOUT].revents & POLLHUP) { + if (Nflag) + shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); + pfd[POLL_NETOUT].fd = -1; + } + /* if HUP, stop watching stdout */ + if (pfd[POLL_STDOUT].revents & POLLHUP) + pfd[POLL_STDOUT].fd = -1; + /* if no net out, stop watching stdin */ + if (pfd[POLL_NETOUT].fd == -1) + pfd[POLL_STDIN].fd = -1; + /* if no stdout, stop watching net in */ + if (pfd[POLL_STDOUT].fd == -1) { + if (pfd[POLL_NETIN].fd != -1) + shutdown(pfd[POLL_NETIN].fd, SHUT_RD); + pfd[POLL_NETIN].fd = -1; + } + + /* try to read from stdin */ + if (pfd[POLL_STDIN].revents & POLLIN && stdinbufpos < BUFSIZE) { + ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf, + &stdinbufpos); + /* error or eof on stdin - remove from pfd */ + if (ret == 0 || ret == -1) + pfd[POLL_STDIN].fd = -1; + /* read something - poll net out */ + if (stdinbufpos > 0) + pfd[POLL_NETOUT].events = POLLOUT; + /* filled buffer - remove self from polling */ + if (stdinbufpos == BUFSIZE) + pfd[POLL_STDIN].events = 0; + } + /* try to write to network */ + if (pfd[POLL_NETOUT].revents & POLLOUT && stdinbufpos > 0) { + ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf, + &stdinbufpos); + if (ret == -1) + pfd[POLL_NETOUT].fd = -1; + /* buffer empty - remove self from polling */ + if (stdinbufpos == 0) + pfd[POLL_NETOUT].events = 0; + /* buffer no longer full - poll stdin again */ + if (stdinbufpos < BUFSIZE) + pfd[POLL_STDIN].events = POLLIN; + } + /* try to read from network */ + if (pfd[POLL_NETIN].revents & POLLIN && netinbufpos < BUFSIZE) { + ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf, + &netinbufpos); + if (ret == -1) + pfd[POLL_NETIN].fd = -1; + /* eof on net in - remove from pfd */ + if (ret == 0) { + shutdown(pfd[POLL_NETIN].fd, SHUT_RD); + pfd[POLL_NETIN].fd = -1; } + /* read something - poll stdout */ + if (netinbufpos > 0) + pfd[POLL_STDOUT].events = POLLOUT; + /* filled buffer - remove self from polling */ + if (netinbufpos == BUFSIZE) + pfd[POLL_NETIN].events = 0; + /* handle telnet */ + if (tflag) + atelnet(pfd[POLL_NETIN].fd, netinbuf, + netinbufpos); + } + /* try to write to stdout */ + if (pfd[POLL_STDOUT].revents & POLLOUT && netinbufpos > 0) { + ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf, + &netinbufpos); + if (ret == -1) + pfd[POLL_STDOUT].fd = -1; + /* buffer empty - remove self from polling */ + if (netinbufpos == 0) + pfd[POLL_STDOUT].events = 0; + /* buffer no longer full - poll net in again */ + if (netinbufpos < BUFSIZE) + pfd[POLL_NETIN].events = POLLIN; + } + + /* stdin gone and queue empty? */ + if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) { + if (pfd[POLL_NETOUT].fd != -1 && Nflag) + shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); + pfd[POLL_NETOUT].fd = -1; + } + /* net in gone and queue empty? */ + if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) { + pfd[POLL_STDOUT].fd = -1; } } } +ssize_t +drainbuf(int fd, unsigned char *buf, size_t *bufpos) +{ + ssize_t n; + ssize_t adjust; + + n = write(fd, buf, *bufpos); + /* don't treat EAGAIN, EINTR as error */ + if (n == -1 && (errno == EAGAIN || errno == EINTR)) + n = -2; + if (n <= 0) + return n; + /* adjust buffer */ + adjust = *bufpos - n; + if (adjust > 0) + memmove(buf, buf + n, adjust); + *bufpos -= n; + return n; +} + + +ssize_t +fillbuf(int fd, unsigned char *buf, size_t *bufpos) +{ + size_t num = BUFSIZE - *bufpos; + ssize_t n; + + n = read(fd, buf + *bufpos, num); + /* don't treat EAGAIN, EINTR as error */ + if (n == -1 && (errno == EAGAIN || errno == EINTR)) + n = -2; + if (n <= 0) + return n; + *bufpos += n; + return n; +} + /* * fdpass() * Pass the connected file descriptor to stdout and exit. @@ -1025,7 +1190,7 @@ udptest(int s) } void -set_common_sockopts(int s) +set_common_sockopts(int s, int af) { int x = 1; @@ -1040,8 +1205,17 @@ set_common_sockopts(int s) err(1, NULL); } if (Tflag != -1) { - if (setsockopt(s, IPPROTO_IP, IP_TOS, - &Tflag, sizeof(Tflag)) == -1) + int proto, option; + + if (af == AF_INET6) { + proto = IPPROTO_IPV6; + option = IPV6_TCLASS; + } else { + proto = IPPROTO_IP; + option = IP_TOS; + } + + if (setsockopt(s, proto, option, &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); } if (Iflag) { diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog index 400cf79340f59..e75384c88fab0 100644 --- a/contrib/ntp/ChangeLog +++ b/contrib/ntp/ChangeLog @@ -1,4 +1,80 @@ --- +(4.2.8p2) 2015/04/07 Released by Harlan Stenn <stenn@ntp.org> +(4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org> + +* [Bug 2763] Fix for different thresholds for forward and backward steps. +--- +(4.2.8p2-RC2) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org> + +* [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c. +* [Bug 2769] New script: update-leap +* [Bug 2769] cleannup for update-leap +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2794] Clean up kernel clock status reports. +* [Bug 2795] Cannot build without OpenSLL (on Win32). + Provided a Win32 specific wrapper around libevent/arc4random.c. + fixed some minor warnings. +* [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32. +* [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys + on big-endian machines. +* [Bug 2798] sntp should decode and display the leap indicator. +* Simple cleanup to html/build.html +--- +(4.2.8p2-RC1) 2015/03/30 Released by Harlan Stenn <stenn@ntp.org> + +* [Bug 2794] Don't let reports on normal kernel status changes + look like errors. +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2592] Account for PPS sources which can provide an accurate + absolute time stamp, and status information. + Fixed indention and removed trailing whitespace. +* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. +* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument. +* [Bug 2346] "graceful termination" signals do not do peer cleanup. +* [Bug 2728] See if C99-style structure initialization works. +* [Bug 2747] Upgrade libevent to 2.1.5-beta. +* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . +* [Bug 2751] jitter.h has stale copies of l_fp macros. +* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM. +* [Bug 2757] Quiet compiler warnings. +* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq. +* [Bug 2763] Allow different thresholds for forward and backward steps. +* [Bug 2766] ntp-keygen output files should not be world-readable. +* [Bug 2767] ntp-keygen -M should symlink to ntp.keys. +* [Bug 2771] nonvolatile value is documented in wrong units. +* [Bug 2773] Early leap announcement from Palisade/Thunderbolt +* [Bug 2774] Unreasonably verbose printout - leap pending/warning +* [Bug 2775] ntp-keygen.c fails to compile under Windows. +* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info. + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. + Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices + in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling + if the time status shall be printed. +* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. +* [Sec 2781] Authentication doesn't protect symmetric associations against + DoS attacks. +* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE. +* [Bug 2789] Quiet compiler warnings from libevent. +* [Bug 2790] If ntpd sets the Windows MM timer highest resolution + pause briefly before measuring system clock precision to yield + correct results. +* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer. +* Use predefined function types for parse driver functions + used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid + compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings + when called with pointers to different types. +--- (4.2.8p1) 2015/02/04 Released by Harlan Stenn <stenn@ntp.org> * Update the NEWS file. @@ -14,7 +90,7 @@ (This should work for all versions of Windows >= W2K) * [Bug 2738] Missing buffer initialization in refclocK_parse.c::parsestate(). * [Bug 2739] Parse driver with PPS enabled occasionally evaluates - PPS timestamp with wrong sign. + PPS timestamp with wrong sign. Removed some German umlauts. * [Bug 2740] Removed some obsolete code from the parse driver. * [Bug 2741] Incorrect buffer check in refclocK_parse.c::parsestatus(). @@ -94,7 +170,7 @@ * [Bug 2678] nmea_control() now checks 'refclock_params()' result. (4.2.7p481) 2014/11/22 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2314] Only enable PPS if kernel consumer binding succeeds. -* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. +* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. * Rename pps_enable to hardpps_enable. (4.2.7p480) 2014/11/21 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2677] PATH_MAX isn't #define'd under Windows. diff --git a/contrib/ntp/CommitLog b/contrib/ntp/CommitLog index 38097ac6ccfea..0e87846dbfbd3 100644 --- a/contrib/ntp/CommitLog +++ b/contrib/ntp/CommitLog @@ -1,3 +1,2569 @@ +ChangeSet@1.3320, 2015-04-07 04:28:16-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2 + TAG: NTP_4_2_8P2 + + ChangeLog@1.1633 +1 -0 + NTP_4_2_8P2 + + ntpd/invoke-ntp.conf.texi@1.182 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntp.keys.texi@1.178 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntpd.texi@1.495 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.5man@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.5mdoc@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.html@1.173 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.conf.man.in@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.mdoc.in@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5man@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5mdoc@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.html@1.174 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.keys.man.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.mdoc.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd-opts.c@1.517 +245 -245 + NTP_4_2_8P2 + + ntpd/ntpd-opts.h@1.516 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdman@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdmdoc@1.324 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.html@1.168 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.man.in@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2 + + ntpdc/invoke-ntpdc.texi@1.492 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.c@1.510 +107 -107 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.html@1.336 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + ntpq/invoke-ntpq.texi@1.498 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq-opts.c@1.515 +106 -106 + NTP_4_2_8P2 + + ntpq/ntpq-opts.h@1.513 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqman@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqmdoc@1.326 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.html@1.165 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.man.in@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.mdoc.in@1.326 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.494 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.c@1.512 +68 -68 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.html@1.163 +1 -1 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + packageinfo.sh@1.509 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.84 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.html@1.86 +1 -1 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.83 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.88 +1 -1 + NTP_4_2_8P2 + + scripts/invoke-plot_summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/invoke-summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.315 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait-opts@1.51 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.html@1.332 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.man.in@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.91 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.html@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/invoke-ntptrace.texi@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptraceman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.html@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.mdoc.in@1.93 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/summary.1summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.1summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/invoke-update-leap.texi@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap-opts@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapman@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapmdoc@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.html@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.man.in@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.mdoc.in@1.4 +2 -2 + NTP_4_2_8P2 + + sntp/invoke-sntp.texi@1.492 +2 -2 + NTP_4_2_8P2 + + sntp/sntp-opts.c@1.511 +159 -159 + NTP_4_2_8P2 + + sntp/sntp-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpman@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpmdoc@1.327 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.html@1.507 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.man.in@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.mdoc.in@1.327 +2 -2 + NTP_4_2_8P2 + + util/invoke-ntp-keygen.texi@1.495 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen-opts.c@1.513 +173 -173 + NTP_4_2_8P2 + + util/ntp-keygen-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenman@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.html@1.169 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + +ChangeSet@1.3319, 2015-04-07 04:05:46-04:00, stenn@deacon.udel.edu + ntp-4.2.8p2 + + packageinfo.sh@1.508 +2 -2 + ntp-4.2.8p2 + +ChangeSet@1.3318, 2015-04-07 07:57:32+00:00, stenn@psp-fb1.ntp.org + NEWS update + + NEWS@1.135 +4 -2 + NEWS update + +ChangeSet@1.3314.1.3, 2015-04-03 03:56:38-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC3 + TAG: NTP_4_2_8P2_RC3 + + ChangeLog@1.1629.1.3 +1 -0 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.conf.texi@1.181 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.keys.texi@1.177 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntpd.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5man@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5mdoc@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.html@1.172 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.man.in@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.mdoc.in@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5man@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5mdoc@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.html@1.173 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.man.in@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.mdoc.in@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.c@1.516 +7 -7 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.h@1.515 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdman@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdmdoc@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.html@1.167 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.man.in@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.mdoc.in@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/invoke-ntpdc.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.c@1.509 +7 -7 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.html@1.335 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/invoke-ntpq.texi@1.497 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.c@1.514 +7 -7 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.h@1.512 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqman@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqmdoc@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.html@1.164 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.man.in@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.mdoc.in@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.c@1.511 +7 -7 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.html@1.162 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + packageinfo.sh@1.507 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.83 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.html@1.85 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.man.in@1.82 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.87 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/invoke-plot_summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/invoke-summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.314 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait-opts@1.50 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.html@1.331 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.man.in@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.102 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.90 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.html@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/invoke-ntptrace.texi@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptraceman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.html@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.mdoc.in@1.92 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.1summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.1summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/invoke-update-leap.texi@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap-opts@1.3 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapman@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapmdoc@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.html@1.3 +6 -5 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.man.in@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.mdoc.in@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/invoke-sntp.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpman@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpmdoc@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/sntp.html@1.506 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp.man.in@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.mdoc.in@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + util/invoke-ntp-keygen.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.c@1.512 +7 -7 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.html@1.168 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + +ChangeSet@1.3314.1.2, 2015-04-03 03:35:54-04:00, stenn@deacon.udel.edu + [Bug 2763] Fix for different thresholds for forward and backward steps + + ChangeLog@1.1629.1.2 +3 -0 + [Bug 2763] Fix for different thresholds for forward and backward steps + + ntpd/ntp_loopfilter.c@1.183 +2 -2 + [Bug 2763] Fix for different thresholds for forward and backward steps + +ChangeSet@1.3314.1.1, 2015-04-03 01:16:34-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC2 + TAG: NTP_4_2_8P2_RC2 + + ChangeLog@1.1629.1.1 +1 -0 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.conf.texi@1.180 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.keys.texi@1.176 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5man@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5mdoc@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.html@1.171 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.man.in@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.mdoc.in@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5man@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5mdoc@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.html@1.172 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.man.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.mdoc.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.c@1.515 +7 -7 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.h@1.514 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdman@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdmdoc@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.html@1.166 +50 -26 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.mdoc.in@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/invoke-ntpdc.texi@1.490 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.c@1.508 +7 -7 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.h@1.507 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.html@1.334 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/invoke-ntpq.texi@1.496 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.c@1.513 +7 -7 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.h@1.511 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqman@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqmdoc@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.html@1.163 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.man.in@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.492 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.h@1.509 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.html@1.161 +1 -1 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + packageinfo.sh@1.506 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.82 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.html@1.84 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.81 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.86 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/invoke-plot_summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/invoke-summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.313 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait-opts@1.49 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.html@1.330 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.man.in@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.89 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.html@1.102 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.man.in@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.90 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/invoke-ntptrace.texi@1.102 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace.1ntptraceman@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.90 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace.html@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace.man.in@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntptrace/ntptrace.mdoc.in@1.91 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/plot_summary-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/plot_summary.1plot_summaryman@1.101 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/plot_summary.1plot_summarymdoc@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/plot_summary.html@1.104 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/plot_summary.man.in@1.101 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/plot_summary.mdoc.in@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/summary-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/summary.1summaryman@1.101 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/summary.1summarymdoc@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/summary.html@1.104 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/summary.man.in@1.101 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/summary.mdoc.in@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/update-leap/invoke-update-leap.texi@1.2 +6 -5 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap-opts@1.2 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap.1update-leapman@1.2 +7 -6 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap.1update-leapmdoc@1.2 +6 -5 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap.html@1.2 +48 -72 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap.man.in@1.2 +7 -6 + NTP_4_2_8P2_RC2 + + scripts/update-leap/update-leap.mdoc.in@1.2 +6 -5 + NTP_4_2_8P2_RC2 + + sntp/invoke-sntp.texi@1.490 +2 -2 + NTP_4_2_8P2_RC2 + + sntp/sntp-opts.c@1.509 +7 -7 + NTP_4_2_8P2_RC2 + + sntp/sntp-opts.h@1.507 +3 -3 + NTP_4_2_8P2_RC2 + + sntp/sntp.1sntpman@1.325 +3 -3 + NTP_4_2_8P2_RC2 + + sntp/sntp.1sntpmdoc@1.325 +2 -2 + NTP_4_2_8P2_RC2 + + sntp/sntp.html@1.505 +111 -135 + NTP_4_2_8P2_RC2 + + sntp/sntp.man.in@1.325 +3 -3 + NTP_4_2_8P2_RC2 + + sntp/sntp.mdoc.in@1.325 +2 -2 + NTP_4_2_8P2_RC2 + + util/invoke-ntp-keygen.texi@1.493 +2 -2 + NTP_4_2_8P2_RC2 + + util/ntp-keygen-opts.c@1.511 +7 -7 + NTP_4_2_8P2_RC2 + + util/ntp-keygen-opts.h@1.509 +3 -3 + NTP_4_2_8P2_RC2 + + util/ntp-keygen.1ntp-keygenman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + util/ntp-keygen.1ntp-keygenmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + util/ntp-keygen.html@1.167 +2 -2 + NTP_4_2_8P2_RC2 + + util/ntp-keygen.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + util/ntp-keygen.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + +ChangeSet@1.3314, 2015-04-03 02:36:18+00:00, stenn@psp-fb1.ntp.org + merge cleanup + + NEWS@1.133 +6 -5 + merge cleanup + +ChangeSet@1.3313, 2015-04-03 02:31:18+00:00, stenn@psp-fb1.ntp.org + merge cleanup + + ChangeLog@1.1629 +3 -3 + merge cleanup + +ChangeSet@1.3308.2.11, 2015-04-02 21:42:37+00:00, stenn@psp-deb1.ntp.org + [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c + + ChangeLog@1.1625.2.9 +1 -0 + [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c + +ChangeSet@1.3308.2.10, 2015-04-02 20:17:55+00:00, stenn@psp-deb1.ntp.org + merge cleanup + + ChangeLog@1.1625.2.8 +1 -3 + merge cleanup + +ChangeSet@1.3308.2.9, 2015-04-02 21:41:22+02:00, jnperlin@nemesis.localnet + [Bug 2795] Cannot build without OpenSLL (on Win32). + fixed minor warning + + ChangeLog@1.1625.2.7 +3 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32). + fixed minor warning + + include/ntp_md5.h@1.10 +1 -1 + [Bug 2795] Cannot build without OpenSLL (on Win32). + OpenSSL declares EVP_md5() as function without arguments; surrogate should do the same. + +ChangeSet@1.3308.6.2, 2015-04-02 07:45:04+00:00, stenn@psp-deb1.ntp.org + cleanup + + ChangeLog@1.1625.6.3 +0 -2 + cleanup + + ChangeLog@1.1625.6.2 +6 -0 + + ntpd/invoke-ntpd.texi@1.492 +20 -3 + [Bug 2788] New -G flag (force step once) cleanup. + + ntpd/ntp_loopfilter.c@1.182 +17 -6 + [Bug 2794] Clean up kernel clock status reports. + Trailing whitespace cleanup. + + ntpd/ntpd-opts.c@1.514 +249 -249 + Autogenerated file. + + ntpd/ntpd-opts.h@1.513 +3 -3 + Autogenerated file. + + ntpd/ntpd.1ntpdman@1.321 +19 -5 + Autogenerated file. + + ntpd/ntpd.1ntpdmdoc@1.321 +17 -4 + Autogenerated file. + + ntpd/ntpd.man.in@1.321 +19 -5 + Autogenerated file. + + ntpd/ntpd.mdoc.in@1.321 +17 -4 + Autogenerated file. + + ntpd/ntpdbase-opts.def@1.29 +9 -6 + [Bug 2788] New flag -G (force_step_once) - documentation cleanup. + +ChangeSet@1.3308.2.7, 2015-04-02 07:34:40+00:00, stenn@psp-deb1.ntp.org + Simple cleanup to html/build.html + + ChangeLog@1.1625.2.5 +1 -0 + Simple cleanup to html/build.html + + html/build.html@1.28 +2 -2 + Simple cleanup to html/build.html + +ChangeSet@1.3308.2.6, 2015-04-02 03:15:42+00:00, stenn@psp-fb1.ntp.org + typos + + ChangeLog@1.1625.2.4 +4 -4 + typos + +ChangeSet@1.3308.5.2, 2015-04-01 11:08:14+00:00, stenn@psp-deb1.ntp.org + [Bug 2798] sntp should decode and display the leap indicator + + html/sntp.html@1.12 +3 -3 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/invoke-sntp.texi@1.489 +4 -3 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp-opts.c@1.508 +1 -1 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp-opts.def@1.47 +2 -1 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp-opts.h@1.506 +1 -1 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp.1sntpman@1.324 +5 -4 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp.1sntpmdoc@1.324 +4 -3 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp.html@1.504 +136 -111 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp.man.in@1.324 +5 -4 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/sntp.mdoc.in@1.324 +4 -3 + [Bug 2798] sntp should decode and display the leap indicator + +ChangeSet@1.3308.5.1, 2015-04-01 10:44:24+00:00, stenn@psp-fb1.ntp.org + [Bug 2798] sntp should decode and display the leap indicator + + ChangeLog@1.1625.5.1 +3 -0 + [Bug 2798] sntp should decode and display the leap indicator + + sntp/main.c@1.95 +21 -1 + [Bug 2798] sntp should decode and display the leap indicator + +ChangeSet@1.3308.4.1, 2015-03-30 20:14:46+02:00, jnperlin@hydra.(none) + [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines + + ChangeLog@1.1625.4.1 +3 -0 + [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines + + util/ntp-keygen.c@1.104 +4 -4 + [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines + +ChangeSet@1.3308.3.1, 2015-03-30 19:39:17+02:00, jnperlin@nemesis.localnet + [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32 + + ChangeLog@1.1625.3.1 +2 -0 + [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32 + + ports/winnt/libntp/getclock.c@1.5 +2 -0 + [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32 + make sure 'init_win_precise_time()' gets called + +ChangeSet@1.3308.2.4, 2015-03-30 19:10:12+02:00, jnperlin@nemesis.localnet + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ChangeLog@1.1625.2.2 +3 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ports/winnt/libntp/arc4wrap.c@1.1 +84 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ports/winnt/libntp/arc4wrap.c@1.0 +0 -0 + + ports/winnt/vs2005/libntp.vcproj@1.24 +4 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ports/winnt/vs2008/libntp/libntp.vcproj@1.52 +6 -2 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.6 +1 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.4 +6 -0 + [Bug 2795] Cannot build without OpenSLL (on Win32) + Provided a Win32 specific wrapper around libevent/arc4random.c + +ChangeSet@1.3305.3.8, 2015-03-30 15:55:43+02:00, martin@pc-martin.(none) + [Bug 2794] Don't let reports on normal kernel status changes look like errors. + + ChangeLog@1.1622.3.8 +2 -0 + [Bug 2794] Don't let reports on normal kernel status changes look like errors. + + ntpd/ntp_loopfilter.c@1.181 +30 -19 + [Bug 2794] Don't let reports on normal kernel status changes look like errors. + +ChangeSet@1.3305.3.7, 2015-03-30 11:23:48+02:00, martin@pc-martin.(none) + [Bug 2788] New flag -G (force_step_once) + + ChangeLog@1.1622.3.7 +1 -0 + [Bug 2788] New flag -G (force_step_once) + + include/ntpd.h@1.185.1.1 +4 -3 + [Bug 2788] Support new flag -G (force_step_once) + Removed trailing whitespace. + + ntpd/cmd_args.c@1.62 +6 -3 + [Bug 2788] New flag -G (force_step_once) + Removed trailing whitespace. + + ntpd/ntp_loopfilter.c@1.180 +21 -15 + [Bug 2788] New flag -G (force_step_once) + Removed trailing whitespace. + + ntpd/ntpd-opts.c@1.511.1.1 +255 -225 + [Bug 2788] New flag -G (force_step_once) + + ntpd/ntpd-opts.h@1.510.1.1 +36 -29 + [Bug 2788] New flag -G (force_step_once) + + ntpd/ntpdbase-opts.def@1.28 +17 -2 + [Bug 2788] New flag -G (force_step_once) + Removed trailing whitespace. + +ChangeSet@1.3308.1.3, 2015-03-30 09:11:33+00:00, stenn@psp-fb1.ntp.org + Start the RC cycle for ntp-4.2.8p2 + + NEWS@1.130.1.2 +82 -1 + Start the RC cycle for ntp-4.2.8p2 + +ChangeSet@1.3308.2.3, 2015-03-30 04:48:27-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC1 + TAG: NTP_4_2_8P2_RC1 + + ChangeLog@1.1625.2.1 +1 -0 + NTP_4_2_8P2_RC1 + + ntpd/invoke-ntp.conf.texi@1.179 +1 -1 + NTP_4_2_8P2_RC1 + + ntpd/invoke-ntp.keys.texi@1.175 +1 -1 + NTP_4_2_8P2_RC1 + + ntpd/invoke-ntpd.texi@1.491 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.conf.5man@1.213 +3 -3 + NTP_4_2_8P2_RC1 + + ntpd/ntp.conf.5mdoc@1.213 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.conf.html@1.170 +13 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.conf.man.in@1.213 +3 -3 + NTP_4_2_8P2_RC1 + + ntpd/ntp.conf.mdoc.in@1.213 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.keys.5man@1.209 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.keys.5mdoc@1.209 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.keys.html@1.171 +1 -1 + NTP_4_2_8P2_RC1 + + ntpd/ntp.keys.man.in@1.209 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntp.keys.mdoc.in@1.209 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntpd-opts.c@1.512 +239 -239 + NTP_4_2_8P2_RC1 + + ntpd/ntpd-opts.h@1.511 +3 -3 + NTP_4_2_8P2_RC1 + + ntpd/ntpd.1ntpdman@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpd/ntpd.1ntpdmdoc@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntpd.html@1.165 +2 -2 + NTP_4_2_8P2_RC1 + + ntpd/ntpd.man.in@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpd/ntpd.mdoc.in@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + ntpdc/invoke-ntpdc.texi@1.489 +2 -2 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc-opts.c@1.507 +107 -107 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc-opts.h@1.506 +3 -3 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc.1ntpdcman@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc.1ntpdcmdoc@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc.html@1.333 +2 -2 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc.man.in@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpdc/ntpdc.mdoc.in@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + ntpq/invoke-ntpq.texi@1.495 +2 -2 + NTP_4_2_8P2_RC1 + + ntpq/ntpq-opts.c@1.512 +106 -106 + NTP_4_2_8P2_RC1 + + ntpq/ntpq-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC1 + + ntpq/ntpq.1ntpqman@1.323 +3 -3 + NTP_4_2_8P2_RC1 + + ntpq/ntpq.1ntpqmdoc@1.323 +2 -2 + NTP_4_2_8P2_RC1 + + ntpq/ntpq.html@1.162 +2 -2 + NTP_4_2_8P2_RC1 + + ntpq/ntpq.man.in@1.323 +3 -3 + NTP_4_2_8P2_RC1 + + ntpq/ntpq.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2_RC1 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.491 +2 -2 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd-opts.c@1.509 +68 -68 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd.html@1.160 +1 -1 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd.man.in@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + packageinfo.sh@1.505 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.81 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.82 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/calc_tickadj.html@1.83 +1 -1 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/calc_tickadj.man.in@1.80 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.82 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.85 +1 -1 + NTP_4_2_8P2_RC1 + + scripts/invoke-plot_summary.texi@1.102 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/invoke-summary.texi@1.102 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.312 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait-opts@1.48 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.309 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.310 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait.html@1.329 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait.man.in@1.309 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.310 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.100 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep-opts@1.50 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.88 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.88 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep.html@1.101 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep.man.in@1.88 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.89 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/invoke-ntptrace.texi@1.101 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace-opts@1.50 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace.1ntptraceman@1.88 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.89 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace.html@1.102 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace.man.in@1.88 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/ntptrace/ntptrace.mdoc.in@1.90 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/plot_summary-opts@1.50 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/plot_summary.1plot_summaryman@1.100 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/plot_summary.1plot_summarymdoc@1.100 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/plot_summary.html@1.103 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/plot_summary.man.in@1.100 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/plot_summary.mdoc.in@1.100 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/summary-opts@1.50 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/summary.1summaryman@1.100 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/summary.1summarymdoc@1.100 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/summary.html@1.103 +2 -2 + NTP_4_2_8P2_RC1 + + scripts/summary.man.in@1.100 +3 -3 + NTP_4_2_8P2_RC1 + + scripts/summary.mdoc.in@1.100 +2 -2 + NTP_4_2_8P2_RC1 + + sntp/invoke-sntp.texi@1.488 +2 -2 + NTP_4_2_8P2_RC1 + + sntp/sntp-opts.c@1.507 +159 -159 + NTP_4_2_8P2_RC1 + + sntp/sntp-opts.h@1.505 +3 -3 + NTP_4_2_8P2_RC1 + + sntp/sntp.1sntpman@1.323 +3 -3 + NTP_4_2_8P2_RC1 + + sntp/sntp.1sntpmdoc@1.323 +2 -2 + NTP_4_2_8P2_RC1 + + sntp/sntp.html@1.503 +2 -2 + NTP_4_2_8P2_RC1 + + sntp/sntp.man.in@1.323 +3 -3 + NTP_4_2_8P2_RC1 + + sntp/sntp.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2_RC1 + + util/invoke-ntp-keygen.texi@1.492 +2 -2 + NTP_4_2_8P2_RC1 + + util/ntp-keygen-opts.c@1.510 +173 -173 + NTP_4_2_8P2_RC1 + + util/ntp-keygen-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC1 + + util/ntp-keygen.1ntp-keygenman@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + util/ntp-keygen.1ntp-keygenmdoc@1.320 +2 -2 + NTP_4_2_8P2_RC1 + + util/ntp-keygen.html@1.166 +2 -2 + NTP_4_2_8P2_RC1 + + util/ntp-keygen.man.in@1.320 +3 -3 + NTP_4_2_8P2_RC1 + + util/ntp-keygen.mdoc.in@1.320 +2 -2 + NTP_4_2_8P2_RC1 + +ChangeSet@1.3308.2.2, 2015-03-30 04:25:58-04:00, stenn@deacon.udel.edu + Begin 4.2.8p2-RC1 + + packageinfo.sh@1.504 +1 -1 + Begin 4.2.8p2-RC1 + +ChangeSet@1.3308.2.1, 2015-03-30 08:18:35+00:00, stenn@psp-fb1.ntp.org + Start the RC cycle for ntp-4.2.8p2 + + NEWS@1.130.1.1 +49 -0 + Start the RC cycle for ntp-4.2.8p2 + +ChangeSet@1.3311, 2015-03-29 05:05:41+00:00, stenn@psp-fb1.ntp.org + [Bug 2769] cleannup for update-leap + + ChangeLog@1.1627 +1 -0 + [Bug 2769] cleannup for update-leap + +ChangeSet@1.3310, 2015-03-29 04:10:31+00:00, stenn@psp-fb1.ntp.org + [Bug 2769] cleannup for update-leap + + NEWS@1.131 +8 -0 + [Bug 2769] cleannup for update-leap + + scripts/update-leap/Makefile.am@1.3 +1 -0 + [Bug 2769] cleannup for update-leap + + scripts/update-leap/update-leap-opts.def@1.2 +4 -3 + [Bug 2769] cleannup for update-leap + +ChangeSet@1.3308, 2015-03-29 01:49:10+00:00, stenn@psp-deb1.ntp.org + [Bug 2346] "graceful termination" signals do not do peer cleanup + + ChangeLog@1.1625 +1 -0 + [Bug 2346] "graceful termination" signals do not do peer cleanup + + include/ntpd.h@1.186 +1 -0 + [Bug 2346] "graceful termination" signals do not do peer cleanup + + ntpd/ntp_peer.c@1.154 +20 -0 + [Bug 2346] "graceful termination" signals do not do peer cleanup + + ntpd/ntpd.c@1.159 +1 -0 + [Bug 2346] "graceful termination" signals do not do peer cleanup + +ChangeSet@1.3305.3.6, 2015-03-25 17:32:25+01:00, martin@pc-martin.(none) + [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information. + + ChangeLog@1.1622.3.6 +2 -0 + [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information. + + include/ntp.h@1.213 +2 -1 + New flag FLAG_TSTAMP_PPS. + + ntpd/ntp_proto.c@1.353.1.2 +2 -1 + [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information. + + ntpd/refclock_parse.c@1.78 +2 -2 + [Bug 2592] Parse driver can return absolute timestamp with PPS, and status information. + +ChangeSet@1.3305.3.5, 2015-03-25 17:24:59+01:00, martin@pc-martin.(none) + Fixed indention and removed trailing whitespace. + + ChangeLog@1.1622.3.5 +1 -0 + Fixed indention and removed trailing whitespace. + + include/ntp.h@1.212 +4 -4 + Fixed indention. + + include/parse_conf.h@1.7 +6 -6 + Fixed indention. + + ntpd/ntp_proto.c@1.353.1.1 +27 -27 + Removed trailing whitespace. + + ntpd/refclock_parse.c@1.77 +16 -16 + Fixed indention. + +ChangeSet@1.3305.3.4, 2015-03-22 07:59:12+00:00, stenn@psp-fb1.ntp.org + merge cleanup + + ChangeLog@1.1622.3.4 +0 -1 + merge cleanup + +ChangeSet@1.3305.5.3, 2015-03-22 07:24:07+00:00, stenn@psp-fb1.ntp.org + Bug 2791 -> Bug 2789 + + ChangeLog@1.1622.5.3 +1 -1 + Bug 2791 -> Bug 2789 + +ChangeSet@1.3305.5.2, 2015-03-22 06:59:06+00:00, stenn@psp-fb1.ntp.org + Merge cleanup + + ChangeLog@1.1622.5.2 +22 -22 + Merge cleanup + +ChangeSet@1.3305.4.2, 2015-03-22 03:48:52+00:00, stenn@psp-fb1.ntp.org + [Bug 2769] New script: update-leap + + .point-changed-filelist@1.26 +7 -0 + [Bug 2769] New script: update-leap + + scripts/update-leap/Makefile.am@1.2 +2 -1 + [Bug 2769] New script: update-leap + +ChangeSet@1.3305.4.1, 2015-03-22 03:01:33+00:00, stenn@psp-fb1.ntp.org + [Bug 2769] New script: update-leap + + BitKeeper/etc/ignore@1.86 +1 -0 + added Makefile.in + + ChangeLog@1.1622.4.1 +1 -0 + [Bug 2769] New script: update-leap + + configure.ac@1.585 +8 -7 + [Bug 2769] New script: update-leap + + scripts/Makefile.am@1.40 +1 -0 + [Bug 2769] New script: update-leap + + scripts/update-leap/Makefile.am@1.1 +95 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/Makefile.am + + scripts/update-leap/Makefile.am@1.0 +0 -0 + + scripts/update-leap/invoke-update-leap.menu@1.1 +1 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/invoke-update-leap.menu + + scripts/update-leap/invoke-update-leap.menu@1.0 +0 -0 + + scripts/update-leap/invoke-update-leap.texi@1.1 +169 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/invoke-update-leap.texi + + scripts/update-leap/invoke-update-leap.texi@1.0 +0 -0 + + scripts/update-leap/update-leap@1.1 +434 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap + + scripts/update-leap/update-leap@1.0 +0 -0 + + scripts/update-leap/update-leap-opts@1.1 +72 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap-opts + + scripts/update-leap/update-leap-opts@1.0 +0 -0 + + scripts/update-leap/update-leap-opts.def@1.1 +162 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap-opts.def + + scripts/update-leap/update-leap-opts.def@1.0 +0 -0 + + scripts/update-leap/update-leap.1update-leapman@1.1 +168 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.1update-leapman + + scripts/update-leap/update-leap.1update-leapman@1.0 +0 -0 + + scripts/update-leap/update-leap.1update-leapmdoc@1.1 +133 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.1update-leapmdoc + + scripts/update-leap/update-leap.1update-leapmdoc@1.0 +0 -0 + + scripts/update-leap/update-leap.html@1.1 +297 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.html + + scripts/update-leap/update-leap.html@1.0 +0 -0 + + scripts/update-leap/update-leap.man.in@1.1 +168 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.man.in + + scripts/update-leap/update-leap.man.in@1.0 +0 -0 + + scripts/update-leap/update-leap.mdoc.in@1.1 +133 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.mdoc.in + + scripts/update-leap/update-leap.mdoc.in@1.0 +0 -0 + + scripts/update-leap/update-leap.texi@1.1 +43 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.texi + + scripts/update-leap/update-leap.texi@1.0 +0 -0 + + sntp/loc/darwin@1.3 +1 -0 + [Bug 2769] New script: update-leap + + sntp/loc/debian@1.4 +1 -0 + [Bug 2769] New script: update-leap + + sntp/loc/freebsd@1.6 +1 -0 + [Bug 2769] New script: update-leap + + sntp/loc/legacy@1.7 +1 -0 + [Bug 2769] New script: update-leap + + sntp/loc/netbsd@1.4 +1 -0 + [Bug 2769] New script: update-leap + + sntp/loc/solaris@1.7 +1 -0 + [Bug 2769] New script: update-leap + + sntp/m4/ntp_locinfo.m4@1.18 +6 -0 + [Bug 2769] New script: update-leap + +ChangeSet@1.3305.3.1, 2015-03-20 13:03:38+01:00, burnicki@pc-martin4. + [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause + briefly before measuring system clock precision to yield correct results. + + ChangeLog@1.1622.3.1 +3 -1 + [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause + briefly before measuring system clock precision to yield correct results. + + ports/winnt/ntpd/nt_clockstuff.c@1.65 +4 -0 + [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause + briefly before measuring system clock precision to yield correct results. + +ChangeSet@1.3305.2.6, 2015-03-20 11:47:15+01:00, martin@pc-martin.(none) + [Bug 2791] Quiet compiler warnings from libevent. + + ChangeLog@1.1622.2.6 +1 -0 + [Bug 2791] Quiet compiler warnings from libevent. + + sntp/libevent/evthread-internal.h@1.8 +2 -2 + [Bug 2791] Fixed function prototypes to quiet compiler warnings. + +ChangeSet@1.3305.2.5, 2015-03-20 11:36:15+01:00, martin@pc-martin.(none) + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + ChangeLog@1.1622.2.5 +4 -3 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + include/parse.h@1.12 +3 -3 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + libparse/clk_meinberg.c@1.14 +7 -4 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + libparse/clk_rawdcf.c@1.20 +3 -2 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + libparse/clk_schmid.c@1.13 +3 -3 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + libparse/parse.c@1.19 +1 -1 + Quiet compiler warning. + + ntpd/refclock_parse.c@1.76 +1 -1 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + + parseutil/dcfd.c@1.28 +26 -25 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + Removed trailing whitespace. + + parseutil/testdcf.c@1.10 +11 -10 + [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. + Removed trailing whitespace and fixed indention. + +ChangeSet@1.3305.2.4, 2015-03-19 17:00:30+01:00, martin@pc-martin.(none) + Added a comment from Juergen Perlinger in ntp_date.c to make the code clearer. + + ChangeLog@1.1622.2.4 +1 -0 + Added a comment from Juergen Perlinger in ntp_date.c to make the code clearer. + + libntp/ntp_calendar.c@1.15 +40 -34 + Added a comment from Juergen Perlinger to make the code clearer. + Removed trailing whitespace. + +ChangeSet@1.3305.2.3, 2015-03-19 16:52:05+01:00, martin@pc-martin.(none) + Use predefined function types for parse driver functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings when called with pointers to different types. + + ChangeLog@1.1622.2.3 +7 -0 + Use predefined function types for parse driver functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings when called with pointers to different types. + + include/binio.h@1.6 +10 -0 + Added macros casting the result of the conversion function to a dedicated with to avoid compiler warnings. + + include/mbg_gps166.h@1.13 +1 -1 + Use specific data type with mbg_csum() to avoid compiler warnings. + + include/parse.h@1.11 +15 -11 + Introduced some dedicated function types simplifying use with function pointers. + Let parse input functions expect a char instead of an unsigned int since chars are used anyway. + This helps to avoid compiler warnings. + + libparse/clk_computime.c@1.12 +10 -10 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_dcf7000.c@1.12 +8 -7 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_hopf6021.c@1.11 +21 -20 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_meinberg.c@1.13 +20 -19 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast conversion results to appropriate types to avoid compiler warnings. + + libparse/clk_rawdcf.c@1.19 +8 -7 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast to appropriate types to avoid compiler warnings. + + libparse/clk_rcc8000.c@1.11 +17 -16 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_schmid.c@1.12 +9 -9 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_sel240x.c@1.4 +5 -11 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast to appropriate types to avoid compiler warnings. + + libparse/clk_trimtaip.c@1.12 +8 -7 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_trimtsip.c@1.13 +18 -18 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast conversion results to appropriate types to avoid compiler warnings. + Use commonly defined constants to handle GPS week number wraparounds. + + libparse/clk_varitext.c@1.11 +6 -5 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/clk_wharton.c@1.10 +7 -4 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + + libparse/data_mbg.c@1.15 +36 -36 + Cast conversion results to appropriate types to avoid compiler warnings. + + libparse/gpstolfp.c@1.12 +1 -1 + Type cast to avoid compiler warning. + + libparse/parse.c@1.18 +14 -14 + Use predefined function types for functions used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast conversion results to appropriate types to avoid compiler warnings. + + ntpd/refclock_parse.c@1.75 +49 -48 + Cast conversion results to appropriate types to avoid compiler warnings. + + ports/winnt/include/termios.h@1.17 +1 -1 + Changed the prototype for ioctl() to accept a (void *) to avoid compiler warnings when called with pointers to different types. + + ports/winnt/libntp/termios.c@1.30 +2 -1 + Let ioctl() accept a (void *) to avoid compiler warnings when called with pointers to different types. + +ChangeSet@1.3305.1.19, 2015-03-19 07:54:24+00:00, stenn@psp-deb1.ntp.org + ntp_proto.c, ChangeLog: + [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. + [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks. + + ChangeLog@1.1622.1.16 +3 -0 + [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. + [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks. + + ntpd/ntp_proto.c@1.354 +16 -14 + [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. + [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks. + +ChangeSet@1.3305.1.18, 2015-03-16 09:17:42+00:00, stenn@psp-fb1.ntp.org + [Bug 2763] Allow different thresholds for forward and backward steps + + ChangeLog@1.1622.1.15 +1 -0 + [Bug 2763] Allow different thresholds for forward and backward steps + + include/ntp.h@1.211 +13 -11 + [Bug 2763] Allow different thresholds for forward and backward steps + + include/ntpd.h@1.185 +2 -1 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/invoke-ntp.conf.texi@1.178 +15 -2 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/keyword-gen-utd@1.22 +1 -1 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/keyword-gen.c@1.27 +2 -0 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp.conf.5man@1.212 +19 -4 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp.conf.5mdoc@1.212 +18 -3 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp.conf.def@1.15 +16 -1 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp.conf.man.in@1.212 +19 -4 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp.conf.mdoc.in@1.212 +18 -3 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_config.c@1.323 +8 -0 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_keyword.h@1.24 +492 -483 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_loopfilter.c@1.179 +27 -5 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_parser.c@1.90 +803 -797 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_parser.h@1.56 +81 -77 + [Bug 2763] Allow different thresholds for forward and backward steps + + ntpd/ntp_parser.y@1.83 +4 -0 + [Bug 2763] Allow different thresholds for forward and backward steps + +ChangeSet@1.3305.2.2, 2015-03-13 10:28:32+01:00, martin@pc-martin.(none) + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed. + + ChangeLog@1.1622.2.2 +12 -0 + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed. + + include/mbg_gps166.h@1.12 +841 -408 + Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Updated prototype for mbg_tm_str() which now takes one more parameter. + + include/ntp_calendar.h@1.17 +4 -2 + Added definitions for DAYSPERWEEK and SECSPERWEEK. + + include/parse.h@1.10 +14 -7 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + Moved a few definitions from gpstolfp.c here so they can also be used in other c modules. + + include/parse_conf.h@1.6 +1 -1 + Removed non-ASCII characters from copyright comment. + + kernel/sys/parsestreams.h@1.8 +1 -1 + Removed non-ASCII characters from copyright comment. + + libparse/clk_computime.c@1.11 +23 -23 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_dcf7000.c@1.11 +7 -7 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_meinberg.c@1.12 +71 -70 + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_rawdcf.c@1.18 +12 -12 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_schmid.c@1.11 +7 -7 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_trimtaip.c@1.11 +5 -5 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_trimtsip.c@1.12 +13 -13 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_varitext.c@1.10 +38 -38 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/clk_wharton.c@1.9 +1 -1 + Fixed a typo. + + libparse/data_mbg.c@1.14 +39 -36 + Account for updated definitions pulled from Meinberg header files. + Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Replaced some constant numbers by defines from ntp_calendar.h. + Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed. + + libparse/gpstolfp.c@1.11 +4 -6 + Moved some commonly used constants to parse.h. + Removed duplicate defines and use those in ntp_calendar.h. + Also replaced some constant numbers by defines from ntp_calendar.h. + + libparse/parse.c@1.17 +46 -46 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/parse_conf.c@1.11 +2 -2 + Removed non-ASCII characters from copyright comment. + + libparse/parsesolaris.c@1.12 +55 -55 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/parsestreams.c@1.8 +63 -63 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + + libparse/trim_info.c@1.6 +1 -1 + Removed non-ASCII characters from copyright comment. + + ntpd/refclock_parse.c@1.74 +326 -295 + Removed non-ASCII characters from copyright comment. + Removed trailing whitespace. + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified creation of parse-specific variables for Meinberg devices in gps16x_message(). + + parseutil/dcfd.c@1.27 +2 -2 + Removed non-ASCII characters from copyright comment. + + parseutil/testdcf.c@1.9 +2 -2 + Removed non-ASCII characters from copyright comment. + +ChangeSet@1.3305.1.17, 2015-03-10 11:21:46+00:00, stenn@psp-fb1.ntp.org + merge cleanup + + ChangeLog@1.1622.1.14 +1 -3 + merge cleanup + + ntpd/ntp_loopfilter.c@1.178 +5 -2 + merge cleanup + +ChangeSet@1.3305.2.1, 2015-03-10 10:48:25+01:00, martin@pc-martin.(none) + Fixed loops and decoding of Meinberg GPS satellite info. + + ChangeLog@1.1622.2.1 +1 -0 + Fixed loops and decoding of Meinberg GPS satellite info. + + libparse/data_mbg.c@1.13 +3 -3 + Fixed loops handling Meinberg GPS satellite info. + + ntpd/refclock_parse.c@1.73 +44 -68 + Fixed loops and decoding of Meinberg GPS satellite info. + +ChangeSet@1.3305.1.16, 2015-03-09 06:36:19-04:00, murray@pogo.udel.edu + ChangeLog, ntp_loopfilter.c: + Fix for bug 2774 + + ChangeLog@1.1622.1.13 +3 -0 + Fix for bug 2774 + + ntpd/ntp_loopfilter.c@1.177 +4 -1 + Fix for bug 2774 + +ChangeSet@1.3305.1.15, 2015-03-05 10:17:02+00:00, stenn@psp-fb1.ntp.org + [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE + + ChangeLog@1.1622.1.12 +1 -0 + [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE + + configure.ac@1.584 +24 -22 + [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE + + sntp/libopts/m4/libopts.m4@1.33 +12 -12 + [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE + + sntp/m4/ntp_libntp.m4@1.29 +4 -4 + [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE + +ChangeSet@1.3305.1.14, 2015-03-04 11:16:31+00:00, stenn@psp-fb1.ntp.org + [Bug 2775] ntp-keygen.c fails to compile under Windows + + ChangeLog@1.1622.1.11 +1 -0 + [Bug 2775] ntp-keygen.c fails to compile under Windows. + + util/ntp-keygen.c@1.103 +7 -1 + [Bug 2775] ntp-keygen.c fails to compile under Windows + +ChangeSet@1.3305.1.13, 2015-03-01 21:46:56-05:00, stenn@pogo.udel.edu + cleanup + + ChangeLog@1.1622.1.10 +1 -2 + cleanup + +ChangeSet@1.3305.1.12, 2015-03-01 02:50:18-05:00, murray@pogo.udel.edu + refclock_palisade.h, ChangeLog, refclock_palisade.c: + Fix bug 2773 - early leap from Palisade/Thunderbolt + + ChangeLog@1.1622.1.9 +2 -0 + Fix bug 2773 - early leap from Palisade/Thunderbolt + + ntpd/refclock_palisade.c@1.42 +8 -2 + Fix bug 2773 - early leap from Palisade/Thunderbolt + + ntpd/refclock_palisade.h@1.15 +1 -0 + Fix bug 2773 - early leap from Palisade/Thunderbolt + +ChangeSet@1.3305.1.11, 2015-02-28 12:12:13+00:00, stenn@psp-fb1.ntp.org + [Bug 2751] jitter.h has stale copies of l_fp macros + + util/Makefile.am@1.78 +1 -1 + [Bug 2751] jitter.h has stale copies of l_fp macros + +ChangeSet@1.3305.1.10, 2015-02-28 12:04:02+00:00, stenn@psp-fb1.ntp.org + [Bug 2771] nonvolatile value is documented in wrong units + + ChangeLog@1.1622.1.8 +1 -0 + [Bug 2771] nonvolatile value is documented in wrong units + + html/miscopt.html@1.80 +2 -2 + [Bug 2771] nonvolatile value is documented in wrong units + +ChangeSet@1.3305.1.9, 2015-02-28 11:34:24+00:00, stenn@psp-fb1.ntp.org + [Bug 2767] ntp-keygen -M should symlink to ntp.keys + + ChangeLog@1.1622.1.7 +1 -0 + [Bug 2767] ntp-keygen -M should symlink to ntp.keys + + util/ntp-keygen.c@1.102 +6 -2 + [Bug 2767] ntp-keygen -M should symlink to ntp.keys + +ChangeSet@1.3305.1.8, 2015-02-28 11:28:04+00:00, stenn@psp-fb1.ntp.org + [Bug 2766] ntp-keygen output files should not be world-readable + + ChangeLog@1.1622.1.6 +1 -0 + [Bug 2766] ntp-keygen output files should not be world-readable + + util/ntp-keygen.c@1.101 +5 -1 + [Bug 2766] ntp-keygen output files should not be world-readable + +ChangeSet@1.3305.1.7, 2015-02-28 11:18:57+00:00, stenn@psp-fb1.ntp.org + [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq + + ChangeLog@1.1622.1.5 +1 -0 + [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq + + ntpd/ntp_control.c@1.196 +56 -51 + [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq + +ChangeSet@1.3305.1.6, 2015-02-28 09:47:20+00:00, stenn@psp-fb1.ntp.org + [Bug 2757] Quiet compiler warnings. + + lib/isc/inet_ntop.c@1.14 +1 -0 + [Bug 2757] Quiet compiler warnings. + + lib/isc/log.c@1.8 +12 -12 + [Bug 2757] Quiet compiler warnings. + + ntpd/ntp_leapsec.c@1.16 +6 -6 + [Bug 2757] Quiet compiler warnings. + + parseutil/dcfd.c@1.26 +7 -0 + [Bug 2757] Quiet compiler warnings. + + sntp/libevent/include/event2/event.h@1.11 +4 -0 + [Bug 2757] Quiet compiler warnings. + +ChangeSet@1.3305.1.5, 2015-02-28 09:11:24+00:00, stenn@psp-fb1.ntp.org + [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM + + ChangeLog@1.1622.1.4 +1 -0 + [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM + + configure.ac@1.583 +0 -2 + [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM + + include/ntp_fp.h@1.32 +4 -1 + [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM + +ChangeSet@1.3305.1.4, 2015-02-25 07:58:47+00:00, stenn@psp-fb1.ntp.org + [Bug 2751] jitter.h has stale copies of l_fp macros + + BitKeeper/deleted/fd/jitter.h~11d7c056cb18e28@1.5 +0 -0 + Delete: util/jitter.h + + ChangeLog@1.1622.1.3 +1 -0 + [Bug 2751] jitter.h has stale copies of l_fp macros + + util/jitter.c@1.11 +1 -2 + [Bug 2751] jitter.h has stale copies of l_fp macros + +ChangeSet@1.3305.1.3, 2015-02-21 05:56:16-05:00, stenn@deacon.udel.edu + Update triggers for bk-6 + + BitKeeper/triggers/post-incoming.license-warn@1.9 +3 -0 + Update triggers for bk-6 + + BitKeeper/triggers/pre-resolve.license-chk@1.10 +3 -0 + Update triggers for bk-6 + + BitKeeper/triggers/send@1.16 +2 -2 + Update triggers for bk-6 + +ChangeSet@1.3305.1.2, 2015-02-21 10:35:38+00:00, stenn@psp-fb1.ntp.org + [Bug 2757] Quiet compiler warnings + + ChangeLog@1.1622.1.2 +1 -0 + [Bug 2757] Quiet compiler warnings + + lib/isc/result.c@1.4 +6 -6 + [Bug 2757] Quiet compiler warnings + + lib/isc/unix/file.c@1.7 +3 -3 + [Bug 2757] Quiet compiler warnings + + lib/isc/unix/ifiter_ioctl.c@1.32.1.1 +4 -0 + [Bug 2757] Quiet compiler warnings + + lib/isc/unix/net.c@1.19 +2 -1 + [Bug 2757] Quiet compiler warnings + + libntp/work_fork.c@1.13 +1 -1 + [Bug 2757] Quiet compiler warnings + + ntpd/ntp_crypto.c@1.174 +1 -1 + [Bug 2757] Quiet compiler warnings + +ChangeSet@1.3305.1.1, 2015-02-21 09:51:32+00:00, stenn@psp-deb1.ntp.org + [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. + + ChangeLog@1.1622.1.1 +1 -0 + [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. + + scripts/lib/NTP/Util.pm@1.3 +15 -4 + [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. + +ChangeSet@1.3306, 2015-02-21 09:28:08+00:00, stenn@psp-fb1.ntp.org + [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument + + ChangeLog@1.1623 +1 -0 + [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument + + lib/isc/unix/ifiter_getifaddrs.c@1.14 +3 -0 + [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument + + lib/isc/unix/ifiter_ioctl.c@1.33 +12 -2 + [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument + +ChangeSet@1.3302.1.1, 2015-02-21 07:15:54+00:00, stenn@psp-deb1.ntp.org + [Bug 2728] See if C99-style structure initialization works + + ChangeLog@1.1620.1.1 +3 -0 + [Bug 2728] See if C99-style structure initialization works + + configure.ac@1.582 +1 -0 + [Bug 2728] See if C99-style structure initialization works + + ntpq/ntpq-subs.c@1.104 +1 -1 + [Bug 2728] See if C99-style structure initialization works + + ports/winnt/include/config.h@1.111 +1 -1 + [Bug 2728] See if C99-style structure initialization works + + sntp/m4/ax_c99_struct_init.m4@1.1 +59 -0 + BitKeeper file /home/stenn/ntp-stable-2728/sntp/m4/ax_c99_struct_init.m4 + + sntp/m4/ax_c99_struct_init.m4@1.0 +0 -0 + +ChangeSet@1.3304, 2015-02-11 09:08:51+00:00, stenn@psp-fb1.ntp.org + [Bug 2747] Upgrade libevent to 2.1.5-beta + + ChangeLog@1.1621 +3 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + +ChangeSet@1.3303, 2015-02-11 09:05:59+00:00, stenn@psp-fb1.ntp.org + [Bug 2747] Upgrade libevent to 2.1.5-beta + + BitKeeper/deleted/5b/README~3a69bb76c676898e@1.7 +0 -0 + Delete: sntp/libevent/README + + sntp/libevent/ChangeLog@1.9 +726 -60 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/Makefile.am@1.13 +3 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/README.md@1.1 +318 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/README.md + + sntp/libevent/README.md@1.0 +0 -0 + + sntp/libevent/WIN32-Code/getopt.c@1.1 +149 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt.c + + sntp/libevent/WIN32-Code/getopt.c@1.0 +0 -0 + + sntp/libevent/WIN32-Code/getopt.h@1.1 +33 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt.h + + sntp/libevent/WIN32-Code/getopt.h@1.0 +0 -0 + + sntp/libevent/WIN32-Code/getopt_long.c@1.1 +233 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt_long.c + + sntp/libevent/WIN32-Code/getopt_long.c@1.0 +0 -0 + + sntp/libevent/WIN32-Code/nmake/event2/event-config.h@1.2 +2 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/WIN32-Code/tree.h@1.2 +0 -677 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/buffer.c@1.10 +74 -10 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/bufferevent.c@1.8 +9 -4 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/bufferevent_async.c@1.7 +6 -4 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/bufferevent_filter.c@1.7 +50 -23 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/bufferevent_openssl.c@1.9 +2 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/bufferevent_pair.c@1.8 +32 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/configure.ac@1.17 +15 -18 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evbuffer-internal.h@1.8 +13 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evdns.c@1.10 +80 -33 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/event.c@1.13 +38 -10 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/event_tagging.c@1.5 +14 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evrpc-internal.h@1.3 +1 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evthread-internal.h@1.7 +7 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evthread.c@1.8 +17 -6 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evutil.c@1.10 +28 -14 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/evutil_time.c@1.5 +50 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/ht-internal.h@1.4 +0 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/http-internal.h@1.6 +2 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/http.c@1.10 +45 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/buffer.h@1.7 +3 -8 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/bufferevent.h@1.6 +5 -4 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/dns.h@1.7 +17 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/event.h@1.10 +6 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/http.h@1.7 +14 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/listener.h@1.4 +9 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/include/event2/util.h@1.7 +69 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/kqueue.c@1.7 +17 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/listener.c@1.7 +5 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/sample/http-server.c@1.10 +5 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/sample/https-client.c@1.2 +15 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/sample/include.am@1.3 +2 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/include.am@1.4 +2 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/print-winsock-errors.c@1.1 +84 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/print-winsock-errors.c + + sntp/libevent/test/print-winsock-errors.c@1.0 +0 -0 + + sntp/libevent/test/regress.c@1.6 +29 -8 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress.h@1.5 +5 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_buffer.c@1.8 +47 -6 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_bufferevent.c@1.6 +150 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_dns.c@1.8 +141 -14 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_finalize.c@1.2 +1 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_http.c@1.8 +107 -9 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_main.c@1.7 +4 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_minheap.c@1.3 +3 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_ssl.c@1.7 +1 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_thread.c@1.6 +3 -2 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_util.c@1.7 +19 -17 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/regress_zlib.c@1.5 +10 -7 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/test-fdleak.c@1.2 +10 -10 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/test-ratelim.c@1.9 +5 -6 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/test-ratelim.sh@1.1 +88 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/test-ratelim.sh + + sntp/libevent/test/test-ratelim.sh@1.0 +0 -0 + + sntp/libevent/test/test-time.c@1.5 +9 -6 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/tinytest.c@1.6 +33 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/tinytest.h@1.4 +2 -0 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/test/tinytest_demo.c@1.1 +260 -0 + BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/tinytest_demo.c + + sntp/libevent/test/tinytest_demo.c@1.0 +0 -0 + + sntp/libevent/test/tinytest_macros.h@1.3 +21 -6 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/time-internal.h@1.2 +0 -3 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/util-internal.h@1.10 +1 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/libevent/whatsnew-2.1.txt@1.4 +52 -1 + [Bug 2747] Upgrade libevent to 2.1.5-beta + + sntp/m4/LICENSE-OPENLDAP@1.2 +0 -0 + Rename: sntp/libevent/m4/LICENSE-OPENLDAP -> sntp/m4/LICENSE-OPENLDAP + + sntp/m4/openldap-thread-check.m4@1.5 +0 -0 + Rename: sntp/libevent/m4/openldap-thread-check.m4 -> sntp/m4/openldap-thread-check.m4 + + sntp/m4/openldap.m4@1.2 +0 -0 + Rename: sntp/libevent/m4/openldap.m4 -> sntp/m4/openldap.m4 + ChangeSet@1.3302, 2015-02-04 02:44:25-05:00, stenn@deacon.udel.edu NTP_4_2_8P1 TAG: NTP_4_2_8P1 diff --git a/contrib/ntp/Makefile.in b/contrib/ntp/Makefile.in index abd5a09463b80..47232a60e2bd3 100644 --- a/contrib/ntp/Makefile.in +++ b/contrib/ntp/Makefile.in @@ -49,8 +49,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -79,6 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -347,6 +348,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS index d33f059985e4a..a425a9a4dc3fa 100644 --- a/contrib/ntp/NEWS +++ b/contrib/ntp/NEWS @@ -1,4 +1,145 @@ --- +NTP 4.2.8p2 (Harlan Stenn <stenn@ntp.org>, 2015/04/xx) + +Focus: Security and Bug fixes, enhancements. + +Severity: MEDIUM + +In addition to bug fixes and enhancements, this release fixes the +following medium-severity vulnerabilities involving private key +authentication: + +* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. + + References: Sec 2779 / CVE-2015-1798 / VU#374268 + Affects: All NTP4 releases starting with ntp-4.2.5p99 up to but not + including ntp-4.2.8p2 where the installation uses symmetric keys + to authenticate remote associations. + CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4 + Date Resolved: Stable (4.2.8p2) 07 Apr 2015 + Summary: When ntpd is configured to use a symmetric key to authenticate + a remote NTP server/peer, it checks if the NTP message + authentication code (MAC) in received packets is valid, but not if + there actually is any MAC included. Packets without a MAC are + accepted as if they had a valid MAC. This allows a MITM attacker to + send false packets that are accepted by the client/peer without + having to know the symmetric key. The attacker needs to know the + transmit timestamp of the client to match it in the forged reply + and the false reply needs to reach the client before the genuine + reply from the server. The attacker doesn't necessarily need to be + relaying the packets between the client and the server. + + Authentication using autokey doesn't have this problem as there is + a check that requires the key ID to be larger than NTP_MAXKEY, + which fails for packets without a MAC. + Mitigation: + Upgrade to 4.2.8p2, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Configure ntpd with enough time sources and monitor it properly. + Credit: This issue was discovered by Miroslav Lichvar, of Red Hat. + +* [Sec 2781] Authentication doesn't protect symmetric associations against + DoS attacks. + + References: Sec 2781 / CVE-2015-1799 / VU#374268 + Affects: All NTP releases starting with at least xntp3.3wy up to but + not including ntp-4.2.8p2 where the installation uses symmetric + key authentication. + CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4 + Note: the CVSS base Score for this issue could be 4.3 or lower, and + it could be higher than 5.4. + Date Resolved: Stable (4.2.8p2) 07 Apr 2015 + Summary: An attacker knowing that NTP hosts A and B are peering with + each other (symmetric association) can send a packet to host A + with source address of B which will set the NTP state variables + on A to the values sent by the attacker. Host A will then send + on its next poll to B a packet with originate timestamp that + doesn't match the transmit timestamp of B and the packet will + be dropped. If the attacker does this periodically for both + hosts, they won't be able to synchronize to each other. This is + a known denial-of-service attack, described at + https://www.eecis.udel.edu/~mills/onwire.html . + + According to the document the NTP authentication is supposed to + protect symmetric associations against this attack, but that + doesn't seem to be the case. The state variables are updated even + when authentication fails and the peers are sending packets with + originate timestamps that don't match the transmit timestamps on + the receiving side. + + This seems to be a very old problem, dating back to at least + xntp3.3wy. It's also in the NTPv3 (RFC 1305) and NTPv4 (RFC 5905) + specifications, so other NTP implementations with support for + symmetric associations and authentication may be vulnerable too. + An update to the NTP RFC to correct this error is in-process. + Mitigation: + Upgrade to 4.2.8p2, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Note that for users of autokey, this specific style of MITM attack + is simply a long-known potential problem. + Configure ntpd with appropriate time sources and monitor ntpd. + Alert your staff if problems are detected. + Credit: This issue was discovered by Miroslav Lichvar, of Red Hat. + +* New script: update-leap +The update-leap script will verify and if necessary, update the +leap-second definition file. +It requires the following commands in order to work: + + wget logger tr sed shasum + +Some may choose to run this from cron. It needs more portability testing. + +Bug Fixes and Improvements: + +* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. +* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument. +* [Bug 2346] "graceful termination" signals do not do peer cleanup. +* [Bug 2728] See if C99-style structure initialization works. +* [Bug 2747] Upgrade libevent to 2.1.5-beta. +* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . +* [Bug 2751] jitter.h has stale copies of l_fp macros. +* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM. +* [Bug 2757] Quiet compiler warnings. +* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq. +* [Bug 2763] Allow different thresholds for forward and backward steps. +* [Bug 2766] ntp-keygen output files should not be world-readable. +* [Bug 2767] ntp-keygen -M should symlink to ntp.keys. +* [Bug 2771] nonvolatile value is documented in wrong units. +* [Bug 2773] Early leap announcement from Palisade/Thunderbolt +* [Bug 2774] Unreasonably verbose printout - leap pending/warning +* [Bug 2775] ntp-keygen.c fails to compile under Windows. +* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info. + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. + Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices + in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling + if the time status shall be printed. +* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. +* [Sec 2781] Authentication doesn't protect symmetric associations against + DoS attacks. +* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE. +* [Bug 2789] Quiet compiler warnings from libevent. +* [Bug 2790] If ntpd sets the Windows MM timer highest resolution + pause briefly before measuring system clock precision to yield + correct results. +* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer. +* Use predefined function types for parse driver functions + used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid + compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings + when called with pointers to different types. + +--- NTP 4.2.8p1 (Harlan Stenn <stenn@ntp.org>, 2015/02/04) Focus: Security and Bug fixes, enhancements. diff --git a/contrib/ntp/aclocal.m4 b/contrib/ntp/aclocal.m4 index c82bc094c180b..24036a4259153 100644 --- a/contrib/ntp/aclocal.m4 +++ b/contrib/ntp/aclocal.m4 @@ -1132,8 +1132,7 @@ AC_SUBST([am__untar]) m4_include([sntp/libopts/m4/libopts.m4]) m4_include([sntp/libopts/m4/stdnoreturn.m4]) -m4_include([sntp/libevent/m4/openldap-thread-check.m4]) -m4_include([sntp/libevent/m4/openldap.m4]) +m4_include([sntp/m4/ax_c99_struct_init.m4]) m4_include([sntp/m4/define_dir.m4]) m4_include([sntp/m4/hms_search_lib.m4]) m4_include([sntp/m4/libtool.m4]) @@ -1162,5 +1161,7 @@ m4_include([sntp/m4/ntp_rlimit.m4]) m4_include([sntp/m4/ntp_sntp.m4]) m4_include([sntp/m4/ntp_ver_suffix.m4]) m4_include([sntp/m4/ntp_vpathhack.m4]) +m4_include([sntp/m4/openldap-thread-check.m4]) +m4_include([sntp/m4/openldap.m4]) m4_include([sntp/m4/os_cflags.m4]) m4_include([sntp/m4/snprintf.m4]) diff --git a/contrib/ntp/adjtimed/Makefile.in b/contrib/ntp/adjtimed/Makefile.in index a6e97da38919c..56f4dfbe1d624 100644 --- a/contrib/ntp/adjtimed/Makefile.in +++ b/contrib/ntp/adjtimed/Makefile.in @@ -49,8 +49,7 @@ subdir = adjtimed ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -79,6 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -329,6 +330,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/clockstuff/Makefile.in b/contrib/ntp/clockstuff/Makefile.in index f04ff2c4a8c18..c852adb9c940d 100644 --- a/contrib/ntp/clockstuff/Makefile.in +++ b/contrib/ntp/clockstuff/Makefile.in @@ -42,8 +42,7 @@ subdir = clockstuff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -72,6 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -325,6 +326,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/config.h.in b/contrib/ntp/config.h.in index 76facf9643b43..5ca9484a00c78 100644 --- a/contrib/ntp/config.h.in +++ b/contrib/ntp/config.h.in @@ -1331,6 +1331,10 @@ /* Should we recommend a minimum value for tickadj? */ #undef MIN_REC_TICKADJ +/* Define to 1 if the compiler does not support C99's structure + initialization. */ +#undef MISSING_C99_STRUCT_INIT + /* Do we need HPUX adjtime() library support? */ #undef NEED_HPUX_ADJTIME diff --git a/contrib/ntp/configure b/contrib/ntp/configure index 28e0c3729cd1a..29d777c34ea0f 100755 --- a/contrib/ntp/configure +++ b/contrib/ntp/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for ntp 4.2.8p1. +# Generated by GNU Autoconf 2.68 for ntp 4.2.8p2. # # Report bugs to <http://bugs.ntp.org./>. # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p1' -PACKAGE_STRING='ntp 4.2.8p1' +PACKAGE_VERSION='4.2.8p2' +PACKAGE_STRING='ntp 4.2.8p2' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -710,6 +710,13 @@ LD FGREP SED LIBTOOL +INSTALL_UPDATE_LEAP_FALSE +INSTALL_UPDATE_LEAP_TRUE +UPDATE_LEAP_NI +UPDATE_LEAP_MS +UPDATE_LEAP_DS +UPDATE_LEAP_DL +UPDATE_LEAP_DB TIMETRIM_NI TIMETRIM_MS TIMETRIM_DS @@ -1573,7 +1580,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p1 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1643,7 +1650,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p1:";; + short | recursive ) echo "Configuration of ntp 4.2.8p2:";; esac cat <<\_ACEOF @@ -1872,7 +1879,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p1 +ntp configure 4.2.8p2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2697,7 +2704,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p1, which was +It was created by ntp $as_me 4.2.8p2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3644,7 +3651,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p1' + VERSION='4.2.8p2' cat >>confdefs.h <<_ACEOF @@ -7780,6 +7787,44 @@ $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports C99 structure initialization" >&5 +$as_echo_n "checking whether the compiler supports C99 structure initialization... " >&6; } + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct foo_s {int i1; int i2;}; + int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; } + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define MISSING_C99_STRUCT_INIT 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5 $as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; } @@ -7946,6 +7991,19 @@ fi + + if test -z "$UPDATE_LEAP_NI" ; then + INSTALL_UPDATE_LEAP_TRUE= + INSTALL_UPDATE_LEAP_FALSE='#' +else + INSTALL_UPDATE_LEAP_TRUE='#' + INSTALL_UPDATE_LEAP_FALSE= +fi + + + + + # So far, the only shared library we might use is libopts. # It's a small library - we might as well use a static version of it. # Check whether --enable-shared was given. @@ -31709,10 +31767,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/syscall.h> - #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) - # error - #endif + #include <sys/syscall.h> + #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) + # error + #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : @@ -31748,10 +31806,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/timex.h> - #ifndef STA_FLL - # error - #endif + #include <sys/timex.h> + #ifndef STA_FLL + # error + #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : @@ -35326,7 +35384,6 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5 $as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; } - # Check whether --enable-nist was given. if test "${enable_nist+set}" = set; then : enableval=$enable_nist; ans=$enableval @@ -35348,7 +35405,6 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5 $as_echo_n "checking if we want support for Samba's signing daemon... " >&6; } - # Check whether --enable-ntp-signd was given. if test "${enable_ntp_signd+set}" = set; then : enableval=$enable_ntp_signd; ans=$enableval @@ -36444,33 +36500,35 @@ ac_config_files="$ac_config_files parseutil/Makefile" ac_config_files="$ac_config_files scripts/Makefile" -ac_config_files="$ac_config_files scripts/lib/Makefile" +ac_config_files="$ac_config_files scripts/build/Makefile" -ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj" +ac_config_files="$ac_config_files scripts/build/mkver" ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile" -ac_config_files="$ac_config_files scripts/build/mkver" +ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj" -ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait" +ac_config_files="$ac_config_files scripts/lib/Makefile" ac_config_files="$ac_config_files scripts/ntp-wait/Makefile" -ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep" +ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait" ac_config_files="$ac_config_files scripts/ntpsweep/Makefile" -ac_config_files="$ac_config_files scripts/ntptrace/ntptrace" +ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep" ac_config_files="$ac_config_files scripts/ntptrace/Makefile" +ac_config_files="$ac_config_files scripts/ntptrace/ntptrace" + ac_config_files="$ac_config_files scripts/ntpver" ac_config_files="$ac_config_files scripts/plot_summary" ac_config_files="$ac_config_files scripts/summary" -ac_config_files="$ac_config_files scripts/build/Makefile" +ac_config_files="$ac_config_files scripts/update-leap/Makefile" ac_config_files="$ac_config_files tests/Makefile" @@ -36664,6 +36722,10 @@ if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; th as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${INSTALL_UPDATE_LEAP_TRUE}" && test -z "${INSTALL_UPDATE_LEAP_FALSE}"; then + as_fn_error $? "conditional \"INSTALL_UPDATE_LEAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -37109,7 +37171,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p1, which was +This file was extended by ntp $as_me 4.2.8p2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -37176,7 +37238,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ntp config.status 4.2.8p1 +ntp config.status 4.2.8p2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -37703,20 +37765,21 @@ do "ntpsnmpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpsnmpd/Makefile" ;; "parseutil/Makefile") CONFIG_FILES="$CONFIG_FILES parseutil/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; - "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;; - "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;; - "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;; + "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;; "scripts/build/mkver") CONFIG_FILES="$CONFIG_FILES scripts/build/mkver" ;; - "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;; + "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;; + "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;; + "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;; "scripts/ntp-wait/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/Makefile" ;; - "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;; + "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;; "scripts/ntpsweep/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/Makefile" ;; - "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;; + "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;; "scripts/ntptrace/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/Makefile" ;; + "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;; "scripts/ntpver") CONFIG_FILES="$CONFIG_FILES scripts/ntpver" ;; "scripts/plot_summary") CONFIG_FILES="$CONFIG_FILES scripts/plot_summary" ;; "scripts/summary") CONFIG_FILES="$CONFIG_FILES scripts/summary" ;; - "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;; + "scripts/update-leap/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/update-leap/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;; "tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;; @@ -39254,8 +39317,8 @@ _LT_EOF ;; "ntpd/complete.conf":F) sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf ;; "ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;; - "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;; "scripts/build/mkver":F) chmod +x scripts/build/mkver ;; + "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;; "scripts/ntp-wait/ntp-wait":F) chmod +x scripts/ntp-wait/ntp-wait ;; "scripts/ntpsweep/ntpsweep":F) chmod +x scripts/ntpsweep/ntpsweep ;; "scripts/ntptrace/ntptrace":F) chmod +x scripts/ntptrace/ntptrace ;; diff --git a/contrib/ntp/configure.ac b/contrib/ntp/configure.ac index 6942ceb5333fc..dc5c7fcfd7035 100644 --- a/contrib/ntp/configure.ac +++ b/contrib/ntp/configure.ac @@ -68,6 +68,7 @@ AC_PROG_CPP AC_PROG_CXX AC_PROG_YACC AC_PROG_CC_C_O +AX_C99_STRUCT_INIT NTP_VPATH_HACK dnl used only by ntpd/Makefile.am @@ -1499,12 +1500,13 @@ AC_CACHE_CHECK( ;; *) AC_PREPROC_IFELSE( - [ - #include <sys/syscall.h> - #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) - # error - #endif - ], + [AC_LANG_SOURCE( + [ + #include <sys/syscall.h> + #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) + # error + #endif + ])], [ntp_cv_var_ntp_syscalls=kernel] ) ;; @@ -1526,12 +1528,13 @@ AC_CACHE_CHECK( [if sys/timex.h has STA_FLL], [ntp_cv_var_sta_fll], [AC_PREPROC_IFELSE( - [ - #include <sys/timex.h> - #ifndef STA_FLL - # error - #endif - ], + [AC_LANG_SOURCE( + [ + #include <sys/timex.h> + #ifndef STA_FLL + # error + #endif + ])], [ntp_cv_var_sta_fll=yes], [ntp_cv_var_sta_fll=no] )] @@ -1586,12 +1589,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV]) case "$ac_cv_header_termios_h" in yes) AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <termios.h> #ifndef TIOCGPPSEV # error #endif - ], + ])], [ntp_ok=yes], [ntp_ok=no] ) @@ -1612,12 +1615,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS]) case "$ac_cv_header_termios_h" in yes) AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <termios.h> #ifndef TIOCSPPS # error #endif - ], + ])], [ntp_ok=yes], [ntp_ok=no] ) @@ -1638,12 +1641,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV]) case "$ac_cv_header_sys_ppsclock_h" in yes) AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <sys/ppsclock.h> #ifndef CIOGETEV # error #endif - ], + ])], [ntp_ok=yes], [ntp_ok=no] ) @@ -1689,7 +1692,7 @@ case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in yesyes) AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG]) AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <sys/time.h> typedef int u_int; #include <sys/ppsclock.h> @@ -1710,7 +1713,7 @@ case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in #ifndef CIOGETEV # error #endif - ], + ])], [ntp_ok=yes], [ntp_ok=no] ) @@ -4193,7 +4196,6 @@ case "$ans" in esac AC_MSG_CHECKING([if we should enable NIST lockclock scheme]) - AC_ARG_ENABLE( [nist], [AS_HELP_STRING( @@ -4213,7 +4215,6 @@ case "$ans" in esac AC_MSG_CHECKING([if we want support for Samba's signing daemon]) - AC_ARG_ENABLE( [ntp-signd], [AS_HELP_STRING( @@ -4266,14 +4267,14 @@ AC_CACHE_CHECK( [for interface list sysctl], [ntp_cv_iflist_sysctl], [AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <sys/param.h> #include <sys/sysctl.h> #include <sys/socket.h> #ifndef NET_RT_IFLIST # error #endif - ], + ])], [ntp_cv_iflist_sysctl=yes], [ntp_cv_iflist_sysctl=no] )] @@ -4333,20 +4334,21 @@ AC_CONFIG_FILES([ntpq/Makefile]) AC_CONFIG_FILES([ntpsnmpd/Makefile]) AC_CONFIG_FILES([parseutil/Makefile]) AC_CONFIG_FILES([scripts/Makefile]) -AC_CONFIG_FILES([scripts/lib/Makefile]) -AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj]) -AC_CONFIG_FILES([scripts/calc_tickadj/Makefile]) +AC_CONFIG_FILES([scripts/build/Makefile]) AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver]) -AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait]) +AC_CONFIG_FILES([scripts/calc_tickadj/Makefile]) +AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj]) +AC_CONFIG_FILES([scripts/lib/Makefile]) AC_CONFIG_FILES([scripts/ntp-wait/Makefile]) -AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep]) +AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait]) AC_CONFIG_FILES([scripts/ntpsweep/Makefile]) -AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace]) +AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep]) AC_CONFIG_FILES([scripts/ntptrace/Makefile]) +AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace]) AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver]) AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary]) AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary]) -AC_CONFIG_FILES([scripts/build/Makefile]) +AC_CONFIG_FILES([scripts/update-leap/Makefile]) AC_CONFIG_FILES([tests/Makefile]) AC_CONFIG_FILES([tests/libntp/Makefile]) AC_CONFIG_FILES([tests/ntpd/Makefile]) diff --git a/contrib/ntp/html/build.html b/contrib/ntp/html/build.html index 9683b291f41a7..5e3c2d8118c9d 100644 --- a/contrib/ntp/html/build.html +++ b/contrib/ntp/html/build.html @@ -11,7 +11,7 @@ <img src="pic/beaver.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> <p>For putting out compiler fires.</p> <p>Last update: - <!-- #BeginDate format:En2m -->31-Mar-2014 05:39<!-- #EndDate --> + <!-- #BeginDate format:En2m -->1-Apr-2015 02:57<!-- #EndDate --> </p> <br clear="left"> <h4>Related Links</h4> @@ -27,7 +27,7 @@ </ul> <hr> <h4 id="build">Building and Installing the Distribution</h4> -<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, <tt>make</tt> and <tt>install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p> +<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, and <tt>make install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p> <p>If available, the OpenSSL library from <a href="http://www.openssl.org">http://www.openssl.org</a> is used to support public key cryptography. The library must be built and installed prior to building NTP. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTP configure phase and the interface routines compiled automatically. Only the <tt>libcrypto.a</tt> library file and <tt>openssl</tt> header files are needed. If the library is not available or disabled, this step is not required.</p> <p>The <a href="config.html">Build Options</a> page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.</p> <h4 id="unix">Building and Installing for Unix</h4> diff --git a/contrib/ntp/html/miscopt.html b/contrib/ntp/html/miscopt.html index 62f41b6c59c30..5750d17999d57 100644 --- a/contrib/ntp/html/miscopt.html +++ b/contrib/ntp/html/miscopt.html @@ -10,7 +10,7 @@ <img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> <p>We have three, now looking for more.</p> <p>Last update: - <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate --> + <!-- #BeginDate format:En2m -->28-Feb-2015 12:01<!-- #EndDate --> UTC</p> <br clear="left"> <h4>Related Links</h4> @@ -90,7 +90,7 @@ </dl> </dd> <dt id="nonvolatile"><tt>nonvolatile <i>threshold</i></tt></dt> - <dd>Specify the <i><tt>threshold</tt></i> in PPM to write the frequency file, with default 0.1 PPM. The frequency file is inspected each hour. If the difference between the current frequency and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt> becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd> + <dd>Specify the <i><tt>threshold</tt></i> in seconds to write the frequency file, with default of 1e-7 (0.1 PPM). The frequency file is inspected each hour. If the difference between the current frequency and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt> becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd> <dt id="phone"><tt>phone <i>dial</i> ...</tt></dt> <dd>This command is used in conjunction with the ACTS modem driver (type 18). The arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services. The Hayes command ATDT is normally prepended to the number, which can contain other modem control codes as well.</dd> <dt id="reset"><tt>reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]</tt></dt> diff --git a/contrib/ntp/html/sntp.html b/contrib/ntp/html/sntp.html index fa17203f25f8e..84c6f29d5fa15 100644 --- a/contrib/ntp/html/sntp.html +++ b/contrib/ntp/html/sntp.html @@ -11,7 +11,7 @@ <img src="pic/dogsnake.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> <p>S is for snakeoil.</p> <p>Last update: - <!-- #BeginDate format:En2m -->7-Dec-2014 11:09<!-- #EndDate --> + <!-- #BeginDate format:En2m -->1-Apr-2015 11:05<!-- #EndDate --> UTC</p> <br clear="left"> <hr> @@ -20,8 +20,8 @@ <h4>Description</h4> <p>This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network Time Protocol (NTP) server and display the time offset of the system clock relative to the server clock. Run as root it can correct the system clock to this offset as well. It can be run as an interactive command or from a script by a <tt>cron</tt> job. The program implements the SNTP client protocol defined in RFC 5905, including the full on-wire protocol but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP version 4 specification, also defined in RFC 5905.</p> <p>By default, <tt>sntp</tt> writes the local date and time (i.e., not UTC) to the standard output in the format</p> -<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26</tt></p> -<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds.</p> +<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26 s3 no-leap</tt></p> +<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds. The hostname and/or the IP is displayed, as is the stratum of the server. Finally, the leap indicator status is displayed.</p> <p>If -b <i>bcaddress</i> is not specified, the program sends a single message to each address and waits up to <i>uctimeout</i> (default 5) seconds for a unicast server response. Otherwise, it sends no message and waits up to <i>bctimeout</i> (default 68) seconds for a broadcast NTP message.</p> <h4>Options</h4> <p><tt>sntp</tt> recognizes the following options:</p> diff --git a/contrib/ntp/include/Makefile.in b/contrib/ntp/include/Makefile.in index 36c9b865f4819..cb210040d8b76 100644 --- a/contrib/ntp/include/Makefile.in +++ b/contrib/ntp/include/Makefile.in @@ -40,8 +40,7 @@ DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -327,6 +328,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/include/binio.h b/contrib/ntp/include/binio.h index d1ee944291446..cf98633578bc2 100644 --- a/contrib/ntp/include/binio.h +++ b/contrib/ntp/include/binio.h @@ -42,11 +42,21 @@ void put_lsb_short (unsigned char **, long); long get_lsb_long (unsigned char **); void put_lsb_long (unsigned char **, long); +#define get_lsb_int16( _x_ ) ((int16_t) get_lsb_short( _x_ )) +#define get_lsb_uint16( _x_ ) ((uint16_t) get_lsb_short( _x_ )) +#define get_lsb_int32( _x_ ) ((int32_t) get_lsb_long( _x_ )) +#define get_lsb_uint32( _x_ ) ((uint32_t) get_lsb_long( _x_ )) + long get_msb_short (unsigned char **); void put_msb_short (unsigned char **, long); long get_msb_long (unsigned char **); void put_msb_long (unsigned char **, long); +#define get_msb_int16( _x_ ) ((int16_t) get_msb_short( _x_ )) +#define get_msb_uint16( _x_ ) ((uint16_t) get_msb_short( _x_ )) +#define get_msb_int32( _x_ ) ((int32_t) get_msb_long( _x_ )) +#define get_msb_uint32( _x_ ) ((uint32_t) get_msb_long( _x_ )) + #endif /* * History: diff --git a/contrib/ntp/include/isc/Makefile.in b/contrib/ntp/include/isc/Makefile.in index f29d1454b9a94..ad0da46e10025 100644 --- a/contrib/ntp/include/isc/Makefile.in +++ b/contrib/ntp/include/isc/Makefile.in @@ -40,8 +40,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -289,6 +290,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/include/mbg_gps166.h b/contrib/ntp/include/mbg_gps166.h index 974debafae28c..b9b3d778356bd 100644 --- a/contrib/ntp/include/mbg_gps166.h +++ b/contrib/ntp/include/mbg_gps166.h @@ -39,206 +39,459 @@ #define MBG_GPS166_H -/***************************************************************************/ -/* */ -/* File: GPSSERIO.H 4.1 */ -/* */ -/* Project: Common C Library */ -/* */ -/* Compiler: Borland C++ */ -/* */ -/* Author: M. Burnicki, Meinberg Funkuhren */ -/* */ -/* */ -/* Description: */ -/* This file defines structures and codes to be used to access GPS166 */ -/* via its serial interface COM0. COM0 should be set to a high baud */ -/* rate, default is 19200. */ -/* */ -/* Standard GPS166 serial operation is to send a time string that is */ -/* compatible with Meinberg UA31 or PZF535 DCF77 radio remote clocks. */ -/* That string can be transmitted automatically once per second, once */ -/* per minute or on request per ASCII '?'. */ -/* */ -/* Parameter setup or parameter readout works using blocks of binary */ -/* data which have to be isolated from the standard string. A block of */ -/* data starts with a SOH code (ASCII Start Of Header, 0x01) followed */ -/* by a message header with constant length and a data portion with */ -/* variable length. The first field (cmd) of the message header holds */ -/* the command code rsp. the type of data to be transmitted. The next */ -/* field (len) gives the number of data bytes that are transmitted */ -/* after the header. This number ranges from 0 to sizeof( MSG_DATA ). */ -/* The third field (data_csum) holds a checksum of all data bytes and */ -/* the last field of the header finally holds the checksum of the. */ -/* header. */ -/* */ -/***************************************************************************/ +/*************************************************************************** + * + * Definitions taken from Meinberg's gpsserio.h and gpsdefs.h files. + * + * Author: Martin Burnicki, Meinberg Funkuhren + * + * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany + * + * Description: + * Structures and codes to be used to access Meinberg GPS clocks via + * their serial interface COM0. COM0 should be set to a high baud rate, + * default is 19200. + * + * Standard Meinberg GPS serial operation is to send the Meinberg + * standard time string automatically once per second, once per + * minute, or on request per ASCII '?'. + * + * GPS parameter setup or parameter readout uses blocks of binary + * data which have to be isolated from the standard string. A block + * of data starts with a SOH code (ASCII Start Of Header, 0x01) + * followed by a message header with constant length and a block of + * data with variable length. + * + * The first field (cmd) of the message header holds the command + * code resp. the type of data to be transmitted. The next field (len) + * gives the number of data bytes that follow the header. This number + * ranges from 0 to sizeof( MSG_DATA ). The third field (data_csum) + * holds a checksum of all data bytes and the last field of the header + * finally holds the checksum of the header itself. + * + ***************************************************************************/ + +/** + * @brief GPS epoch bias from ordinary time_t epoch + * + * The Unix time_t epoch is usually 1970-01-01 00:00 whereas + * the GPS epoch is 1980-01-06 00:00, so the difference is 10 years, + * plus 2 days due to leap years (1972 and 1976), plus the difference + * of the day-of-month (6 - 1), so:<br> + * + * time_t t = ( gps_week * ::SECS_PER_WEEK ) + sec_of_week + ::GPS_SEC_BIAS + */ +#define GPS_SEC_BIAS 315964800UL // ( ( ( 10UL * 365UL ) + 2 + 5 ) * SECS_PER_DAY ) -/* the control codes defined below are to be or'ed with a command/type code */ -#define GPS_REQACK 0x8000 /* to GPS166: request acknowledge */ -#define GPS_ACK 0x4000 /* from GPS166: acknowledge a command */ -#define GPS_NACK 0x2000 /* from GPS166: error receiving command */ +#ifndef _COM_HS_DEFINED + /** + * @brief Enumeration of handshake modes + */ + enum COM_HANSHAKE_MODES { HS_NONE, HS_XONXOFF, HS_RTSCTS, N_COM_HS }; + #define _COM_HS_DEFINED +#endif + +#ifndef _COM_PARM_DEFINED + /** + * @brief A data type to configure a serial port's baud rate + * + * @see ::MBG_BAUD_RATES + */ + typedef int32_t BAUD_RATE; -#define GPS_CTRL_MSK 0xF000 /* masks control code from command */ + /** + * @brief Indices used to identify a parameter in the framing string + * + * @see ::MBG_FRAMING_STRS + */ + enum MBG_FRAMING_STR_IDXS { F_DBITS, F_PRTY, F_STBITS }; + /** + * @brief A structure to store the configuration of a serial port + */ + typedef struct + { + BAUD_RATE baud_rate; ///< transmission speed, e.g. 19200L, see ::MBG_BAUD_RATES + char framing[4]; ///< ASCIIZ framing string, e.g. "8N1" or "7E2", see ::MBG_FRAMING_STRS + int16_t handshake; ///< handshake mode, yet only ::HS_NONE supported -/* The codes below specify commands/types of data to be supplied to GPS166: */ + } COM_PARM; -/* GPS166 auto-message to host */ -/* þ host request, GPS166 response */ -/* þ þ host download to GPS166 */ -/* þ þ þ */ -enum { /* þ þ þ */ - /* system data */ - GPS_AUTO_ON = 0x000, /* þ þ þ X þ enable auto-messages from GPS166 */ - GPS_AUTO_OFF, /* þ þ þ X þ disable auto-messages from GPS166 */ - GPS_SW_REV, /* þ þ X þ þ request software revision */ - GPS_STAT, /* þ þ X þ þ request status of buffered variables */ - GPS_TIME, /* þ X þ þ X þ current time or capture or init board time */ - GPS_POS_XYZ, /* þ þ X þ X þ current position in ECEF coords */ - GPS_POS_LLA, /* þ þ X þ X þ current position in geographic coords */ - GPS_TZDL, /* þ þ X þ X þ time zone / daylight saving */ - GPS_PORT_PARM, /* þ þ X þ X þ parameters of the serial ports */ - GPS_SYNTH, /* þ þ X þ X þ synthesizer's frequency and phase */ - GPS_ANT_INFO, /* þ X þ X þ þ time diff after antenna disconnect */ - GPS_UCAP, /* þ X þ X þ þ user capture */ + #define _COM_PARM_DEFINED +#endif - /* GPS data */ - GPS_CFGH = 0x100, /* þ þ X þ X þ SVs' configuration and health codes */ - GPS_ALM, /* þ þ X þ X þ one SV's almanac */ - GPS_EPH, /* þ þ X þ X þ one SV's ephemeris */ - GPS_UTC, /* þ þ X þ X þ UTC correction parameters */ - GPS_IONO, /* þ þ X þ X þ ionospheric correction parameters */ - GPS_ASCII_MSG /* þ þ X þ þ the GPS ASCII message */ + +/** + * @brief Enumeration of modes supported for time string transmission + * + * This determines e.g. at which point in time a string starts + * to be transmitted via the serial port. + * Used with ::PORT_SETTINGS::mode. + * + * @see ::STR_MODE_MASKS + */ +enum STR_MODES +{ + STR_ON_REQ, ///< transmission on request by received '?' character only + STR_PER_SEC, ///< transmission automatically if second changes + STR_PER_MIN, ///< transmission automatically if minute changes + STR_AUTO, ///< transmission automatically if required, e.g. on capture event + STR_ON_REQ_SEC, ///< transmission if second changes and a request has been received before + N_STR_MODE ///< the number of known modes }; -/* - * modelled after GPSDEFS.H Revision 1.5 + +/** + * The number of serial ports which are at least available + * even with very old GPS receiver models. For devices providing + * a ::RECEIVER_INFO structure the number of provided COM ports + * is available in ::RECEIVER_INFO::n_com_ports. */ -/***************************************************************************/ -/* */ -/* File: GPSDEFS.H 4.1 */ -/* */ -/* Project: Common C Library */ -/* */ -/* Compiler: Borland C++ */ -/* */ -/* Author: M. Burnicki, Meinberg Funkuhren */ -/* */ -/* */ -/* Description: */ -/* General definitions to be used with GPS166 */ -/* GPS166 Rev. 1.23 or above */ -/* */ -/* Modifications: see file GPSLIB.TXT */ -/* */ -/***************************************************************************/ -#define _GPSDEFS_H -/* the type of various checksums */ +#define DEFAULT_N_COM 2 + + +/** + * @brief A The structure used to store the configuration of two serial ports + * + * @deprecated This structure is deprecated, ::PORT_SETTINGS and related structures + * should be used instead, if supported by the device. + */ +typedef struct +{ + COM_PARM com[DEFAULT_N_COM]; ///< COM0 and COM1 settings + uint8_t mode[DEFAULT_N_COM]; ///< COM0 and COM1 output mode + +} PORT_PARM; + + +/** + * @brief The type of a GPS command code + * + * @see ::GPS_CMD_CODES + */ +typedef uint16_t GPS_CMD; + + +/** + * @brief Control codes to be or'ed with a particular command/type code + */ +enum GPS_CMD_CTRL_CODES +{ + GPS_REQACK = 0x8000, ///< to device: request acknowledge + GPS_ACK = 0x4000, ///< from device: acknowledge a command + GPS_NACK = 0x2000, ///< from device: error evaluating a command +}; + +#define GPS_CTRL_MSK 0xF000 ///< bit mask of all ::GPS_CMD_CTRL_CODES + + +/** + * @brief Command codes for the binary protocol + * + * These codes specify commands and associated data types used by Meinberg's + * binary protocol to exchange data with a device via serial port, direct USB, + * or socket I/O. + * + * Some commands and associated data structures can be read (r) from a device, others + * can be written (w) to the device, and some can also be sent automatically (a) by + * a device after a ::GPS_AUTO_ON command has been sent to the device. + * The individual command codes are marked with (rwa) accordingly, where '-' is used + * to indicate that a particular mode is not supported. + * + * @note Not all command code are supported by all devices. + * See the hints for a particular command. + * + * @note If ::GPS_ALM, ::GPS_EPH or a code named ..._IDX is sent to retrieve + * some data from a device then an uint16_t parameter must be also supplied + * in order to specify the index number of the data set to be returned. + * The valid index range depends on the command code. + * For ::GPS_ALM and ::GPS_EPH the index is the SV number which may be 0 or + * ::MIN_SVNO_GPS to ::MAX_SVNO_GPS. If the number is 0 then all ::N_SVNO_GPS + * almanacs or ephemeris data structures are returned. + * + * @see ::GPS_CMD_CODES_TABLE + */ +enum GPS_CMD_CODES +{ /* system data */ + GPS_AUTO_ON = 0x000, ///< (-w-) no data, enable auto-msgs from device + GPS_AUTO_OFF, ///< (-w-) no data, disable auto-msgs from device + GPS_SW_REV, ///< (r--) deprecated, ::SW_REV, software revision, use only if ::GPS_RECEIVER_INFO not supp. + GPS_BVAR_STAT, ///< (r--) ::BVAR_STAT, status of buffered variables, only if ::GPS_MODEL_HAS_BVAR_STAT + GPS_TIME, ///< (-wa) ::TTM, current time or capture, or init board time + GPS_POS_XYZ, ///< (rw-) ::XYZ, current position in ECEF coordinates, only if ::GPS_MODEL_HAS_POS_XYZ + GPS_POS_LLA, ///< (rw-) ::LLA, current position in geographic coordinates, only if ::GPS_MODEL_HAS_POS_LLA + GPS_TZDL, ///< (rw-) ::TZDL, time zone / daylight saving, only if ::GPS_MODEL_HAS_TZDL + GPS_PORT_PARM, ///< (rw-) deprecated, ::PORT_PARM, use ::PORT_SETTINGS etc. if ::GPS_RECEIVER_INFO supported + GPS_SYNTH, ///< (rw-) ::SYNTH, synthesizer settings, only if ::GPS_HAS_SYNTH + GPS_ANT_INFO, ///< (r-a) ::ANT_INFO, time diff after antenna disconnect, only if ::GPS_MODEL_HAS_ANT_INFO + GPS_UCAP, ///< (r-a) ::TTM, user capture events, only if ::RECEIVER_INFO::n_ucaps > 0 + + /* GPS data */ + GPS_CFGH = 0x100, ///< (rw-) ::CFGH, SVs' configuration and health codes + GPS_ALM, ///< (rw-) req: uint16_t SV num, ::SV_ALM, one SV's almanac + GPS_EPH, ///< (rw-) req: uint16_t SV num, ::SV_EPH, one SV's ephemeris + GPS_UTC, ///< (rw-) ::UTC, GPS %UTC correction parameters + GPS_IONO, ///< (rw-) ::IONO, GPS ionospheric correction parameters + GPS_ASCII_MSG ///< (r--) ::ASCII_MSG, the GPS ASCII message +}; + #ifndef _CSUM_DEFINED - typedef unsigned short CSUM; -# define _CSUM_DEFINED + typedef uint16_t CSUM; /* checksum used by some structures stored in non-volatile memory */ + #define _CSUM_DEFINED #endif -/* the message header */ -typedef struct { - unsigned short gps_cmd; - unsigned short gps_len; - unsigned short gps_data_csum; - unsigned short gps_hdr_csum; +/** + * @brief The header of a binary message. + */ +typedef struct +{ + GPS_CMD cmd; ///< see ::GPS_CMD_CODES + uint16_t len; ///< length of the data portion appended after the header + CSUM data_csum; ///< checksum of the data portion appended after the header + CSUM hdr_csum; ///< checksum of the preceding header bytes + } GPS_MSG_HDR; -/* a struct used to hold the software revision information */ -typedef struct { - unsigned short code; /* e.g. 0x0120 means rev. 1.20 */ - unsigned char name[17]; /* used to identify customized versions */ +#define GPS_ID_STR_LEN 16 +#define GPS_ID_STR_SIZE ( GPS_ID_STR_LEN + 1 ) + +/** + * @brief Software revision information + * + * Contains a software revision code, plus an optional + * identifier for a customized version. + */ +typedef struct +{ + uint16_t code; ///< Version number, e.g. 0x0120 means v1.20 + char name[GPS_ID_STR_SIZE]; ///< Optional string identifying a customized version + uint8_t reserved; ///< Reserved field to yield even structure size + } SW_REV; -/* GPS ASCII message */ -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ - char s[23]; /* 22 chars GPS ASCII message plus trailing zero */ -} ASCII_MSG; +/** + * @brief GNSS satellite numbers + * + * @todo: Check if MAX_SVNO_GLN is 94 instead of 95, and thus + * N_SVNO_GLN is 30 instead of 31, as reported by Wikipedia. + */ +enum GNSS_SVNOS +{ + MIN_SVNO_GPS = 1, ///< min. GPS satellite PRN number + MAX_SVNO_GPS = 32, ///< max. GPS satellite PRN number + N_SVNO_GPS = 32, ///< max. number of active GPS satellites + + MIN_SVNO_WAAS = 33, ///< min. WAAS satellite number + MAX_SVNO_WAAS = 64, ///< max. WAAS satellite number + N_SVNO_WAAS = 32, ///< max. number of active WAAS satellites + + MIN_SVNO_GLONASS = 65, ///< min. Glonass satellite number (64 + sat slot ID) + MAX_SVNO_GLONASS = 95, ///< max. Glonass satellite number (64 + sat slot ID) + N_SVNO_GLONASS = 31 ///< max. number of active Glonass satellites +}; + + +typedef uint16_t SVNO; ///< the number of an SV (Space Vehicle, i.e. satellite) +typedef uint16_t HEALTH; ///< an SV's 6 bit health code +typedef uint16_t CFG; ///< an SV's 4 bit configuration code +typedef uint16_t IOD; ///< Issue-Of-Data code + + +/** + * @brief Status flags of battery buffered data + * + * Related to data received from the satellites, or data derived thereof. + * + * All '0' means OK, single bits set to '1' indicate + * the associated type of GPS data is not available. + * + * @see ::BVAR_FLAGS + */ +typedef uint16_t BVAR_STAT; + +#define _mbg_swab_bvar_stat( _p ) _mbg_swab16( (_p) ) -#define MIN_SVNO 1 /* min. SV number */ -#define MAX_SVNO 32 /* max. SV number */ -#define N_SVNO ( MAX_SVNO - MIN_SVNO + 1) /* number of possibly active SVs */ +/** + * @brief Enumeration of flag bits used to define ::BVAR_FLAGS + * + * For each bit which is set this means the associated data set in + * non-volatile memory is not available, or incomplete. + * Most data sets will just be re-collected from the data streams sent + * by the satellites. However, the receiver position has usually been + * computed earlier during normal operation, and will be re-computed + * when a sufficient number of satellites can be received. + * + * @see ::BVAR_STAT + * @see ::BVAR_FLAGS + * @see ::BVAR_FLAG_NAMES + */ +enum BVAR_FLAG_BITS +{ + BVAR_BIT_CFGH_INVALID, ///< Satellite configuration and health parameters incomplete + BVAR_BIT_ALM_NOT_COMPLETE, ///< Almanac parameters incomplete + BVAR_BIT_UTC_INVALID, ///< %UTC offset parameters incomplete + BVAR_BIT_IONO_INVALID, ///< Ionospheric correction parameters incomplete + BVAR_BIT_RCVR_POS_INVALID, ///< No valid receiver position available + N_BVAR_BIT ///< number of defined ::BVAR_STAT bits +}; + + +/** + * @brief Bit masks associated with ::BVAR_FLAG_BITS + * + * Used with ::BVAR_STAT. + * + * @see ::BVAR_STAT + * @see ::BVAR_FLAG_BITS + * @see ::BVAR_FLAG_NAMES + */ +enum BVAR_FLAGS +{ + BVAR_CFGH_INVALID = ( 1UL << BVAR_BIT_CFGH_INVALID ), ///< see ::BVAR_BIT_CFGH_INVALID + BVAR_ALM_NOT_COMPLETE = ( 1UL << BVAR_BIT_ALM_NOT_COMPLETE ), ///< see ::BVAR_BIT_ALM_NOT_COMPLETE + BVAR_UTC_INVALID = ( 1UL << BVAR_BIT_UTC_INVALID ), ///< see ::BVAR_BIT_UTC_INVALID + BVAR_IONO_INVALID = ( 1UL << BVAR_BIT_IONO_INVALID ), ///< see ::BVAR_BIT_IONO_INVALID + BVAR_RCVR_POS_INVALID = ( 1UL << BVAR_BIT_RCVR_POS_INVALID ), ///< see ::BVAR_BIT_RCVR_POS_INVALID +}; -typedef short SVNO; /* the number of a SV */ -typedef unsigned short HEALTH; /* a SV's health code */ -typedef unsigned short CFG; /* a SV's configuration code */ -typedef unsigned short IOD; /* Issue-Of-Data code */ -/* Date and time referred to the linear time scale defined by GPS. */ -/* GPS time is defined by the number of weeks since midnight from */ -/* January 5, 1980 to January 6, 1980 plus the number of seconds of */ -/* the current week plus fractions of a second. GPS time differs from */ -/* UTC because UTC is corrected with leap seconds while GPS time scale */ -/* is continuous. */ +/** + * @brief A structure used to hold time in GPS format + * + * Date and time refer to the linear time scale defined by GPS, with + * the epoch starting at %UTC midnight at the beginning of January 6, 1980. + * + * GPS time is counted by the week numbers since the epoch, plus second + * of the week, plus fraction of the second. The week number transmitted + * by the satellites rolls over from 1023 to 0, but Meinberg devices + * just continue to count the weeks beyond the 1024 week limit to keep + * the receiver's internal time. + * + * %UTC time differs from GPS time since a number of leap seconds have + * been inserted in the %UTC time scale after the GPS epoche. The number + * of leap seconds is disseminated by the satellites using the ::UTC + * parameter set, which also provides info on pending leap seconds. + */ +typedef struct +{ + uint16_t wn; ///< the week number since GPS has been installed + uint32_t sec; ///< the second of that week + uint32_t tick; ///< fractions of a second, 1/::RECEIVER_INFO::ticks_per_sec units -typedef struct { - unsigned short wn; /* the week number since GPS has been installed */ - unsigned long sec; /* the second of that week */ - unsigned long tick; /* fractions of a second; scale: 1E-7 */ } T_GPS; -/* Local date and time computed from GPS time. The current number */ -/* of leap seconds have to be added to get UTC from GPS time. */ -/* Additional corrections could have been made according to the */ -/* time zone/daylight saving parameters (TZDL, see below) defined */ -/* by the user. The status field can be checked to see which corrections */ -/* have been applied. */ +/** + * @brief Local date and time computed from GPS time + * + * The current number of leap seconds have to be added to get %UTC + * from GPS time. Additional corrections could have been made according + * to the time zone/daylight saving parameters ::TZDL defined by the user. + * The status field can be checked to see which corrections + * have actually been applied. + * + * @note Conversion from GPS time to %UTC and/or local time can only be + * done if some valid ::UTC correction parameters are available in the + * receiver's non-volatile memory. + */ +typedef struct +{ + int16_t year; ///< year number, 0..9999 + int8_t month; ///< month, 1..12 + int8_t mday; ///< day of month, 1..31 + int16_t yday; ///< day of year, 1..365, or 366 in case of leap year + int8_t wday; ///< day of week, 0..6 == Sun..Sat + int8_t hour; ///< hours, 0..23 + int8_t min; ///< minutes, 0..59 + int8_t sec; ///< seconds, 0..59, or 60 in case of inserted leap second + int32_t frac; ///< fractions of a second, 1/::RECEIVER_INFO::ticks_per_sec units + int32_t offs_from_utc; ///< local time offset from %UTC [sec] + uint16_t status; ///< status flags, see ::TM_GPS_STATUS_BIT_MASKS -#ifndef GPS166_TM_DEFINED - typedef struct { - short year; /* 0..9999 */ - char month; /* 1..12 */ - char mday; /* 1..31 */ - short yday; /* 1..366 */ - char wday; /* 0..6 == Sun..Sat */ - char hour; /* 0..23 */ - char minute; /* 0..59 */ - char second; /* 0..59 */ - long frac; /* fractions of a second, scale 1E-7 */ - long offs_from_utc; /* local time's offset from UTC */ - unsigned short status; /* flags */ - } TM; +} TM_GPS; - /* status flags used with conversion from GPS time to local time */ -# define TM_UTC 0x01 /* UTC correction has been made */ -# define TM_LOCAL 0x02 /* UTC has been converted to local time */ -# define TM_DL_ANN 0x04 /* state of daylight saving is going to change */ -# define TM_DL_ENB 0x08 /* daylight saving is enabled */ -# define TM_LS_ANN 0x10 /* leap second will be inserted */ -# define TM_LS_ENB 0x20 /* current second is leap second */ -# define GPS166_TM_DEFINED -#endif +/** + * @brief Status flag bits used to define ::TM_GPS_STATUS_BIT_MASKS + * + * These bits report info on the time conversion from GPS time to %UTC + * and/or local time as well as device status info. + * + * @see ::TM_GPS_STATUS_BIT_MASKS + */ +enum TM_GPS_STATUS_BITS +{ + TM_BIT_UTC, ///< %UTC correction has been made + TM_BIT_LOCAL, ///< %UTC has been converted to local time according to ::TZDL settings + TM_BIT_DL_ANN, ///< state of daylight saving is going to change + TM_BIT_DL_ENB, ///< daylight saving is in effect + TM_BIT_LS_ANN, ///< leap second pending + TM_BIT_LS_ENB, ///< current second is leap second + TM_BIT_LS_ANN_NEG, ///< set in addition to ::TM_BIT_LS_ANN if leap sec is negative + TM_BIT_INVT, ///< invalid time, e.g. if RTC battery bas been empty + + TM_BIT_EXT_SYNC, ///< synchronized externally + TM_BIT_HOLDOVER, ///< in holdover mode after previous synchronization + TM_BIT_ANT_SHORT, ///< antenna cable short circuited + TM_BIT_NO_WARM, ///< OCXO has not warmed up + TM_BIT_ANT_DISCONN, ///< antenna currently disconnected + TM_BIT_SYN_FLAG, ///< TIME_SYN output is low + TM_BIT_NO_SYNC, ///< time sync actually not verified + TM_BIT_NO_POS ///< position actually not verified, LOCK LED off +}; + +/** + * @brief Status flag masks used with ::TM_GPS::status + * + * These bits report info on the time conversion from GPS time to %UTC + * and/or local time as well as device status info. + * + * @see ::TM_GPS_STATUS_BITS + */ +enum TM_GPS_STATUS_BIT_MASKS +{ + TM_UTC = ( 1UL << TM_BIT_UTC ), ///< see ::TM_BIT_UTC + TM_LOCAL = ( 1UL << TM_BIT_LOCAL ), ///< see ::TM_BIT_LOCAL + TM_DL_ANN = ( 1UL << TM_BIT_DL_ANN ), ///< see ::TM_BIT_DL_ANN + TM_DL_ENB = ( 1UL << TM_BIT_DL_ENB ), ///< see ::TM_BIT_DL_ENB + TM_LS_ANN = ( 1UL << TM_BIT_LS_ANN ), ///< see ::TM_BIT_LS_ANN + TM_LS_ENB = ( 1UL << TM_BIT_LS_ENB ), ///< see ::TM_BIT_LS_ENB + TM_LS_ANN_NEG = ( 1UL << TM_BIT_LS_ANN_NEG ), ///< see ::TM_BIT_LS_ANN_NEG + TM_INVT = ( 1UL << TM_BIT_INVT ), ///< see ::TM_BIT_INVT -/* the status flags below are defined starting with rev. 1.32 */ + TM_EXT_SYNC = ( 1UL << TM_BIT_EXT_SYNC ), ///< see ::TM_BIT_EXT_SYNC + TM_HOLDOVER = ( 1UL << TM_BIT_HOLDOVER ), ///< see ::TM_BIT_HOLDOVER + TM_ANT_SHORT = ( 1UL << TM_BIT_ANT_SHORT ), ///< see ::TM_BIT_ANT_SHORT + TM_NO_WARM = ( 1UL << TM_BIT_NO_WARM ), ///< see ::TM_BIT_NO_WARM + TM_ANT_DISCONN = ( 1UL << TM_BIT_ANT_DISCONN ), ///< see ::TM_BIT_ANT_DISCONN + TM_SYN_FLAG = ( 1UL << TM_BIT_SYN_FLAG ), ///< see ::TM_BIT_SYN_FLAG + TM_NO_SYNC = ( 1UL << TM_BIT_NO_SYNC ), ///< see ::TM_BIT_NO_SYNC + TM_NO_POS = ( 1UL << TM_BIT_NO_POS ) ///< see ::TM_BIT_NO_POS +}; -#define TM_ANT_DISCONN 0x1000 /* antenna currently disconnected */ -#define TM_SYN_FLAG 0x2000 /* TIME_SYN output is low */ -#define TM_NO_SYNC 0x4000 /* not sync'ed after reset */ -#define TM_NO_POS 0x8000 /* position not computed after reset, */ - /* LOCK LED off */ -/* a struct used to transmit information on date and time */ +/** + * @brief A structure used to transmit information on date and time + * + * This structure can be used to transfer the current time, in which + * case the channel field has to be set to -1, or an event capture time + * retrieved from the on-board FIFO, in which case the channel field + * contains the index of the time capture input, e.g. 0 or 1. + */ +typedef struct +{ + int16_t channel; ///< -1: the current on-board time; >= 0 the capture channel number + T_GPS t; ///< time in GPS scale and format + TM_GPS tm; ///< time converted to %UTC and/or local time according to ::TZDL settings -typedef struct { - short channel; /* -1: the current time; 0, 1: capture 0, 1 */ - T_GPS t; /* time in GPS format */ - TM tm; /* that time converted to local time */ } TTM; @@ -249,282 +502,462 @@ typedef struct { /* to geographic coordinates as defined by WGS84 (World Geodetic */ /* System from 1984). */ -#ifndef _XYZ_DEFINED - /* sequence and number of components of a cartesian position */ - enum { XP, YP, ZP, N_XYZ }; +/** + * @brief Sequence and number of components of a cartesian position + */ +enum XYZ_FIELDS { XP, YP, ZP, N_XYZ }; // x, y, z - /* a type of array holding a cartesian position */ - typedef l_fp XYZ[N_XYZ]; /* values are in [m] */ +/** + * @brief A position in cartesian coordinates + * + * Usually earth centered, earth fixed (ECEF) coordinates, + * in [m]. + * + * @note In the original code this is an array of double. + * + * @see ::XYZ_FIELDS + */ +typedef l_fp XYZ[N_XYZ]; -# define _XYZ_DEFINED -#endif +/** + * @brief Sequence and number of components of a geographic position + */ +enum LLA_FIELDS { LAT, LON, ALT, N_LLA }; /* latitude, longitude, altitude */ -#ifndef _LLA_DEFINED - /* sequence and number of components of a geographic position */ - enum { LAT, LON, ALT, N_LLA }; /* latitude, longitude, altitude */ +/** + * @brief A geographic position based on latitude, longitude, and altitude + * + * The geographic position associated to specific cartesian coordinates + * depends on the characteristics of the ellipsoid used for the computation, + * the so-called geographic datum. GPS uses the WGS84 (World Geodetic System + * from 1984) ellipsoid by default. + * + * lon, lat in [rad], alt in [m] + * + * @note In the original code this is an array of double. + * + * @see ::LLA_FIELDS + */ +typedef l_fp LLA[N_LLA]; - /* a type of array holding a geographic position */ - typedef l_fp LLA[N_LLA]; /* lon, lat in [rad], alt in [m] */ -# define _LLA_DEFINED -#endif +/** + * @defgroup group_synth Synthesizer parameters + * + * Synthesizer frequency is expressed as a + * four digit decimal number (freq) to be multiplied by 0.1 Hz and an + * base 10 exponent (range). If the effective frequency is less than + * 10 kHz its phase is synchronized corresponding to the variable phase. + * Phase may be in a range from -360 deg to +360 deg with a resolution + * of 0.1 deg, so the resulting numbers to be stored are in a range of + * -3600 to +3600. + * + * Example:<br> + * Assume the value of freq is 2345 (decimal) and the value of phase is 900. + * If range == 0 the effective frequency is 234.5 Hz with a phase of +90 deg. + * If range == 1 the synthesizer will generate a 2345 Hz output frequency + * and so on. + * + * Limitations:<br> + * If freq == 0 the synthesizer is disabled. If range == 0 the least + * significant digit of freq is limited to 0, 3, 5 or 6. The resulting + * frequency is shown in the examples below: + * - freq == 1230 --> 123.0 Hz + * - freq == 1233 --> 123 1/3 Hz (real 1/3 Hz, NOT 123.3 Hz) + * - freq == 1235 --> 123.5 Hz + * - freq == 1236 --> 123 2/3 Hz (real 2/3 Hz, NOT 123.6 Hz) + * + * If range == ::MAX_SYNTH_RANGE the value of freq must not exceed 1000, so + * the output frequency is limited to 10 MHz (see ::MAX_SYNTH_FREQ_VAL). + * + * @{ */ -/* Synthesizer parameters. Synthesizer frequency is expressed as a */ -/* four digit decimal number (freq) to be multiplied by 0.1 Hz and an */ -/* base 10 exponent (range). If the effective frequency is less than */ -/* 10 kHz its phase is synchronized corresponding to the variable phase. */ -/* Phase may be in a range from -360° to +360° with a resolution of 0.1°, */ -/* so the resulting numbers to be stored are in a range of -3600 to +3600. */ +#define N_SYNTH_FREQ_DIGIT 4 ///< number of digits to edit +#define MAX_SYNTH_FREQ 1000 ///< if range == ::MAX_SYNTH_RANGE -/* Example: */ -/* Assume the value of freq is 2345 (decimal) and the value of phase is 900. */ -/* If range == 0 the effective frequency is 234.5 Hz with a phase of +90°. */ -/* If range == 1 the synthesizer will generate a 2345 Hz output frequency */ -/* and so on. */ +#define MIN_SYNTH_RANGE 0 +#define MAX_SYNTH_RANGE 5 +#define N_SYNTH_RANGE ( MAX_SYNTH_RANGE - MIN_SYNTH_RANGE + 1 ) -/* Limitations: */ -/* If freq == 0 the synthesizer is disabled. If range == 0 the least */ -/* significant digit of freq is limited to 0, 3, 5 or 6. The resulting */ -/* frequency is shown in the examples below: */ -/* freq == 1230 --> 123.0 Hz */ -/* freq == 1233 --> 123 1/3 Hz (real 1/3 Hz, NOT 123.3 Hz) */ -/* freq == 1235 --> 123.5 Hz */ -/* freq == 1236 --> 123 2/3 Hz (real 2/3 Hz, NOT 123.6 Hz) */ +#define N_SYNTH_PHASE_DIGIT 4 +#define MAX_SYNTH_PHASE 3600 -/* If range == MAX_RANGE the value of freq must not exceed 1200, so the */ -/* output frequency is limited to 12 MHz. */ -/* Phase will be ignored if the resulting frequency is greater or equal */ -/* to 10 kHz. */ +#define MAX_SYNTH_FREQ_EDIT 9999 ///< max sequence of digits when editing -#define MAX_SYNTH_FREQ 1200 /* if range == MAX_SYNTH_RANGE */ -#define MIN_SYNTH_RANGE 0 -#define MAX_SYNTH_RANGE 5 -#define MAX_SYNTH_PHASE 3600 -typedef struct { - short freq; /* four digits used; scale: 0.1; e.g. 1234 -> 123.4 Hz */ - short range; /* scale factor for freq; 0..MAX_SYNTH_RANGE */ - short phase; /* -MAX_SYNTH_PHASE..+MAX_SYNTH_PHASE; >0 -> pulses later */ -} SYNTH; +/** + * @brief The maximum frequency that can be configured for the synthesizer + */ +#define MAX_SYNTH_FREQ_VAL 10000000UL ///< 10 MHz +/* == MAX_SYNTH_FREQ * 10^(MAX_SYNTH_RANGE-1) */ +/** + * @brief The synthesizer's phase is only be synchronized if the frequency is below this limit + */ +#define SYNTH_PHASE_SYNC_LIMIT 10000UL ///< 10 kHz +/** + * A Macro used to determine the position of the decimal point + * when printing the synthesizer frequency as 4 digit value + */ +#define _synth_dp_pos_from_range( _r ) \ + ( ( ( N_SYNTH_RANGE - (_r) ) % ( N_SYNTH_FREQ_DIGIT - 1 ) ) + 1 ) -/* Time zone/daylight saving parameters. */ +/** + * @brief Synthesizer frequency units + * + * An initializer for commonly displayed synthesizer frequency units + * (::N_SYNTH_RANGE strings) + */ +#define DEFAULT_FREQ_RANGES \ +{ \ + "Hz", \ + "kHz", \ + "kHz", \ + "kHz", \ + "MHz", \ + "MHz", \ +} -/* the name of a time zone, 5 characters plus trailing zero */ -typedef char TZ_NAME[6]; -typedef struct { - long offs; /* offset from UTC to local time [sec] */ - long offs_dl; /* additional offset if daylight saving enabled [sec] */ - TM tm_on; /* date/time when daylight saving starts */ - TM tm_off; /* date/time when daylight saving ends */ - TZ_NAME name[2]; /* names without and with daylight saving enabled */ -} TZDL; -/* The constant below is defined beginning with software rev. 1.29. */ -/* If the year in tzdl.tmon and tzdl.tm_off is or'ed with that constant, */ -/* the receiver automatically generates daylight saving year by year. */ -/* See GPSLIB.TXT for more information. */ +/** + * @brief Synthesizer configuration parameters + */ +typedef struct +{ + int16_t freq; ///< four digits used; scale: 0.1 Hz; e.g. 1234 -> 123.4 Hz + int16_t range; ///< scale factor for freq; 0..::MAX_SYNTH_RANGE + int16_t phase; ///< -::MAX_SYNTH_PHASE..+::MAX_SYNTH_PHASE; >0 -> pulses later -#define DL_AUTO_FLAG 0x8000 +} SYNTH; + +#define _mbg_swab_synth( _p ) \ +{ \ + _mbg_swab16( &(_p)->freq ); \ + _mbg_swab16( &(_p)->range ); \ + _mbg_swab16( &(_p)->phase ); \ +} + + +/** + * @brief Enumeration of synthesizer states + */ +enum SYNTH_STATES +{ + SYNTH_DISABLED, ///< disbled by cfg, i.e. freq == 0.0 + SYNTH_OFF, ///< not enabled after power-up + SYNTH_FREE, ///< enabled, but not synchronized + SYNTH_DRIFTING, ///< has initially been sync'd, but now running free + SYNTH_SYNC, ///< fully synchronized + N_SYNTH_STATE ///< the number of known states +}; -/* Example: */ -/* for automatic daylight saving enable/disable in Central Europe, */ -/* the variables are to be set as shown below: */ -/* offs = 3600L one hour from UTC */ -/* offs_dl = 3600L one additional hour if daylight saving enabled */ -/* tm_on = first Sunday from March 25, 02:00:00h ( year |= DL_AUTO_FLAG ) */ -/* tm_off = first Sunday from Sept 24, 03:00:00h ( year |= DL_AUTO_FLAG ) */ -/* name[0] == "MEZ " name if daylight saving not enabled */ -/* name[1] == "MESZ " name if daylight saving is enabled */ +/** + * @brief A structure used to report the synthesizer state + */ +typedef struct +{ + uint8_t state; ///< state code as enumerated in ::SYNTH_STATES + uint8_t flags; ///< reserved, currently always 0 +} SYNTH_STATE; +#define _mbg_swab_synth_state( _p ) _nop_macro_fnc() -/* the structure below was defined in rev. 1.31. It reflects the status */ -/* of the antenna, the times of last disconnect/reconnect and the boards */ -/* clock offset after the phase of disconnection. */ +#define SYNTH_FLAG_PHASE_IGNORED 0x01 -typedef struct { - short status; /* current status of antenna */ - TM tm_disconn; /* time of antenna disconnect */ - TM tm_reconn; /* time of antenna reconnect */ - long delta_t; /* clock offset at reconnect time, units: TICKS_PER_SEC */ -} ANT_INFO; +/** @} defgroup group_synth */ -/* the status field may be set to one of the values below: */ -enum { - ANT_INVALID, /* struct not set yet because ant. has not been disconn. */ - ANT_DISCONN, /* ant. now disconn., tm_reconn and delta_t not set */ - ANT_RECONN /* ant. has been disconn. and reconn., all fields valid */ -}; +/** + * @defgroup group_tzdl Time zone / daylight saving parameters + * + * Example: <br> + * For automatic daylight saving enable/disable in Central Europe, + * the variables are to be set as shown below: <br> + * - offs = 3600L one hour from %UTC + * - offs_dl = 3600L one additional hour if daylight saving enabled + * - tm_on = first Sunday from March 25, 02:00:00h ( year |= ::DL_AUTO_FLAG ) + * - tm_off = first Sunday from October 25, 03:00:00h ( year |= ::DL_AUTO_FLAG ) + * - name[0] == "CET " name if daylight saving not enabled + * - name[1] == "CEST " name if daylight saving is enabled + * + * @{ */ +/** + * @brief The name of a time zone + * + * @note Up to 5 printable characters, plus trailing zero + */ +typedef char TZ_NAME[6]; -/* Summary of configuration and health data of all SVs. */ +/** + * @brief Time zone / daylight saving parameters + * + * This structure is used to specify how a device converts on-board %UTC + * to local time, including computation of beginning and end of daylight + * saving time (DST), if required. + * + * @note The ::TZDL structure contains members of type ::TM_GPS to specify + * the times for beginning and end of DST. However, the ::TM_GPS::frac, + * ::TM_GPS::offs_from_utc, and ::TM_GPS::status fields of these ::TZDL::tm_on + * and ::TZDL::tm_off members are ignored for the conversion to local time, + * and thus should be 0. + */ +typedef struct +{ + int32_t offs; ///< standard offset from %UTC to local time [sec] + int32_t offs_dl; ///< additional offset if daylight saving enabled [sec] + TM_GPS tm_on; ///< date/time when daylight saving starts + TM_GPS tm_off; ///< date/time when daylight saving ends + TZ_NAME name[2]; ///< names without and with daylight saving enabled -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ +} TZDL; - T_GPS tot_51; /* time of transmission, page 51 */ - T_GPS tot_63; /* time of transmission, page 63 */ - T_GPS t0a; /* complete reference time almanac */ +/** + * @brief A flag indicating automatic computation of DST + * + * If this flag is or'ed to the year numbers in ::TZDL::tm_on and ::TZDL::tm_off + * then daylight saving is computed automatically year by year. + */ +#define DL_AUTO_FLAG 0x8000 - CFG cfg[N_SVNO]; /* SV configuration from page 63 */ - HEALTH health[N_SVNO]; /* SV health from pages 51, 63 */ -} CFGH; +/** @} defgroup group_tzdl */ -/* UTC correction parameters */ +/** + * @brief Antenna status and error at reconnect information + * + * The structure below reflects the status of the antenna, + * the times of last disconnect/reconnect, and the board's + * clock offset when it has synchronized again after the + * disconnection interval. + * + * @note ::ANT_INFO::status changes back to ::ANT_RECONN only + * after the antenna has been reconnected <b>and</b> the + * receiver has re-synchronized to the satellite signal. + * In this case ::ANT_INFO::delta_t reports the time offset + * before resynchronization, i.e. how much the internal + * time has drifted while the antenna was disconnected. + */ +typedef struct +{ + int16_t status; ///< current status of antenna, see ::ANT_STATUS_CODES + TM_GPS tm_disconn; ///< time of antenna disconnect + TM_GPS tm_reconn; ///< time of antenna reconnect + int32_t delta_t; ///< clock offs at reconn. time in 1/::RECEIVER_INFO::ticks_per_sec units -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ +} ANT_INFO; - T_GPS t0t; /* Reference Time UTC Parameters [sec] */ - l_fp A0; /* ± Clock Correction Coefficient 0 [sec] */ - l_fp A1; /* ± Clock Correction Coefficient 1 [sec/sec] */ - u_short WNlsf; /* week number of nearest leap second */ - short DNt; /* the day number at the end of which LS is inserted */ - char delta_tls; /* */ - char delta_tlsf; /* */ +/** + * @brief Status code used with ::ANT_INFO::status + */ +enum ANT_STATUS_CODES +{ + ANT_INVALID, ///< No other fields valid since antenna has not yet been disconnected + ANT_DISCONN, ///< Antenna is disconnected, tm_reconn and delta_t not yet set + ANT_RECONN, ///< Antenna has been disconnect, and receiver sync. after reconnect, so all fields valid + N_ANT_STATUS_CODES ///< the number of known status codes +}; -} UTC; -/* a struct used to hold the settings of a serial port */ -#ifndef _COM_PARM_DEFINED - typedef long BAUD_RATE; +/** + * @brief Summary of configuration and health data of all satellites + */ +typedef struct +{ + CSUM csum; ///< checksum of the remaining bytes + int16_t valid; ///< flag data are valid - /* indices used to identify a parameter in the framing string */ - enum { F_DBITS, F_PRTY, F_STBITS }; + T_GPS tot_51; ///< time of transmission, page 51 + T_GPS tot_63; ///< time of transmission, page 63 + T_GPS t0a; ///< complete reference time almanac - /* types of handshake */ - enum { HS_NONE, HS_XONXOFF, HS_RTSCTS }; + CFG cfg[N_SVNO_GPS]; ///< 4 bit SV configuration code from page 63 + HEALTH health[N_SVNO_GPS]; ///< 6 bit SV health codes from pages 51, 63 - typedef struct { - BAUD_RATE baud_rate; /* e.g. 19200L */ - char framing[4]; /* e.g. "8N1" */ - short handshake; /* a numeric value, only HS_NONE supported yet */ - } COM_PARM; +} CFGH; -#define _COM_PARM_DEFINED -#endif +/** + * @brief GPS %UTC correction parameters + * + * %UTC correction parameters basically as sent by the GPS satellites. + * + * The csum field is only used by the card's firmware to check the + * consistency of the structure in non-volatile memory. + * + * The field labeled valid indicates if the parameter set is valid, i.e. + * if it contains data received from the satellites. + * + * t0t, A0 and A1 contain fractional correction parameters for the current + * GPS-%UTC time offset in addition to the whole seconds. This is evaluated + * by the receivers' firmware to convert GPS time to %UTC time. + * + * The delta_tls field contains the current full seconds offset between + * GPS time and %UTC, which corresponds to the number of leap seconds inserted + * into the %UTC time scale since GPS was put into operation in January 1980. + * + * delta_tlfs holds the number of "future" leap seconds, i.e. the %UTC offset + * after the next leap second event defined by WNlsf and DNt. + * + * The fields WNlsf and DNt specify the GPS week number and the day number + * in that week for the end of which a leap second has been scheduled. + * + * @note: The satellites transmit WNlsf only as a signed 8 bit value, so it + * can only define a point in time which is +/- 127 weeks off the current time. + * The firmware tries to expand this based on the current week number, but + * the result is ambiguous if the leap second occurs or occurred more + * than 127 weeks in the future or past. + * + * So the leap second date should <b>only</b> be evaluated and displayed + * in a user interface if the fields delta_tls and delta_tlsf have + * different values, in which case there is indeed a leap second announcement + * inside the +/- 127 week range. + * + * @note In the original code the type of A0 and A1 is double. + */ +typedef struct +{ + CSUM csum; ///< Checksum of the remaining bytes + int16_t valid; ///< Flag indicating %UTC parameters are valid -/* the codes below define what has to comes out of the serial ports */ + T_GPS t0t; ///< Reference Time %UTC Parameters [wn|sec] + l_fp A0; ///< +- Clock Correction Coefficient 0 [sec] + l_fp A1; ///< +- Clock Correction Coefficient 1 [sec/sec] -enum { STR_ON_REQ, STR_PER_SEC, - STR_PER_MIN, N_STR_MODE_0, /* COM0 and COM1 */ - STR_UCAP = N_STR_MODE_0, - STR_UCAP_REQ, N_STR_MODE_1 /* COM1 only */ - }; + uint16_t WNlsf; ///< Week number of nearest leap second + int16_t DNt; ///< The day number at the end of which a leap second occurs + int8_t delta_tls; ///< Current %UTC offset to GPS system time [sec] + int8_t delta_tlsf; ///< Future %UTC offset to GPS system time after next leap second transition [sec] +} UTC; -#define N_COM 2 /* the number of serial ports */ -/* the structure used to store the modes of both serial ports */ +/** + * @brief GPS ASCII message + */ +typedef struct +{ + CSUM csum; ///< checksum of the remaining bytes */ + int16_t valid; ///< flag data are valid + char s[23]; ///< 22 chars GPS ASCII message plus trailing zero -typedef struct { - COM_PARM com[N_COM]; /* COM0 and COM1 settings */ - u_char mode[N_COM]; /* COM0 and COM1 output mode */ -} PORT_PARM; +} ASCII_MSG; -/* Ephemeris parameters of one specific SV. Needed to compute the position */ -/* of a satellite at a given time with high precision. Valid for an */ -/* interval of 4 to 6 hours from start of transmission. */ -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ +/** + * @brief Ephemeris parameters of one specific satellite + * + * Needed to compute the position of a satellite at a given time with + * high precision. Valid for an interval of 4 to 6 hours from start + * of transmission. + */ +typedef struct +{ + CSUM csum; ///< checksum of the remaining bytes + int16_t valid; ///< flag data are valid - HEALTH health; /* health indication of transmitting SV [---] */ - IOD IODC; /* Issue Of Data, Clock */ - IOD IODE2; /* Issue of Data, Ephemeris (Subframe 2) */ - IOD IODE3; /* Issue of Data, Ephemeris (Subframe 3) */ - T_GPS tt; /* time of transmission */ - T_GPS t0c; /* Reference Time Clock [---] */ - T_GPS t0e; /* Reference Time Ephemeris [---] */ + HEALTH health; ///< health indication of transmitting SV [---] + IOD IODC; ///< Issue Of Data, Clock + IOD IODE2; ///< Issue of Data, Ephemeris (Subframe 2) + IOD IODE3; ///< Issue of Data, Ephemeris (Subframe 3) + T_GPS tt; ///< time of transmission + T_GPS t0c; ///< Reference Time Clock [---] + T_GPS t0e; ///< Reference Time Ephemeris [---] - l_fp sqrt_A; /* Square Root of semi-major Axis [sqrt(m)] */ - l_fp e; /* Eccentricity [---] */ - l_fp M0; /* ± Mean Anomaly at Ref. Time [rad] */ - l_fp omega; /* ± Argument of Perigee [rad] */ - l_fp OMEGA0; /* ± Longit. of Asc. Node of orbit plane [rad] */ - l_fp OMEGADOT; /* ± Rate of Right Ascension [rad/sec] */ - l_fp deltan; /* ± Mean Motion Diff. from computed value [rad/sec] */ - l_fp i0; /* ± Inclination Angle [rad] */ - l_fp idot; /* ± Rate of Inclination Angle [rad/sec] */ - l_fp crc; /* ± Cosine Corr. Term to Orbit Radius [m] */ - l_fp crs; /* ± Sine Corr. Term to Orbit Radius [m] */ - l_fp cuc; /* ± Cosine Corr. Term to Arg. of Latitude [rad] */ - l_fp cus; /* ± Sine Corr. Term to Arg. of Latitude [rad] */ - l_fp cic; /* ± Cosine Corr. Term to Inclination Angle [rad] */ - l_fp cis; /* ± Sine Corr. Term to Inclination Angle [rad] */ + l_fp sqrt_A; ///< Square Root of semi-major Axis [sqrt(m)] + l_fp e; ///< Eccentricity [---] + l_fp M0; ///< +- Mean Anomaly at Ref. Time [rad] + l_fp omega; ///< +- Argument of Perigee [rad] + l_fp OMEGA0; ///< +- Longit. of Asc. Node of orbit plane [rad] + l_fp OMEGADOT; ///< +- Rate of Right Ascension [rad/sec] + l_fp deltan; ///< +- Mean Motion Diff. from computed value [rad/sec] + l_fp i0; ///< +- Inclination Angle [rad] + l_fp idot; ///< +- Rate of Inclination Angle [rad/sec] + l_fp crc; ///< +- Cosine Corr. Term to Orbit Radius [m] + l_fp crs; ///< +- Sine Corr. Term to Orbit Radius [m] + l_fp cuc; ///< +- Cosine Corr. Term to Arg. of Latitude [rad] + l_fp cus; ///< +- Sine Corr. Term to Arg. of Latitude [rad] + l_fp cic; ///< +- Cosine Corr. Term to Inclination Angle [rad] + l_fp cis; ///< +- Sine Corr. Term to Inclination Angle [rad] - l_fp af0; /* ± Clock Correction Coefficient 0 [sec] */ - l_fp af1; /* ± Clock Correction Coefficient 1 [sec/sec] */ - l_fp af2; /* ± Clock Correction Coefficient 2 [sec/sec²] */ - l_fp tgd; /* ± estimated group delay differential [sec] */ + l_fp af0; ///< +- Clock Correction Coefficient 0 [sec] + l_fp af1; ///< +- Clock Correction Coefficient 1 [sec/sec] + l_fp af2; ///< +- Clock Correction Coefficient 2 [sec/sec^2] + l_fp tgd; ///< +- estimated group delay differential [sec] - u_short URA; /* predicted User Range Accuracy */ + uint16_t URA; ///< predicted User Range Accuracy - u_char L2code; /* code on L2 channel [---] */ - u_char L2flag; /* L2 P data flag [---] */ + uint8_t L2code; ///< code on L2 channel [---] + uint8_t L2flag; ///< L2 P data flag [---] } EPH; -/* Almanac parameters of one specific SV. A reduced precision set of */ -/* parameters used to check if a satellite is in view at a given time. */ -/* Valid for an interval of more than 7 days from start of transmission. */ -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ - HEALTH health; /* [---] */ - T_GPS t0a; /* Reference Time Almanac [sec] */ +/** + * @brief Almanac parameters of one specific satellite + * + * A reduced precision set of parameters used to check if a satellite + * is in view at a given time. Valid for an interval of more than 7 days + * from start of transmission. + */ +typedef struct +{ + CSUM csum; ///< checksum of the remaining bytes + int16_t valid; ///< flag data are valid + + HEALTH health; ///< [---] + T_GPS t0a; ///< Reference Time Almanac [sec] + + l_fp sqrt_A; ///< Square Root of semi-major Axis [sqrt(m)] + l_fp e; ///< Eccentricity [---] - l_fp sqrt_A; /* Square Root of semi-major Axis [sqrt(m)] */ - l_fp e; /* Eccentricity [---] */ + l_fp M0; ///< +- Mean Anomaly at Ref. Time [rad] + l_fp omega; ///< +- Argument of Perigee [rad] + l_fp OMEGA0; ///< +- Longit. of Asc. Node of orbit plane [rad] + l_fp OMEGADOT; ///< +- Rate of Right Ascension [rad/sec] + l_fp deltai; ///< +- [rad] + l_fp af0; ///< +- Clock Correction Coefficient 0 [sec] + l_fp af1; ///< +- Clock Correction Coefficient 1 [sec/sec] - l_fp M0; /* ± Mean Anomaly at Ref. Time [rad] */ - l_fp omega; /* ± Argument of Perigee [rad] */ - l_fp OMEGA0; /* ± Longit. of Asc. Node of orbit plane [rad] */ - l_fp OMEGADOT; /* ± Rate of Right Ascension [rad/sec] */ - l_fp deltai; /* ± [rad] */ - l_fp af0; /* ± Clock Correction Coefficient 0 [sec] */ - l_fp af1; /* ± Clock Correction Coefficient 1 [sec/sec] */ } ALM; -/* ionospheric correction parameters */ -typedef struct { - CSUM csum; /* checksum of the remaining bytes */ - short valid; /* flag data are valid */ +/** + * @brief Ionospheric correction parameters + */ +typedef struct +{ + CSUM csum; ///< checksum of the remaining bytes + int16_t valid; ///< flag data are valid - l_fp alpha_0; /* Ionosph. Corr. Coeff. Alpha 0 [sec] */ - l_fp alpha_1; /* Ionosph. Corr. Coeff. Alpha 1 [sec/deg] */ - l_fp alpha_2; /* Ionosph. Corr. Coeff. Alpha 2 [sec/deg^2] */ - l_fp alpha_3; /* Ionosph. Corr. Coeff. Alpha 3 [sec/deg^3] */ + l_fp alpha_0; ///< Ionosph. Corr. Coeff. Alpha 0 [sec] + l_fp alpha_1; ///< Ionosph. Corr. Coeff. Alpha 1 [sec/deg] + l_fp alpha_2; ///< Ionosph. Corr. Coeff. Alpha 2 [sec/deg^2] + l_fp alpha_3; ///< Ionosph. Corr. Coeff. Alpha 3 [sec/deg^3] - l_fp beta_0; /* Ionosph. Corr. Coeff. Beta 0 [sec] */ - l_fp beta_1; /* Ionosph. Corr. Coeff. Beta 1 [sec/deg] */ - l_fp beta_2; /* Ionosph. Corr. Coeff. Beta 2 [sec/deg^2] */ - l_fp beta_3; /* Ionosph. Corr. Coeff. Beta 3 [sec/deg^3] */ + l_fp beta_0; ///< Ionosph. Corr. Coeff. Beta 0 [sec] + l_fp beta_1; ///< Ionosph. Corr. Coeff. Beta 1 [sec/deg] + l_fp beta_2; ///< Ionosph. Corr. Coeff. Beta 2 [sec/deg^2] + l_fp beta_3; ///< Ionosph. Corr. Coeff. Beta 3 [sec/deg^3] } IONO; -void mbg_tm_str (char **, TM *, int); + + +void mbg_tm_str (char **, TM_GPS *, int, int); void mbg_tgps_str (char **, T_GPS *, int); void get_mbg_header (unsigned char **, GPS_MSG_HDR *); void put_mbg_header (unsigned char **, GPS_MSG_HDR *); @@ -534,7 +967,7 @@ void get_mbg_svno (unsigned char **, SVNO *); void get_mbg_health (unsigned char **, HEALTH *); void get_mbg_cfg (unsigned char **, CFG *); void get_mbg_tgps (unsigned char **, T_GPS *); -void get_mbg_tm (unsigned char **, TM *); +void get_mbg_tm (unsigned char **, TM_GPS *); void get_mbg_ttm (unsigned char **, TTM *); void get_mbg_synth (unsigned char **, SYNTH *); void get_mbg_tzdl (unsigned char **, TZDL *); @@ -548,7 +981,7 @@ void get_mbg_eph (unsigned char **, EPH *); void get_mbg_alm (unsigned char **, ALM *); void get_mbg_iono (unsigned char **, IONO *); -unsigned long mbg_csum (unsigned char *, unsigned int); +CSUM mbg_csum (unsigned char *, unsigned int); #endif /* diff --git a/contrib/ntp/include/ntp.h b/contrib/ntp/include/ntp.h index 38343f23a705b..4ffc35f6febce 100644 --- a/contrib/ntp/include/ntp.h +++ b/contrib/ntp/include/ntp.h @@ -435,7 +435,7 @@ struct peer { #define STRATUM_UNSPEC ((u_char)16) /* unspecified */ /* - * Values for peer.flags + * Values for peer.flags (u_int) */ #define FLAG_CONFIG 0x0001 /* association was configured */ #define FLAG_PREEMPT 0x0002 /* preemptable association */ @@ -453,8 +453,9 @@ struct peer { #define FLAG_XB 0x2000 /* interleaved broadcast */ #define FLAG_XBOGUS 0x4000 /* interleaved bogus packet */ #ifdef OPENSSL -#define FLAG_ASSOC 0x8000 /* autokey request */ +# define FLAG_ASSOC 0x8000 /* autokey request */ #endif /* OPENSSL */ +#define FLAG_TSTAMP_PPS 0x10000 /* PPS source provides absolute timestamp */ /* * Definitions for the clear() routine. We use memset() to clear @@ -713,17 +714,19 @@ struct pkt { */ #define LOOP_DRIFTINIT 1 /* iniitialize frequency */ #define LOOP_KERN_CLEAR 2 /* set initial frequency offset */ -#define LOOP_MAX 3 /* set step offset */ -#define LOOP_PANIC 4 /* set panic offseet */ -#define LOOP_PHI 5 /* set dispersion rate */ -#define LOOP_MINSTEP 6 /* set step timeout */ -#define LOOP_MINPOLL 7 /* set min poll interval (log2 s) */ -#define LOOP_ALLAN 8 /* set minimum Allan intercept */ -#define LOOP_HUFFPUFF 9 /* set huff-n'-puff filter length */ -#define LOOP_FREQ 10 /* set initial frequency */ -#define LOOP_CODEC 11 /* set audio codec frequency */ -#define LOOP_LEAP 12 /* insert leap after second 23:59 */ -#define LOOP_TICK 13 /* sim. low precision clock */ +#define LOOP_MAX 3 /* set both step offsets */ +#define LOOP_MAX_BACK 4 /* set bacward-step offset */ +#define LOOP_MAX_FWD 5 /* set forward-step offset */ +#define LOOP_PANIC 6 /* set panic offseet */ +#define LOOP_PHI 7 /* set dispersion rate */ +#define LOOP_MINSTEP 8 /* set step timeout */ +#define LOOP_MINPOLL 9 /* set min poll interval (log2 s) */ +#define LOOP_ALLAN 10 /* set minimum Allan intercept */ +#define LOOP_HUFFPUFF 11 /* set huff-n'-puff filter length */ +#define LOOP_FREQ 12 /* set initial frequency */ +#define LOOP_CODEC 13 /* set audio codec frequency */ +#define LOOP_LEAP 14 /* insert leap after second 23:59 */ +#define LOOP_TICK 15 /* sim. low precision clock */ /* * Configuration items for the stats printer @@ -875,13 +878,13 @@ struct endpoint { */ #define AM_ERR -1 /* error */ #define AM_NOMATCH 0 /* no match */ -#define AM_PROCPKT 1 /* server/symmetric packet */ -#define AM_BCST 2 /* broadcast packet */ +#define AM_PROCPKT 1 /* server/symmetric packet */ +#define AM_BCST 2 /* broadcast packet */ #define AM_FXMIT 3 /* client packet */ #define AM_MANYCAST 4 /* manycast or pool */ #define AM_NEWPASS 5 /* new passive */ #define AM_NEWBCL 6 /* new broadcast */ -#define AM_POSSBCL 7 /* discard broadcast */ +#define AM_POSSBCL 7 /* discard broadcast */ /* NetInfo configuration locations */ #ifdef HAVE_NETINFO diff --git a/contrib/ntp/include/ntp_calendar.h b/contrib/ntp/include/ntp_calendar.h index 3ee1ff79c8060..3afb627d25944 100644 --- a/contrib/ntp/include/ntp_calendar.h +++ b/contrib/ntp/include/ntp_calendar.h @@ -83,13 +83,15 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr); #define SECSPERMIN (60) /* seconds per minute */ #define MINSPERHR (60) /* minutes per hour */ #define HRSPERDAY (24) /* hours per day */ +#define DAYSPERWEEK (7) /* days per week */ #define DAYSPERYEAR (365) /* days per year */ #define SECSPERHR (SECSPERMIN * MINSPERHR) #define SECSPERDAY (SECSPERHR * HRSPERDAY) +#define SECSPERWEEK (DAYSPERWEEK * SECSPERDAY) #define SECSPERYEAR (365 * SECSPERDAY) /* regular year */ #define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */ -#define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */ +#define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */ /* * Gross hacks. I have illicit knowlege that there won't be overflows @@ -113,7 +115,7 @@ extern uint32_t caltontp (const struct calendar *); * Convert between 'time_t' and 'vint64' */ extern vint64 time_to_vint64(const time_t *); -extern time_t vint64_to_time(const vint64 *); +extern time_t vint64_to_time(const vint64 *); /* * Get the build date & time. ATTENTION: The time zone is not specified! diff --git a/contrib/ntp/include/ntp_fp.h b/contrib/ntp/include/ntp_fp.h index 1b97e8b5cf72e..7806932262070 100644 --- a/contrib/ntp/include/ntp_fp.h +++ b/contrib/ntp/include/ntp_fp.h @@ -264,10 +264,13 @@ typedef u_int32 u_fp; * headers. So far the problem has only been seen with gcc, but it * may also affect Sun compilers, in which case the defined(__GNUC__) * term should be removed. + * XSCALE also generates bad code for these, at least with GCC 3.3.5. + * This is unrelated to math.h, but the same solution applies. */ #if defined(HAVE_U_INT64) && \ !(defined(__SVR4) && defined(__sun) && \ - defined(sparc) && defined(__GNUC__)) + defined(sparc) && defined(__GNUC__) || \ + defined(__arm__) && defined(__XSCALE__) && defined(__GNUC__)) #include <math.h> /* ldexp() */ diff --git a/contrib/ntp/include/ntp_md5.h b/contrib/ntp/include/ntp_md5.h index 9f43378f81c58..2306b9a87fa6b 100644 --- a/contrib/ntp/include/ntp_md5.h +++ b/contrib/ntp/include/ntp_md5.h @@ -24,7 +24,7 @@ typedef MD5_CTX EVP_MD_CTX; # define EVP_get_digestbynid(t) NULL -# define EVP_md5(v) NULL +# define EVP_md5() NULL # define EVP_MD_CTX_init(c) # define EVP_MD_CTX_set_flags(c, f) # define EVP_DigestInit(c, dt) (MD5Init(c), 1) diff --git a/contrib/ntp/include/ntpd.h b/contrib/ntp/include/ntpd.h index 77fe4843a6541..f0bbeb08211f3 100644 --- a/contrib/ntp/include/ntpd.h +++ b/contrib/ntp/include/ntpd.h @@ -188,6 +188,7 @@ extern void unpeer (struct peer *); extern void clear_all (void); extern int score_all (struct peer *); extern struct peer *findmanycastpeer(struct recvbuf *); +extern void peer_cleanup (void); /* ntp_crypto.c */ #ifdef AUTOKEY @@ -385,7 +386,8 @@ extern endpt * ep_list; /* linked list */ /* ntp_loopfilter.c */ extern double drift_comp; /* clock frequency (s/s) */ extern double clock_stability; /* clock stability (s/s) */ -extern double clock_max; /* max offset before step (s) */ +extern double clock_max_back; /* max backward offset before step (s) */ +extern double clock_max_fwd; /* max forward offset before step (s) */ extern double clock_panic; /* max offset before panic (s) */ extern double clock_phi; /* dispersion rate (s/s) */ extern double clock_minstep; /* step timeout (s) */ @@ -403,8 +405,9 @@ extern int kern_enable; /* kernel support enabled */ extern int hardpps_enable; /* kernel PPS discipline enabled */ extern int ext_enable; /* external clock enabled */ extern int cal_enable; /* refclock calibrate enable */ -extern int allow_panic; /* allow panic correction */ -extern int mode_ntpdate; /* exit on first clock set */ +extern int allow_panic; /* allow panic correction (-g) */ +extern int force_step_once; /* always step time once at startup (-G) */ +extern int mode_ntpdate; /* exit on first clock set (-q) */ extern int peer_ntpdate; /* count of ntpdate peers */ /* @@ -518,7 +521,7 @@ extern u_int32 conf_file_sum; /* Simple sum of characters */ /* ntp_signd.c */ #ifdef HAVE_NTP_SIGND -extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int, +extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int, struct pkt *); #endif diff --git a/contrib/ntp/include/parse.h b/contrib/ntp/include/parse.h index 3a98408f07dea..ca6855d18e585 100644 --- a/contrib/ntp/include/parse.h +++ b/contrib/ntp/include/parse.h @@ -4,7 +4,7 @@ * parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -105,6 +105,13 @@ extern unsigned int splclock (void); #endif /* + * some constants useful for GPS time conversion + */ +#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */ +#define GPSWRAP 990U /* assume week count less than this in the previous epoch */ +#define GPSWEEKS 1024U /* number of weeks until the GPS epch rolls over */ + +/* * state flags */ #define PARSEB_POWERUP 0x00000001 /* no synchronisation */ @@ -127,7 +134,7 @@ extern unsigned int splclock (void); /* * optional status information */ -#define PARSEB_ALTERNATE 0x00001000 /* alternate antenna used */ +#define PARSEB_CALLBIT 0x00001000 /* "call bit" used to signalize irregularities in the control facilities */ #define PARSEB_POSITION 0x00002000 /* position available */ #define PARSEB_MESSAGE 0x00004000 /* addtitional message data */ /* @@ -145,7 +152,7 @@ extern unsigned int splclock (void); #define PARSEB_PPS 0x20000000 /* valid PPS sample */ #define PARSE_TCINFO (PARSEB_ANNOUNCE|PARSEB_POWERUP|PARSEB_NOSYNC|PARSEB_DST|\ - PARSEB_UTC|PARSEB_LEAPS|PARSEB_ALTERNATE|PARSEB_S_LEAP|\ + PARSEB_UTC|PARSEB_LEAPS|PARSEB_CALLBIT|PARSEB_S_LEAP|\ PARSEB_S_LOCATION|PARSEB_TIMECODE|PARSEB_MESSAGE) #define PARSE_POWERUP(x) ((x) & PARSEB_POWERUP) @@ -156,7 +163,7 @@ extern unsigned int splclock (void); #define PARSE_UTC(x) ((x) & PARSEB_UTC) #define PARSE_LEAPADD(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPADD)) #define PARSE_LEAPDEL(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPDEL)) -#define PARSE_ALTERNATE(x) ((x) & PARSEB_ALTERNATE) +#define PARSE_CALLBIT(x) ((x) & PARSEB_CALLBIT) #define PARSE_LEAPSECOND(x) (PARSE_SYNC(x) && ((x) & PARSEB_LEAP_SECOND)) #define PARSE_S_LEAP(x) ((x) & PARSEB_S_LEAP) @@ -229,13 +236,13 @@ typedef struct parsetime parsetime_t; #define PARSE_IO_CSIZE 0x00000003 #define PARSE_IO_CS5 0x00000000 #define PARSE_IO_CS6 0x00000001 -#define PARSE_IO_CS7 0x00000002 -#define PARSE_IO_CS8 0x00000003 +#define PARSE_IO_CS7 0x00000002 +#define PARSE_IO_CS8 0x00000003 /* * ioctl structure */ -union parsectl +union parsectl { struct parsegettc { @@ -258,7 +265,7 @@ union parsectl u_long parse_cs; /* character size (needed for stripping) */ } parsesetcs; }; - + typedef union parsectl parsectl_t; /*------ for conversion routines --------*/ @@ -266,7 +273,7 @@ typedef union parsectl parsectl_t; struct parse /* parse module local data */ { int parse_flags; /* operation and current status flags */ - + int parse_ioflags; /* io handling flags (5-8 Bit control currently) */ /* @@ -286,7 +293,7 @@ struct parse /* parse module local data */ char *parse_ldata; /* last data buffer */ unsigned short parse_ldsize; /* last data buffer length */ u_long parse_badformat; /* number of unparsable pakets */ - + timestamp_t parse_lastchar; /* last time a character was received */ parsetime_t parse_dtime; /* external data prototype */ }; @@ -337,15 +344,19 @@ typedef struct clocktime clocktime_t; #define SYNC_ZERO 0x00 #define SYNC_ONE 0x01 +typedef u_long parse_inp_fnc_t(parse_t *, char, timestamp_t *); +typedef u_long parse_cvt_fnc_t(unsigned char *, int, struct format *, clocktime_t *, void *); +typedef u_long parse_pps_fnc_t(parse_t *, int, timestamp_t *); + struct clockformat { /* special input protocol - implies fixed format */ - u_long (*input) (parse_t *, unsigned int, timestamp_t *); + parse_inp_fnc_t *input; /* conversion routine */ - u_long (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *); + parse_cvt_fnc_t *convert; /* routine for handling RS232 sync events (time stamps) */ /* PPS input routine */ - u_long (*syncpps) (parse_t *, int, timestamp_t *); + parse_pps_fnc_t *syncpps; /* time code synthesizer */ void *data; /* local parameters */ @@ -361,7 +372,7 @@ typedef struct clockformat clockformat_t; */ extern int parse_ioinit (parse_t *); extern void parse_ioend (parse_t *); -extern int parse_ioread (parse_t *, unsigned int, timestamp_t *); +extern int parse_ioread (parse_t *, char, timestamp_t *); extern int parse_iopps (parse_t *, int, timestamp_t *); extern void parse_iodone (parse_t *); extern int parse_timecode (parsectl_t *, parse_t *); @@ -369,8 +380,8 @@ extern int parse_getfmt (parsectl_t *, parse_t *); extern int parse_setfmt (parsectl_t *, parse_t *); extern int parse_setcs (parsectl_t *, parse_t *); -extern unsigned int parse_restart (parse_t *, unsigned int); -extern unsigned int parse_addchar (parse_t *, unsigned int); +extern unsigned int parse_restart (parse_t *, char); +extern unsigned int parse_addchar (parse_t *, char); extern unsigned int parse_end (parse_t *); extern int Strok (const unsigned char *, const unsigned char *); @@ -379,9 +390,9 @@ extern int Stoi (const unsigned char *, long *, int); extern time_t parse_to_unixtime (clocktime_t *, u_long *); extern u_long updatetimeinfo (parse_t *, u_long); extern void syn_simple (parse_t *, timestamp_t *, struct format *, u_long); -extern u_long pps_simple (parse_t *, int, timestamp_t *); -extern u_long pps_one (parse_t *, int, timestamp_t *); -extern u_long pps_zero (parse_t *, int, timestamp_t *); +extern parse_pps_fnc_t pps_simple; +extern parse_pps_fnc_t pps_one; +extern parse_pps_fnc_t pps_zero; extern int parse_timedout (parse_t *, timestamp_t *, struct timeval *); #endif diff --git a/contrib/ntp/include/parse_conf.h b/contrib/ntp/include/parse_conf.h index 319dd543c43c9..d17d616a48457 100644 --- a/contrib/ntp/include/parse_conf.h +++ b/contrib/ntp/include/parse_conf.h @@ -4,7 +4,7 @@ * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,13 +41,13 @@ /* * field location structure */ -#define O_DAY 0 +#define O_DAY 0 #define O_MONTH 1 -#define O_YEAR 2 -#define O_HOUR 3 -#define O_MIN 4 -#define O_SEC 5 -#define O_WDAY 6 +#define O_YEAR 2 +#define O_HOUR 3 +#define O_MIN 4 +#define O_SEC 5 +#define O_WDAY 6 #define O_FLAGS 7 #define O_ZONE 8 #define O_UTCHOFFSET 9 diff --git a/contrib/ntp/kernel/Makefile.in b/contrib/ntp/kernel/Makefile.in index 5c85def062fdd..2147529a1a837 100644 --- a/contrib/ntp/kernel/Makefile.in +++ b/contrib/ntp/kernel/Makefile.in @@ -38,8 +38,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -68,6 +67,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -324,6 +325,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/kernel/sys/Makefile.in b/contrib/ntp/kernel/sys/Makefile.in index 83334765ee471..2e8f990bbb41f 100644 --- a/contrib/ntp/kernel/sys/Makefile.in +++ b/contrib/ntp/kernel/sys/Makefile.in @@ -40,8 +40,7 @@ DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -289,6 +290,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/kernel/sys/parsestreams.h b/contrib/ntp/kernel/sys/parsestreams.h index e784f9e8b37a9..bd40093d362c5 100644 --- a/contrib/ntp/kernel/sys/parsestreams.h +++ b/contrib/ntp/kernel/sys/parsestreams.h @@ -4,7 +4,7 @@ * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/contrib/ntp/lib/isc/inet_ntop.c b/contrib/ntp/lib/isc/inet_ntop.c index 26d5dcad1f0a6..773018031b9d3 100644 --- a/contrib/ntp/lib/isc/inet_ntop.c +++ b/contrib/ntp/lib/isc/inet_ntop.c @@ -135,6 +135,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; + best.len = cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) diff --git a/contrib/ntp/lib/isc/log.c b/contrib/ntp/lib/isc/log.c index ce98303fecafd..38f0c4ff51e68 100644 --- a/contrib/ntp/lib/isc/log.c +++ b/contrib/ntp/lib/isc/log.c @@ -1143,7 +1143,7 @@ sync_channellist(isc_logconfig_t *lcfg) { static isc_result_t greatest_version(isc_logchannel_t *channel, int *greatestp) { /* XXXDCL HIGHLY NT */ - char *basename, *digit_end; + char *basenam, *digit_end; const char *dirname; int version, greatest = -1; unsigned int basenamelen; @@ -1160,23 +1160,23 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { * It is safe to DE_CONST the file.name because it was copied * with isc_mem_strdup in isc_log_createchannel. */ - basename = strrchr(FILE_NAME(channel), sep); + basenam = strrchr(FILE_NAME(channel), sep); #ifdef _WIN32 basename2 = strrchr(FILE_NAME(channel), '\\'); - if ((basename != NULL && basename2 != NULL && basename2 > basename) || - (basename == NULL && basename2 != NULL)) { - basename = basename2; + if ((basenam != NULL && basename2 != NULL && basename2 > basenam) || + (basenam == NULL && basename2 != NULL)) { + basenam = basename2; sep = '\\'; } #endif - if (basename != NULL) { - *basename++ = '\0'; + if (basenam != NULL) { + *basenam++ = '\0'; dirname = FILE_NAME(channel); } else { - DE_CONST(FILE_NAME(channel), basename); + DE_CONST(FILE_NAME(channel), basenam); dirname = "."; } - basenamelen = strlen(basename); + basenamelen = strlen(basenam); isc_dir_init(&dir); result = isc_dir_open(&dir, dirname); @@ -1184,8 +1184,8 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { /* * Replace the file separator if it was taken out. */ - if (basename != FILE_NAME(channel)) - *(basename - 1) = sep; + if (basenam != FILE_NAME(channel)) + *(basenam - 1) = sep; /* * Return if the directory open failed. @@ -1195,7 +1195,7 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { while (isc_dir_read(&dir) == ISC_R_SUCCESS) { if (dir.entry.length > basenamelen && - strncmp(dir.entry.name, basename, basenamelen) == 0 && + strncmp(dir.entry.name, basenam, basenamelen) == 0 && dir.entry.name[basenamelen] == '.') { version = strtol(&dir.entry.name[basenamelen + 1], diff --git a/contrib/ntp/lib/isc/result.c b/contrib/ntp/lib/isc/result.c index 520f1613acd17..da57272dfc271 100644 --- a/contrib/ntp/lib/isc/result.c +++ b/contrib/ntp/lib/isc/result.c @@ -172,7 +172,7 @@ const char * isc_result_totext(isc_result_t result) { resulttable *table; const char *txt, *default_text; - int index; + int idx; initialize(); @@ -183,15 +183,15 @@ isc_result_totext(isc_result_t result) { table != NULL; table = ISC_LIST_NEXT(table, link)) { if (result >= table->base && result <= table->last) { - index = (int)(result - table->base); - default_text = table->text[index]; + idx = (int)(result - table->base); + default_text = table->text[idx]; /* - * Note: we use 'index + 1' as the message number - * instead of index because isc_msgcat_get() requires + * Note: we use 'idx + 1' as the message number + * instead of idx because isc_msgcat_get() requires * the message number to be > 0. */ txt = isc_msgcat_get(table->msgcat, table->set, - index + 1, default_text); + idx + 1, default_text); break; } } diff --git a/contrib/ntp/lib/isc/unix/file.c b/contrib/ntp/lib/isc/unix/file.c index 3b59e86b07555..9eda4a33bc806 100644 --- a/contrib/ntp/lib/isc/unix/file.c +++ b/contrib/ntp/lib/isc/unix/file.c @@ -508,7 +508,7 @@ isc_file_safecreate(const char *filename, FILE **fp) { } isc_result_t -isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) +isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam) { char *dir, *file, *slash; @@ -537,8 +537,8 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) return (ISC_R_INVALIDFILE); } - *dirname = dir; - *basename = file; + *dirnam = dir; + *basenam = file; return (ISC_R_SUCCESS); } diff --git a/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c b/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c index c2e4044ac0088..425b9b4c3d355 100644 --- a/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c +++ b/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c @@ -212,6 +212,9 @@ internal_current(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr, ifa->ifa_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } diff --git a/contrib/ntp/lib/isc/unix/ifiter_ioctl.c b/contrib/ntp/lib/isc/unix/ifiter_ioctl.c index a684867ce71f9..c8e4970e6b335 100644 --- a/contrib/ntp/lib/isc/unix/ifiter_ioctl.c +++ b/contrib/ntp/lib/isc/unix/ifiter_ioctl.c @@ -109,6 +109,10 @@ struct isc_interfaceiter { #endif #endif +/* Silence a warning when this file is #included */ +int +isc_ioctl(int fildes, int req, char *arg); + int isc_ioctl(int fildes, int req, char *arg) { int trys; @@ -588,6 +592,9 @@ internal_current4(isc_interfaceiter_t *iter) { } iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff; } +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); inet: @@ -664,6 +671,9 @@ internal_current4(isc_interfaceiter_t *iter) { } get_addr(family, &iter->current.netmask, (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } @@ -704,7 +714,6 @@ internal_current6(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.address, (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); - iter->current.ifindex = lifreq.lifr_index; if (isc_netaddr_islinklocal(&iter->current.address)) isc_netaddr_setzone(&iter->current.address, (isc_uint32_t)lifreq.lifr_index); @@ -844,7 +853,9 @@ internal_current6(isc_interfaceiter_t *iter) { iter->current.netmask.type.in6.s6_addr[i / 8] = (~0 << bits) & 0xff; } - +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } #endif @@ -867,6 +878,9 @@ internal_current6(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.netmask, (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } #endif diff --git a/contrib/ntp/lib/isc/unix/net.c b/contrib/ntp/lib/isc/unix/net.c index 2ba17d165067c..7056668ca0cd4 100644 --- a/contrib/ntp/lib/isc/unix/net.c +++ b/contrib/ntp/lib/isc/unix/net.c @@ -106,7 +106,8 @@ const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; static isc_once_t once_ipv6only = ISC_ONCE_INIT; # endif -# if defined(ISC_PLATFORM_HAVEIN6PKTINFO) +# if defined(ISC_PLATFORM_HAVEIPV6) && \ + defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; # endif #endif /* ISC_PLATFORM_HAVEIPV6 */ diff --git a/contrib/ntp/libntp/Makefile.in b/contrib/ntp/libntp/Makefile.in index 0ff8c52e88ed1..1b451169e1719 100644 --- a/contrib/ntp/libntp/Makefile.in +++ b/contrib/ntp/libntp/Makefile.in @@ -41,8 +41,7 @@ subdir = libntp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -444,6 +445,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/libntp/ntp_calendar.c b/contrib/ntp/libntp/ntp_calendar.c index 94ca0e9ee154b..ff91fcfc678d7 100644 --- a/contrib/ntp/libntp/ntp_calendar.c +++ b/contrib/ntp/libntp/ntp_calendar.c @@ -29,7 +29,7 @@ ntpcal_set_timefunc( ) { systime_func_ptr res; - + res = systime_func; if (NULL == nfunc) nfunc = &time; @@ -118,7 +118,7 @@ vint64_to_time( #endif return res; -} +} /* *--------------------------------------------------------------------- @@ -170,7 +170,7 @@ ntpcal_get_build_date( #ifdef DEBUG static int ignore = 0; #endif - + ZERO(*jd); jd->year = 1970; jd->month = 1; @@ -255,7 +255,7 @@ static const uint16_t real_month_table[2][13] = { * in the proleptic Gregorian calendar. The begin of the Christian Era * (0001-01-01) is RD(1). * - * + * * Some notes on the implementation: * * Calendar algorithms thrive on the division operation, which is one of @@ -351,7 +351,7 @@ ntpcal_periodic_extend( char cpl = 0; /* modulo complement flag */ char neg = 0; /* sign change flag */ - /* make the cycle positive and adjust the flags */ + /* make the cycle positive and adjust the flags */ if (cycle < 0) { cycle = - cycle; neg ^= 1; @@ -407,21 +407,21 @@ ntpcal_ntp_to_time( #ifdef HAVE_INT64 - res.q_s = (pivot != NULL) + res.q_s = (pivot != NULL) ? *pivot - : now(); + : now(); res.Q_s -= 0x80000000; /* unshift of half range */ ntp -= (uint32_t)JAN_1970; /* warp into UN*X domain */ ntp -= res.D_s.lo; /* cycle difference */ res.Q_s += (uint64_t)ntp; /* get expanded time */ #else /* no 64bit scalars */ - + time_t tmp; - - tmp = (pivot != NULL) + + tmp = (pivot != NULL) ? *pivot - : now(); + : now(); res = time_to_vint64(&tmp); M_SUB(res.D_s.hi, res.D_s.lo, 0, 0x80000000); ntp -= (uint32_t)JAN_1970; /* warp into UN*X domain */ @@ -465,9 +465,9 @@ ntpcal_ntp_to_ntp( res.Q_s += (uint64_t)ntp; /* get expanded time */ #else /* no 64bit scalars */ - + time_t tmp; - + tmp = (pivot) ? *pivot : now(); @@ -492,7 +492,7 @@ ntpcal_ntp_to_ntp( */ /* - *------------------------------------------------------------------- + *------------------------------------------------------------------- * Split a 64bit seconds value into elapsed days in 'res.hi' and * elapsed seconds since midnight in 'res.lo' using explicit floor * division. This function happily accepts negative time values as @@ -532,7 +532,7 @@ ntpcal_daysplit( isneg = M_ISNEG(op.D_s.hi); if (isneg) M_NEG(op.D_s.hi, op.D_s.lo); - + /* save remainder of DIV 128, shift for divide */ r = op.D_s.lo & 127; /* save remainder bits */ op.D_s.lo = (op.D_s.lo >> 7) | (op.D_s.hi << 25); @@ -572,16 +572,16 @@ ntpcal_daysplit( } else q = ~q + 1; } - + res.hi = q; res.lo = r; -#endif +#endif return res; } /* - *------------------------------------------------------------------- + *------------------------------------------------------------------- * Split a 32bit seconds value into h/m/s and excessive days. This * function happily accepts negative time values as timestamps before * midnight. @@ -632,7 +632,7 @@ ntpcal_split_eradays( { ntpcal_split res; int32_t n400, n100, n004, n001, yday; /* calendar year cycles */ - + /* * Split off calendar cycles, using floor division in the first * step. After that first step, simple division does it because @@ -652,7 +652,7 @@ ntpcal_split_eradays( yday = yday % GREGORIAN_NORMAL_LEAP_CYCLE_DAYS; n001 = yday / DAYSPERYEAR; yday = yday % DAYSPERYEAR; - + /* * check for leap cycle overflows and calculate the leap flag * if needed @@ -665,11 +665,11 @@ ntpcal_split_eradays( *isleapyear = 1; } else if (isleapyear) *isleapyear = (n001 == 3) && ((n004 != 24) || (n100 == 3)); - + /* now merge the cycles to elapsed years, using horner scheme */ res.hi = ((4*n400 + n100)*25 + n004)*4 + n001; res.lo = yday; - + return res; } @@ -724,7 +724,13 @@ ntpcal_rd_to_date( leaps = 0; retv = 0; - /* get day-of-week first */ + /* Get day-of-week first. Since rd is signed, the remainder can + * be in the range [-6..+6], but the assignment to an unsigned + * variable maps the negative values to positive values >=7. + * This makes the sign correction look strange, but adding 7 + * causes the needed wrap-around into the desired value range of + * zero to six, both inclusive. + */ jd->weekday = rd % 7; if (jd->weekday >= 7) /* unsigned! */ jd->weekday += 7; @@ -794,7 +800,7 @@ ntpcal_daysec_to_date( { int32_t days; int ts[3]; - + days = priv_timesplit(ts, sec); jd->hour = (uint8_t)ts[0]; jd->minute = (uint8_t)ts[1]; @@ -817,7 +823,7 @@ ntpcal_daysec_to_tm( { int32_t days; int32_t ts[3]; - + days = priv_timesplit(ts, sec); utm->tm_hour = ts[0]; utm->tm_min = ts[1]; @@ -946,7 +952,7 @@ ntpcal_dayjoin( /* fix sign */ if (isneg) M_NEG(res.D_s.hi, res.D_s.lo); - + /* properly add seconds */ p2 = 0; if (secs < 0) { @@ -957,7 +963,7 @@ ntpcal_dayjoin( } M_ADD(res.D_s.hi, res.D_s.lo, p2, p1); -#endif +#endif return res; } @@ -1279,7 +1285,7 @@ ntpcal_ntp64_to_date( ) { ntpcal_split ds; - + ds = ntpcal_daysplit(ntp); ds.hi += ntpcal_daysec_to_date(jd, ds.lo); @@ -1294,7 +1300,7 @@ ntpcal_ntp_to_date( ) { vint64 ntp64; - + /* * Unfold ntp time around current time into NTP domain. Split * into days and seconds, shift days into CE domain and @@ -1516,12 +1522,12 @@ isocal_split_eraweeks( res.lo += (res.lo >= 10435); cents = res.lo / 5218; res.lo %= 5218; /* res.lo is weeks in century now */ - + /* convert elapsed weeks in century to elapsed years and weeks */ res.lo = res.lo * 157 + bctab[cents]; res.hi += cents * 100 + res.lo / 8192; - res.lo = (res.lo % 8192) / 157; - + res.lo = (res.lo % 8192) / 157; + return res; } @@ -1538,7 +1544,7 @@ isocal_ntp64_to_date( { ntpcal_split ds; int32_t ts[3]; - + /* * Split NTP time into days and seconds, shift days into CE * domain and process the parts. @@ -1576,7 +1582,7 @@ isocal_ntp_to_date( ) { vint64 ntp64; - + /* * Unfold ntp time around current time into NTP domain, then * convert the full time stamp. diff --git a/contrib/ntp/libntp/work_fork.c b/contrib/ntp/libntp/work_fork.c index 10329e70be8f4..dab02bc6af148 100644 --- a/contrib/ntp/libntp/work_fork.c +++ b/contrib/ntp/libntp/work_fork.c @@ -382,7 +382,7 @@ fork_blocking_child( int rc; int was_pipe; int is_pipe; - int saved_errno; + int saved_errno = 0; int childpid; int keep_fd; int fd; diff --git a/contrib/ntp/libparse/Makefile.in b/contrib/ntp/libparse/Makefile.in index 1594eb13865be..d473a77e76d09 100644 --- a/contrib/ntp/libparse/Makefile.in +++ b/contrib/ntp/libparse/Makefile.in @@ -43,8 +43,7 @@ subdir = libparse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -73,6 +72,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -352,6 +353,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/libparse/clk_computime.c b/contrib/ntp/libparse/clk_computime.c index 1068576f88aa9..5026232ea5f00 100644 --- a/contrib/ntp/libparse/clk_computime.c +++ b/contrib/ntp/libparse/clk_computime.c @@ -7,15 +7,15 @@ * /src/NTP/ntp4-dev/libparse/clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * Supports Diem's Computime Radio Clock - * + * * Used the Meinberg clock as a template for Diem's Computime Radio Clock * * adapted by Alois Camenzind <alois.camenzind@ubs.ch> - * + * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,22 +59,22 @@ extern int printf (const char *, ...); /* * The Computime receiver sends a datagram in the following format every minute - * - * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF + * + * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF * Pos 0123456789012345678901 2 3 * 0000000000111111111122 2 2 * Parse T: : : : : : : rn - * - * T Startcharacter "T" specifies start of the timestamp - * YY Year MM Month 1-12 - * MD Day of the month - * WD Day of week - * HH Hour - * MM Minute + * + * T Startcharacter "T" specifies start of the timestamp + * YY Year MM Month 1-12 + * MD Day of the month + * WD Day of week + * HH Hour + * MM Minute * SS Second - * CR Carriage return + * CR Carriage return * LF Linefeed - * + * */ static struct format computime_fmt = @@ -88,10 +88,10 @@ static struct format computime_fmt = 0 }; -static u_long cvt_computime (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_computime (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_computime; +static parse_inp_fnc_t inp_computime; -clockformat_t clock_computime = +clockformat_t clock_computime = { inp_computime, /* Computime input handling */ cvt_computime, /* Computime conversion */ @@ -99,15 +99,15 @@ clockformat_t clock_computime = (void *)&computime_fmt, /* conversion configuration */ "Diem's Computime Radio Clock", /* Computime Radio Clock */ 24, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; /* - * cvt_computime - * + * parse_cvt_fnc_t cvt_computime + * * convert simple type format */ -static u_long +static u_long cvt_computime( unsigned char *buffer, int size, @@ -117,7 +117,7 @@ cvt_computime( ) { - if (!Strok(buffer, format->fixed_string)) { + if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, @@ -131,7 +131,7 @@ cvt_computime( Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute, format->field_offsets[O_MIN].length) || Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second, - format->field_offsets[O_SEC].length)) { + format->field_offsets[O_SEC].length)) { return CVT_FAIL | CVT_BADFMT; } else { @@ -144,31 +144,31 @@ cvt_computime( } /* - * inp_computime + * parse_inp_fnc_t inp_computime * - * grep data from input stream + * grab data from input stream */ static u_long inp_computime( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_computime(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case 'T': parseprintf(DD_PARSE, ("inp_computime: START seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case '\n': parseprintf(DD_PARSE, ("inp_computime: END seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) diff --git a/contrib/ntp/libparse/clk_dcf7000.c b/contrib/ntp/libparse/clk_dcf7000.c index bfd9a744acb36..f1da9ef8484e0 100644 --- a/contrib/ntp/libparse/clk_dcf7000.c +++ b/contrib/ntp/libparse/clk_dcf7000.c @@ -1,12 +1,12 @@ /* * /src/NTP/ntp4-dev/libparse/clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * ELV DCF7000 module * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -63,9 +63,10 @@ static struct format dcf7000_fmt = }, (const unsigned char *)" - - - - - - - \r", 0 -}; -static u_long cvt_dcf7000 (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_dcf7000 (parse_t *, unsigned int, timestamp_t *); +}; + +static parse_cvt_fnc_t cvt_dcf7000; +static parse_inp_fnc_t inp_dcf7000; clockformat_t clock_dcf7000 = { @@ -75,11 +76,11 @@ clockformat_t clock_dcf7000 = (void *)&dcf7000_fmt, /* conversion configuration */ "ELV DCF7000", /* ELV clock */ 24, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; /* - * cvt_dcf7000 + * parse_cvt_fnc_t cvt_dcf7000 * * convert dcf7000 type format */ @@ -117,7 +118,7 @@ cvt_dcf7000( { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; long flags; - + clock_time->flags = 0; clock_time->usecond = 0; @@ -144,21 +145,21 @@ cvt_dcf7000( } /* - * inp_dcf700 + * parse_inp_fnc_t inp_dcf700 * - * grep data from input stream + * grab data from input stream */ static u_long inp_dcf7000( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '\r': diff --git a/contrib/ntp/libparse/clk_hopf6021.c b/contrib/ntp/libparse/clk_hopf6021.c index 033d2d2ca4e71..357ac2ec0f15f 100644 --- a/contrib/ntp/libparse/clk_hopf6021.c +++ b/contrib/ntp/libparse/clk_hopf6021.c @@ -37,10 +37,10 @@ extern int printf (const char *, ...); #endif -/* - * hopf Funkuhr 6021 +/* + * hopf Funkuhr 6021 * used with 9600,8N1, - * UTC ueber serielle Schnittstelle + * UTC ueber serielle Schnittstelle * Sekundenvorlauf ON * ETX zum Sekundenvorlauf ON * Datenstring 6021 @@ -71,7 +71,7 @@ extern int printf (const char *, ...); * x x 0 x - Wintertime * x x 1 x - Summertime * 0 0 x x - Time/Date invalid - * 0 1 x x - Internal clock used + * 0 1 x x - Internal clock used * 1 0 x x - Radio clock * 1 1 x x - Radio clock highprecision * @@ -90,10 +90,10 @@ extern int printf (const char *, ...); #define HOPF_DSTWARN 0x01 /* DST switch warning */ #define HOPF_DST 0x02 /* DST in effect */ -#define HOPF_MODE 0x0C /* operation mode mask */ +#define HOPF_MODE 0x0C /* operation mode mask */ #define HOPF_INVALID 0x00 /* no time code available */ #define HOPF_INTERNAL 0x04 /* internal clock */ -#define HOPF_RADIO 0x08 /* radio clock */ +#define HOPF_RADIO 0x08 /* radio clock */ #define HOPF_RADIOHP 0x0C /* high precision radio clock */ #define HOPF_UTC 0x08 /* time code in UTC */ @@ -102,13 +102,13 @@ extern int printf (const char *, ...); static struct format hopf6021_fmt = { { - { 9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */ - { 3, 2 }, { 5, 2}, { 7, 2}, /* Hour, Minute, Second */ + { 9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */ + { 3, 2 }, { 5, 2}, { 7, 2}, /* Hour, Minute, Second */ { 2, 1 }, { 1, 1}, { 0, 0}, /* Weekday, Flags, Zone */ /* ... */ }, (const unsigned char *)"\002 \n\r\003", - 0 + 0 }; #define OFFS(x) format->field_offsets[(x)].offset @@ -118,8 +118,8 @@ static struct format hopf6021_fmt = ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \ -1) -static unsigned long cvt_hopf6021 (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_hopf6021 (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_hopf6021; +static parse_inp_fnc_t inp_hopf6021; clockformat_t clock_hopf6021 = { @@ -132,7 +132,8 @@ clockformat_t clock_hopf6021 = 0 /* private data length, no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_hopf6021 */ +static u_long cvt_hopf6021( unsigned char *buffer, int size, @@ -162,8 +163,8 @@ cvt_hopf6021( clock_time->usecond = 0; clock_time->utcoffset = 0; - status = hexval(buffer[OFFS(O_FLAGS)]); - weekday= hexval(buffer[OFFS(O_WDAY)]); + status = (u_char) hexval(buffer[OFFS(O_FLAGS)]); + weekday= (u_char) hexval(buffer[OFFS(O_WDAY)]); if ((status == 0xFF) || (weekday == 0xFF)) { @@ -213,21 +214,21 @@ cvt_hopf6021( } /* - * inp_hopf6021 + * parse_inp_fnc_t inp_hopf6021 * - * grep data from input stream + * grab data from input stream */ static u_long inp_hopf6021( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case ETX: diff --git a/contrib/ntp/libparse/clk_meinberg.c b/contrib/ntp/libparse/clk_meinberg.c index a94c3f7a2edd0..4047be5e7314f 100644 --- a/contrib/ntp/libparse/clk_meinberg.c +++ b/contrib/ntp/libparse/clk_meinberg.c @@ -1,12 +1,12 @@ /* * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A - * + * * clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A * * Meinberg clock support * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,7 +65,7 @@ /* * The Meinberg receiver every second sends a datagram of the following form * (Standard Format) - * + * * <STX>D:<dd>.<mm>.<yy>;T:<w>;U:<hh>:<mm>:<ss>;<S><F><D><A><ETX> * pos: 0 00 00 0 00 0 11 111 1 111 12 2 22 2 22 2 2 2 3 3 3 * 1 23 45 6 78 9 01 234 5 678 90 1 23 4 56 7 8 9 0 1 2 @@ -105,12 +105,14 @@ * <A> = '!' during the hour preceeding an daylight saving time * start/end change * <L> = 'A' LEAP second announcement - * <R> = 'R' alternate antenna + * <R> = 'R' "call bit" used to signalize irregularities in the control facilities, + * usually ' ', until 2003 indicated transmission via alternate antenna * - * Meinberg GPS166 receiver + * Meinberg GPS receivers * - * You must get the Uni-Erlangen firmware for the GPS receiver support + * For very old devices you must get the Uni-Erlangen firmware for the GPS receiver support * to work to full satisfaction ! + * With newer GPS receiver types the Uni Erlangen string format can be configured at the device. * * <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX> * @@ -118,7 +120,7 @@ * 123456789012345678901234567890123456789012345678901234567890123456 * \x0209.07.93; 5; 08:48:26; +00:00; #*S!A L; 49.5736N 11.0280E 373m\x03 * - * + * * <STX> = '\002' ASCII start of text * <ETX> = '\003' ASCII end of text * <dd>,<mm>,<yy> = day, month, year(2 digits!!) @@ -131,8 +133,10 @@ * <A> = '!' during the hour preceeding an daylight saving time * start/end change * <L> = 'A' LEAP second announcement - * <R> = 'R' alternate antenna (reminiscent of PZF535) usually ' ' - * <L> = 'L' on 23:59:60 + * <R> = 'R' "call bit" used to signalize irregularities in the control facilities, + * usually ' ', until 2003 indicated transmission via alternate antenna + * (reminiscent of PZF receivers) + * <L> = 'L' on 23:59:60 * * Binary messages have a lead in for a fixed header of SOH */ @@ -150,19 +154,20 @@ /* Ret val: the checksum */ /*+-------------------------------------------------------------*/ -unsigned long +CSUM mbg_csum( unsigned char *p, unsigned int n ) { - unsigned long sum = 0; + unsigned int sum = 0; unsigned int i; - + for ( i = 0; i < n; i++ ) sum += *p++; - - return( sum ); + + return (CSUM) sum; + } /* csum */ void @@ -171,10 +176,10 @@ get_mbg_header( GPS_MSG_HDR *headerp ) { - headerp->gps_cmd = get_lsb_short(bufpp); - headerp->gps_len = get_lsb_short(bufpp); - headerp->gps_data_csum = get_lsb_short(bufpp); - headerp->gps_hdr_csum = get_lsb_short(bufpp); + headerp->cmd = (GPS_CMD) get_lsb_short(bufpp); + headerp->len = get_lsb_uint16(bufpp); + headerp->data_csum = (CSUM) get_lsb_short(bufpp); + headerp->hdr_csum = (CSUM) get_lsb_short(bufpp); } static struct format meinberg_fmt[] = @@ -209,10 +214,10 @@ static struct format meinberg_fmt[] = } }; -static u_long cvt_meinberg (unsigned char *, int, struct format *, clocktime_t *, void *); -static u_long cvt_mgps (unsigned char *, int, struct format *, clocktime_t *, void *); -static u_long mbg_input (parse_t *, unsigned int, timestamp_t *); -static u_long gps_input (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_meinberg; +static parse_cvt_fnc_t cvt_mgps; +static parse_inp_fnc_t mbg_input; +static parse_inp_fnc_t gps_input; struct msg_buf { @@ -224,7 +229,7 @@ struct msg_buf #define MBG_HEADER 1 /* receiving header */ #define MBG_DATA 2 /* receiving data */ #define MBG_STRING 3 /* receiving standard data message */ - + clockformat_t clock_meinberg[] = { { @@ -234,7 +239,7 @@ clockformat_t clock_meinberg[] = 0, /* conversion configuration */ "Meinberg Standard", /* Meinberg simple format - beware */ 32, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }, { mbg_input, /* normal input handling */ @@ -243,21 +248,21 @@ clockformat_t clock_meinberg[] = 0, /* conversion configuration */ "Meinberg Extended", /* Meinberg enhanced format */ 32, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }, { gps_input, /* no input handling */ - cvt_mgps, /* Meinberg GPS166 conversion */ + cvt_mgps, /* Meinberg GPS receiver conversion */ pps_one, /* easy PPS monitoring */ (void *)&meinberg_fmt[2], /* conversion configuration */ - "Meinberg GPS Extended", /* Meinberg FAU GPS format */ + "Meinberg GPS Extended", /* Meinberg FAU GPS format */ 512, /* string buffer */ - sizeof(struct msg_buf) /* no private data (complete pakets) */ + sizeof(struct msg_buf) /* no private data (complete packets) */ } }; /* - * cvt_meinberg + * parse_cvt_fnc_t cvt_meinberg * * convert simple type format */ @@ -271,7 +276,7 @@ cvt_meinberg( ) { struct format *format; - + /* * select automagically correct data format */ @@ -312,7 +317,7 @@ cvt_meinberg( else { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; - + clock_time->usecond = 0; clock_time->flags = PARSEB_S_LEAP; @@ -348,7 +353,7 @@ cvt_meinberg( case ' ': clock_time->utcoffset = -1*60*60; /* MET */ break; - + case 'S': clock_time->utcoffset = -2*60*60; /* MED */ break; @@ -360,27 +365,27 @@ cvt_meinberg( clock_time->utcoffset = 0; /* UTC */ clock_time->flags |= PARSEB_UTC; break; - + default: return CVT_FAIL|CVT_BADFMT; } } - + /* * gather status flags */ if (buffer[format->field_offsets[O_ZONE].offset] == 'S') clock_time->flags |= PARSEB_DST; - + if (f[0] == '#') clock_time->flags |= PARSEB_POWERUP; - + if (f[1] == '*') clock_time->flags |= PARSEB_NOSYNC; - + if (f[3] == '!') clock_time->flags |= PARSEB_ANNOUNCE; - + /* * oncoming leap second * 'a' code not confirmed - earth is not @@ -388,27 +393,27 @@ cvt_meinberg( */ if (f[3] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[3] == 'a') clock_time->flags |= PARSEB_LEAPDEL; - - + + if (format->flags & MBG_EXTENDED) { clock_time->flags |= PARSEB_S_ANTENNA; - + /* * DCF77 does not encode the direction - * so we take the current default - * earth slowing down */ clock_time->flags &= ~PARSEB_LEAPDEL; - + if (f[4] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[5] == 'R') - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; } return CVT_OK; } @@ -416,31 +421,31 @@ cvt_meinberg( /* - * mbg_input + * parse_inp_fnc_t mbg_input * - * grep data from input stream + * grab data from input stream */ static u_long mbg_input( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case STX: parseprintf(DD_PARSE, ("mbg_input: STX seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case ETX: parseprintf(DD_PARSE, ("mbg_input: ETX seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) @@ -455,7 +460,7 @@ mbg_input( /* - * cvt_mgps + * parse_cvt_fnc_t cvt_mgps * * convert Meinberg GPS format */ @@ -493,9 +498,9 @@ cvt_mgps( { long h; unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; - + clock_time->flags = PARSEB_S_LEAP|PARSEB_S_POSITION; - + clock_time->usecond = 0; /* @@ -522,22 +527,22 @@ cvt_mgps( clock_time->utcoffset = -clock_time->utcoffset; } } - + /* * gather status flags */ if (buffer[format->field_offsets[O_ZONE].offset] == 'S') clock_time->flags |= PARSEB_DST; - + if (clock_time->utcoffset == 0) clock_time->flags |= PARSEB_UTC; - + /* * no sv's seen - no time & position */ if (f[0] == '#') clock_time->flags |= PARSEB_POWERUP; - + /* * at least one sv seen - time (for last position) */ @@ -546,13 +551,13 @@ cvt_mgps( else if (!(clock_time->flags & PARSEB_POWERUP)) clock_time->flags |= PARSEB_POSITION; - + /* * oncoming zone switch */ if (f[3] == '!') clock_time->flags |= PARSEB_ANNOUNCE; - + /* * oncoming leap second * 'a' code not confirmed - earth is not @@ -560,14 +565,14 @@ cvt_mgps( */ if (f[4] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[4] == 'a') clock_time->flags |= PARSEB_LEAPDEL; /* * f[5] == ' ' */ - + /* * this is the leap second */ @@ -580,35 +585,35 @@ cvt_mgps( } /* - * gps_input + * parse_inp_fnc_t gps_input * * grep binary data from input stream */ static u_long gps_input( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { CSUM calc_csum; /* used to compare the incoming csums */ GPS_MSG_HDR header; struct msg_buf *msg_buf; - + msg_buf = (struct msg_buf *)parseio->parse_pdata; parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); if (!msg_buf) return PARSE_INP_SKIP; - + if ( msg_buf->phase == MBG_NONE ) { /* not receiving yet */ switch (ch) { case SOH: parseprintf(DD_PARSE, ("gps_input: SOH seen\n")); - + msg_buf->len = sizeof( header ); /* prepare to receive msg header */ msg_buf->phase = MBG_HEADER; /* receiving header */ break; @@ -621,7 +626,7 @@ gps_input( parseio->parse_index = 1; parseio->parse_data[0] = ch; break; - + default: return PARSE_INP_SKIP; /* keep searching */ } @@ -638,7 +643,7 @@ gps_input( if ((msg_buf->phase == MBG_STRING) && (parseio->parse_index < parseio->parse_dsize)) parseio->parse_data[parseio->parse_index++] = ch; - + parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; if (parseio->parse_dtime.parse_msglen > sizeof(parseio->parse_dtime.parse_msg)) @@ -649,7 +654,7 @@ gps_input( parseio->parse_ldsize = parseio->parse_index; return PARSE_INP_DATA; } - + switch (msg_buf->phase) { case MBG_HEADER: @@ -685,41 +690,41 @@ gps_input( if ( msg_buf->phase == MBG_HEADER ) { /* header complete now */ unsigned char *datap = parseio->parse_dtime.parse_msg + 1; - + get_mbg_header(&datap, &header); - + parseprintf(DD_PARSE, ("gps_input: header: cmd 0x%x, len %d, dcsum 0x%x, hcsum 0x%x\n", - (int)header.gps_cmd, (int)header.gps_len, (int)header.gps_data_csum, - (int)header.gps_hdr_csum)); - + (int)header.cmd, (int)header.len, (int)header.data_csum, + (int)header.hdr_csum)); + calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 ); - if ( calc_csum != header.gps_hdr_csum ) + if ( calc_csum != header.hdr_csum ) { parseprintf(DD_PARSE, ("gps_input: header checksum mismatch expected 0x%x, got 0x%x\n", (int)calc_csum, (int)mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg, (unsigned short)6 ))); - + msg_buf->phase = MBG_NONE; /* back to hunting mode */ return PARSE_INP_DATA; /* invalid header checksum received - pass up for detection */ } - if ((header.gps_len == 0) || /* no data to wait for */ - (header.gps_len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */ + if ((header.len == 0) || /* no data to wait for */ + (header.len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */ { msg_buf->phase = MBG_NONE; /* back to hunting mode */ - return (header.gps_len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */ + return (header.len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */ } - - parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.gps_len)); - - msg_buf->len = header.gps_len;/* save number of bytes to wait for */ + + parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.len)); + + msg_buf->len = header.len;/* save number of bytes to wait for */ msg_buf->phase = MBG_DATA; /* flag header already complete */ return PARSE_INP_SKIP; } parseprintf(DD_PARSE, ("gps_input: message data complete\n")); - + /* Header and data have been received. The header checksum has been */ /* checked */ diff --git a/contrib/ntp/libparse/clk_rawdcf.c b/contrib/ntp/libparse/clk_rawdcf.c index d6e4b184c0502..132fbc33146e2 100644 --- a/contrib/ntp/libparse/clk_rawdcf.c +++ b/contrib/ntp/libparse/clk_rawdcf.c @@ -1,12 +1,12 @@ /* * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A - * + * * clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A * * Raw DCF77 pulse clock support * * Copyright (c) 1995-2006 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,7 +75,8 @@ * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free - * 15 R - alternate antenna + * 15 R - "call bit" used to signalize irregularities in the control facilities + * (until 2003 indicated transmission via alternate antenna) * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal @@ -101,9 +102,9 @@ * 59 - usually missing (minute indication), except for leap insertion */ -static u_long pps_rawdcf (parse_t *, int, timestamp_t *); -static u_long cvt_rawdcf (unsigned char *, int, struct format *, clocktime_t *, void *); -static u_long inp_rawdcf (parse_t *, unsigned int, timestamp_t *); +static parse_pps_fnc_t pps_rawdcf; +static parse_cvt_fnc_t cvt_rawdcf; +static parse_inp_fnc_t inp_rawdcf; typedef struct last_tcode { time_t tcode; /* last converted time code */ @@ -127,13 +128,13 @@ static struct dcfparam { const unsigned char *onebits; const unsigned char *zerobits; -} dcfparameter = +} dcfparameter = { (const unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ (const unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ }; -static struct rawdcfcode +static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = @@ -189,7 +190,7 @@ ext_bf( int i, first; first = rawdcfcode[idx].offset; - + for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; @@ -238,7 +239,7 @@ convert_rawdcf( #endif return CVT_NONE; } - + for (i = 0; i < size; i++) { if ((*s != *b) && (*s != *c)) @@ -307,7 +308,7 @@ convert_rawdcf( clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */ if (ext_bf(buffer, DCF_R, dcfprm->zerobits)) - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %d:%d, %d.%d.%d, flags 0x%lx\n", (int)clock_time->hour, (int)clock_time->minute, (int)clock_time->day, (int)clock_time->month,(int) clock_time->year, @@ -327,6 +328,7 @@ convert_rawdcf( } /* + * parse_cvt_fnc_t cvt_rawdcf * raw dcf input routine - needs to fix up 50 baud * characters for 1/0 decision */ @@ -379,7 +381,7 @@ cvt_rawdcf( ch >>= 1; } - *s = i; + *s = (unsigned char) i; histbuf[i]++; cutoff += i; lowmax++; @@ -504,12 +506,12 @@ cvt_rawdcf( } } } - + return rtc; } /* - * pps_rawdcf + * parse_pps_fnc_t pps_rawdcf * * currently a very stupid version - should be extended to decode * also ones and zeros (which is easy) @@ -546,30 +548,30 @@ snt_rawdcf( #else parseio->parse_dtime.parse_time.fp.l_ui++; #endif - + parseprintf(DD_RAWDCF,("parse: snt_rawdcf: time stamp synthesized offset %d seconds\n", parseio->parse_index - 1)); - + return updatetimeinfo(parseio, parseio->parse_lstate); } return CVT_NONE; } /* - * inp_rawdcf + * parse_inp_fnc_t inp_rawdcf * * grab DCF77 data from input stream */ static u_long inp_rawdcf( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */ - + parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ if (parse_timedout(parseio, tstamp, &timeout)) @@ -583,7 +585,7 @@ inp_rawdcf( else { unsigned int rtc; - + rtc = parse_addchar(parseio, ch); if (rtc == PARSE_INP_SKIP) { diff --git a/contrib/ntp/libparse/clk_rcc8000.c b/contrib/ntp/libparse/clk_rcc8000.c index 6dca1660d4450..a690e588b91b3 100644 --- a/contrib/ntp/libparse/clk_rcc8000.c +++ b/contrib/ntp/libparse/clk_rcc8000.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A - * + * * clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A * * Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support @@ -49,16 +49,16 @@ extern int printf (const char *, ...); #define O_USEC O_WDAY static struct format rcc8000_fmt = -{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ - { 0, 2 }, { 3, 2}, { 6, 2}, /* Hour, Minute, Second */ +{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ + { 0, 2 }, { 3, 2}, { 6, 2}, /* Hour, Minute, Second */ { 9, 3 }, {28, 1}, { 0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */ }, - (const unsigned char *)" : : . / / \r\n", + (const unsigned char *)" : : . / / \r\n", /*"15:50:36.534 30/09/94 273 5 A\x0d\x0a" */ - 0 + 0 }; -static unsigned long cvt_rcc8000 (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_rcc8000 (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_rcc8000; +static parse_inp_fnc_t inp_rcc8000; clockformat_t clock_rcc8000 = { @@ -71,7 +71,8 @@ clockformat_t clock_rcc8000 = 0 /* no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_rcc8000 */ +static u_long cvt_rcc8000( unsigned char *buffer, int size, @@ -121,27 +122,27 @@ cvt_rcc8000( clock_time->flags |= PARSEB_POWERUP; clock_time->flags |= PARSEB_UTC; /* British special - guess why 8-) */ - + /* other flags not used */ } return CVT_OK; } /* - * inp_rcc8000 + * parse_inp_fnc_t inp_rcc8000 * - * grep data from input stream + * grab data from input stream */ static u_long inp_rcc8000( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '\n': @@ -150,7 +151,7 @@ inp_rcc8000( return parse_end(parseio); else return rtc; - + default: if (parseio->parse_index == 0) /* take sample at start of message */ diff --git a/contrib/ntp/libparse/clk_schmid.c b/contrib/ntp/libparse/clk_schmid.c index 045f0fcf5a8f6..5e303b94c29a0 100644 --- a/contrib/ntp/libparse/clk_schmid.c +++ b/contrib/ntp/libparse/clk_schmid.c @@ -1,13 +1,13 @@ /* * /src/NTP/ntp4-dev/libparse/clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Schmid clock support * based on information and testing from Adam W. Feigin et. al (Swisstime iis.ethz.ch) * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ extern int printf (const char *, ...); * The command to Schmid's DCF77 clock is a single byte; each bit * allows the user to select some part of the time string, as follows (the * output for the lsb is sent first). - * + * * Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths * Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy * Bit 2: week day, 1 byte (unused here) @@ -82,15 +82,15 @@ extern int printf (const char *, ...); #define WS_TIME 0x01 #define WS_SIGNAL 0x02 -#define WS_ALTERNATE 0x01 +#define WS_CALLBIT 0x01 /* "call bit" used to signalize irregularities in the control facilities */ #define WS_ANNOUNCE 0x02 #define WS_TZ 0x0c #define WS_MET 0x08 #define WS_MEST 0x04 #define WS_LEAP 0x10 -static u_long cvt_schmid (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_schmid (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_schmid; +static parse_inp_fnc_t inp_schmid; clockformat_t clock_schmid = { @@ -103,7 +103,7 @@ clockformat_t clock_schmid = 0, /* no private data (complete messages) */ }; - +/* parse_cvt_fnc_t */ static u_long cvt_schmid( unsigned char *buffer, @@ -155,7 +155,7 @@ cvt_schmid( default: return CVT_FAIL|CVT_BADFMT; } - + if (!(buffer[7] & WS_TIME)) { clock_time->flags |= PARSEB_POWERUP; @@ -168,9 +168,9 @@ cvt_schmid( if (buffer[7] & WS_SIGNAL) { - if (buffer[8] & WS_ALTERNATE) + if (buffer[8] & WS_CALLBIT) { - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; } if (buffer[8] & WS_ANNOUNCE) @@ -185,32 +185,32 @@ cvt_schmid( } clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_ANTENNA; - + return CVT_OK; } } } /* - * inp_schmid + * parse_inp_fnc_t inp_schmid * - * grep data from input stream + * grab data from input stream */ static u_long inp_schmid( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - - switch (ch) + + switch ((uint8_t)ch) { case 0xFD: /* */ - parseprintf(DD_PARSE, ("mbg_input: ETX seen\n")); + parseprintf(DD_PARSE, ("inp_schmid: 0xFD seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else diff --git a/contrib/ntp/libparse/clk_sel240x.c b/contrib/ntp/libparse/clk_sel240x.c index a09d3478dbf66..b1390b4cefb1b 100644 --- a/contrib/ntp/libparse/clk_sel240x.c +++ b/contrib/ntp/libparse/clk_sel240x.c @@ -3,7 +3,7 @@ // Schweitzer Engineering Laboratories, Inc. <opensource@selinc.com> ////////////////////////////////////////////////////////////////////////////// -// Need to have _XOPEN_SOURCE defined for time.h to give the +// Need to have _XOPEN_SOURCE defined for time.h to give the // correct strptime signature. As per feature_test_macros(7), // define this before including any header files. @@ -51,14 +51,8 @@ // a '?'. But we are only going to call it synced when we receive a ' ' ////////////////////////////////////////////////////////////////////////////// -static unsigned long inp_sel240x( parse_t *parseio, - unsigned int ch, - timestamp_t *tstamp); -static unsigned long cvt_sel240x( unsigned char *buffer, - int size, - struct format *format, - clocktime_t *clock_time, - void *local ); +static parse_inp_fnc_t inp_sel240x; +static parse_cvt_fnc_t cvt_sel240x; // Parse clock format structure describing the message above static struct format sel240x_fmt = @@ -94,7 +88,7 @@ clockformat_t clock_sel240x = ////////////////////////////////////////////////////////////////////////////// static unsigned long inp_sel240x( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -139,7 +133,7 @@ cvt_sel240x( unsigned char *buffer, { struct tm ptime; buffer++; - buffer = (unsigned char *) strptime( + buffer = (unsigned char *) strptime( (const char *)buffer, "%Y:%j:%H:%M:%S", &ptime ); if( *(buffer+1) != '\x0d' ) { diff --git a/contrib/ntp/libparse/clk_trimtaip.c b/contrib/ntp/libparse/clk_trimtaip.c index 322d0fa08e894..426e897bec972 100644 --- a/contrib/ntp/libparse/clk_trimtaip.c +++ b/contrib/ntp/libparse/clk_trimtaip.c @@ -6,7 +6,7 @@ * Trimble SV6 clock support - several collected codepieces * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,8 +78,8 @@ extern int printf (const char *, ...); 0 }; -static unsigned long cvt_trimtaip (unsigned char *, int, struct format *, clocktime_t *, void *); -static unsigned long inp_trimtaip (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_trimtaip; +static parse_inp_fnc_t inp_trimtaip; clockformat_t clock_trimtaip = { @@ -92,7 +92,8 @@ clockformat_t clock_trimtaip = 0 /* no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_trimtaip */ +static u_long cvt_trimtaip( unsigned char *buffer, int size, @@ -141,31 +142,31 @@ cvt_trimtaip( } /* - * inp_trimtaip + * parse_inp_fnc_t inp_trimtaip * - * grep data from input stream + * grab data from input stream */ static u_long inp_trimtaip( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_trimtaip(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '>': parseprintf(DD_PARSE, ("inp_trimptaip: START seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case '<': parseprintf(DD_PARSE, ("inp_trimtaip: END seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) diff --git a/contrib/ntp/libparse/clk_trimtsip.c b/contrib/ntp/libparse/clk_trimtsip.c index 743e39c3bc747..6c71d75627ac8 100644 --- a/contrib/ntp/libparse/clk_trimtsip.c +++ b/contrib/ntp/libparse/clk_trimtsip.c @@ -7,7 +7,7 @@ * Thanks to Sven Dietrich for providing test hardware * * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -116,7 +116,7 @@ struct trimble #define STATUS_UNSAFE 1 /* not enough receivers for full precision */ #define STATUS_SYNC 2 /* enough information for good operation */ -static unsigned long inp_tsip (parse_t *, unsigned int, timestamp_t *); +static unsigned long inp_tsip (parse_t *, char, timestamp_t *); static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *); struct clockformat clock_trimtsip = @@ -136,7 +136,7 @@ struct clockformat clock_trimtsip = static unsigned long inp_tsip( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -183,7 +183,7 @@ inp_tsip( /* DLE,ETX -> end of packet */ parseio->parse_data[parseio->parse_index++] = DLE; parseio->parse_data[parseio->parse_index] = ch; - parseio->parse_ldsize = parseio->parse_index+1; + parseio->parse_ldsize = (u_short) (parseio->parse_index + 1); memcpy(parseio->parse_ldata, parseio->parse_data, parseio->parse_ldsize); parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE; parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; @@ -200,13 +200,13 @@ inp_tsip( return PARSE_INP_SKIP; } - -static int + +static short getshort( unsigned char *p ) { - return get_msb_short(&p); + return (short) get_msb_short(&p); } /* @@ -245,7 +245,7 @@ cvt_trimtsip( { unsigned char *bp; cmd = buffer[1]; - + switch(cmd) { case CMD_RCURTIME: @@ -258,15 +258,15 @@ cvt_trimtsip( bp = &mb(0); if (fetch_ieee754(&bp, IEEE_SINGLE, &secs, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; - + if ((secs.l_i <= 0) || (t->t_utcknown == 0)) { clock_time->flags = PARSEB_POWERUP; return CVT_OK; } - if (week < 990) { - week += 1024; + if (week < GPSWRAP) { + week += GPSWEEKS; } /* time OK */ @@ -275,7 +275,7 @@ cvt_trimtsip( bp = &mb(6); if (fetch_ieee754(&bp, IEEE_SINGLE, &utcoffset, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; - + L_SUB(&secs, &utcoffset); /* adjust GPS time to UTC time */ gpstolfp((unsigned short)week, (unsigned short)0, @@ -289,10 +289,10 @@ cvt_trimtsip( if (t->t_leap == ADDSECOND) clock_time->flags |= PARSEB_LEAPADD; - + if (t->t_leap == DELSECOND) clock_time->flags |= PARSEB_LEAPDEL; - + switch (t->t_operable) { case STATUS_SYNC: @@ -307,12 +307,12 @@ cvt_trimtsip( clock_time->flags |= PARSEB_NOSYNC|PARSEB_POWERUP; break; } - + if (t->t_mode == 0) clock_time->flags |= PARSEB_POSITION; - + clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_POSITION; - + return CVT_OK; } /* case 0x41 */ @@ -346,26 +346,26 @@ cvt_trimtsip( { l_fp t0t; unsigned char *lbp; - + /* UTC correction data - derive a leap warning */ - int tls = t->t_gpsutc = getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */ - int tlsf = t->t_gpsutcleap = getshort((unsigned char *)&mb(24)); /* new leap correction */ + int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */ + int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */ + + t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */ + if (t->t_weekleap < GPSWRAP) + t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS); - t->t_weekleap = getshort((unsigned char *)&mb(20)); /* week no of leap correction */ - if (t->t_weekleap < 990) - t->t_weekleap += 1024; + t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */ + t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */ + if (t->t_week < GPSWRAP) + t->t_week = (u_short)(t->t_weekleap + GPSWEEKS); - t->t_dayleap = getshort((unsigned char *)&mb(22)); /* day in week of leap correction */ - t->t_week = getshort((unsigned char *)&mb(18)); /* current week no */ - if (t->t_week < 990) - t->t_week += 1024; - lbp = (unsigned char *)&mb(14); /* last update time */ if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; t->t_utcknown = t0t.l_ui != 0; - + if ((t->t_utcknown) && /* got UTC information */ (tlsf != tls) && /* something will change */ ((t->t_weekleap - t->t_week) < 5)) /* and close in the future */ diff --git a/contrib/ntp/libparse/clk_varitext.c b/contrib/ntp/libparse/clk_varitext.c index 295ce0af7589e..022549e82f4a6 100644 --- a/contrib/ntp/libparse/clk_varitext.c +++ b/contrib/ntp/libparse/clk_varitext.c @@ -9,14 +9,14 @@ * clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Varitext code variant by A.McConnell 1997/01/19 - * + * * Supports Varitext's Radio Clock - * + * * Used the Meinberg/Computime clock as a template for Varitext Radio Clock * * Codebase: * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,31 +67,31 @@ static const u_char VT_LAST_TELEGRAM_OK = 0x20; /* * The Varitext receiver sends a datagram in the following format every minute - * - * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX + * + * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX * Pos 0123456789012345678901 2 3 4567 * 0000000000111111111122 2 2 2222 - * Parse T: : : : : : : \r\n - * - * T Startcharacter "T" specifies start of the timestamp - * YY Year MM Month 1-12 - * MD Day of the month - * WD Day of week - * HH Hour - * MM Minute - * SS Second - * CR Carriage return - * LF Linefeed + * Parse T: : : : : : : \r\n + * + * T Startcharacter "T" specifies start of the timestamp + * YY Year MM Month 1-12 + * MD Day of the month + * WD Day of week + * HH Hour + * MM Minute + * SS Second + * CR Carriage return + * LF Linefeed * ST Status character * Bit 0 - Set= Initialised; Reset=Time Invalid (DO NOT USE) - * Bit 1 - Set= Synchronised; Reset= Unsynchronised - * Bit 2 - Set= Alarm state; Reset= No alarm - * Bit 3 - Set= BST; Reset= GMT - * Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected + * Bit 1 - Set= Synchronised; Reset= Unsynchronised + * Bit 2 - Set= Alarm state; Reset= No alarm + * Bit 3 - Set= BST; Reset= GMT + * Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected * Bit 5 - Set= Last MSF telegram was OK; Reset= Last telegram was in error; - * Bit 6 - Always set + * Bit 6 - Always set * Bit 7 - Unused - * XXX Checksum calculated using Fletcher's method (ignored for now). + * XXX Checksum calculated using Fletcher's method (ignored for now). */ static struct format varitext_fmt = @@ -105,8 +105,8 @@ static struct format varitext_fmt = 0 }; -static u_long cvt_varitext (unsigned char *, int, struct format *, clocktime_t *, void *); -static u_long inp_varitext (parse_t *, unsigned int, timestamp_t *); +static parse_cvt_fnc_t cvt_varitext; +static parse_inp_fnc_t inp_varitext; struct varitext { unsigned char start_found; @@ -128,11 +128,11 @@ clockformat_t clock_varitext = }; /* - * cvt_varitext - * + * parse_cvt_fnc_t cvt_varitext + * * convert simple type format */ -static u_long +static u_long cvt_varitext( unsigned char *buffer, int size, @@ -142,7 +142,7 @@ cvt_varitext( ) { - if (!Strok(buffer, format->fixed_string)) { + if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, @@ -156,7 +156,7 @@ cvt_varitext( Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute, format->field_offsets[O_MIN].length) || Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second, - format->field_offsets[O_SEC].length)) { + format->field_offsets[O_SEC].length)) { return CVT_FAIL | CVT_BADFMT; } else { u_char *f = (u_char*) &buffer[format->field_offsets[O_FLAGS].offset]; @@ -170,24 +170,25 @@ cvt_varitext( clock_time->flags |= PARSEB_DST; } /* - if (!((*f) & VT_INITIALISED)) Clock not initialised + if (!((*f) & VT_INITIALISED)) Clock not initialised clock_time->flags |= PARSEB_POWERUP; - - if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised + + if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised clock_time->flags |= PARSEB_NOSYNC; - - if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour + + if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour clock_time->flags |= PARSEB_ANNOUNCE; */ - return CVT_OK; + return CVT_OK; } } } -static u_long +/* parse_inp_fnc_t inp_varitext */ +static u_long inp_varitext( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -196,10 +197,10 @@ inp_varitext( parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - if (!t) + if (!t) return PARSE_INP_SKIP; /* local data not allocated - sigh! */ - if (ch == 'T') + if (ch == 'T') t->tstamp = *tstamp; if ((t->previous_ch == 'T') && (ch == ':')) @@ -224,7 +225,7 @@ inp_varitext( return rtc; } - if (t->end_found) + if (t->end_found) { if (++(t->end_count) == 4) /* Finally found the end of the message */ { @@ -235,16 +236,16 @@ inp_varitext( return parse_end(parseio); else return rtc; - } + } } - if ((t->previous_ch == '\r') && (ch == '\n')) + if ((t->previous_ch == '\r') && (ch == '\n')) { t->end_found = 1; } } - + t->previous_ch = ch; return PARSE_INP_SKIP; diff --git a/contrib/ntp/libparse/clk_wharton.c b/contrib/ntp/libparse/clk_wharton.c index 55ab43a9b5746..a65bc53860e6c 100644 --- a/contrib/ntp/libparse/clk_wharton.c +++ b/contrib/ntp/libparse/clk_wharton.c @@ -74,8 +74,11 @@ extern void printf (const char *, ...); * */ +static parse_cvt_fnc_t cvt_wharton_400a; +static parse_inp_fnc_t inp_wharton_400a; + /* - * cvt_wharton_400a + * parse_cvt_fnc_t cvt_wharton_400a * * convert simple type format */ @@ -121,14 +124,14 @@ cvt_wharton_400a( } /* - * inp_wharton_400a + * parse_inp_fnc_t inp_wharton_400a * - * grep data from input stream + * grab data from input stream */ static u_long inp_wharton_400a( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -166,7 +169,7 @@ clockformat_t clock_wharton_400a = 0, /* conversion configuration */ "WHARTON 400A Series clock Output Format 1", /* String format name */ 15, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */ diff --git a/contrib/ntp/libparse/data_mbg.c b/contrib/ntp/libparse/data_mbg.c index 23ca75509180c..0b3808c8ba647 100644 --- a/contrib/ntp/libparse/data_mbg.c +++ b/contrib/ntp/libparse/data_mbg.c @@ -43,6 +43,7 @@ #include "ntp_types.h" #include "ntp_stdlib.h" #include "ntp_fp.h" +#include "ntp_calendar.h" #include "mbg_gps166.h" #include "binio.h" #include "ieee754io.h" @@ -63,10 +64,10 @@ put_mbg_header( GPS_MSG_HDR *headerp ) { - put_lsb_short(bufpp, headerp->gps_cmd); - put_lsb_short(bufpp, headerp->gps_len); - put_lsb_short(bufpp, headerp->gps_data_csum); - put_lsb_short(bufpp, headerp->gps_hdr_csum); + put_lsb_short(bufpp, headerp->cmd); + put_lsb_short(bufpp, headerp->len); + put_lsb_short(bufpp, headerp->data_csum); + put_lsb_short(bufpp, headerp->hdr_csum); } void @@ -75,7 +76,7 @@ get_mbg_sw_rev( SW_REV *sw_revp ) { - sw_revp->code = get_lsb_short(bufpp); + sw_revp->code = get_lsb_uint16(bufpp); memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name)); *bufpp += sizeof(sw_revp->name); } @@ -86,8 +87,8 @@ get_mbg_ascii_msg( ASCII_MSG *ascii_msgp ) { - ascii_msgp->csum = get_lsb_short(bufpp); - ascii_msgp->valid = get_lsb_short(bufpp); + ascii_msgp->csum = (CSUM) get_lsb_short(bufpp); + ascii_msgp->valid = get_lsb_int16(bufpp); memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s)); *bufpp += sizeof(ascii_msgp->s); } @@ -98,7 +99,7 @@ get_mbg_svno( SVNO *svnop ) { - *svnop = get_lsb_short(bufpp); + *svnop = (SVNO) get_lsb_short(bufpp); } void @@ -107,7 +108,7 @@ get_mbg_health( HEALTH *healthp ) { - *healthp = get_lsb_short(bufpp); + *healthp = (HEALTH) get_lsb_short(bufpp); } void @@ -116,7 +117,7 @@ get_mbg_cfg( CFG *cfgp ) { - *cfgp = get_lsb_short(bufpp); + *cfgp = (CFG) get_lsb_short(bufpp); } void @@ -125,7 +126,7 @@ get_mbg_tgps( T_GPS *tgpsp ) { - tgpsp->wn = get_lsb_short(bufpp); + tgpsp->wn = get_lsb_uint16(bufpp); tgpsp->sec = get_lsb_long(bufpp); tgpsp->tick = get_lsb_long(bufpp); } @@ -133,20 +134,20 @@ get_mbg_tgps( void get_mbg_tm( unsigned char **buffpp, - TM *tmp + TM_GPS *tmp ) { - tmp->year = get_lsb_short(buffpp); + tmp->year = get_lsb_int16(buffpp); tmp->month = *(*buffpp)++; - tmp->mday = *(*buffpp)++; - tmp->yday = get_lsb_short(buffpp); - tmp->wday = *(*buffpp)++; - tmp->hour = *(*buffpp)++; - tmp->minute = *(*buffpp)++; - tmp->second = *(*buffpp)++; - tmp->frac = get_lsb_long(buffpp); + tmp->mday = *(*buffpp)++; + tmp->yday = get_lsb_int16(buffpp); + tmp->wday = *(*buffpp)++; + tmp->hour = *(*buffpp)++; + tmp->min = *(*buffpp)++; + tmp->sec = *(*buffpp)++; + tmp->frac = get_lsb_long(buffpp); tmp->offs_from_utc = get_lsb_long(buffpp); - tmp->status= get_lsb_short(buffpp); + tmp->status = get_lsb_uint16(buffpp); } void @@ -155,7 +156,7 @@ get_mbg_ttm( TTM *ttmp ) { - ttmp->channel = get_lsb_short(buffpp); + ttmp->channel = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &ttmp->t); get_mbg_tm(buffpp, &ttmp->tm); } @@ -166,9 +167,9 @@ get_mbg_synth( SYNTH *synthp ) { - synthp->freq = get_lsb_short(buffpp); - synthp->range = get_lsb_short(buffpp); - synthp->phase = get_lsb_short(buffpp); + synthp->freq = get_lsb_int16(buffpp); + synthp->range = get_lsb_int16(buffpp); + synthp->phase = get_lsb_int16(buffpp); } static void @@ -201,7 +202,7 @@ get_mbg_antinfo( ANT_INFO *antinfop ) { - antinfop->status = get_lsb_short(buffpp); + antinfop->status = get_lsb_int16(buffpp); get_mbg_tm(buffpp, &antinfop->tm_disconn); get_mbg_tm(buffpp, &antinfop->tm_reconn); antinfop->delta_t = get_lsb_long(buffpp); @@ -216,8 +217,8 @@ mbg_time_status_str( { static struct state { - int flag; /* bit flag */ - const char *string; /* bit name */ + int flag; /* bit flag */ + const char *string; /* bit name */ } states[] = { { TM_UTC, "UTC CORR" }, @@ -233,7 +234,7 @@ mbg_time_status_str( { char *start, *p; struct state *s; - + start = p = *buffpp; for (s = states; s->flag; s++) @@ -252,25 +253,27 @@ mbg_time_status_str( *buffpp = p; } } - + void mbg_tm_str( char **buffpp, - TM *tmp, - int size + TM_GPS *tmp, + int size, + int print_status ) { char *s = *buffpp; snprintf(*buffpp, size, "%04d-%02d-%02d %02d:%02d:%02d.%07ld (%c%02d%02d) ", tmp->year, tmp->month, tmp->mday, - tmp->hour, tmp->minute, tmp->second, tmp->frac, + tmp->hour, tmp->min, tmp->sec, (long) tmp->frac, (tmp->offs_from_utc < 0) ? '-' : '+', abs((int)tmp->offs_from_utc) / 3600, (abs((int)tmp->offs_from_utc) / 60) % 60); *buffpp += strlen(*buffpp); - mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); + if (print_status) + mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); } void @@ -281,8 +284,8 @@ mbg_tgps_str( ) { snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec", - tgpsp->wn, tgpsp->sec / 86400, - tgpsp->sec % 86400, tgpsp->tick); + tgpsp->wn, (long) tgpsp->sec / SECSPERDAY, + (long) tgpsp->sec % SECSPERDAY, (long) tgpsp->tick); *buffpp += strlen(*buffpp); } @@ -293,19 +296,19 @@ get_mbg_cfgh( ) { int i; - - cfghp->csum = get_lsb_short(buffpp); - cfghp->valid = get_lsb_short(buffpp); + + cfghp->csum = (CSUM) get_lsb_short(buffpp); + cfghp->valid = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &cfghp->tot_51); get_mbg_tgps(buffpp, &cfghp->tot_63); get_mbg_tgps(buffpp, &cfghp->t0a); - for (i = MIN_SVNO; i <= MAX_SVNO; i++) + for (i = 0; i < N_SVNO_GPS; i++) { get_mbg_cfg(buffpp, &cfghp->cfg[i]); } - - for (i = MIN_SVNO; i <= MAX_SVNO; i++) + + for (i = 0; i < N_SVNO_GPS; i++) { get_mbg_health(buffpp, &cfghp->health[i]); } @@ -317,23 +320,23 @@ get_mbg_utc( UTC *utcp ) { - utcp->csum = get_lsb_short(buffpp); - utcp->valid = get_lsb_short(buffpp); + utcp->csum = (CSUM) get_lsb_short(buffpp); + utcp->valid = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &utcp->t0t); - + if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A0, mbg_double) != IEEE_OK) { L_CLR(&utcp->A0); } - + if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A1, mbg_double) != IEEE_OK) { L_CLR(&utcp->A1); } - utcp->WNlsf = get_lsb_short(buffpp); - utcp->DNt = get_lsb_short(buffpp); + utcp->WNlsf = get_lsb_uint16(buffpp); + utcp->DNt = get_lsb_int16(buffpp); utcp->delta_tls = *(*buffpp)++; utcp->delta_tlsf = *(*buffpp)++; } @@ -345,7 +348,7 @@ get_mbg_lla( ) { int i; - + for (i = LAT; i <= ALT; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &lla[i], mbg_double) != IEEE_OK) @@ -367,7 +370,7 @@ get_mbg_xyz( ) { int i; - + for (i = XP; i <= ZP; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &xyz[i], mbg_double) != IEEE_OK) @@ -384,13 +387,13 @@ get_mbg_comparam( ) { size_t i; - + comparamp->baud_rate = get_lsb_long(buffpp); for (i = 0; i < sizeof(comparamp->framing); i++) { comparamp->framing[i] = *(*buffpp)++; } - comparamp->handshake = get_lsb_short(buffpp); + comparamp->handshake = get_lsb_int16(buffpp); } void @@ -400,12 +403,12 @@ get_mbg_portparam( ) { int i; - - for (i = 0; i < N_COM; i++) + + for (i = 0; i < DEFAULT_N_COM; i++) { get_mbg_comparam(buffpp, &portparamp->com[i]); } - for (i = 0; i < N_COM; i++) + for (i = 0; i < DEFAULT_N_COM; i++) { portparamp->mode[i] = *(*buffpp)++; } @@ -416,20 +419,20 @@ get_mbg_portparam( { \ L_CLR(addr); \ } - + void get_mbg_eph( unsigned char ** buffpp, EPH *ephp ) { - ephp->csum = get_lsb_short(buffpp); - ephp->valid = get_lsb_short(buffpp); - - ephp->health = get_lsb_short(buffpp); - ephp->IODC = get_lsb_short(buffpp); - ephp->IODE2 = get_lsb_short(buffpp); - ephp->IODE3 = get_lsb_short(buffpp); + ephp->csum = (CSUM) get_lsb_short(buffpp); + ephp->valid = get_lsb_int16(buffpp); + + ephp->health = (HEALTH) get_lsb_short(buffpp); + ephp->IODC = (IOD) get_lsb_short(buffpp); + ephp->IODE2 = (IOD) get_lsb_short(buffpp); + ephp->IODE3 = (IOD) get_lsb_short(buffpp); get_mbg_tgps(buffpp, &ephp->tt); get_mbg_tgps(buffpp, &ephp->t0c); @@ -456,7 +459,7 @@ get_mbg_eph( FETCH_DOUBLE(buffpp, &ephp->af2); FETCH_DOUBLE(buffpp, &ephp->tgd); - ephp->URA = get_lsb_short(buffpp); + ephp->URA = get_lsb_uint16(buffpp); ephp->L2code = *(*buffpp)++; ephp->L2flag = *(*buffpp)++; @@ -468,10 +471,10 @@ get_mbg_alm( ALM *almp ) { - almp->csum = get_lsb_short(buffpp); - almp->valid = get_lsb_short(buffpp); - - almp->health = get_lsb_short(buffpp); + almp->csum = (CSUM) get_lsb_short(buffpp); + almp->valid = get_lsb_int16(buffpp); + + almp->health = (HEALTH) get_lsb_short(buffpp); get_mbg_tgps(buffpp, &almp->t0a); @@ -493,8 +496,8 @@ get_mbg_iono( IONO *ionop ) { - ionop->csum = get_lsb_short(buffpp); - ionop->valid = get_lsb_short(buffpp); + ionop->csum = (CSUM) get_lsb_short(buffpp); + ionop->valid = get_lsb_int16(buffpp); FETCH_DOUBLE(buffpp, &ionop->alpha_0); FETCH_DOUBLE(buffpp, &ionop->alpha_1); diff --git a/contrib/ntp/libparse/gpstolfp.c b/contrib/ntp/libparse/gpstolfp.c index 5354dd3223aa2..c162429ed92a9 100644 --- a/contrib/ntp/libparse/gpstolfp.c +++ b/contrib/ntp/libparse/gpstolfp.c @@ -34,10 +34,8 @@ */ #include <config.h> #include "ntp_fp.h" - -#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */ -#define SECSPERWEEK (unsigned)(604800) /* seconds per week - GPS tells us about weeks */ -#define GPSWRAP 990 /* assume week count less than this in the previous epoch */ +#include "ntp_calendar.h" +#include "parse.h" void gpstolfp( @@ -49,10 +47,10 @@ gpstolfp( { if (weeks < GPSWRAP) { - weeks += 1024; + weeks += GPSWEEKS; } - lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */ + lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */ lfp->l_uf = 0; } diff --git a/contrib/ntp/libparse/parse.c b/contrib/ntp/libparse/parse.c index 85e5299cb195d..9e663f911f74d 100644 --- a/contrib/ntp/libparse/parse.c +++ b/contrib/ntp/libparse/parse.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A - * + * * parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A * * Parser module for reference clock @@ -12,7 +12,7 @@ * when PARSEKERNEL is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -106,7 +106,7 @@ Strcmp( while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } @@ -154,10 +154,10 @@ parse_ioinit( ) { parseprintf(DD_PARSE, ("parse_iostart\n")); - + parseio->parse_plen = 0; parseio->parse_pdata = (void *)0; - + parseio->parse_data = 0; parseio->parse_ldata = 0; parseio->parse_dsize = 0; @@ -166,7 +166,7 @@ parse_ioinit( parseio->parse_ioflags = PARSE_IO_CS7; /* usual unix default */ parseio->parse_index = 0; parseio->parse_ldsize = 0; - + return 1; } @@ -188,15 +188,15 @@ parse_ioend( unsigned int parse_restart( parse_t *parseio, - unsigned int ch + char ch ) { unsigned int updated = PARSE_INP_SKIP; - + /* * re-start packet - timeout - overflow - start symbol */ - + if (parseio->parse_index) { /* @@ -208,17 +208,17 @@ parse_restart( parseio->parse_ldsize = parseio->parse_index; updated = PARSE_INP_TIME; } - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseprintf(DD_PARSE, ("parse: parse_restart: buffer start (updated = %x)\n", updated)); return updated; } - + unsigned int parse_addchar( parse_t *parseio, - unsigned int ch + char ch ) { /* @@ -239,7 +239,7 @@ parse_addchar( */ return parse_restart(parseio, ch); } - + unsigned int parse_end( parse_t *parseio @@ -260,11 +260,11 @@ parse_end( int parse_ioread( register parse_t *parseio, - register unsigned int ch, + register char ch, register timestamp_t *tstamp ) { - register unsigned updated = CVT_NONE; + register u_int updated = CVT_NONE; /* * within STREAMS CSx (x < 8) chars still have the upper bits set * so we normalize the characters by masking unecessary bits off. @@ -282,9 +282,9 @@ parse_ioread( case PARSE_IO_CS7: ch &= 0x7F; break; - + case PARSE_IO_CS8: - ch &= 0xFF; + ch &= (char) 0xFFU; break; } @@ -306,18 +306,18 @@ parse_ioread( { updated = CVT_OK; } - + if (input_status & PARSE_INP_TIME) /* time sample is available */ { - updated = timepacket(parseio); + updated = (u_int) timepacket(parseio); } - + if (input_status & PARSE_INP_DATA) /* got additional data */ { updated |= CVT_ADDITIONAL; } } - + /* * remember last character time @@ -353,7 +353,7 @@ parse_iopps( register timestamp_t *ptime ) { - register unsigned updated = CVT_NONE; + register u_int updated = CVT_NONE; /* * PPS pulse information will only be delivered to ONE clock format @@ -364,7 +364,7 @@ parse_iopps( if (clockformats[parseio->parse_lformat]->syncpps) { - updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime); + updated = (u_int) clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime); parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated)); } @@ -403,13 +403,13 @@ parse_to_unixtime( ) { #define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); } - static int days_of_month[] = + static int days_of_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; register int i; time_t t; - + if (clock_time->utctime) return clock_time->utctime; /* if the conversion routine gets it right away - why not */ @@ -423,12 +423,12 @@ parse_to_unixtime( SETRTC(CVT_FAIL|CVT_BADDATE); return -1; } - + /* * sorry, slow section here - but it's not time critical anyway */ t = julian0(clock_time->year) - julian0(1970); /* Y2kFixes */ - /* month */ + /* month */ if (clock_time->month <= 0 || clock_time->month > 12) { SETRTC(CVT_FAIL|CVT_BADDATE); @@ -466,7 +466,7 @@ parse_to_unixtime( t = TIMES24(t) + clock_time->hour; - /* min */ + /* min */ if (clock_time->minute < 0 || clock_time->minute > 59) { SETRTC(CVT_FAIL|CVT_BADTIME); @@ -475,7 +475,7 @@ parse_to_unixtime( t = TIMES60(t) + clock_time->minute; /* sec */ - + if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */ { SETRTC(CVT_FAIL|CVT_BADTIME); @@ -510,7 +510,7 @@ Stoi( while(*s == ' ') s++; - + if (*s == '-') { s++; @@ -519,7 +519,7 @@ Stoi( else if (*s == '+') s++; - + for(;;) { c = *s++; @@ -573,16 +573,16 @@ updatetimeinfo( { int s = splhigh(); #endif - + parseio->parse_lstate = parseio->parse_dtime.parse_state | flags | PARSEB_TIMECODE; - + parseio->parse_dtime.parse_state = parseio->parse_lstate; #ifdef PARSEKERNEL (void)splx((unsigned int)s); } #endif - + #ifdef PARSEKERNEL parseprintf(DD_PARSE, ("updatetimeinfo status=0x%x, time=%x\n", parseio->parse_dtime.parse_state, @@ -591,7 +591,7 @@ updatetimeinfo( parseprintf(DD_PARSE, ("updatetimeinfo status=0x%lx, time=%x\n", (long)parseio->parse_dtime.parse_state, parseio->parse_dtime.parse_time.fp.l_ui)); #endif - + return CVT_OK; /* everything fine and dandy... */ } @@ -614,7 +614,7 @@ syn_simple( } /* - * pps_simple + * parse_pps_fnc_t pps_simple * * handle a pps time stamp */ @@ -628,12 +628,12 @@ pps_simple( { parseio->parse_dtime.parse_ptime = *ptime; parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; - + return CVT_NONE; } /* - * pps_one + * parse_pps_fnc_t pps_one * * handle a pps time stamp in ONE edge */ @@ -647,12 +647,12 @@ pps_one( { if (status) return pps_simple(parseio, status, ptime); - + return CVT_NONE; } /* - * pps_zero + * parse_pps_fnc_t pps_zero * * handle a pps time stamp in ZERO edge */ @@ -666,7 +666,7 @@ pps_zero( { if (!status) return pps_simple(parseio, status, ptime); - + return CVT_NONE; } @@ -684,13 +684,13 @@ timepacket( register time_t t; u_long cvtrtc; /* current conversion result */ clocktime_t clock_time; - + memset((char *)&clock_time, 0, sizeof clock_time); format = parseio->parse_lformat; if (format == (unsigned short)~0) return CVT_NONE; - + switch ((cvtrtc = clockformats[format]->convert ? clockformats[format]->convert((unsigned char *)parseio->parse_ldata, parseio->parse_ldsize, (struct format *)(clockformats[format]->data), &clock_time, parseio->parse_pdata) : CVT_NONE) & CVT_MASK) @@ -698,17 +698,17 @@ timepacket( case CVT_FAIL: parseio->parse_badformat++; break; - + case CVT_NONE: /* * too bad - pretend bad format */ parseio->parse_badformat++; break; - + case CVT_OK: break; - + case CVT_SKIP: return CVT_NONE; @@ -716,7 +716,7 @@ timepacket( /* shouldn't happen */ #ifndef PARSEKERNEL msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"", clockformats[format]->name); -#endif +#endif return CVT_FAIL|cvtrtc; } @@ -724,7 +724,7 @@ timepacket( { return CVT_FAIL|cvtrtc; } - + /* * time stamp */ @@ -732,7 +732,7 @@ timepacket( parseio->parse_dtime.parse_time.tv.tv_sec = t; parseio->parse_dtime.parse_time.tv.tv_usec = clock_time.usecond; #else - parseio->parse_dtime.parse_time.fp.l_ui = t + JAN_1970; + parseio->parse_dtime.parse_time.fp.l_ui = (uint32_t) (t + JAN_1970); TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf); #endif @@ -758,7 +758,7 @@ parse_timecode( */ dct->parsegettc.parse_badformat = parse->parse_badformat; parse->parse_badformat = 0; - + if (parse->parse_ldsize <= PARSE_TCMAX) { dct->parsegettc.parse_count = parse->parse_ldsize; @@ -771,7 +771,7 @@ parse_timecode( } } - + /*ARGSUSED*/ int parse_setfmt( @@ -792,7 +792,7 @@ parse_setfmt( if (parse->parse_pdata) FREE(parse->parse_pdata, parse->parse_plen); parse->parse_pdata = 0; - + parse->parse_plen = clockformats[i]->plen; if (parse->parse_plen) @@ -809,9 +809,9 @@ parse_setfmt( if (parse->parse_data) FREE(parse->parse_data, (unsigned)(parse->parse_dsize * 2 + 2)); parse->parse_ldata = parse->parse_data = 0; - + parse->parse_dsize = clockformats[i]->length; - + if (parse->parse_dsize) { parse->parse_data = (char*)MALLOC((unsigned)(parse->parse_dsize * 2 + 2)); @@ -820,20 +820,20 @@ parse_setfmt( if (parse->parse_pdata) FREE(parse->parse_pdata, parse->parse_plen); parse->parse_pdata = 0; - + parseprintf(DD_PARSE, ("init failed: malloc for data area failed\n")); return 0; } } - + /* * leave room for '\0' */ parse->parse_ldata = parse->parse_data + parse->parse_dsize + 1; - + parse->parse_lformat = i; - + return 1; } } @@ -852,7 +852,7 @@ parse_getfmt( if (dct->parseformat.parse_format < nformats && Strlen(clockformats[dct->parseformat.parse_format]->name) <= PARSE_TCMAX) { - dct->parseformat.parse_count = Strlen(clockformats[dct->parseformat.parse_format]->name)+1; + dct->parseformat.parse_count = (unsigned short) (Strlen(clockformats[dct->parseformat.parse_format]->name) + 1); memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count); return 1; } @@ -870,7 +870,7 @@ parse_setcs( ) { parse->parse_ioflags &= ~PARSE_IO_CSIZE; - parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE; + parse->parse_ioflags |= (int) (dct->parsesetcs.parse_cs & PARSE_IO_CSIZE); return 1; } diff --git a/contrib/ntp/libparse/parse_conf.c b/contrib/ntp/libparse/parse_conf.c index b7234dd419b76..37871c9de8872 100644 --- a/contrib/ntp/libparse/parse_conf.c +++ b/contrib/ntp/libparse/parse_conf.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Parser configuration module for reference clocks @@ -12,7 +12,7 @@ * when STREAM is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/contrib/ntp/libparse/parsesolaris.c b/contrib/ntp/libparse/parsesolaris.c index d3756af882a3e..8c91257b44829 100644 --- a/contrib/ntp/libparse/parsesolaris.c +++ b/contrib/ntp/libparse/parsesolaris.c @@ -1,12 +1,12 @@ /* * /src/NTP/ntp4-dev/libparse/parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * STREAMS module for reference clocks * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -74,7 +74,7 @@ static struct fmodsw fmod_templ = extern struct mod_ops mod_strmodops; -static struct modlstrmod modlstrmod = +static struct modlstrmod modlstrmod = { &mod_strmodops, /* a STREAMS module */ "PARSE - NTP reference", /* name this baby - keep room for revision number */ @@ -100,13 +100,13 @@ _init( ) { static char revision[] = "4.6"; - char *s, *S; + char *s, *S; char *t; - + #ifndef lint t = rcsid; #endif - + /* * copy RCS revision into Drv_name * @@ -125,20 +125,20 @@ _init( } if (*s == ' ') s++; } - - t = modlstrmod.strmod_linkinfo; + + t = modlstrmod.strmod_linkinfo; while (*t && (*t != ' ')) { t++; } if (*t == ' ') t++; - + S = s; while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.'))) { S++; } - + if (*s && *t && (S > s)) { if (strlen(t) >= (S - s)) @@ -308,7 +308,7 @@ setup_stream( } else { - pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); + pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); return 0; } } @@ -325,18 +325,18 @@ parseopen( { register parsestream_t *parse; static int notice = 0; - - pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q); - + + pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q); + if (sflag != MODOPEN) { /* open only for modules */ - pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n"); + pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n"); return EIO; } if (q->q_ptr != (caddr_t)NULL) { - pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); + pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); return EBUSY; } @@ -346,10 +346,10 @@ parseopen( return ENOMEM; } - pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr); + pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr); WR(q)->q_ptr = q->q_ptr; - pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr); - + pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr); + parse = (parsestream_t *) q->q_ptr; bzero((caddr_t)parse, sizeof(*parse)); parse->parse_queue = q; @@ -360,7 +360,7 @@ parseopen( qprocson(q); - pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); + pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); if (!parse_ioinit(&parse->parse_io)) { @@ -374,12 +374,12 @@ parseopen( return EIO; } - pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q); + pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q); if (setup_stream(q, M_PARSE)) { (void) init_linemon(q); /* hook up PPS ISR routines if possible */ - pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n"); + pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n"); /* * I know that you know the delete key, but you didn't write this @@ -412,19 +412,19 @@ parseclose( { register parsestream_t *parse = (parsestream_t *)q->q_ptr; register unsigned long s; - + pprintf(DD_CLOSE, "parse: CLOSE\n"); - + qprocsoff(q); s = splhigh(); - + if (parse->parse_dqueue) close_linemon(parse->parse_dqueue, q); parse->parse_dqueue = (queue_t *)0; (void) splx(s); - + parse_ioend(&parse->parse_io); kmem_free((caddr_t)parse, sizeof(parsestream_t)); @@ -444,7 +444,7 @@ parsersvc( ) { mblk_t *mp; - + while ((mp = getq(q))) { if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) @@ -477,15 +477,15 @@ parsewput( register mblk_t *datap; register struct iocblk *iocp; parsestream_t *parse = (parsestream_t *)q->q_ptr; - + pprintf(DD_WPUT, "parse: parsewput\n"); - + switch (mp->b_datap->db_type) { default: putnext(q, mp); break; - + case M_IOCTL: iocp = (void *)mp->b_rptr; switch (iocp->ioc_cmd) @@ -519,7 +519,7 @@ parsewput( iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; - + case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { @@ -537,7 +537,7 @@ parsewput( } qreply(q, mp); break; - } + } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: @@ -553,7 +553,7 @@ parsewput( pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_TIMECODE\n"); ok = parse_timecode(dct, &parse->parse_io); break; - + case PARSEIOC_SETFMT: pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETFMT\n"); ok = parse_setfmt(dct, &parse->parse_io); @@ -600,7 +600,7 @@ rdchar( else { register mblk_t *mmp = *mp; - + *mp = (*mp)->b_cont; freeb(mmp); } @@ -619,7 +619,7 @@ parserput( { register unsigned char type; mblk_t *mp = imp; - + switch (type = mp->b_datap->db_type) { default: @@ -636,7 +636,7 @@ parserput( else putq(q, mp); break; - + case M_BREAK: case M_DATA: { @@ -691,7 +691,7 @@ parserput( if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } - } + } } else { @@ -733,7 +733,7 @@ parserput( gethrestime(&hres_time); c_time.tv.tv_sec = hres_time.tv_sec; c_time.tv.tv_usec = hres_time.tv_nsec / 1000; - + pprintf(DD_RPUT, "parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN"); if ((parse->parse_status & PARSE_ENABLE) && @@ -758,7 +758,7 @@ parserput( } else putq(q, mp); - + if (status) { parse->parse_ppsclockev.tv = c_time.tv; @@ -780,7 +780,7 @@ init_linemon( ) { register queue_t *dq; - + dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR @@ -916,14 +916,14 @@ init_zs_linemon( szs->zsops.zsop_xsint = (void (*) (struct zscom *))zs_xsisr; /* place our bastard */ szs->oldzsops = zs->zs_ops; emergencyzs = zs->zs_ops; - + zs->zs_ops = &szs->zsops; /* hook it up */ /* - * XXX: this is usually done via zsopinit() + * XXX: this is usually done via zsopinit() * - have yet to find a way to call that routine */ zs->zs_xsint = (void (*) (struct zscom *))zs_xsisr; - + mutex_exit(zs->zs_excl); pprintf(DD_INSTALL, "init_zs_linemon: CD monitor installed\n"); @@ -934,7 +934,7 @@ init_zs_linemon( } /* - * unregister our ISR routine - must call under splhigh() (or + * unregister our ISR routine - must call under splhigh() (or * whatever block ZS status interrupts) */ static void @@ -970,7 +970,7 @@ close_zs_linemon( mutex_exit(zs->zs_excl); kmem_free((caddr_t)szs, sizeof (struct savedzsops)); - + pprintf(DD_INSTALL, "close_zs_linemon: CD monitor deleted\n"); return; } @@ -1005,7 +1005,7 @@ zs_xsisr( { timestamp_t cdevent; register int status; - + /* * time stamp */ @@ -1024,7 +1024,7 @@ zs_xsisr( * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; - + while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) @@ -1052,7 +1052,7 @@ zs_xsisr( */ parse_iodone(&((parsestream_t *)q->q_ptr)->parse_io); } - + if (status) { ((parsestream_t *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; @@ -1091,9 +1091,9 @@ zs_xsisr( SCC_WRITE0(ZSWR0_RESET_STATUS); /* might kill other conditions here */ return; } - } + } - pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n", + pprintf(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 @@ -1108,7 +1108,7 @@ zs_xsisr( q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; - + /* * the real thing for everything else ... */ @@ -1120,7 +1120,7 @@ zs_xsisr( if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { register void (*zsisr) (struct zscom *); - + /* * back home - phew (hopping along stream queues might * prove dangerous to your health) @@ -1129,7 +1129,7 @@ zs_xsisr( zsisr(zs); else panic("zs_xsisr: unable to locate original ISR"); - + pprintf(DD_ISR, "zs_xsisr: non CD event was processed for \"%s\"\n", dname); /* * now back to our program ... @@ -1151,7 +1151,7 @@ zs_xsisr( * corrupted TTY structures */ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-"); - + if (emergencyzs && emergencyzs->zsop_xsint) emergencyzs->zsop_xsint(zs); else diff --git a/contrib/ntp/libparse/parsestreams.c b/contrib/ntp/libparse/parsestreams.c index 3fb4cc3511aa9..6cd9d8ff904ef 100644 --- a/contrib/ntp/libparse/parsestreams.c +++ b/contrib/ntp/libparse/parsestreams.c @@ -1,13 +1,13 @@ /* * /src/NTP/ntp4-dev/libparse/parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * STREAMS module for reference clocks * (SunOS4.x) * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -110,7 +110,7 @@ static char mnam[] = "PARSEPPS "; /* name this baby - keep room for revision #else static char mnam[] = "PARSE "; /* name this baby - keep room for revision number */ #endif -struct vdldrv parsesync_vd = +struct vdldrv parsesync_vd = { VDMAGIC_PSEUDO, /* nothing like a real driver - a STREAMS module */ mnam, @@ -166,7 +166,7 @@ Strcmp( while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } @@ -186,10 +186,10 @@ Strncmp( while (n-- && !(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } - + void ntp_memset( char *a, @@ -217,12 +217,12 @@ xxxinit( { extern struct fmodsw fmodsw[]; extern int fmodcnt; - + struct fmodsw *fm = fmodsw; struct fmodsw *fmend = &fmodsw[fmodcnt]; struct fmodsw *ifm = (struct fmodsw *)0; char *mname = parseinfo.st_rdinit->qi_minfo->mi_idname; - + switch (fc) { case VDLOAD: @@ -233,13 +233,13 @@ xxxinit( */ while (fm <= fmend) { - if (!Strncmp(fm->f_name, mname, FMNAMESZ)) + if (!Strncmp(fm->f_name, mname, FMNAMESZ)) { printf("vddrinit[%s]: STREAMS module already loaded.\n", mname); return(EBUSY); } else - if ((ifm == (struct fmodsw *)0) && + if ((ifm == (struct fmodsw *)0) && (fm->f_name[0] == '\0') && (fm->f_str == (struct streamtab *)0)) { @@ -261,7 +261,7 @@ xxxinit( { static char revision[] = "4.7"; char *s, *S, *t; - + s = rcsid; /* NOOP - keep compilers happy */ Strncpy(ifm->f_name, mname, FMNAMESZ); @@ -285,20 +285,20 @@ xxxinit( } if (*s == ' ') s++; } - - t = parsesync_vd.Drv_name; + + t = parsesync_vd.Drv_name; while (*t && (*t != ' ')) { t++; } if (*t == ' ') t++; - + S = s; while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.'))) { S++; } - + if (*s && *t && (S > s)) { if (Strlen(t) >= (S - s)) @@ -307,9 +307,9 @@ xxxinit( } } return (0); - } + } break; - + case VDUNLOAD: if (parsebusy > 0) { @@ -328,7 +328,7 @@ xxxinit( fm->f_name[0] = '\0'; fm->f_str = (struct streamtab *)0; fm++; - + break; } fm++; @@ -341,14 +341,14 @@ xxxinit( else return (0); } - + case VDSTAT: return (0); default: return (EIO); - + } return EIO; } @@ -460,7 +460,7 @@ setup_stream( } else { - parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); + parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); return 0; } } @@ -476,37 +476,37 @@ parseopen( { register parsestream_t *parse; static int notice = 0; - - parseprintf(DD_OPEN,("parse: OPEN\n")); - + + parseprintf(DD_OPEN,("parse: OPEN\n")); + if (sflag != MODOPEN) { /* open only for modules */ - parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n")); return OPENFAIL; } if (q->q_ptr != (caddr_t)NULL) { u.u_error = EBUSY; - parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n")); return OPENFAIL; } #ifdef VDDRV parsebusy++; #endif - + q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t)); if (q->q_ptr == (caddr_t)0) { - parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n")); #ifdef VDDRV parsebusy--; #endif return OPENFAIL; } WR(q)->q_ptr = q->q_ptr; - + parse = (parsestream_t *)(void *)q->q_ptr; bzero((caddr_t)parse, sizeof(*parse)); parse->parse_queue = q; @@ -531,7 +531,7 @@ parseopen( { (void) init_linemon(q); /* hook up PPS ISR routines if possible */ - parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); + parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); /* * I know that you know the delete key, but you didn't write this @@ -569,17 +569,17 @@ parseclose( { register parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr; register unsigned long s; - + parseprintf(DD_CLOSE,("parse: CLOSE\n")); - + s = splhigh(); - + if (parse->parse_dqueue) close_linemon(parse->parse_dqueue, q); parse->parse_dqueue = (queue_t *)0; (void) splx(s); - + parse_ioend(&parse->parse_io); kmem_free((caddr_t)parse, sizeof(parsestream_t)); @@ -602,7 +602,7 @@ parsersvc( ) { mblk_t *mp; - + while ((mp = getq(q))) { if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) @@ -635,15 +635,15 @@ parsewput( register mblk_t *datap; register struct iocblk *iocp; parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr; - + parseprintf(DD_WPUT,("parse: parsewput\n")); - + switch (mp->b_datap->db_type) { default: putnext(q, mp); break; - + case M_IOCTL: iocp = (struct iocblk *)(void *)mp->b_rptr; switch (iocp->ioc_cmd) @@ -676,7 +676,7 @@ parsewput( iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; - + case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { @@ -694,7 +694,7 @@ parsewput( } qreply(q, mp); break; - } + } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: @@ -710,7 +710,7 @@ parsewput( parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_TIMECODE\n")); ok = parse_timecode(dct, &parse->parse_io); break; - + case PARSEIOC_SETFMT: parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETFMT\n")); ok = parse_setfmt(dct, &parse->parse_io); @@ -757,7 +757,7 @@ rdchar( else { register mblk_t *mmp = *mp; - + *mp = (*mp)->b_cont; freeb(mmp); } @@ -775,7 +775,7 @@ parserput( ) { unsigned char type; - + switch (type = mp->b_datap->db_type) { default: @@ -791,7 +791,7 @@ parserput( else putq(q, mp); break; - + case M_BREAK: case M_DATA: { @@ -844,7 +844,7 @@ parserput( if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } - } + } } else { @@ -883,7 +883,7 @@ parserput( register int status = cd_invert ^ (type == M_UNHANGUP); uniqtime(&ctime.tv); - + parseprintf(DD_RPUT,("parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN")); if ((parse->parse_status & PARSE_ENABLE) && @@ -908,7 +908,7 @@ parserput( } else putq(q, mp); - + if (status) { parse->parse_ppsclockev.tv = ctime.tv; @@ -930,7 +930,7 @@ init_linemon( ) { register queue_t *dq; - + dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR @@ -1038,7 +1038,7 @@ init_zs_linemon( else { unsigned long s; - + /* * we do a direct replacement, in case others fiddle also * if somebody else grabs our hook and we disconnect @@ -1064,9 +1064,9 @@ init_zs_linemon( szs->zsops.zsop_xsint = zs_xsisr; /* place our bastard */ szs->oldzsops = zs->zs_ops; emergencyzs = zs->zs_ops; - + zsopinit(zs, &szs->zsops); /* hook it up */ - + (void) splx(s); parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor installed\n")); @@ -1099,11 +1099,11 @@ close_zs_linemon( else { register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data; - + zsopinit(zs, szs->oldzsops); /* reset to previous handler functions */ kmem_free((caddr_t)szs, sizeof (struct savedzsops)); - + parseprintf(DD_INSTALL, ("close_zs_linemon: CD monitor deleted\n")); return; } @@ -1148,7 +1148,7 @@ zs_xsisr( { timestamp_t cdevent; register int status; - + za->za_rr0 = (za->za_rr0 & ~(cdmask)) | (zsstatus & (cdmask)); #ifdef PPS_SYNC @@ -1163,7 +1163,7 @@ zs_xsisr( * time stamp */ uniqtime(&cdevent.tv); - + #ifdef PPS_SYNC (void)splx(s); #endif @@ -1190,7 +1190,7 @@ zs_xsisr( * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; - + while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) @@ -1218,7 +1218,7 @@ zs_xsisr( */ parse_iodone(&((parsestream_t *)(void *)q->q_ptr)->parse_io); } - + if (status) { ((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; @@ -1251,13 +1251,13 @@ zs_xsisr( zsaddr->zscc_control = ZSWR0_RESET_STATUS; /* might kill other conditions here */ return 0; } - } + } if (zsstatus & cdmask) /* fake CARRIER status */ za->za_flags |= ZAS_CARR_ON; else za->za_flags &= ~ZAS_CARR_ON; - + /* * we are now gathered here to process some unusual external status * interrupts. @@ -1271,7 +1271,7 @@ zs_xsisr( q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; - + /* * the real thing for everything else ... */ @@ -1283,7 +1283,7 @@ zs_xsisr( if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { register int (*zsisr) (struct zscom *); - + /* * back home - phew (hopping along stream queues might * prove dangerous to your health) @@ -1292,7 +1292,7 @@ zs_xsisr( return zsisr(zs); else panic("zs_xsisr: unable to locate original ISR"); - + parseprintf(DD_ISR, ("zs_xsisr: non CD event was processed for \"%s\"\n", dname)); /* * now back to our program ... @@ -1314,7 +1314,7 @@ zs_xsisr( * corrupted TTY structures */ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-"); - + if (emergencyzs && emergencyzs->zsop_xsint) emergencyzs->zsop_xsint(zs); else diff --git a/contrib/ntp/libparse/trim_info.c b/contrib/ntp/libparse/trim_info.c index 619e23861aef3..4178209e5c013 100644 --- a/contrib/ntp/libparse/trim_info.c +++ b/contrib/ntp/libparse/trim_info.c @@ -6,7 +6,7 @@ * $Created: Sun Aug 2 20:20:34 1998 $ * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/contrib/ntp/ntpd/Makefile.in b/contrib/ntp/ntpd/Makefile.in index 09af628ca387e..ed489f6321099 100644 --- a/contrib/ntp/ntpd/Makefile.in +++ b/contrib/ntp/ntpd/Makefile.in @@ -52,8 +52,7 @@ subdir = ntpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -82,6 +81,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -431,6 +432,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/ntpd/cmd_args.c b/contrib/ntp/ntpd/cmd_args.c index 045c0a98e2338..14e86f7e87ca1 100644 --- a/contrib/ntp/ntpd/cmd_args.c +++ b/contrib/ntp/ntpd/cmd_args.c @@ -76,6 +76,9 @@ getCmdOpts( if (HAVE_OPT( PANICGATE )) allow_panic = TRUE; + if (HAVE_OPT( FORCE_STEP_ONCE )) + force_step_once = TRUE; + #ifdef HAVE_DROPROOT if (HAVE_OPT( JAILDIR )) { droproot = 1; @@ -175,14 +178,14 @@ getCmdOpts( if (HAVE_OPT( UPDATEINTERVAL )) { long val = OPT_VALUE_UPDATEINTERVAL; - + if (val >= 0) interface_interval = val; else { - fprintf(stderr, + fprintf(stderr, "command line interface update interval %ld must not be negative\n", val); - msyslog(LOG_ERR, + msyslog(LOG_ERR, "command line interface update interval %ld must not be negative", val); errflg++; diff --git a/contrib/ntp/ntpd/invoke-ntp.conf.texi b/contrib/ntp/ntpd/invoke-ntp.conf.texi index 23569fc52f6f5..7151efb82e140 100644 --- a/contrib/ntp/ntpd/invoke-ntp.conf.texi +++ b/contrib/ntp/ntpd/invoke-ntp.conf.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:41:59 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:25:50 AM by AutoGen 5.18.5pre4 # From the definitions ntp.conf.def # and the template file agtexi-file.tpl @end ignore @@ -2482,7 +2482,7 @@ holds the names of all peer variables and the @code{clock_var_list} holds the names of the reference clock variables. -@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{srep} | @code{stepout} @kbd{stepout}]} +@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{step} | @code{stepback} @kbd{stepback} | @code{stepfwd} @kbd{stepfwd} | @code{stepout} @kbd{stepout}]} This command can be used to alter several system variables in very exceptional circumstances. It should occur in the @@ -2539,6 +2539,19 @@ adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. +@item @code{stepback} @kbd{stepback} +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +@item @code{stepfwd} @kbd{stepfwd} +As for stepback, but for the forward direction. @item @code{stepout} @kbd{stepout} The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/invoke-ntp.keys.texi b/contrib/ntp/ntpd/invoke-ntp.keys.texi index dbafe1c733e98..b0d494040e79e 100644 --- a/contrib/ntp/ntpd/invoke-ntp.keys.texi +++ b/contrib/ntp/ntpd/invoke-ntp.keys.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:42:02 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:25:52 AM by AutoGen 5.18.5pre4 # From the definitions ntp.keys.def # and the template file agtexi-file.tpl @end ignore diff --git a/contrib/ntp/ntpd/invoke-ntpd.texi b/contrib/ntp/ntpd/invoke-ntpd.texi index 75a525702309b..b6c69db8a1da9 100644 --- a/contrib/ntp/ntpd/invoke-ntpd.texi +++ b/contrib/ntp/ntpd/invoke-ntpd.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:42:04 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:25:54 AM by AutoGen 5.18.5pre4 # From the definitions ntpd-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -95,6 +95,7 @@ This software is released under the NTP license, <http://ntp.org/license>. * ntpd configfile:: configfile option (-c) * ntpd driftfile:: driftfile option (-f) * ntpd panicgate:: panicgate option (-g) +* ntpd force-step-once:: force-step-once option (-G) * ntpd jaildir:: jaildir option (-i) * ntpd interface:: interface option (-I) * ntpd keyfile:: keyfile option (-k) @@ -141,7 +142,7 @@ with a status code of 0. @exampleindent 0 @example -ntpd - NTP daemon program - Ver. 4.2.8p1 +ntpd - NTP daemon program - Ver. 4.2.8p2 Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \ [ <server1> ... <serverN> ] Flg Arg Option-Name Description @@ -162,6 +163,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \ -f Str driftfile frequency drift file name -g no panicgate Allow the first adjustment to be Big - may appear multiple times + -G no force-step-once Step any initial offset correction. -i Str jaildir Jail directory -I Str interface Listen on an interface name or address - may appear multiple times @@ -298,7 +300,7 @@ The name and path of the frequency file, by default. This is the same operation as the @code{driftfile} @kbd{driftfile} -configuration specification in the +configuration specification in the @file{/etc/ntp.conf} file. @node ntpd panicgate @@ -326,6 +328,21 @@ options. See the @code{tinker} configuration file directive for other options. +@node ntpd force-step-once +@subsection force-step-once option (-G) +@cindex ntpd-force-step-once + +This is the ``step any initial offset correction.'' option. +Normally, +@code{ntpd} +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the @code{tinker} configuration file directive for other options. @node ntpd jaildir @subsection jaildir option (-i) @cindex ntpd-jaildir @@ -370,7 +387,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -@code{interface} command, which is more versatile. +@code{interface} command, which is more versatile. @node ntpd keyfile @subsection keyfile option (-k) @cindex ntpd-keyfile diff --git a/contrib/ntp/ntpd/keyword-gen-utd b/contrib/ntp/ntpd/keyword-gen-utd index 0485feecca0cf..b9b59bd4739f1 100644 --- a/contrib/ntp/ntpd/keyword-gen-utd +++ b/contrib/ntp/ntpd/keyword-gen-utd @@ -1 +1 @@ - * Generated 2015-01-03 23:51:10 UTC diff_ignore_line + * Generated 2015-03-16 09:05:44 UTC diff_ignore_line diff --git a/contrib/ntp/ntpd/keyword-gen.c b/contrib/ntp/ntpd/keyword-gen.c index bb593aba2e20b..5872e2a5cc1f6 100644 --- a/contrib/ntp/ntpd/keyword-gen.c +++ b/contrib/ntp/ntpd/keyword-gen.c @@ -206,6 +206,8 @@ struct key_tok ntp_keywords[] = { { "filenum", T_Filenum, FOLLBY_TOKEN }, /* tinker_option */ { "step", T_Step, FOLLBY_TOKEN }, +{ "stepback", T_Stepback, FOLLBY_TOKEN }, +{ "stepfwd", T_Stepfwd, FOLLBY_TOKEN }, { "panic", T_Panic, FOLLBY_TOKEN }, { "dispersion", T_Dispersion, FOLLBY_TOKEN }, { "stepout", T_Stepout, FOLLBY_TOKEN }, diff --git a/contrib/ntp/ntpd/ntp.conf.5man b/contrib/ntp/ntpd/ntp.conf.5man index 1e9ba668fe4df..f1ed4b298fd9c 100644 --- a/contrib/ntp/ntpd/ntp.conf.5man +++ b/contrib/ntp/ntpd/ntp.conf.5man @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp.conf 5man "04 Feb 2015" "4.2.8p1" "File Formats" +.TH ntp.conf 5man "07 Apr 2015" "4.2.8p2" "File Formats" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-sPaOCn/ag-RPaGBn) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:46 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.conf.def .\" and the template file agman-cmd.tpl .SH NAME @@ -2786,7 +2786,7 @@ the names of all peer variables and the \fIclock_var_list\f[] holds the names of the reference clock variables. .TP 7 -.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]] +.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]] This command can be used to alter several system variables in very exceptional circumstances. It should occur in the @@ -2852,6 +2852,21 @@ Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. .TP 7 +.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +.TP 7 +.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] +As for stepback, but for the forward direction. +.TP 7 .NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[] The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/ntp.conf.5mdoc b/contrib/ntp/ntpd/ntp.conf.5mdoc index 069a543cf2ea9..1a52a1257c4e4 100644 --- a/contrib/ntp/ntpd/ntp.conf.5mdoc +++ b/contrib/ntp/ntpd/ntp.conf.5mdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_CONF 5mdoc File Formats .Os .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.conf.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -2618,7 +2618,9 @@ holds the names of the reference clock variables. .Cm freq Ar freq | .Cm huffpuff Ar huffpuff | .Cm panic Ar panic | -.Cm step Ar srep | +.Cm step Ar step | +.Cm stepback Ar stepback | +.Cm stepfwd Ar stepfwd | .Cm stepout Ar stepout .Oc .Xc @@ -2678,6 +2680,19 @@ adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. +.It Cm stepback Ar stepback +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +.It Cm stepfwd Ar stepfwd +As for stepback, but for the forward direction. .It Cm stepout Ar stepout The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/ntp.conf.def b/contrib/ntp/ntpd/ntp.conf.def index 6f0bae12b3f56..e5c44b7565c77 100644 --- a/contrib/ntp/ntpd/ntp.conf.def +++ b/contrib/ntp/ntpd/ntp.conf.def @@ -2620,7 +2620,9 @@ holds the names of the reference clock variables. .Cm freq Ar freq | .Cm huffpuff Ar huffpuff | .Cm panic Ar panic | -.Cm step Ar srep | +.Cm step Ar step | +.Cm stepback Ar stepback | +.Cm stepfwd Ar stepfwd | .Cm stepout Ar stepout .Oc .Xc @@ -2680,6 +2682,19 @@ adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. +.It Cm stepback Ar stepback +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +.It Cm stepfwd Ar stepfwd +As for stepback, but for the forward direction. .It Cm stepout Ar stepout The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/ntp.conf.html b/contrib/ntp/ntpd/ntp.conf.html index b237cc025085e..7ab25e3756f42 100644 --- a/contrib/ntp/ntpd/ntp.conf.html +++ b/contrib/ntp/ntpd/ntp.conf.html @@ -33,7 +33,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <p>This document describes the configuration file for the NTP Project's <code>ntpd</code> program. - <p>This document applies to version 4.2.8p1 of <code>ntp.conf</code>. + <p>This document applies to version 4.2.8p2 of <code>ntp.conf</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -2463,7 +2463,7 @@ holds the names of all peer variables and the <code>clock_var_list</code> holds the names of the reference clock variables. -<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>srep</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in +<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>step</kbd><code> | stepback </code><kbd>stepback</kbd><code> | stepfwd </code><kbd>stepfwd</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in very exceptional circumstances. It should occur in the configuration file before any other configuration options. @@ -2513,6 +2513,17 @@ adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. +<br><dt><code>stepback</code> <kbd>stepback</kbd><dd>The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +<br><dt><code>stepfwd</code> <kbd>stepfwd</kbd><dd>As for stepback, but for the forward direction. <br><dt><code>stepout</code> <kbd>stepout</kbd><dd>The argument is the stepout timeout, which by default is 900 s. It can be set to any positive number in seconds. diff --git a/contrib/ntp/ntpd/ntp.conf.man.in b/contrib/ntp/ntpd/ntp.conf.man.in index ec2c866c750a0..548151d334c75 100644 --- a/contrib/ntp/ntpd/ntp.conf.man.in +++ b/contrib/ntp/ntpd/ntp.conf.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp.conf 5 "04 Feb 2015" "4.2.8p1" "File Formats" +.TH ntp.conf 5 "07 Apr 2015" "4.2.8p2" "File Formats" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-sPaOCn/ag-RPaGBn) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:46 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.conf.def .\" and the template file agman-cmd.tpl .SH NAME @@ -2786,7 +2786,7 @@ the names of all peer variables and the \fIclock_var_list\f[] holds the names of the reference clock variables. .TP 7 -.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]] +.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]] This command can be used to alter several system variables in very exceptional circumstances. It should occur in the @@ -2852,6 +2852,21 @@ Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. .TP 7 +.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +.TP 7 +.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] +As for stepback, but for the forward direction. +.TP 7 .NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[] The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/ntp.conf.mdoc.in b/contrib/ntp/ntpd/ntp.conf.mdoc.in index ec45a749c3a04..da935ed697ee3 100644 --- a/contrib/ntp/ntpd/ntp.conf.mdoc.in +++ b/contrib/ntp/ntpd/ntp.conf.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_CONF 5 File Formats .Os .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.conf.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -2618,7 +2618,9 @@ holds the names of the reference clock variables. .Cm freq Ar freq | .Cm huffpuff Ar huffpuff | .Cm panic Ar panic | -.Cm step Ar srep | +.Cm step Ar step | +.Cm stepback Ar stepback | +.Cm stepfwd Ar stepfwd | .Cm stepout Ar stepout .Oc .Xc @@ -2678,6 +2680,19 @@ adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. +.It Cm stepback Ar stepback +The argument is the step threshold for the backward direction, +which by default is 0.128 s. +It can +be set to any positive number in seconds. +If both the forward and backward step thresholds are set to zero, step +adjustments will never occur. +Note: The kernel time discipline is +disabled if +each direction of step threshold are either +set to zero or greater than .5 second. +.It Cm stepfwd Ar stepfwd +As for stepback, but for the forward direction. .It Cm stepout Ar stepout The argument is the stepout timeout, which by default is 900 s. It can diff --git a/contrib/ntp/ntpd/ntp.keys.5man b/contrib/ntp/ntpd/ntp.keys.5man index 7ba8b5815f04b..a505afb90dc62 100644 --- a/contrib/ntp/ntpd/ntp.keys.5man +++ b/contrib/ntp/ntpd/ntp.keys.5man @@ -1,8 +1,8 @@ -.TH ntp.keys 5man "04 Feb 2015" "4.2.8p1" "File Formats" +.TH ntp.keys 5man "07 Apr 2015" "4.2.8p2" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (ntp.man) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:51 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.keys.def .\" and the template file agman-file.tpl .Sh NAME diff --git a/contrib/ntp/ntpd/ntp.keys.5mdoc b/contrib/ntp/ntpd/ntp.keys.5mdoc index 8d7dacc0f1b16..a7157ec4e3940 100644 --- a/contrib/ntp/ntpd/ntp.keys.5mdoc +++ b/contrib/ntp/ntpd/ntp.keys.5mdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_KEYS 5mdoc File Formats .Os SunOS 5.10 .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.keys.def .\" and the template file agmdoc-file.tpl .Sh NAME diff --git a/contrib/ntp/ntpd/ntp.keys.html b/contrib/ntp/ntpd/ntp.keys.html index 2329476e15ff5..98a22ef0aedb7 100644 --- a/contrib/ntp/ntpd/ntp.keys.html +++ b/contrib/ntp/ntpd/ntp.keys.html @@ -33,7 +33,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <p>This document describes the symmetric key file for the NTP Project's <code>ntpd</code> program. - <p>This document applies to version 4.2.8p1 of <code>ntp.keys</code>. + <p>This document applies to version 4.2.8p2 of <code>ntp.keys</code>. <div class="shortcontents"> <h2>Short Contents</h2> diff --git a/contrib/ntp/ntpd/ntp.keys.man.in b/contrib/ntp/ntpd/ntp.keys.man.in index b1ec652d989fe..c7585afa16f3f 100644 --- a/contrib/ntp/ntpd/ntp.keys.man.in +++ b/contrib/ntp/ntpd/ntp.keys.man.in @@ -1,8 +1,8 @@ -.TH ntp.keys 5 "04 Feb 2015" "4.2.8p1" "File Formats" +.TH ntp.keys 5 "07 Apr 2015" "4.2.8p2" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (ntp.man) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:51 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.keys.def .\" and the template file agman-file.tpl .Sh NAME diff --git a/contrib/ntp/ntpd/ntp.keys.mdoc.in b/contrib/ntp/ntpd/ntp.keys.mdoc.in index 1f3fea54ab963..e6590db72fbbe 100644 --- a/contrib/ntp/ntpd/ntp.keys.mdoc.in +++ b/contrib/ntp/ntpd/ntp.keys.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_KEYS 5 File Formats .Os SunOS 5.10 .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp.keys.def .\" and the template file agmdoc-file.tpl .Sh NAME diff --git a/contrib/ntp/ntpd/ntp_config.c b/contrib/ntp/ntpd/ntp_config.c index b9f0e24e3ee1a..a224579d1cce9 100644 --- a/contrib/ntp/ntpd/ntp_config.c +++ b/contrib/ntp/ntpd/ntp_config.c @@ -2705,6 +2705,14 @@ config_tinker( item = LOOP_MAX; break; + case T_Stepback: + item = LOOP_MAX_BACK; + break; + + case T_Stepfwd: + item = LOOP_MAX_FWD; + break; + case T_Stepout: item = LOOP_MINSTEP; break; diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c index 6713670ed270e..7aac86a4dbe9f 100644 --- a/contrib/ntp/ntpd/ntp_control.c +++ b/contrib/ntp/ntpd/ntp_control.c @@ -228,7 +228,8 @@ static const struct ctl_proc control_codes[] = { #define CS_TIMER_OVERRUNS 86 #define CS_TIMER_XMTS 87 #define CS_FUZZ 88 -#define CS_MAX_NOAUTOKEY CS_FUZZ +#define CS_WANDER_THRESH 89 +#define CS_MAX_NOAUTOKEY CS_WANDER_THRESH #ifdef AUTOKEY #define CS_FLAGS (1 + CS_MAX_NOAUTOKEY) #define CS_HOST (2 + CS_MAX_NOAUTOKEY) @@ -423,6 +424,7 @@ static const struct ctl_var sys_var[] = { { CS_TIMER_OVERRUNS, RO, "timer_overruns" }, /* 86 */ { CS_TIMER_XMTS, RO, "timer_xmts" }, /* 87 */ { CS_FUZZ, RO, "fuzz" }, /* 88 */ + { CS_WANDER_THRESH, RO, "clk_wander_threshold" }, /* 89 */ #ifdef AUTOKEY { CS_FLAGS, RO, "flags" }, /* 1 + CS_MAX_NOAUTOKEY */ { CS_HOST, RO, "host" }, /* 2 + CS_MAX_NOAUTOKEY */ @@ -485,7 +487,7 @@ static const struct ctl_var peer_var[] = { { 0, PADDING, "" }, /* 0 */ { CP_CONFIG, RO, "config" }, /* 1 */ { CP_AUTHENABLE, RO, "authenable" }, /* 2 */ - { CP_AUTHENTIC, RO, "authentic" }, /* 3 */ + { CP_AUTHENTIC, RO, "authentic" }, /* 3 */ { CP_SRCADR, RO, "srcadr" }, /* 4 */ { CP_SRCPORT, RO, "srcport" }, /* 5 */ { CP_DSTADR, RO, "dstadr" }, /* 6 */ @@ -537,7 +539,7 @@ static const struct ctl_var peer_var[] = { { CP_FLAGS, RO, "flags" }, /* 1 + CP_MAX_NOAUTOKEY */ { CP_HOST, RO, "host" }, /* 2 + CP_MAX_NOAUTOKEY */ { CP_VALID, RO, "valid" }, /* 3 + CP_MAX_NOAUTOKEY */ - { CP_INITSEQ, RO, "initsequence" }, /* 4 + CP_MAX_NOAUTOKEY */ + { CP_INITSEQ, RO, "initsequence" }, /* 4 + CP_MAX_NOAUTOKEY */ { CP_INITKEY, RO, "initkey" }, /* 5 + CP_MAX_NOAUTOKEY */ { CP_INITTSP, RO, "timestamp" }, /* 6 + CP_MAX_NOAUTOKEY */ { CP_SIGNATURE, RO, "signature" }, /* 7 + CP_MAX_NOAUTOKEY */ @@ -690,37 +692,37 @@ int num_ctl_traps; */ #ifdef REFCLOCK static const u_char clocktypes[] = { - CTL_SST_TS_NTP, /* REFCLK_NONE (0) */ + CTL_SST_TS_NTP, /* REFCLK_NONE (0) */ CTL_SST_TS_LOCAL, /* REFCLK_LOCALCLOCK (1) */ - CTL_SST_TS_UHF, /* deprecated REFCLK_GPS_TRAK (2) */ + CTL_SST_TS_UHF, /* deprecated REFCLK_GPS_TRAK (2) */ CTL_SST_TS_HF, /* REFCLK_WWV_PST (3) */ CTL_SST_TS_LF, /* REFCLK_WWVB_SPECTRACOM (4) */ - CTL_SST_TS_UHF, /* REFCLK_TRUETIME (5) */ - CTL_SST_TS_UHF, /* REFCLK_IRIG_AUDIO (6) */ + CTL_SST_TS_UHF, /* REFCLK_TRUETIME (5) */ + CTL_SST_TS_UHF, /* REFCLK_IRIG_AUDIO (6) */ CTL_SST_TS_HF, /* REFCLK_CHU (7) */ CTL_SST_TS_LF, /* REFCLOCK_PARSE (default) (8) */ CTL_SST_TS_LF, /* REFCLK_GPS_MX4200 (9) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_AS2201 (10) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_ARBITER (11) */ - CTL_SST_TS_UHF, /* REFCLK_IRIG_TPRO (12) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_AS2201 (10) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_ARBITER (11) */ + CTL_SST_TS_UHF, /* REFCLK_IRIG_TPRO (12) */ CTL_SST_TS_ATOM, /* REFCLK_ATOM_LEITCH (13) */ CTL_SST_TS_LF, /* deprecated REFCLK_MSF_EES (14) */ - CTL_SST_TS_NTP, /* not used (15) */ - CTL_SST_TS_UHF, /* REFCLK_IRIG_BANCOMM (16) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_DATU (17) */ + CTL_SST_TS_NTP, /* not used (15) */ + CTL_SST_TS_UHF, /* REFCLK_IRIG_BANCOMM (16) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_DATU (17) */ CTL_SST_TS_TELEPHONE, /* REFCLK_NIST_ACTS (18) */ CTL_SST_TS_HF, /* REFCLK_WWV_HEATH (19) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_NMEA (20) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_VME (21) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_NMEA (20) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_VME (21) */ CTL_SST_TS_ATOM, /* REFCLK_ATOM_PPS (22) */ CTL_SST_TS_NTP, /* not used (23) */ CTL_SST_TS_NTP, /* not used (24) */ - CTL_SST_TS_NTP, /* not used (25) */ - CTL_SST_TS_UHF, /* REFCLK_GPS_HP (26) */ + CTL_SST_TS_NTP, /* not used (25) */ + CTL_SST_TS_UHF, /* REFCLK_GPS_HP (26) */ CTL_SST_TS_LF, /* REFCLK_ARCRON_MSF (27) */ CTL_SST_TS_UHF, /* REFCLK_SHM (28) */ - CTL_SST_TS_UHF, /* REFCLK_PALISADE (29) */ - CTL_SST_TS_UHF, /* REFCLK_ONCORE (30) */ + CTL_SST_TS_UHF, /* REFCLK_PALISADE (29) */ + CTL_SST_TS_UHF, /* REFCLK_ONCORE (30) */ CTL_SST_TS_UHF, /* REFCLK_JUPITER (31) */ CTL_SST_TS_LF, /* REFCLK_CHRONOLOG (32) */ CTL_SST_TS_LF, /* REFCLK_DUMBCLOCK (33) */ @@ -728,7 +730,7 @@ static const u_char clocktypes[] = { CTL_SST_TS_LF, /* REFCLK_PCF (35) */ CTL_SST_TS_HF, /* REFCLK_WWV (36) */ CTL_SST_TS_LF, /* REFCLK_FG (37) */ - CTL_SST_TS_UHF, /* REFCLK_HOPF_SERIAL (38) */ + CTL_SST_TS_UHF, /* REFCLK_HOPF_SERIAL (38) */ CTL_SST_TS_UHF, /* REFCLK_HOPF_PCI (39) */ CTL_SST_TS_LF, /* REFCLK_JJY (40) */ CTL_SST_TS_UHF, /* REFCLK_TT560 (41) */ @@ -759,17 +761,17 @@ static u_char ctl_sys_num_events; u_long ctltimereset; /* time stats reset */ u_long numctlreq; /* number of requests we've received */ u_long numctlbadpkts; /* number of bad control packets */ -u_long numctlresponses; /* number of resp packets sent with data */ -u_long numctlfrags; /* number of fragments sent */ +u_long numctlresponses; /* number of resp packets sent with data */ +u_long numctlfrags; /* number of fragments sent */ u_long numctlerrors; /* number of error responses sent */ u_long numctltooshort; /* number of too short input packets */ -u_long numctlinputresp; /* number of responses on input */ -u_long numctlinputfrag; /* number of fragments on input */ +u_long numctlinputresp; /* number of responses on input */ +u_long numctlinputfrag; /* number of fragments on input */ u_long numctlinputerr; /* number of input pkts with err bit set */ -u_long numctlbadoffset; /* number of input pkts with nonzero offset */ +u_long numctlbadoffset; /* number of input pkts with nonzero offset */ u_long numctlbadversion; /* number of input pkts with unknown version */ u_long numctldatatooshort; /* data too short for count */ -u_long numctlbadop; /* bad op code found in packet */ +u_long numctlbadop; /* bad op code found in packet */ u_long numasyncmsgs; /* number of async messages we've sent */ /* @@ -788,7 +790,7 @@ static int res_offset; /* offset of payload in response */ static u_char * datapt; static u_char * dataend; static int datalinelen; -static int datasent; /* flag to avoid initial ", " */ +static int datasent; /* flag to avoid initial ", " */ static int datanotbinflag; static sockaddr_u *rmt_addr; static struct interface *lcl_inter; @@ -852,7 +854,7 @@ ctl_error( * Fill in the fields. We assume rpkt.sequence and rpkt.associd * have already been filled in. */ - rpkt.r_m_e_op = (u_char)CTL_RESPONSE | CTL_ERROR | + rpkt.r_m_e_op = (u_char)CTL_RESPONSE | CTL_ERROR | (res_opcode & CTL_OP_MASK); rpkt.status = htons((u_short)(errcode << 8) & 0xff00); rpkt.count = 0; @@ -870,7 +872,7 @@ ctl_error( CTL_HEADER_LEN); } -/* +/* * save_config - Implements ntpq -c "saveconfig <filename>" * Writes current configuration including any runtime * changes by ntpq's :config or config-from-file @@ -934,7 +936,7 @@ save_config( if (0 == strftime(filename, sizeof(filename), filespec, localtime(&now))) strlcpy(filename, filespec, sizeof(filename)); - + /* * Conceptually we should be searching for DIRSEP in filename, * however Windows actually recognizes both forward and @@ -1324,7 +1326,7 @@ static void ctl_putdata( const char *dp, unsigned int dlen, - int bin /* set to 1 when data is binary */ + int bin /* set to 1 when data is binary */ ) { int overhead; @@ -1694,7 +1696,7 @@ ctl_putrefid( return; iptr = (char *)&refid; iplim = iptr + sizeof(refid); - for ( ; optr < oplim && iptr < iplim && '\0' != *iptr; + for ( ; optr < oplim && iptr < iplim && '\0' != *iptr; iptr++, optr++) if (isprint((int)*iptr)) *optr = *iptr; @@ -1762,7 +1764,7 @@ ctl_putsys( static const double to_ms = # ifdef STA_NANO - 1.0e-6; /* nsec to msec */ + 1.0e-6; /* nsec to msec */ # else 1.0e-3; /* usec to msec */ # endif @@ -1954,12 +1956,12 @@ ctl_putsys( ctl_putdata(buf, (unsigned)( buffp - buf ), 0); break; } - + case CS_TAI: if (sys_tai > 0) ctl_putuint(sys_var[CS_TAI].text, sys_tai); break; - + case CS_LEAPTAB: { leap_signature_t lsig; @@ -1968,7 +1970,7 @@ ctl_putsys( ctl_putfs(sys_var[CS_LEAPTAB].text, lsig.ttime); break; } - + case CS_LEAPEND: { leap_signature_t lsig; @@ -2113,7 +2115,7 @@ ctl_putsys( break; case CS_AUTHRESET: - ctl_putuint(sys_var[varid].text, + ctl_putuint(sys_var[varid].text, current_time - auth_timereset); break; @@ -2147,7 +2149,7 @@ ctl_putsys( case CS_K_OFFSET: CTL_IF_KERNLOOP( - ctl_putdblf, + ctl_putdblf, (sys_var[varid].text, 0, -1, to_ms * ntx.offset) ); break; @@ -2327,6 +2329,9 @@ ctl_putsys( case CS_FUZZ: ctl_putdbl(sys_var[varid].text, sys_fuzz * 1e3); break; + case CS_WANDER_THRESH: + ctl_putdbl(sys_var[varid].text, wander_threshold * 1e6); + break; #ifdef AUTOKEY case CS_FLAGS: if (crypto_flags) @@ -2633,7 +2638,7 @@ ctl_putpeer( memcpy(s, k->text, i); s += i; } - if (s + 2 < be) { + if (s + 2 < be) { *s++ = '"'; *s = '\0'; ctl_putdata(buf, (u_int)(s - buf), 0); @@ -2712,7 +2717,7 @@ ctl_putpeer( strlen(p->ident)); break; - + #endif /* AUTOKEY */ } } @@ -2821,7 +2826,7 @@ ctl_putclock( sizeof(buf)) break; /* really long var name */ - snprintf(s, sizeof(buf), "%s=\"", + snprintf(s, sizeof(buf), "%s=\"", clock_var[CC_VARLIST].text); s += strlen(s); t = s; @@ -3309,7 +3314,7 @@ static void configure( snprintf(remote_config.err_msg, sizeof(remote_config.err_msg), "runtime configuration prohibited by restrict ... nomodify"); - ctl_putdata(remote_config.err_msg, + ctl_putdata(remote_config.err_msg, strlen(remote_config.err_msg), 0); ctl_flushpkt(0); NLOG(NLOG_SYSINFO) @@ -3365,7 +3370,7 @@ static void configure( config_remotely(&rbufp->recv_srcadr); - /* + /* * Check if errors were reported. If not, output 'Config * Succeeded'. Else output the error count. It would be nice * to output any parser error messages. @@ -3374,10 +3379,10 @@ static void configure( retval = snprintf(remote_config.err_msg, sizeof(remote_config.err_msg), "Config Succeeded"); - if (retval > 0) + if (retval > 0) remote_config.err_pos += retval; } - + ctl_putdata(remote_config.err_msg, remote_config.err_pos, 0); ctl_flushpkt(0); @@ -3790,7 +3795,7 @@ static void read_mru_list( while (NULL != (v = ctl_getitem(in_parms, &val)) && !(EOV & v->flags)) { - int si; + int si; if (!strcmp(nonce_text, v->text)) { if (NULL != pnonce) @@ -3887,7 +3892,7 @@ static void read_mru_list( pch = sptoa(&mon->rmtadr); ctl_putunqstr("addr.older", pch, strlen(pch)); - /* + /* * Move on to the first entry the client doesn't have, * except in the special case of a limit of one. In * that case return the starting point entry. @@ -3897,7 +3902,7 @@ static void read_mru_list( } else { /* start with the oldest */ mon = TAIL_DLIST(mon_mru_list, mru); } - + /* * send up to limit= entries in up to frags= datagrams */ @@ -4656,7 +4661,7 @@ ctlfindtrap( for (n = 0; n < COUNTOF(ctl_traps); n++) if ((ctl_traps[n].tr_flags & TRAP_INUSE) && ADDR_PORT_EQ(raddr, &ctl_traps[n].tr_addr) - && (linter == ctl_traps[n].tr_localaddr)) + && (linter == ctl_traps[n].tr_localaddr)) return &ctl_traps[n]; return NULL; @@ -4713,7 +4718,7 @@ report_event( const char * src; u_char errlast; - errlast = (u_char)err & ~PEER_EVENT; + errlast = (u_char)err & ~PEER_EVENT; if (peer->last_event == errlast) peer->num_events = 0; if (peer->num_events >= CTL_PEER_MAXEVENTS) @@ -4985,7 +4990,7 @@ get_ext_sys_var(const char *tag) } } } - + return val; } diff --git a/contrib/ntp/ntpd/ntp_crypto.c b/contrib/ntp/ntpd/ntp_crypto.c index 8edc357f8ddd4..7a5a1008e04e8 100644 --- a/contrib/ntp/ntpd/ntp_crypto.c +++ b/contrib/ntp/ntpd/ntp_crypto.c @@ -1731,7 +1731,7 @@ crypto_args( tstamp_t tstamp; /* NTP timestamp */ struct exten *ep; /* extension field pointer */ u_int len; /* extension field length */ - size_t slen; + size_t slen = 0; tstamp = crypto_time(); len = sizeof(struct exten); diff --git a/contrib/ntp/ntpd/ntp_keyword.h b/contrib/ntp/ntpd/ntp_keyword.h index 131cf0fab1f9e..723793636b7e6 100644 --- a/contrib/ntp/ntpd/ntp_keyword.h +++ b/contrib/ntp/ntpd/ntp_keyword.h @@ -2,7 +2,7 @@ * ntp_keyword.h * * NOTE: edit this file with caution, it is generated by keyword-gen.c - * Generated 2015-01-03 23:51:10 UTC diff_ignore_line + * Generated 2015-03-16 09:05:44 UTC diff_ignore_line * */ #include "ntp_scanner.h" @@ -10,7 +10,7 @@ #define LOWEST_KEYWORD_ID 258 -const char * const keyword_text[187] = { +const char * const keyword_text[189] = { /* 0 258 T_Abbrev */ "abbrev", /* 1 259 T_Age */ "age", /* 2 260 T_All */ "all", @@ -160,49 +160,51 @@ const char * const keyword_text[187] = { /* 146 404 T_Stats */ "stats", /* 147 405 T_Statsdir */ "statsdir", /* 148 406 T_Step */ "step", - /* 149 407 T_Stepout */ "stepout", - /* 150 408 T_Stratum */ "stratum", - /* 151 409 T_String */ NULL, - /* 152 410 T_Sys */ "sys", - /* 153 411 T_Sysstats */ "sysstats", - /* 154 412 T_Tick */ "tick", - /* 155 413 T_Time1 */ "time1", - /* 156 414 T_Time2 */ "time2", - /* 157 415 T_Timer */ "timer", - /* 158 416 T_Timingstats */ "timingstats", - /* 159 417 T_Tinker */ "tinker", - /* 160 418 T_Tos */ "tos", - /* 161 419 T_Trap */ "trap", - /* 162 420 T_True */ "true", - /* 163 421 T_Trustedkey */ "trustedkey", - /* 164 422 T_Ttl */ "ttl", - /* 165 423 T_Type */ "type", - /* 166 424 T_U_int */ NULL, - /* 167 425 T_Unconfig */ "unconfig", - /* 168 426 T_Unpeer */ "unpeer", - /* 169 427 T_Version */ "version", - /* 170 428 T_WanderThreshold */ NULL, - /* 171 429 T_Week */ "week", - /* 172 430 T_Wildcard */ "wildcard", - /* 173 431 T_Xleave */ "xleave", - /* 174 432 T_Year */ "year", - /* 175 433 T_Flag */ NULL, - /* 176 434 T_EOC */ NULL, - /* 177 435 T_Simulate */ "simulate", - /* 178 436 T_Beep_Delay */ "beep_delay", - /* 179 437 T_Sim_Duration */ "simulation_duration", - /* 180 438 T_Server_Offset */ "server_offset", - /* 181 439 T_Duration */ "duration", - /* 182 440 T_Freq_Offset */ "freq_offset", - /* 183 441 T_Wander */ "wander", - /* 184 442 T_Jitter */ "jitter", - /* 185 443 T_Prop_Delay */ "prop_delay", - /* 186 444 T_Proc_Delay */ "proc_delay" + /* 149 407 T_Stepback */ "stepback", + /* 150 408 T_Stepfwd */ "stepfwd", + /* 151 409 T_Stepout */ "stepout", + /* 152 410 T_Stratum */ "stratum", + /* 153 411 T_String */ NULL, + /* 154 412 T_Sys */ "sys", + /* 155 413 T_Sysstats */ "sysstats", + /* 156 414 T_Tick */ "tick", + /* 157 415 T_Time1 */ "time1", + /* 158 416 T_Time2 */ "time2", + /* 159 417 T_Timer */ "timer", + /* 160 418 T_Timingstats */ "timingstats", + /* 161 419 T_Tinker */ "tinker", + /* 162 420 T_Tos */ "tos", + /* 163 421 T_Trap */ "trap", + /* 164 422 T_True */ "true", + /* 165 423 T_Trustedkey */ "trustedkey", + /* 166 424 T_Ttl */ "ttl", + /* 167 425 T_Type */ "type", + /* 168 426 T_U_int */ NULL, + /* 169 427 T_Unconfig */ "unconfig", + /* 170 428 T_Unpeer */ "unpeer", + /* 171 429 T_Version */ "version", + /* 172 430 T_WanderThreshold */ NULL, + /* 173 431 T_Week */ "week", + /* 174 432 T_Wildcard */ "wildcard", + /* 175 433 T_Xleave */ "xleave", + /* 176 434 T_Year */ "year", + /* 177 435 T_Flag */ NULL, + /* 178 436 T_EOC */ NULL, + /* 179 437 T_Simulate */ "simulate", + /* 180 438 T_Beep_Delay */ "beep_delay", + /* 181 439 T_Sim_Duration */ "simulation_duration", + /* 182 440 T_Server_Offset */ "server_offset", + /* 183 441 T_Duration */ "duration", + /* 184 442 T_Freq_Offset */ "freq_offset", + /* 185 443 T_Wander */ "wander", + /* 186 444 T_Jitter */ "jitter", + /* 187 445 T_Prop_Delay */ "prop_delay", + /* 188 446 T_Proc_Delay */ "proc_delay" }; -#define SCANNER_INIT_S 830 +#define SCANNER_INIT_S 837 -const scan_state sst[833] = { +const scan_state sst[840] = { /*SS_T( ch, f-by, match, other ), */ 0, /* 0 */ S_ST( '-', 3, 322, 0 ), /* 1 */ @@ -248,7 +250,7 @@ const scan_state sst[833] = { S_ST( 'd', 3, 42, 0 ), /* 41 beep_ */ S_ST( 'e', 3, 43, 0 ), /* 42 beep_d */ S_ST( 'l', 3, 44, 0 ), /* 43 beep_de */ - S_ST( 'a', 3, 436, 0 ), /* 44 beep_del */ + S_ST( 'a', 3, 438, 0 ), /* 44 beep_del */ S_ST( 'r', 3, 46, 34 ), /* 45 b */ S_ST( 'o', 3, 47, 0 ), /* 46 br */ S_ST( 'a', 3, 48, 0 ), /* 47 bro */ @@ -346,7 +348,7 @@ const scan_state sst[833] = { S_ST( 'a', 3, 140, 0 ), /* 139 dur */ S_ST( 't', 3, 141, 0 ), /* 140 dura */ S_ST( 'i', 3, 142, 0 ), /* 141 durat */ - S_ST( 'o', 3, 439, 0 ), /* 142 durati */ + S_ST( 'o', 3, 441, 0 ), /* 142 durati */ S_ST( 'e', 3, 144, 105 ), /* 143 */ S_ST( 'n', 3, 292, 0 ), /* 144 e */ S_ST( 'a', 3, 146, 0 ), /* 145 en */ @@ -372,7 +374,7 @@ const scan_state sst[833] = { S_ST( 'f', 3, 166, 0 ), /* 165 freq_o */ S_ST( 'f', 3, 167, 0 ), /* 166 freq_of */ S_ST( 's', 3, 168, 0 ), /* 167 freq_off */ - S_ST( 'e', 3, 440, 0 ), /* 168 freq_offs */ + S_ST( 'e', 3, 442, 0 ), /* 168 freq_offs */ S_ST( 'u', 3, 170, 161 ), /* 169 f */ S_ST( 'd', 3, 171, 0 ), /* 170 fu */ S_ST( 'g', 3, 304, 0 ), /* 171 fud */ @@ -432,7 +434,7 @@ const scan_state sst[833] = { S_ST( 'i', 3, 226, 0 ), /* 225 j */ S_ST( 't', 3, 227, 0 ), /* 226 ji */ S_ST( 't', 3, 228, 0 ), /* 227 jit */ - S_ST( 'e', 3, 442, 0 ), /* 228 jitt */ + S_ST( 'e', 3, 444, 0 ), /* 228 jitt */ S_ST( 'k', 3, 236, 224 ), /* 229 */ S_ST( 'e', 3, 324, 0 ), /* 230 k */ S_ST( 'r', 3, 232, 0 ), /* 231 ke */ @@ -457,7 +459,7 @@ const scan_state sst[833] = { S_ST( 's', 3, 251, 249 ), /* 250 li */ S_ST( 't', 3, 252, 0 ), /* 251 lis */ S_ST( 'e', 3, 332, 0 ), /* 252 list */ - S_ST( 'o', 3, 447, 244 ), /* 253 l */ + S_ST( 'o', 3, 449, 244 ), /* 253 l */ S_ST( 'g', 3, 315, 0 ), /* 254 lo */ S_ST( 'c', 3, 256, 0 ), /* 255 log */ S_ST( 'o', 3, 257, 0 ), /* 256 logc */ @@ -521,7 +523,7 @@ const scan_state sst[833] = { S_ST( 'e', 1, 0, 0 ), /* 314 T_Includefile */ S_ST( 'f', 3, 317, 255 ), /* 315 log */ S_ST( 'e', 0, 0, 0 ), /* 316 T_Interface */ - S_ST( 'i', 3, 409, 0 ), /* 317 logf */ + S_ST( 'i', 3, 411, 0 ), /* 317 logf */ S_ST( 'o', 0, 0, 193 ), /* 318 T_Io */ S_ST( '4', 0, 0, 0 ), /* 319 T_Ipv4 */ S_ST( '4', 0, 0, 0 ), /* 320 T_Ipv4_flag */ @@ -551,7 +553,7 @@ const scan_state sst[833] = { S_ST( 'm', 0, 0, 0 ), /* 344 T_Maxmem */ S_ST( 'l', 0, 0, 0 ), /* 345 T_Maxpoll */ S_ST( 's', 0, 0, 0 ), /* 346 T_Mdnstries */ - S_ST( 'm', 0, 500, 0 ), /* 347 T_Mem */ + S_ST( 'm', 0, 502, 0 ), /* 347 T_Mem */ S_ST( 'k', 0, 0, 0 ), /* 348 T_Memlock */ S_ST( 'k', 0, 0, 0 ), /* 349 T_Minclock */ S_ST( 'h', 0, 0, 0 ), /* 350 T_Mindepth */ @@ -577,23 +579,23 @@ const scan_state sst[833] = { S_ST( 'e', 0, 0, 0 ), /* 370 T_Noserve */ S_ST( 'p', 0, 0, 0 ), /* 371 T_Notrap */ S_ST( 't', 0, 0, 0 ), /* 372 T_Notrust */ - S_ST( 'p', 0, 596, 0 ), /* 373 T_Ntp */ + S_ST( 'p', 0, 598, 0 ), /* 373 T_Ntp */ S_ST( 't', 0, 0, 0 ), /* 374 T_Ntpport */ S_ST( 't', 1, 0, 0 ), /* 375 T_NtpSignDsocket */ - S_ST( 'n', 0, 611, 0 ), /* 376 T_Orphan */ + S_ST( 'n', 0, 613, 0 ), /* 376 T_Orphan */ S_ST( 't', 0, 0, 0 ), /* 377 T_Orphanwait */ S_ST( 'c', 0, 0, 0 ), /* 378 T_Panic */ - S_ST( 'r', 1, 620, 0 ), /* 379 T_Peer */ + S_ST( 'r', 1, 622, 0 ), /* 379 T_Peer */ S_ST( 's', 0, 0, 0 ), /* 380 T_Peerstats */ S_ST( 'e', 2, 0, 0 ), /* 381 T_Phone */ - S_ST( 'd', 0, 628, 0 ), /* 382 T_Pid */ + S_ST( 'd', 0, 630, 0 ), /* 382 T_Pid */ S_ST( 'e', 1, 0, 0 ), /* 383 T_Pidfile */ S_ST( 'l', 1, 0, 0 ), /* 384 T_Pool */ S_ST( 't', 0, 0, 0 ), /* 385 T_Port */ S_ST( 't', 0, 0, 0 ), /* 386 T_Preempt */ S_ST( 'r', 0, 0, 0 ), /* 387 T_Prefer */ S_ST( 's', 0, 0, 0 ), /* 388 T_Protostats */ - S_ST( 'w', 1, 0, 634 ), /* 389 T_Pw */ + S_ST( 'w', 1, 0, 636 ), /* 389 T_Pw */ S_ST( 'e', 1, 0, 0 ), /* 390 T_Randfile */ S_ST( 's', 0, 0, 0 ), /* 391 T_Rawstats */ S_ST( 'd', 1, 0, 0 ), /* 392 T_Refid */ @@ -603,439 +605,446 @@ const scan_state sst[833] = { S_ST( 'e', 0, 0, 0 ), /* 396 T_Revoke */ S_ST( 't', 0, 0, 0 ), /* 397 T_Rlimit */ S_ST( 'r', 1, 0, 0 ), /* 398 T_Saveconfigdir */ - S_ST( 'r', 1, 711, 0 ), /* 399 T_Server */ + S_ST( 'r', 1, 713, 0 ), /* 399 T_Server */ S_ST( 'r', 1, 0, 0 ), /* 400 T_Setvar */ S_ST( 'e', 0, 0, 0 ), /* 401 T_Source */ S_ST( 'e', 0, 0, 0 ), /* 402 T_Stacksize */ S_ST( 's', 0, 0, 0 ), /* 403 T_Statistics */ - S_ST( 's', 0, 754, 749 ), /* 404 T_Stats */ + S_ST( 's', 0, 756, 751 ), /* 404 T_Stats */ S_ST( 'r', 1, 0, 0 ), /* 405 T_Statsdir */ - S_ST( 'p', 0, 757, 0 ), /* 406 T_Step */ - S_ST( 't', 0, 0, 0 ), /* 407 T_Stepout */ - S_ST( 'm', 0, 0, 0 ), /* 408 T_Stratum */ - S_ST( 'l', 3, 334, 0 ), /* 409 logfi */ - S_ST( 's', 0, 764, 0 ), /* 410 T_Sys */ - S_ST( 's', 0, 0, 0 ), /* 411 T_Sysstats */ - S_ST( 'k', 0, 0, 0 ), /* 412 T_Tick */ - S_ST( '1', 0, 0, 0 ), /* 413 T_Time1 */ - S_ST( '2', 0, 0, 413 ), /* 414 T_Time2 */ - S_ST( 'r', 0, 0, 414 ), /* 415 T_Timer */ - S_ST( 's', 0, 0, 0 ), /* 416 T_Timingstats */ - S_ST( 'r', 0, 0, 0 ), /* 417 T_Tinker */ - S_ST( 's', 0, 0, 0 ), /* 418 T_Tos */ - S_ST( 'p', 1, 0, 0 ), /* 419 T_Trap */ - S_ST( 'e', 0, 0, 0 ), /* 420 T_True */ - S_ST( 'y', 0, 0, 0 ), /* 421 T_Trustedkey */ - S_ST( 'l', 0, 0, 0 ), /* 422 T_Ttl */ - S_ST( 'e', 0, 0, 0 ), /* 423 T_Type */ - S_ST( 'o', 3, 428, 254 ), /* 424 lo */ - S_ST( 'g', 1, 0, 0 ), /* 425 T_Unconfig */ - S_ST( 'r', 1, 0, 0 ), /* 426 T_Unpeer */ - S_ST( 'n', 0, 0, 0 ), /* 427 T_Version */ - S_ST( 'p', 3, 433, 0 ), /* 428 loo */ - S_ST( 'k', 0, 0, 0 ), /* 429 T_Week */ - S_ST( 'd', 0, 0, 0 ), /* 430 T_Wildcard */ - S_ST( 'e', 0, 0, 0 ), /* 431 T_Xleave */ - S_ST( 'r', 0, 0, 0 ), /* 432 T_Year */ - S_ST( 's', 3, 434, 0 ), /* 433 loop */ - S_ST( 't', 3, 445, 0 ), /* 434 loops */ - S_ST( 'e', 0, 0, 0 ), /* 435 T_Simulate */ - S_ST( 'y', 0, 0, 0 ), /* 436 T_Beep_Delay */ - S_ST( 'n', 0, 0, 0 ), /* 437 T_Sim_Duration */ - S_ST( 't', 0, 0, 0 ), /* 438 T_Server_Offset */ - S_ST( 'n', 0, 0, 0 ), /* 439 T_Duration */ - S_ST( 't', 0, 0, 0 ), /* 440 T_Freq_Offset */ - S_ST( 'r', 0, 0, 0 ), /* 441 T_Wander */ - S_ST( 'r', 0, 0, 0 ), /* 442 T_Jitter */ - S_ST( 'y', 0, 0, 0 ), /* 443 T_Prop_Delay */ - S_ST( 'y', 0, 0, 0 ), /* 444 T_Proc_Delay */ - S_ST( 'a', 3, 446, 0 ), /* 445 loopst */ - S_ST( 't', 3, 335, 0 ), /* 446 loopsta */ - S_ST( 'w', 3, 448, 424 ), /* 447 lo */ - S_ST( 'p', 3, 449, 0 ), /* 448 low */ - S_ST( 'r', 3, 450, 0 ), /* 449 lowp */ - S_ST( 'i', 3, 451, 0 ), /* 450 lowpr */ - S_ST( 'o', 3, 452, 0 ), /* 451 lowpri */ - S_ST( 't', 3, 453, 0 ), /* 452 lowprio */ - S_ST( 'r', 3, 454, 0 ), /* 453 lowpriot */ - S_ST( 'a', 3, 336, 0 ), /* 454 lowpriotr */ - S_ST( 'm', 3, 536, 237 ), /* 455 */ - S_ST( 'a', 3, 474, 0 ), /* 456 m */ - S_ST( 'n', 3, 458, 0 ), /* 457 ma */ - S_ST( 'y', 3, 459, 0 ), /* 458 man */ - S_ST( 'c', 3, 460, 0 ), /* 459 many */ - S_ST( 'a', 3, 461, 0 ), /* 460 manyc */ - S_ST( 's', 3, 462, 0 ), /* 461 manyca */ - S_ST( 't', 3, 468, 0 ), /* 462 manycas */ - S_ST( 'c', 3, 464, 0 ), /* 463 manycast */ - S_ST( 'l', 3, 465, 0 ), /* 464 manycastc */ - S_ST( 'i', 3, 466, 0 ), /* 465 manycastcl */ - S_ST( 'e', 3, 467, 0 ), /* 466 manycastcli */ - S_ST( 'n', 3, 337, 0 ), /* 467 manycastclie */ - S_ST( 's', 3, 469, 463 ), /* 468 manycast */ - S_ST( 'e', 3, 470, 0 ), /* 469 manycasts */ - S_ST( 'r', 3, 471, 0 ), /* 470 manycastse */ - S_ST( 'v', 3, 472, 0 ), /* 471 manycastser */ - S_ST( 'e', 3, 338, 0 ), /* 472 manycastserv */ - S_ST( 's', 3, 339, 457 ), /* 473 ma */ - S_ST( 'x', 3, 489, 473 ), /* 474 ma */ - S_ST( 'a', 3, 476, 0 ), /* 475 max */ - S_ST( 'g', 3, 340, 0 ), /* 476 maxa */ - S_ST( 'c', 3, 478, 475 ), /* 477 max */ - S_ST( 'l', 3, 479, 0 ), /* 478 maxc */ - S_ST( 'o', 3, 480, 0 ), /* 479 maxcl */ - S_ST( 'c', 3, 341, 0 ), /* 480 maxclo */ - S_ST( 'd', 3, 485, 477 ), /* 481 max */ - S_ST( 'e', 3, 483, 0 ), /* 482 maxd */ - S_ST( 'p', 3, 484, 0 ), /* 483 maxde */ - S_ST( 't', 3, 342, 0 ), /* 484 maxdep */ - S_ST( 'i', 3, 486, 482 ), /* 485 maxd */ - S_ST( 's', 3, 343, 0 ), /* 486 maxdi */ - S_ST( 'm', 3, 488, 481 ), /* 487 max */ - S_ST( 'e', 3, 344, 0 ), /* 488 maxm */ - S_ST( 'p', 3, 490, 487 ), /* 489 max */ - S_ST( 'o', 3, 491, 0 ), /* 490 maxp */ - S_ST( 'l', 3, 345, 0 ), /* 491 maxpo */ - S_ST( 'd', 3, 493, 456 ), /* 492 m */ - S_ST( 'n', 3, 494, 0 ), /* 493 md */ - S_ST( 's', 3, 495, 0 ), /* 494 mdn */ - S_ST( 't', 3, 496, 0 ), /* 495 mdns */ - S_ST( 'r', 3, 497, 0 ), /* 496 mdnst */ - S_ST( 'i', 3, 498, 0 ), /* 497 mdnstr */ - S_ST( 'e', 3, 346, 0 ), /* 498 mdnstri */ - S_ST( 'e', 3, 347, 492 ), /* 499 m */ - S_ST( 'l', 3, 501, 0 ), /* 500 mem */ - S_ST( 'o', 3, 502, 0 ), /* 501 meml */ - S_ST( 'c', 3, 348, 0 ), /* 502 memlo */ - S_ST( 'i', 3, 504, 499 ), /* 503 m */ - S_ST( 'n', 3, 521, 0 ), /* 504 mi */ - S_ST( 'c', 3, 506, 0 ), /* 505 min */ - S_ST( 'l', 3, 507, 0 ), /* 506 minc */ - S_ST( 'o', 3, 508, 0 ), /* 507 mincl */ - S_ST( 'c', 3, 349, 0 ), /* 508 minclo */ - S_ST( 'd', 3, 513, 505 ), /* 509 min */ - S_ST( 'e', 3, 511, 0 ), /* 510 mind */ - S_ST( 'p', 3, 512, 0 ), /* 511 minde */ - S_ST( 't', 3, 350, 0 ), /* 512 mindep */ - S_ST( 'i', 3, 514, 510 ), /* 513 mind */ - S_ST( 's', 3, 351, 0 ), /* 514 mindi */ - S_ST( 'i', 3, 516, 509 ), /* 515 min */ - S_ST( 'm', 3, 517, 0 ), /* 516 mini */ - S_ST( 'u', 3, 352, 0 ), /* 517 minim */ - S_ST( 'p', 3, 519, 515 ), /* 518 min */ - S_ST( 'o', 3, 520, 0 ), /* 519 minp */ - S_ST( 'l', 3, 353, 0 ), /* 520 minpo */ - S_ST( 's', 3, 522, 518 ), /* 521 min */ - S_ST( 'a', 3, 523, 0 ), /* 522 mins */ - S_ST( 'n', 3, 354, 0 ), /* 523 minsa */ - S_ST( 'o', 3, 526, 503 ), /* 524 m */ - S_ST( 'd', 3, 355, 0 ), /* 525 mo */ - S_ST( 'n', 3, 530, 525 ), /* 526 mo */ - S_ST( 'i', 3, 528, 0 ), /* 527 mon */ - S_ST( 't', 3, 529, 0 ), /* 528 moni */ - S_ST( 'o', 3, 357, 0 ), /* 529 monit */ - S_ST( 't', 3, 358, 527 ), /* 530 mon */ - S_ST( 'r', 3, 359, 524 ), /* 531 m */ - S_ST( 's', 3, 533, 531 ), /* 532 m */ - S_ST( 's', 3, 534, 0 ), /* 533 ms */ - S_ST( 'n', 3, 535, 0 ), /* 534 mss */ - S_ST( 't', 3, 328, 0 ), /* 535 mssn */ - S_ST( 'u', 3, 537, 532 ), /* 536 m */ - S_ST( 'l', 3, 538, 0 ), /* 537 mu */ - S_ST( 't', 3, 539, 0 ), /* 538 mul */ - S_ST( 'i', 3, 540, 0 ), /* 539 mult */ - S_ST( 'c', 3, 541, 0 ), /* 540 multi */ - S_ST( 'a', 3, 542, 0 ), /* 541 multic */ - S_ST( 's', 3, 543, 0 ), /* 542 multica */ - S_ST( 't', 3, 544, 0 ), /* 543 multicas */ - S_ST( 'c', 3, 545, 0 ), /* 544 multicast */ - S_ST( 'l', 3, 546, 0 ), /* 545 multicastc */ - S_ST( 'i', 3, 547, 0 ), /* 546 multicastcl */ - S_ST( 'e', 3, 548, 0 ), /* 547 multicastcli */ - S_ST( 'n', 3, 360, 0 ), /* 548 multicastclie */ - S_ST( 'n', 3, 592, 455 ), /* 549 */ - S_ST( 'i', 3, 361, 0 ), /* 550 n */ - S_ST( 'o', 3, 587, 550 ), /* 551 n */ - S_ST( 'l', 3, 553, 0 ), /* 552 no */ - S_ST( 'i', 3, 554, 0 ), /* 553 nol */ - S_ST( 'n', 3, 362, 0 ), /* 554 noli */ - S_ST( 'm', 3, 560, 552 ), /* 555 no */ - S_ST( 'o', 3, 557, 0 ), /* 556 nom */ - S_ST( 'd', 3, 558, 0 ), /* 557 nomo */ - S_ST( 'i', 3, 559, 0 ), /* 558 nomod */ - S_ST( 'f', 3, 363, 0 ), /* 559 nomodi */ - S_ST( 'r', 3, 561, 556 ), /* 560 nom */ - S_ST( 'u', 3, 562, 0 ), /* 561 nomr */ - S_ST( 'l', 3, 563, 0 ), /* 562 nomru */ - S_ST( 'i', 3, 564, 0 ), /* 563 nomrul */ - S_ST( 's', 3, 364, 0 ), /* 564 nomruli */ - S_ST( 'n', 3, 566, 555 ), /* 565 no */ - S_ST( 'v', 3, 567, 365 ), /* 566 non */ - S_ST( 'o', 3, 568, 0 ), /* 567 nonv */ - S_ST( 'l', 3, 569, 0 ), /* 568 nonvo */ - S_ST( 'a', 3, 570, 0 ), /* 569 nonvol */ - S_ST( 't', 3, 571, 0 ), /* 570 nonvola */ - S_ST( 'i', 3, 572, 0 ), /* 571 nonvolat */ - S_ST( 'l', 3, 366, 0 ), /* 572 nonvolati */ - S_ST( 'p', 3, 574, 565 ), /* 573 no */ - S_ST( 'e', 3, 575, 0 ), /* 574 nop */ - S_ST( 'e', 3, 367, 0 ), /* 575 nope */ - S_ST( 'q', 3, 577, 573 ), /* 576 no */ - S_ST( 'u', 3, 578, 0 ), /* 577 noq */ - S_ST( 'e', 3, 579, 0 ), /* 578 noqu */ - S_ST( 'r', 3, 368, 0 ), /* 579 noque */ - S_ST( 's', 3, 581, 576 ), /* 580 no */ - S_ST( 'e', 3, 585, 0 ), /* 581 nos */ - S_ST( 'l', 3, 583, 0 ), /* 582 nose */ - S_ST( 'e', 3, 584, 0 ), /* 583 nosel */ - S_ST( 'c', 3, 369, 0 ), /* 584 nosele */ - S_ST( 'r', 3, 586, 582 ), /* 585 nose */ - S_ST( 'v', 3, 370, 0 ), /* 586 noser */ - S_ST( 't', 3, 588, 580 ), /* 587 no */ - S_ST( 'r', 3, 590, 0 ), /* 588 not */ - S_ST( 'a', 3, 371, 0 ), /* 589 notr */ - S_ST( 'u', 3, 591, 589 ), /* 590 notr */ - S_ST( 's', 3, 372, 0 ), /* 591 notru */ - S_ST( 't', 3, 373, 551 ), /* 592 n */ - S_ST( 'p', 3, 594, 0 ), /* 593 ntp */ - S_ST( 'o', 3, 595, 0 ), /* 594 ntpp */ - S_ST( 'r', 3, 374, 0 ), /* 595 ntppo */ - S_ST( 's', 3, 597, 593 ), /* 596 ntp */ - S_ST( 'i', 3, 598, 0 ), /* 597 ntps */ - S_ST( 'g', 3, 599, 0 ), /* 598 ntpsi */ - S_ST( 'n', 3, 600, 0 ), /* 599 ntpsig */ - S_ST( 'd', 3, 601, 0 ), /* 600 ntpsign */ - S_ST( 's', 3, 602, 0 ), /* 601 ntpsignd */ - S_ST( 'o', 3, 603, 0 ), /* 602 ntpsignds */ - S_ST( 'c', 3, 604, 0 ), /* 603 ntpsigndso */ - S_ST( 'k', 3, 605, 0 ), /* 604 ntpsigndsoc */ - S_ST( 'e', 3, 375, 0 ), /* 605 ntpsigndsock */ - S_ST( 'o', 3, 607, 549 ), /* 606 */ - S_ST( 'r', 3, 608, 0 ), /* 607 o */ - S_ST( 'p', 3, 609, 0 ), /* 608 or */ - S_ST( 'h', 3, 610, 0 ), /* 609 orp */ - S_ST( 'a', 3, 376, 0 ), /* 610 orph */ - S_ST( 'w', 3, 612, 0 ), /* 611 orphan */ - S_ST( 'a', 3, 613, 0 ), /* 612 orphanw */ - S_ST( 'i', 3, 377, 0 ), /* 613 orphanwa */ - S_ST( 'p', 3, 389, 606 ), /* 614 */ - S_ST( 'a', 3, 616, 0 ), /* 615 p */ - S_ST( 'n', 3, 617, 0 ), /* 616 pa */ - S_ST( 'i', 3, 378, 0 ), /* 617 pan */ - S_ST( 'e', 3, 619, 615 ), /* 618 p */ - S_ST( 'e', 3, 379, 0 ), /* 619 pe */ - S_ST( 's', 3, 621, 0 ), /* 620 peer */ - S_ST( 't', 3, 622, 0 ), /* 621 peers */ - S_ST( 'a', 3, 623, 0 ), /* 622 peerst */ - S_ST( 't', 3, 380, 0 ), /* 623 peersta */ - S_ST( 'h', 3, 625, 618 ), /* 624 p */ - S_ST( 'o', 3, 626, 0 ), /* 625 ph */ - S_ST( 'n', 3, 381, 0 ), /* 626 pho */ - S_ST( 'i', 3, 382, 624 ), /* 627 p */ - S_ST( 'f', 3, 629, 0 ), /* 628 pid */ - S_ST( 'i', 3, 630, 0 ), /* 629 pidf */ - S_ST( 'l', 3, 383, 0 ), /* 630 pidfi */ - S_ST( 'o', 3, 633, 627 ), /* 631 p */ - S_ST( 'o', 3, 384, 0 ), /* 632 po */ - S_ST( 'r', 3, 385, 632 ), /* 633 po */ - S_ST( 'r', 3, 641, 631 ), /* 634 p */ - S_ST( 'e', 3, 639, 0 ), /* 635 pr */ - S_ST( 'e', 3, 637, 0 ), /* 636 pre */ - S_ST( 'm', 3, 638, 0 ), /* 637 pree */ - S_ST( 'p', 3, 386, 0 ), /* 638 preem */ - S_ST( 'f', 3, 640, 636 ), /* 639 pre */ - S_ST( 'e', 3, 387, 0 ), /* 640 pref */ - S_ST( 'o', 3, 654, 635 ), /* 641 pr */ - S_ST( 'c', 3, 643, 0 ), /* 642 pro */ - S_ST( '_', 3, 644, 0 ), /* 643 proc */ - S_ST( 'd', 3, 645, 0 ), /* 644 proc_ */ - S_ST( 'e', 3, 646, 0 ), /* 645 proc_d */ - S_ST( 'l', 3, 647, 0 ), /* 646 proc_de */ - S_ST( 'a', 3, 444, 0 ), /* 647 proc_del */ - S_ST( 'p', 3, 649, 642 ), /* 648 pro */ - S_ST( '_', 3, 650, 0 ), /* 649 prop */ - S_ST( 'd', 3, 651, 0 ), /* 650 prop_ */ - S_ST( 'e', 3, 652, 0 ), /* 651 prop_d */ - S_ST( 'l', 3, 653, 0 ), /* 652 prop_de */ - S_ST( 'a', 3, 443, 0 ), /* 653 prop_del */ - S_ST( 't', 3, 655, 648 ), /* 654 pro */ - S_ST( 'o', 3, 656, 0 ), /* 655 prot */ - S_ST( 's', 3, 657, 0 ), /* 656 proto */ - S_ST( 't', 3, 658, 0 ), /* 657 protos */ - S_ST( 'a', 3, 659, 0 ), /* 658 protost */ - S_ST( 't', 3, 388, 0 ), /* 659 protosta */ - S_ST( 'r', 3, 691, 614 ), /* 660 */ - S_ST( 'a', 3, 667, 0 ), /* 661 r */ - S_ST( 'n', 3, 663, 0 ), /* 662 ra */ - S_ST( 'd', 3, 664, 0 ), /* 663 ran */ - S_ST( 'f', 3, 665, 0 ), /* 664 rand */ - S_ST( 'i', 3, 666, 0 ), /* 665 randf */ - S_ST( 'l', 3, 390, 0 ), /* 666 randfi */ - S_ST( 'w', 3, 668, 662 ), /* 667 ra */ - S_ST( 's', 3, 669, 0 ), /* 668 raw */ - S_ST( 't', 3, 670, 0 ), /* 669 raws */ - S_ST( 'a', 3, 671, 0 ), /* 670 rawst */ - S_ST( 't', 3, 391, 0 ), /* 671 rawsta */ - S_ST( 'e', 3, 688, 661 ), /* 672 r */ - S_ST( 'f', 3, 674, 0 ), /* 673 re */ - S_ST( 'i', 3, 392, 0 ), /* 674 ref */ - S_ST( 'q', 3, 676, 673 ), /* 675 re */ - S_ST( 'u', 3, 677, 0 ), /* 676 req */ - S_ST( 'e', 3, 678, 0 ), /* 677 requ */ - S_ST( 's', 3, 679, 0 ), /* 678 reque */ - S_ST( 't', 3, 680, 0 ), /* 679 reques */ - S_ST( 'k', 3, 681, 0 ), /* 680 request */ - S_ST( 'e', 3, 393, 0 ), /* 681 requestk */ - S_ST( 's', 3, 684, 675 ), /* 682 re */ - S_ST( 'e', 3, 394, 0 ), /* 683 res */ - S_ST( 't', 3, 685, 683 ), /* 684 res */ - S_ST( 'r', 3, 686, 0 ), /* 685 rest */ - S_ST( 'i', 3, 687, 0 ), /* 686 restr */ - S_ST( 'c', 3, 395, 0 ), /* 687 restri */ - S_ST( 'v', 3, 689, 682 ), /* 688 re */ - S_ST( 'o', 3, 690, 0 ), /* 689 rev */ - S_ST( 'k', 3, 396, 0 ), /* 690 revo */ - S_ST( 'l', 3, 692, 672 ), /* 691 r */ - S_ST( 'i', 3, 693, 0 ), /* 692 rl */ - S_ST( 'm', 3, 694, 0 ), /* 693 rli */ - S_ST( 'i', 3, 397, 0 ), /* 694 rlim */ - S_ST( 's', 3, 763, 660 ), /* 695 */ - S_ST( 'a', 3, 697, 0 ), /* 696 s */ - S_ST( 'v', 3, 698, 0 ), /* 697 sa */ - S_ST( 'e', 3, 699, 0 ), /* 698 sav */ - S_ST( 'c', 3, 700, 0 ), /* 699 save */ - S_ST( 'o', 3, 701, 0 ), /* 700 savec */ - S_ST( 'n', 3, 702, 0 ), /* 701 saveco */ - S_ST( 'f', 3, 703, 0 ), /* 702 savecon */ - S_ST( 'i', 3, 704, 0 ), /* 703 saveconf */ - S_ST( 'g', 3, 705, 0 ), /* 704 saveconfi */ - S_ST( 'd', 3, 706, 0 ), /* 705 saveconfig */ - S_ST( 'i', 3, 398, 0 ), /* 706 saveconfigd */ - S_ST( 'e', 3, 717, 696 ), /* 707 s */ - S_ST( 'r', 3, 709, 0 ), /* 708 se */ - S_ST( 'v', 3, 710, 0 ), /* 709 ser */ - S_ST( 'e', 3, 399, 0 ), /* 710 serv */ - S_ST( '_', 3, 712, 0 ), /* 711 server */ - S_ST( 'o', 3, 713, 0 ), /* 712 server_ */ - S_ST( 'f', 3, 714, 0 ), /* 713 server_o */ - S_ST( 'f', 3, 715, 0 ), /* 714 server_of */ - S_ST( 's', 3, 716, 0 ), /* 715 server_off */ - S_ST( 'e', 3, 438, 0 ), /* 716 server_offs */ - S_ST( 't', 3, 718, 708 ), /* 717 se */ - S_ST( 'v', 3, 719, 0 ), /* 718 set */ - S_ST( 'a', 3, 400, 0 ), /* 719 setv */ - S_ST( 'i', 3, 721, 707 ), /* 720 s */ - S_ST( 'm', 3, 722, 0 ), /* 721 si */ - S_ST( 'u', 3, 723, 0 ), /* 722 sim */ - S_ST( 'l', 3, 724, 0 ), /* 723 simu */ - S_ST( 'a', 3, 725, 0 ), /* 724 simul */ - S_ST( 't', 3, 726, 0 ), /* 725 simula */ - S_ST( 'i', 3, 727, 435 ), /* 726 simulat */ - S_ST( 'o', 3, 728, 0 ), /* 727 simulati */ - S_ST( 'n', 3, 729, 0 ), /* 728 simulatio */ - S_ST( '_', 3, 730, 0 ), /* 729 simulation */ - S_ST( 'd', 3, 731, 0 ), /* 730 simulation_ */ - S_ST( 'u', 3, 732, 0 ), /* 731 simulation_d */ - S_ST( 'r', 3, 733, 0 ), /* 732 simulation_du */ - S_ST( 'a', 3, 734, 0 ), /* 733 simulation_dur */ - S_ST( 't', 3, 735, 0 ), /* 734 simulation_dura */ - S_ST( 'i', 3, 736, 0 ), /* 735 simulation_durat */ - S_ST( 'o', 3, 437, 0 ), /* 736 simulation_durati */ - S_ST( 'o', 3, 738, 720 ), /* 737 s */ - S_ST( 'u', 3, 739, 0 ), /* 738 so */ - S_ST( 'r', 3, 740, 0 ), /* 739 sou */ - S_ST( 'c', 3, 401, 0 ), /* 740 sour */ - S_ST( 't', 3, 759, 737 ), /* 741 s */ - S_ST( 'a', 3, 748, 0 ), /* 742 st */ - S_ST( 'c', 3, 744, 0 ), /* 743 sta */ - S_ST( 'k', 3, 745, 0 ), /* 744 stac */ - S_ST( 's', 3, 746, 0 ), /* 745 stack */ - S_ST( 'i', 3, 747, 0 ), /* 746 stacks */ - S_ST( 'z', 3, 402, 0 ), /* 747 stacksi */ - S_ST( 't', 3, 404, 743 ), /* 748 sta */ - S_ST( 'i', 3, 750, 0 ), /* 749 stat */ - S_ST( 's', 3, 751, 0 ), /* 750 stati */ - S_ST( 't', 3, 752, 0 ), /* 751 statis */ - S_ST( 'i', 3, 753, 0 ), /* 752 statist */ - S_ST( 'c', 3, 403, 0 ), /* 753 statisti */ - S_ST( 'd', 3, 755, 0 ), /* 754 stats */ - S_ST( 'i', 3, 405, 0 ), /* 755 statsd */ - S_ST( 'e', 3, 406, 742 ), /* 756 st */ - S_ST( 'o', 3, 758, 0 ), /* 757 step */ - S_ST( 'u', 3, 407, 0 ), /* 758 stepo */ - S_ST( 'r', 3, 760, 756 ), /* 759 st */ - S_ST( 'a', 3, 761, 0 ), /* 760 str */ - S_ST( 't', 3, 762, 0 ), /* 761 stra */ - S_ST( 'u', 3, 408, 0 ), /* 762 strat */ - S_ST( 'y', 3, 410, 741 ), /* 763 s */ - S_ST( 's', 3, 765, 0 ), /* 764 sys */ - S_ST( 't', 3, 766, 0 ), /* 765 syss */ - S_ST( 'a', 3, 767, 0 ), /* 766 sysst */ - S_ST( 't', 3, 411, 0 ), /* 767 syssta */ - S_ST( 't', 3, 794, 695 ), /* 768 */ - S_ST( 'i', 3, 780, 0 ), /* 769 t */ - S_ST( 'c', 3, 412, 0 ), /* 770 ti */ - S_ST( 'm', 3, 773, 770 ), /* 771 ti */ - S_ST( 'e', 3, 415, 0 ), /* 772 tim */ - S_ST( 'i', 3, 774, 772 ), /* 773 tim */ - S_ST( 'n', 3, 775, 0 ), /* 774 timi */ - S_ST( 'g', 3, 776, 0 ), /* 775 timin */ - S_ST( 's', 3, 777, 0 ), /* 776 timing */ - S_ST( 't', 3, 778, 0 ), /* 777 timings */ - S_ST( 'a', 3, 779, 0 ), /* 778 timingst */ - S_ST( 't', 3, 416, 0 ), /* 779 timingsta */ - S_ST( 'n', 3, 781, 771 ), /* 780 ti */ - S_ST( 'k', 3, 782, 0 ), /* 781 tin */ - S_ST( 'e', 3, 417, 0 ), /* 782 tink */ - S_ST( 'o', 3, 418, 769 ), /* 783 t */ - S_ST( 'r', 3, 786, 783 ), /* 784 t */ - S_ST( 'a', 3, 419, 0 ), /* 785 tr */ - S_ST( 'u', 3, 787, 785 ), /* 786 tr */ - S_ST( 's', 3, 788, 420 ), /* 787 tru */ - S_ST( 't', 3, 789, 0 ), /* 788 trus */ - S_ST( 'e', 3, 790, 0 ), /* 789 trust */ - S_ST( 'd', 3, 791, 0 ), /* 790 truste */ - S_ST( 'k', 3, 792, 0 ), /* 791 trusted */ - S_ST( 'e', 3, 421, 0 ), /* 792 trustedk */ - S_ST( 't', 3, 422, 784 ), /* 793 t */ - S_ST( 'y', 3, 795, 793 ), /* 794 t */ - S_ST( 'p', 3, 423, 0 ), /* 795 ty */ - S_ST( 'u', 3, 797, 768 ), /* 796 */ - S_ST( 'n', 3, 803, 0 ), /* 797 u */ - S_ST( 'c', 3, 799, 0 ), /* 798 un */ - S_ST( 'o', 3, 800, 0 ), /* 799 unc */ - S_ST( 'n', 3, 801, 0 ), /* 800 unco */ - S_ST( 'f', 3, 802, 0 ), /* 801 uncon */ - S_ST( 'i', 3, 425, 0 ), /* 802 unconf */ - S_ST( 'p', 3, 804, 798 ), /* 803 un */ - S_ST( 'e', 3, 805, 0 ), /* 804 unp */ - S_ST( 'e', 3, 426, 0 ), /* 805 unpe */ - S_ST( 'v', 3, 807, 796 ), /* 806 */ - S_ST( 'e', 3, 808, 0 ), /* 807 v */ - S_ST( 'r', 3, 809, 0 ), /* 808 ve */ - S_ST( 's', 3, 810, 0 ), /* 809 ver */ - S_ST( 'i', 3, 811, 0 ), /* 810 vers */ - S_ST( 'o', 3, 427, 0 ), /* 811 versi */ - S_ST( 'w', 3, 819, 806 ), /* 812 */ - S_ST( 'a', 3, 814, 0 ), /* 813 w */ - S_ST( 'n', 3, 815, 0 ), /* 814 wa */ - S_ST( 'd', 3, 816, 0 ), /* 815 wan */ - S_ST( 'e', 3, 441, 0 ), /* 816 wand */ - S_ST( 'e', 3, 818, 813 ), /* 817 w */ - S_ST( 'e', 3, 429, 0 ), /* 818 we */ - S_ST( 'i', 3, 820, 817 ), /* 819 w */ - S_ST( 'l', 3, 821, 0 ), /* 820 wi */ - S_ST( 'd', 3, 822, 0 ), /* 821 wil */ - S_ST( 'c', 3, 823, 0 ), /* 822 wild */ - S_ST( 'a', 3, 824, 0 ), /* 823 wildc */ - S_ST( 'r', 3, 430, 0 ), /* 824 wildca */ - S_ST( 'x', 3, 826, 812 ), /* 825 */ - S_ST( 'l', 3, 827, 0 ), /* 826 x */ - S_ST( 'e', 3, 828, 0 ), /* 827 xl */ - S_ST( 'a', 3, 829, 0 ), /* 828 xle */ - S_ST( 'v', 3, 431, 0 ), /* 829 xlea */ - S_ST( 'y', 3, 831, 825 ), /* 830 [initial state] */ - S_ST( 'e', 3, 832, 0 ), /* 831 y */ - S_ST( 'a', 3, 432, 0 ) /* 832 ye */ + S_ST( 'p', 0, 764, 0 ), /* 406 T_Step */ + S_ST( 'k', 0, 0, 0 ), /* 407 T_Stepback */ + S_ST( 'd', 0, 0, 0 ), /* 408 T_Stepfwd */ + S_ST( 't', 0, 0, 0 ), /* 409 T_Stepout */ + S_ST( 'm', 0, 0, 0 ), /* 410 T_Stratum */ + S_ST( 'l', 3, 334, 0 ), /* 411 logfi */ + S_ST( 's', 0, 771, 0 ), /* 412 T_Sys */ + S_ST( 's', 0, 0, 0 ), /* 413 T_Sysstats */ + S_ST( 'k', 0, 0, 0 ), /* 414 T_Tick */ + S_ST( '1', 0, 0, 0 ), /* 415 T_Time1 */ + S_ST( '2', 0, 0, 415 ), /* 416 T_Time2 */ + S_ST( 'r', 0, 0, 416 ), /* 417 T_Timer */ + S_ST( 's', 0, 0, 0 ), /* 418 T_Timingstats */ + S_ST( 'r', 0, 0, 0 ), /* 419 T_Tinker */ + S_ST( 's', 0, 0, 0 ), /* 420 T_Tos */ + S_ST( 'p', 1, 0, 0 ), /* 421 T_Trap */ + S_ST( 'e', 0, 0, 0 ), /* 422 T_True */ + S_ST( 'y', 0, 0, 0 ), /* 423 T_Trustedkey */ + S_ST( 'l', 0, 0, 0 ), /* 424 T_Ttl */ + S_ST( 'e', 0, 0, 0 ), /* 425 T_Type */ + S_ST( 'o', 3, 430, 254 ), /* 426 lo */ + S_ST( 'g', 1, 0, 0 ), /* 427 T_Unconfig */ + S_ST( 'r', 1, 0, 0 ), /* 428 T_Unpeer */ + S_ST( 'n', 0, 0, 0 ), /* 429 T_Version */ + S_ST( 'p', 3, 435, 0 ), /* 430 loo */ + S_ST( 'k', 0, 0, 0 ), /* 431 T_Week */ + S_ST( 'd', 0, 0, 0 ), /* 432 T_Wildcard */ + S_ST( 'e', 0, 0, 0 ), /* 433 T_Xleave */ + S_ST( 'r', 0, 0, 0 ), /* 434 T_Year */ + S_ST( 's', 3, 436, 0 ), /* 435 loop */ + S_ST( 't', 3, 447, 0 ), /* 436 loops */ + S_ST( 'e', 0, 0, 0 ), /* 437 T_Simulate */ + S_ST( 'y', 0, 0, 0 ), /* 438 T_Beep_Delay */ + S_ST( 'n', 0, 0, 0 ), /* 439 T_Sim_Duration */ + S_ST( 't', 0, 0, 0 ), /* 440 T_Server_Offset */ + S_ST( 'n', 0, 0, 0 ), /* 441 T_Duration */ + S_ST( 't', 0, 0, 0 ), /* 442 T_Freq_Offset */ + S_ST( 'r', 0, 0, 0 ), /* 443 T_Wander */ + S_ST( 'r', 0, 0, 0 ), /* 444 T_Jitter */ + S_ST( 'y', 0, 0, 0 ), /* 445 T_Prop_Delay */ + S_ST( 'y', 0, 0, 0 ), /* 446 T_Proc_Delay */ + S_ST( 'a', 3, 448, 0 ), /* 447 loopst */ + S_ST( 't', 3, 335, 0 ), /* 448 loopsta */ + S_ST( 'w', 3, 450, 426 ), /* 449 lo */ + S_ST( 'p', 3, 451, 0 ), /* 450 low */ + S_ST( 'r', 3, 452, 0 ), /* 451 lowp */ + S_ST( 'i', 3, 453, 0 ), /* 452 lowpr */ + S_ST( 'o', 3, 454, 0 ), /* 453 lowpri */ + S_ST( 't', 3, 455, 0 ), /* 454 lowprio */ + S_ST( 'r', 3, 456, 0 ), /* 455 lowpriot */ + S_ST( 'a', 3, 336, 0 ), /* 456 lowpriotr */ + S_ST( 'm', 3, 538, 237 ), /* 457 */ + S_ST( 'a', 3, 476, 0 ), /* 458 m */ + S_ST( 'n', 3, 460, 0 ), /* 459 ma */ + S_ST( 'y', 3, 461, 0 ), /* 460 man */ + S_ST( 'c', 3, 462, 0 ), /* 461 many */ + S_ST( 'a', 3, 463, 0 ), /* 462 manyc */ + S_ST( 's', 3, 464, 0 ), /* 463 manyca */ + S_ST( 't', 3, 470, 0 ), /* 464 manycas */ + S_ST( 'c', 3, 466, 0 ), /* 465 manycast */ + S_ST( 'l', 3, 467, 0 ), /* 466 manycastc */ + S_ST( 'i', 3, 468, 0 ), /* 467 manycastcl */ + S_ST( 'e', 3, 469, 0 ), /* 468 manycastcli */ + S_ST( 'n', 3, 337, 0 ), /* 469 manycastclie */ + S_ST( 's', 3, 471, 465 ), /* 470 manycast */ + S_ST( 'e', 3, 472, 0 ), /* 471 manycasts */ + S_ST( 'r', 3, 473, 0 ), /* 472 manycastse */ + S_ST( 'v', 3, 474, 0 ), /* 473 manycastser */ + S_ST( 'e', 3, 338, 0 ), /* 474 manycastserv */ + S_ST( 's', 3, 339, 459 ), /* 475 ma */ + S_ST( 'x', 3, 491, 475 ), /* 476 ma */ + S_ST( 'a', 3, 478, 0 ), /* 477 max */ + S_ST( 'g', 3, 340, 0 ), /* 478 maxa */ + S_ST( 'c', 3, 480, 477 ), /* 479 max */ + S_ST( 'l', 3, 481, 0 ), /* 480 maxc */ + S_ST( 'o', 3, 482, 0 ), /* 481 maxcl */ + S_ST( 'c', 3, 341, 0 ), /* 482 maxclo */ + S_ST( 'd', 3, 487, 479 ), /* 483 max */ + S_ST( 'e', 3, 485, 0 ), /* 484 maxd */ + S_ST( 'p', 3, 486, 0 ), /* 485 maxde */ + S_ST( 't', 3, 342, 0 ), /* 486 maxdep */ + S_ST( 'i', 3, 488, 484 ), /* 487 maxd */ + S_ST( 's', 3, 343, 0 ), /* 488 maxdi */ + S_ST( 'm', 3, 490, 483 ), /* 489 max */ + S_ST( 'e', 3, 344, 0 ), /* 490 maxm */ + S_ST( 'p', 3, 492, 489 ), /* 491 max */ + S_ST( 'o', 3, 493, 0 ), /* 492 maxp */ + S_ST( 'l', 3, 345, 0 ), /* 493 maxpo */ + S_ST( 'd', 3, 495, 458 ), /* 494 m */ + S_ST( 'n', 3, 496, 0 ), /* 495 md */ + S_ST( 's', 3, 497, 0 ), /* 496 mdn */ + S_ST( 't', 3, 498, 0 ), /* 497 mdns */ + S_ST( 'r', 3, 499, 0 ), /* 498 mdnst */ + S_ST( 'i', 3, 500, 0 ), /* 499 mdnstr */ + S_ST( 'e', 3, 346, 0 ), /* 500 mdnstri */ + S_ST( 'e', 3, 347, 494 ), /* 501 m */ + S_ST( 'l', 3, 503, 0 ), /* 502 mem */ + S_ST( 'o', 3, 504, 0 ), /* 503 meml */ + S_ST( 'c', 3, 348, 0 ), /* 504 memlo */ + S_ST( 'i', 3, 506, 501 ), /* 505 m */ + S_ST( 'n', 3, 523, 0 ), /* 506 mi */ + S_ST( 'c', 3, 508, 0 ), /* 507 min */ + S_ST( 'l', 3, 509, 0 ), /* 508 minc */ + S_ST( 'o', 3, 510, 0 ), /* 509 mincl */ + S_ST( 'c', 3, 349, 0 ), /* 510 minclo */ + S_ST( 'd', 3, 515, 507 ), /* 511 min */ + S_ST( 'e', 3, 513, 0 ), /* 512 mind */ + S_ST( 'p', 3, 514, 0 ), /* 513 minde */ + S_ST( 't', 3, 350, 0 ), /* 514 mindep */ + S_ST( 'i', 3, 516, 512 ), /* 515 mind */ + S_ST( 's', 3, 351, 0 ), /* 516 mindi */ + S_ST( 'i', 3, 518, 511 ), /* 517 min */ + S_ST( 'm', 3, 519, 0 ), /* 518 mini */ + S_ST( 'u', 3, 352, 0 ), /* 519 minim */ + S_ST( 'p', 3, 521, 517 ), /* 520 min */ + S_ST( 'o', 3, 522, 0 ), /* 521 minp */ + S_ST( 'l', 3, 353, 0 ), /* 522 minpo */ + S_ST( 's', 3, 524, 520 ), /* 523 min */ + S_ST( 'a', 3, 525, 0 ), /* 524 mins */ + S_ST( 'n', 3, 354, 0 ), /* 525 minsa */ + S_ST( 'o', 3, 528, 505 ), /* 526 m */ + S_ST( 'd', 3, 355, 0 ), /* 527 mo */ + S_ST( 'n', 3, 532, 527 ), /* 528 mo */ + S_ST( 'i', 3, 530, 0 ), /* 529 mon */ + S_ST( 't', 3, 531, 0 ), /* 530 moni */ + S_ST( 'o', 3, 357, 0 ), /* 531 monit */ + S_ST( 't', 3, 358, 529 ), /* 532 mon */ + S_ST( 'r', 3, 359, 526 ), /* 533 m */ + S_ST( 's', 3, 535, 533 ), /* 534 m */ + S_ST( 's', 3, 536, 0 ), /* 535 ms */ + S_ST( 'n', 3, 537, 0 ), /* 536 mss */ + S_ST( 't', 3, 328, 0 ), /* 537 mssn */ + S_ST( 'u', 3, 539, 534 ), /* 538 m */ + S_ST( 'l', 3, 540, 0 ), /* 539 mu */ + S_ST( 't', 3, 541, 0 ), /* 540 mul */ + S_ST( 'i', 3, 542, 0 ), /* 541 mult */ + S_ST( 'c', 3, 543, 0 ), /* 542 multi */ + S_ST( 'a', 3, 544, 0 ), /* 543 multic */ + S_ST( 's', 3, 545, 0 ), /* 544 multica */ + S_ST( 't', 3, 546, 0 ), /* 545 multicas */ + S_ST( 'c', 3, 547, 0 ), /* 546 multicast */ + S_ST( 'l', 3, 548, 0 ), /* 547 multicastc */ + S_ST( 'i', 3, 549, 0 ), /* 548 multicastcl */ + S_ST( 'e', 3, 550, 0 ), /* 549 multicastcli */ + S_ST( 'n', 3, 360, 0 ), /* 550 multicastclie */ + S_ST( 'n', 3, 594, 457 ), /* 551 */ + S_ST( 'i', 3, 361, 0 ), /* 552 n */ + S_ST( 'o', 3, 589, 552 ), /* 553 n */ + S_ST( 'l', 3, 555, 0 ), /* 554 no */ + S_ST( 'i', 3, 556, 0 ), /* 555 nol */ + S_ST( 'n', 3, 362, 0 ), /* 556 noli */ + S_ST( 'm', 3, 562, 554 ), /* 557 no */ + S_ST( 'o', 3, 559, 0 ), /* 558 nom */ + S_ST( 'd', 3, 560, 0 ), /* 559 nomo */ + S_ST( 'i', 3, 561, 0 ), /* 560 nomod */ + S_ST( 'f', 3, 363, 0 ), /* 561 nomodi */ + S_ST( 'r', 3, 563, 558 ), /* 562 nom */ + S_ST( 'u', 3, 564, 0 ), /* 563 nomr */ + S_ST( 'l', 3, 565, 0 ), /* 564 nomru */ + S_ST( 'i', 3, 566, 0 ), /* 565 nomrul */ + S_ST( 's', 3, 364, 0 ), /* 566 nomruli */ + S_ST( 'n', 3, 568, 557 ), /* 567 no */ + S_ST( 'v', 3, 569, 365 ), /* 568 non */ + S_ST( 'o', 3, 570, 0 ), /* 569 nonv */ + S_ST( 'l', 3, 571, 0 ), /* 570 nonvo */ + S_ST( 'a', 3, 572, 0 ), /* 571 nonvol */ + S_ST( 't', 3, 573, 0 ), /* 572 nonvola */ + S_ST( 'i', 3, 574, 0 ), /* 573 nonvolat */ + S_ST( 'l', 3, 366, 0 ), /* 574 nonvolati */ + S_ST( 'p', 3, 576, 567 ), /* 575 no */ + S_ST( 'e', 3, 577, 0 ), /* 576 nop */ + S_ST( 'e', 3, 367, 0 ), /* 577 nope */ + S_ST( 'q', 3, 579, 575 ), /* 578 no */ + S_ST( 'u', 3, 580, 0 ), /* 579 noq */ + S_ST( 'e', 3, 581, 0 ), /* 580 noqu */ + S_ST( 'r', 3, 368, 0 ), /* 581 noque */ + S_ST( 's', 3, 583, 578 ), /* 582 no */ + S_ST( 'e', 3, 587, 0 ), /* 583 nos */ + S_ST( 'l', 3, 585, 0 ), /* 584 nose */ + S_ST( 'e', 3, 586, 0 ), /* 585 nosel */ + S_ST( 'c', 3, 369, 0 ), /* 586 nosele */ + S_ST( 'r', 3, 588, 584 ), /* 587 nose */ + S_ST( 'v', 3, 370, 0 ), /* 588 noser */ + S_ST( 't', 3, 590, 582 ), /* 589 no */ + S_ST( 'r', 3, 592, 0 ), /* 590 not */ + S_ST( 'a', 3, 371, 0 ), /* 591 notr */ + S_ST( 'u', 3, 593, 591 ), /* 592 notr */ + S_ST( 's', 3, 372, 0 ), /* 593 notru */ + S_ST( 't', 3, 373, 553 ), /* 594 n */ + S_ST( 'p', 3, 596, 0 ), /* 595 ntp */ + S_ST( 'o', 3, 597, 0 ), /* 596 ntpp */ + S_ST( 'r', 3, 374, 0 ), /* 597 ntppo */ + S_ST( 's', 3, 599, 595 ), /* 598 ntp */ + S_ST( 'i', 3, 600, 0 ), /* 599 ntps */ + S_ST( 'g', 3, 601, 0 ), /* 600 ntpsi */ + S_ST( 'n', 3, 602, 0 ), /* 601 ntpsig */ + S_ST( 'd', 3, 603, 0 ), /* 602 ntpsign */ + S_ST( 's', 3, 604, 0 ), /* 603 ntpsignd */ + S_ST( 'o', 3, 605, 0 ), /* 604 ntpsignds */ + S_ST( 'c', 3, 606, 0 ), /* 605 ntpsigndso */ + S_ST( 'k', 3, 607, 0 ), /* 606 ntpsigndsoc */ + S_ST( 'e', 3, 375, 0 ), /* 607 ntpsigndsock */ + S_ST( 'o', 3, 609, 551 ), /* 608 */ + S_ST( 'r', 3, 610, 0 ), /* 609 o */ + S_ST( 'p', 3, 611, 0 ), /* 610 or */ + S_ST( 'h', 3, 612, 0 ), /* 611 orp */ + S_ST( 'a', 3, 376, 0 ), /* 612 orph */ + S_ST( 'w', 3, 614, 0 ), /* 613 orphan */ + S_ST( 'a', 3, 615, 0 ), /* 614 orphanw */ + S_ST( 'i', 3, 377, 0 ), /* 615 orphanwa */ + S_ST( 'p', 3, 389, 608 ), /* 616 */ + S_ST( 'a', 3, 618, 0 ), /* 617 p */ + S_ST( 'n', 3, 619, 0 ), /* 618 pa */ + S_ST( 'i', 3, 378, 0 ), /* 619 pan */ + S_ST( 'e', 3, 621, 617 ), /* 620 p */ + S_ST( 'e', 3, 379, 0 ), /* 621 pe */ + S_ST( 's', 3, 623, 0 ), /* 622 peer */ + S_ST( 't', 3, 624, 0 ), /* 623 peers */ + S_ST( 'a', 3, 625, 0 ), /* 624 peerst */ + S_ST( 't', 3, 380, 0 ), /* 625 peersta */ + S_ST( 'h', 3, 627, 620 ), /* 626 p */ + S_ST( 'o', 3, 628, 0 ), /* 627 ph */ + S_ST( 'n', 3, 381, 0 ), /* 628 pho */ + S_ST( 'i', 3, 382, 626 ), /* 629 p */ + S_ST( 'f', 3, 631, 0 ), /* 630 pid */ + S_ST( 'i', 3, 632, 0 ), /* 631 pidf */ + S_ST( 'l', 3, 383, 0 ), /* 632 pidfi */ + S_ST( 'o', 3, 635, 629 ), /* 633 p */ + S_ST( 'o', 3, 384, 0 ), /* 634 po */ + S_ST( 'r', 3, 385, 634 ), /* 635 po */ + S_ST( 'r', 3, 643, 633 ), /* 636 p */ + S_ST( 'e', 3, 641, 0 ), /* 637 pr */ + S_ST( 'e', 3, 639, 0 ), /* 638 pre */ + S_ST( 'm', 3, 640, 0 ), /* 639 pree */ + S_ST( 'p', 3, 386, 0 ), /* 640 preem */ + S_ST( 'f', 3, 642, 638 ), /* 641 pre */ + S_ST( 'e', 3, 387, 0 ), /* 642 pref */ + S_ST( 'o', 3, 656, 637 ), /* 643 pr */ + S_ST( 'c', 3, 645, 0 ), /* 644 pro */ + S_ST( '_', 3, 646, 0 ), /* 645 proc */ + S_ST( 'd', 3, 647, 0 ), /* 646 proc_ */ + S_ST( 'e', 3, 648, 0 ), /* 647 proc_d */ + S_ST( 'l', 3, 649, 0 ), /* 648 proc_de */ + S_ST( 'a', 3, 446, 0 ), /* 649 proc_del */ + S_ST( 'p', 3, 651, 644 ), /* 650 pro */ + S_ST( '_', 3, 652, 0 ), /* 651 prop */ + S_ST( 'd', 3, 653, 0 ), /* 652 prop_ */ + S_ST( 'e', 3, 654, 0 ), /* 653 prop_d */ + S_ST( 'l', 3, 655, 0 ), /* 654 prop_de */ + S_ST( 'a', 3, 445, 0 ), /* 655 prop_del */ + S_ST( 't', 3, 657, 650 ), /* 656 pro */ + S_ST( 'o', 3, 658, 0 ), /* 657 prot */ + S_ST( 's', 3, 659, 0 ), /* 658 proto */ + S_ST( 't', 3, 660, 0 ), /* 659 protos */ + S_ST( 'a', 3, 661, 0 ), /* 660 protost */ + S_ST( 't', 3, 388, 0 ), /* 661 protosta */ + S_ST( 'r', 3, 693, 616 ), /* 662 */ + S_ST( 'a', 3, 669, 0 ), /* 663 r */ + S_ST( 'n', 3, 665, 0 ), /* 664 ra */ + S_ST( 'd', 3, 666, 0 ), /* 665 ran */ + S_ST( 'f', 3, 667, 0 ), /* 666 rand */ + S_ST( 'i', 3, 668, 0 ), /* 667 randf */ + S_ST( 'l', 3, 390, 0 ), /* 668 randfi */ + S_ST( 'w', 3, 670, 664 ), /* 669 ra */ + S_ST( 's', 3, 671, 0 ), /* 670 raw */ + S_ST( 't', 3, 672, 0 ), /* 671 raws */ + S_ST( 'a', 3, 673, 0 ), /* 672 rawst */ + S_ST( 't', 3, 391, 0 ), /* 673 rawsta */ + S_ST( 'e', 3, 690, 663 ), /* 674 r */ + S_ST( 'f', 3, 676, 0 ), /* 675 re */ + S_ST( 'i', 3, 392, 0 ), /* 676 ref */ + S_ST( 'q', 3, 678, 675 ), /* 677 re */ + S_ST( 'u', 3, 679, 0 ), /* 678 req */ + S_ST( 'e', 3, 680, 0 ), /* 679 requ */ + S_ST( 's', 3, 681, 0 ), /* 680 reque */ + S_ST( 't', 3, 682, 0 ), /* 681 reques */ + S_ST( 'k', 3, 683, 0 ), /* 682 request */ + S_ST( 'e', 3, 393, 0 ), /* 683 requestk */ + S_ST( 's', 3, 686, 677 ), /* 684 re */ + S_ST( 'e', 3, 394, 0 ), /* 685 res */ + S_ST( 't', 3, 687, 685 ), /* 686 res */ + S_ST( 'r', 3, 688, 0 ), /* 687 rest */ + S_ST( 'i', 3, 689, 0 ), /* 688 restr */ + S_ST( 'c', 3, 395, 0 ), /* 689 restri */ + S_ST( 'v', 3, 691, 684 ), /* 690 re */ + S_ST( 'o', 3, 692, 0 ), /* 691 rev */ + S_ST( 'k', 3, 396, 0 ), /* 692 revo */ + S_ST( 'l', 3, 694, 674 ), /* 693 r */ + S_ST( 'i', 3, 695, 0 ), /* 694 rl */ + S_ST( 'm', 3, 696, 0 ), /* 695 rli */ + S_ST( 'i', 3, 397, 0 ), /* 696 rlim */ + S_ST( 's', 3, 770, 662 ), /* 697 */ + S_ST( 'a', 3, 699, 0 ), /* 698 s */ + S_ST( 'v', 3, 700, 0 ), /* 699 sa */ + S_ST( 'e', 3, 701, 0 ), /* 700 sav */ + S_ST( 'c', 3, 702, 0 ), /* 701 save */ + S_ST( 'o', 3, 703, 0 ), /* 702 savec */ + S_ST( 'n', 3, 704, 0 ), /* 703 saveco */ + S_ST( 'f', 3, 705, 0 ), /* 704 savecon */ + S_ST( 'i', 3, 706, 0 ), /* 705 saveconf */ + S_ST( 'g', 3, 707, 0 ), /* 706 saveconfi */ + S_ST( 'd', 3, 708, 0 ), /* 707 saveconfig */ + S_ST( 'i', 3, 398, 0 ), /* 708 saveconfigd */ + S_ST( 'e', 3, 719, 698 ), /* 709 s */ + S_ST( 'r', 3, 711, 0 ), /* 710 se */ + S_ST( 'v', 3, 712, 0 ), /* 711 ser */ + S_ST( 'e', 3, 399, 0 ), /* 712 serv */ + S_ST( '_', 3, 714, 0 ), /* 713 server */ + S_ST( 'o', 3, 715, 0 ), /* 714 server_ */ + S_ST( 'f', 3, 716, 0 ), /* 715 server_o */ + S_ST( 'f', 3, 717, 0 ), /* 716 server_of */ + S_ST( 's', 3, 718, 0 ), /* 717 server_off */ + S_ST( 'e', 3, 440, 0 ), /* 718 server_offs */ + S_ST( 't', 3, 720, 710 ), /* 719 se */ + S_ST( 'v', 3, 721, 0 ), /* 720 set */ + S_ST( 'a', 3, 400, 0 ), /* 721 setv */ + S_ST( 'i', 3, 723, 709 ), /* 722 s */ + S_ST( 'm', 3, 724, 0 ), /* 723 si */ + S_ST( 'u', 3, 725, 0 ), /* 724 sim */ + S_ST( 'l', 3, 726, 0 ), /* 725 simu */ + S_ST( 'a', 3, 727, 0 ), /* 726 simul */ + S_ST( 't', 3, 728, 0 ), /* 727 simula */ + S_ST( 'i', 3, 729, 437 ), /* 728 simulat */ + S_ST( 'o', 3, 730, 0 ), /* 729 simulati */ + S_ST( 'n', 3, 731, 0 ), /* 730 simulatio */ + S_ST( '_', 3, 732, 0 ), /* 731 simulation */ + S_ST( 'd', 3, 733, 0 ), /* 732 simulation_ */ + S_ST( 'u', 3, 734, 0 ), /* 733 simulation_d */ + S_ST( 'r', 3, 735, 0 ), /* 734 simulation_du */ + S_ST( 'a', 3, 736, 0 ), /* 735 simulation_dur */ + S_ST( 't', 3, 737, 0 ), /* 736 simulation_dura */ + S_ST( 'i', 3, 738, 0 ), /* 737 simulation_durat */ + S_ST( 'o', 3, 439, 0 ), /* 738 simulation_durati */ + S_ST( 'o', 3, 740, 722 ), /* 739 s */ + S_ST( 'u', 3, 741, 0 ), /* 740 so */ + S_ST( 'r', 3, 742, 0 ), /* 741 sou */ + S_ST( 'c', 3, 401, 0 ), /* 742 sour */ + S_ST( 't', 3, 766, 739 ), /* 743 s */ + S_ST( 'a', 3, 750, 0 ), /* 744 st */ + S_ST( 'c', 3, 746, 0 ), /* 745 sta */ + S_ST( 'k', 3, 747, 0 ), /* 746 stac */ + S_ST( 's', 3, 748, 0 ), /* 747 stack */ + S_ST( 'i', 3, 749, 0 ), /* 748 stacks */ + S_ST( 'z', 3, 402, 0 ), /* 749 stacksi */ + S_ST( 't', 3, 404, 745 ), /* 750 sta */ + S_ST( 'i', 3, 752, 0 ), /* 751 stat */ + S_ST( 's', 3, 753, 0 ), /* 752 stati */ + S_ST( 't', 3, 754, 0 ), /* 753 statis */ + S_ST( 'i', 3, 755, 0 ), /* 754 statist */ + S_ST( 'c', 3, 403, 0 ), /* 755 statisti */ + S_ST( 'd', 3, 757, 0 ), /* 756 stats */ + S_ST( 'i', 3, 405, 0 ), /* 757 statsd */ + S_ST( 'e', 3, 406, 744 ), /* 758 st */ + S_ST( 'b', 3, 760, 0 ), /* 759 step */ + S_ST( 'a', 3, 761, 0 ), /* 760 stepb */ + S_ST( 'c', 3, 407, 0 ), /* 761 stepba */ + S_ST( 'f', 3, 763, 759 ), /* 762 step */ + S_ST( 'w', 3, 408, 0 ), /* 763 stepf */ + S_ST( 'o', 3, 765, 762 ), /* 764 step */ + S_ST( 'u', 3, 409, 0 ), /* 765 stepo */ + S_ST( 'r', 3, 767, 758 ), /* 766 st */ + S_ST( 'a', 3, 768, 0 ), /* 767 str */ + S_ST( 't', 3, 769, 0 ), /* 768 stra */ + S_ST( 'u', 3, 410, 0 ), /* 769 strat */ + S_ST( 'y', 3, 412, 743 ), /* 770 s */ + S_ST( 's', 3, 772, 0 ), /* 771 sys */ + S_ST( 't', 3, 773, 0 ), /* 772 syss */ + S_ST( 'a', 3, 774, 0 ), /* 773 sysst */ + S_ST( 't', 3, 413, 0 ), /* 774 syssta */ + S_ST( 't', 3, 801, 697 ), /* 775 */ + S_ST( 'i', 3, 787, 0 ), /* 776 t */ + S_ST( 'c', 3, 414, 0 ), /* 777 ti */ + S_ST( 'm', 3, 780, 777 ), /* 778 ti */ + S_ST( 'e', 3, 417, 0 ), /* 779 tim */ + S_ST( 'i', 3, 781, 779 ), /* 780 tim */ + S_ST( 'n', 3, 782, 0 ), /* 781 timi */ + S_ST( 'g', 3, 783, 0 ), /* 782 timin */ + S_ST( 's', 3, 784, 0 ), /* 783 timing */ + S_ST( 't', 3, 785, 0 ), /* 784 timings */ + S_ST( 'a', 3, 786, 0 ), /* 785 timingst */ + S_ST( 't', 3, 418, 0 ), /* 786 timingsta */ + S_ST( 'n', 3, 788, 778 ), /* 787 ti */ + S_ST( 'k', 3, 789, 0 ), /* 788 tin */ + S_ST( 'e', 3, 419, 0 ), /* 789 tink */ + S_ST( 'o', 3, 420, 776 ), /* 790 t */ + S_ST( 'r', 3, 793, 790 ), /* 791 t */ + S_ST( 'a', 3, 421, 0 ), /* 792 tr */ + S_ST( 'u', 3, 794, 792 ), /* 793 tr */ + S_ST( 's', 3, 795, 422 ), /* 794 tru */ + S_ST( 't', 3, 796, 0 ), /* 795 trus */ + S_ST( 'e', 3, 797, 0 ), /* 796 trust */ + S_ST( 'd', 3, 798, 0 ), /* 797 truste */ + S_ST( 'k', 3, 799, 0 ), /* 798 trusted */ + S_ST( 'e', 3, 423, 0 ), /* 799 trustedk */ + S_ST( 't', 3, 424, 791 ), /* 800 t */ + S_ST( 'y', 3, 802, 800 ), /* 801 t */ + S_ST( 'p', 3, 425, 0 ), /* 802 ty */ + S_ST( 'u', 3, 804, 775 ), /* 803 */ + S_ST( 'n', 3, 810, 0 ), /* 804 u */ + S_ST( 'c', 3, 806, 0 ), /* 805 un */ + S_ST( 'o', 3, 807, 0 ), /* 806 unc */ + S_ST( 'n', 3, 808, 0 ), /* 807 unco */ + S_ST( 'f', 3, 809, 0 ), /* 808 uncon */ + S_ST( 'i', 3, 427, 0 ), /* 809 unconf */ + S_ST( 'p', 3, 811, 805 ), /* 810 un */ + S_ST( 'e', 3, 812, 0 ), /* 811 unp */ + S_ST( 'e', 3, 428, 0 ), /* 812 unpe */ + S_ST( 'v', 3, 814, 803 ), /* 813 */ + S_ST( 'e', 3, 815, 0 ), /* 814 v */ + S_ST( 'r', 3, 816, 0 ), /* 815 ve */ + S_ST( 's', 3, 817, 0 ), /* 816 ver */ + S_ST( 'i', 3, 818, 0 ), /* 817 vers */ + S_ST( 'o', 3, 429, 0 ), /* 818 versi */ + S_ST( 'w', 3, 826, 813 ), /* 819 */ + S_ST( 'a', 3, 821, 0 ), /* 820 w */ + S_ST( 'n', 3, 822, 0 ), /* 821 wa */ + S_ST( 'd', 3, 823, 0 ), /* 822 wan */ + S_ST( 'e', 3, 443, 0 ), /* 823 wand */ + S_ST( 'e', 3, 825, 820 ), /* 824 w */ + S_ST( 'e', 3, 431, 0 ), /* 825 we */ + S_ST( 'i', 3, 827, 824 ), /* 826 w */ + S_ST( 'l', 3, 828, 0 ), /* 827 wi */ + S_ST( 'd', 3, 829, 0 ), /* 828 wil */ + S_ST( 'c', 3, 830, 0 ), /* 829 wild */ + S_ST( 'a', 3, 831, 0 ), /* 830 wildc */ + S_ST( 'r', 3, 432, 0 ), /* 831 wildca */ + S_ST( 'x', 3, 833, 819 ), /* 832 */ + S_ST( 'l', 3, 834, 0 ), /* 833 x */ + S_ST( 'e', 3, 835, 0 ), /* 834 xl */ + S_ST( 'a', 3, 836, 0 ), /* 835 xle */ + S_ST( 'v', 3, 433, 0 ), /* 836 xlea */ + S_ST( 'y', 3, 838, 832 ), /* 837 [initial state] */ + S_ST( 'e', 3, 839, 0 ), /* 838 y */ + S_ST( 'a', 3, 434, 0 ) /* 839 ye */ }; diff --git a/contrib/ntp/ntpd/ntp_leapsec.c b/contrib/ntp/ntpd/ntp_leapsec.c index ec42a9740a076..eeef89f3c6481 100644 --- a/contrib/ntp/ntpd/ntp_leapsec.c +++ b/contrib/ntp/ntpd/ntp_leapsec.c @@ -787,7 +787,7 @@ leapsec_add( const vint64 * now64 , int insert) { - vint64 ttime, stime; + vint64 ttime, starttime; struct calendar fts; leap_info_t li; @@ -815,12 +815,12 @@ leapsec_add( fts.hour = 0; fts.minute = 0; fts.second = 0; - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); fts.month++; ttime = ntpcal_date_to_ntp64(&fts); li.ttime = ttime; - li.stime = ttime.D_s.lo - stime.D_s.lo; + li.stime = ttime.D_s.lo - starttime.D_s.lo; li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai) + (insert ? 1 : -1); li.dynls = 1; @@ -839,7 +839,7 @@ leapsec_raw( int taiof, int dynls) { - vint64 stime; + vint64 starttime; struct calendar fts; leap_info_t li; @@ -856,9 +856,9 @@ leapsec_raw( return FALSE; } fts.month--; /* was in range 1..12, no overflow here! */ - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); li.ttime = *ttime; - li.stime = ttime->D_s.lo - stime.D_s.lo; + li.stime = ttime->D_s.lo - starttime.D_s.lo; li.taiof = (int16_t)taiof; li.dynls = (dynls != 0); return add_range(pt, &li); diff --git a/contrib/ntp/ntpd/ntp_loopfilter.c b/contrib/ntp/ntpd/ntp_loopfilter.c index 82ff1632e518d..e47f83b976a2e 100644 --- a/contrib/ntp/ntpd/ntp_loopfilter.c +++ b/contrib/ntp/ntpd/ntp_loopfilter.c @@ -46,7 +46,7 @@ #define CLOCK_LIMIT 30 /* poll-adjust threshold */ #define CLOCK_PGATE 4. /* poll-adjust gate */ #define PPS_MAXAGE 120 /* kernel pps signal timeout (s) */ -#define FREQTOD(x) ((x) / 65536e6) /* NTP to double */ +#define FREQTOD(x) ((x) / 65536e6) /* NTP to double */ #define DTOFREQ(x) ((int32)((x) * 65536e6)) /* double to NTP */ /* @@ -106,7 +106,8 @@ /* * Program variables that can be tinkered. */ -double clock_max = CLOCK_MAX; /* step threshold */ +double clock_max_back = CLOCK_MAX; /* step threshold */ +double clock_max_fwd = CLOCK_MAX; /* step threshold */ double clock_minstep = CLOCK_MINSTEP; /* stepout threshold */ double clock_panic = CLOCK_PANIC; /* panic threshold */ double clock_phi = CLOCK_PHI; /* dispersion rate (s/s) */ @@ -152,8 +153,10 @@ int kern_enable = TRUE; /* kernel support enabled */ int hardpps_enable; /* kernel PPS discipline enabled */ int ext_enable; /* external clock enabled */ int pps_stratum; /* pps stratum */ -int allow_panic = FALSE; /* allow panic correction */ -int mode_ntpdate = FALSE; /* exit on first clock set */ +int kernel_status; /* from ntp_adjtime */ +int allow_panic = FALSE; /* allow panic correction (-g) */ +int force_step_once = FALSE; /* always step time once at startup (-G) */ +int mode_ntpdate = FALSE; /* exit on first clock set (-q) */ int freq_cnt; /* initial frequency clamp */ int freq_set; /* initial set frequency switch */ @@ -279,47 +282,69 @@ ntp_adjtime_error_handler( } break; #ifdef TIME_OK - case TIME_OK: /* 0 no leap second warning */ - /* OK means OK */ + case TIME_OK: /* 0: synchronized, no leap second warning */ + /* msyslog(LOG_INFO, "kernel reports time is synchronized normally"); */ break; +#else +# warning TIME_OK is not defined #endif #ifdef TIME_INS - case TIME_INS: /* 1 positive leap second warning */ - msyslog(LOG_INFO, "%s: %s line %d: kernel reports positive leap second warning state", - caller, file_name(), line - ); + case TIME_INS: /* 1: positive leap second warning */ + msyslog(LOG_INFO, "kernel reports leap second insertion scheduled"); break; +#else +# warning TIME_INS is not defined #endif #ifdef TIME_DEL - case TIME_DEL: /* 2 negative leap second warning */ - msyslog(LOG_INFO, "%s: %s line %d: kernel reports negative leap second warning state", - caller, file_name(), line - ); + case TIME_DEL: /* 2: negative leap second warning */ + msyslog(LOG_INFO, "kernel reports leap second deletion scheduled"); break; +#else +# warning TIME_DEL is not defined #endif #ifdef TIME_OOP - case TIME_OOP: /* 3 leap second in progress */ - msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second in progress", - caller, file_name(), line - ); + case TIME_OOP: /* 3: leap second in progress */ + msyslog(LOG_INFO, "kernel reports leap second in progress"); break; +#else +# warning TIME_OOP is not defined #endif #ifdef TIME_WAIT - case TIME_WAIT: /* 4 leap second has occured */ - msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second has occured", - caller, file_name(), line - ); + case TIME_WAIT: /* 4: leap second has occured */ + msyslog(LOG_INFO, "kernel reports leap second has occurred"); break; +#else +# warning TIME_WAIT is not defined #endif #ifdef TIME_ERROR - case TIME_ERROR: /* loss of synchronization */ + case TIME_ERROR: /* 5: unsynchronized, or loss of synchronization */ + /* error (see status word) */ if (pps_call && !(ptimex->status & STA_PPSSIGNAL)) report_event(EVNT_KERN, NULL, "PPS no signal"); errno = saved_errno; DPRINTF(1, ("kernel loop status (%s) %d %m\n", k_st_flags(ptimex->status), errno)); + /* + * This code may be returned when ntp_adjtime() has just + * been called for the first time, quite a while after + * startup, when ntpd just starts to discipline the kernel + * time. In this case the occurrence of this message + * can be pretty confusing. + * + * HMS: How about a message when we begin kernel processing: + * Determining kernel clock state... + * so an initial TIME_ERROR message is less confising, + * or skipping the first message (ugh), + * or ??? + * msyslog(LOG_INFO, "kernel reports time synchronization lost"); + */ + errno = saved_errno; /* may not be needed */ + msyslog(LOG_INFO, "kernel reports TIME_ERROR: %#x: %s %m", + ptimex->status, k_st_flags(ptimex->status)); break; +#else +# warning TIME_ERROR is not defined #endif default: msyslog(LOG_NOTICE, "%s: %s line %d: unhandled return value %d from ntp_adjtime in %s at line %d", @@ -403,7 +428,8 @@ local_clock( * directly to the terminal. */ if (mode_ntpdate) { - if (fabs(fp_offset) > clock_max && clock_max > 0) { + if ( ( fp_offset > clock_max_fwd && clock_max_fwd > 0) + || (-fp_offset > clock_max_back && clock_max_back > 0)) { step_systime(fp_offset); msyslog(LOG_NOTICE, "ntpd: time set %+.6f s", fp_offset); @@ -452,10 +478,10 @@ local_clock( * threshold (128 ms) and when it does not. Under certain * conditions updates are suspended until the stepout theshold * (900 s) is exceeded. See the documentation on how these - * thresholds interact with commands and command line options. + * thresholds interact with commands and command line options. * * Note the kernel is disabled if step is disabled or greater - * than 0.5 s or in ntpdate mode. + * than 0.5 s or in ntpdate mode. */ osys_poll = sys_poll; if (sys_poll < peer->minpoll) @@ -465,7 +491,14 @@ local_clock( mu = current_time - clock_epoch; clock_frequency = drift_comp; rval = 1; - if (fabs(fp_offset) > clock_max && clock_max > 0) { + if ( ( fp_offset > clock_max_fwd && clock_max_fwd > 0) + || (-fp_offset > clock_max_back && clock_max_back > 0) + || force_step_once ) { + if (force_step_once) { + force_step_once = FALSE; /* we want this only once after startup */ + msyslog(LOG_NOTICE, "Doing intital time step" ); + } + switch (state) { /* @@ -525,7 +558,7 @@ local_clock( * threshold. Note that a single spike greater than the * step threshold is always suppressed, even with a * long time constant. - */ + */ default: snprintf(tbuf, sizeof(tbuf), "%+.6f s", fp_offset); @@ -543,7 +576,6 @@ local_clock( } rstclock(EVNT_SYNC, 0); } else { - /* * The offset is less than the step threshold. Calculate * the jitter as the exponentially weighted offset @@ -605,9 +637,9 @@ local_clock( /* * The PLL frequency gain (numerator) depends on * the minimum of the update interval and Allan - * intercept. This reduces the PLL gain when the + * intercept. This reduces the PLL gain when the * FLL becomes effective. - */ + */ etemp = min(ULOGTOD(allan_xpt), mu); dtemp = 4 * CLOCK_PLL * ULOGTOD(sys_poll); clock_frequency += fp_offset * etemp / (dtemp * @@ -706,8 +738,13 @@ local_clock( * the pps. In any case, fetch the kernel offset, * frequency and jitter. */ - if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) { - ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1); + ntp_adj_ret = ntp_adjtime(&ntv); + /* + * A squeal is a return status < 0, or a state change. + */ + if ((0 > ntp_adj_ret) || (ntp_adj_ret != kernel_status)) { + kernel_status = ntp_adj_ret; + ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1); } pll_status = ntv.status; #ifdef STA_NANO @@ -888,7 +925,7 @@ adj_host_clock( clock_offset -= offset_adj; /* * Windows port adj_systime() must be called each second, - * even if the argument is zero, to ease emulation of + * even if the argument is zero, to ease emulation of * adjtime() using Windows' slew API which controls the rate * but does not automatically stop slewing when an offset * has decayed to zero. @@ -917,7 +954,7 @@ rstclock( report_event(trans, NULL, NULL); state = trans; last_offset = clock_offset = offset; - clock_epoch = current_time; + clock_epoch = current_time; } @@ -1190,12 +1227,12 @@ loop_config( case LOOP_CODEC: /* audio codec frequency (codec) */ clock_codec = freq / 1e6; break; - + case LOOP_PHI: /* dispersion threshold (dispersion) */ clock_phi = freq / 1e6; break; - case LOOP_FREQ: /* initial frequency (freq) */ + case LOOP_FREQ: /* initial frequency (freq) */ init_drift_comp = freq; freq_set++; break; @@ -1216,8 +1253,27 @@ loop_config( break; case LOOP_MAX: /* step threshold (step) */ - clock_max = freq; - if (clock_max == 0 || clock_max > 0.5) + clock_max_fwd = clock_max_back = freq; + if (freq == 0 || freq > 0.5) + select_loop(FALSE); + break; + + case LOOP_MAX_BACK: /* step threshold (step) */ + clock_max_back = freq; + /* + * Leave using the kernel discipline code unless both + * limits are massive. This assumes the reason to stop + * using it is that it's pointless, not that it goes wrong. + */ + if ( (clock_max_back == 0 || clock_max_back > 0.5) + || (clock_max_fwd == 0 || clock_max_fwd > 0.5)) + select_loop(FALSE); + break; + + case LOOP_MAX_FWD: /* step threshold (step) */ + clock_max_fwd = freq; + if ( (clock_max_back == 0 || clock_max_back > 0.5) + || (clock_max_fwd == 0 || clock_max_fwd > 0.5)) select_loop(FALSE); break; @@ -1225,7 +1281,7 @@ loop_config( if (freq < CLOCK_MINSTEP) clock_minstep = CLOCK_MINSTEP; else - clock_minstep = freq; + clock_minstep = freq; break; case LOOP_TICK: /* tick increment (tick) */ diff --git a/contrib/ntp/ntpd/ntp_parser.c b/contrib/ntp/ntpd/ntp_parser.c index de3d73cedd650..0cf55197ac6cd 100644 --- a/contrib/ntp/ntpd/ntp_parser.c +++ b/contrib/ntp/ntpd/ntp_parser.c @@ -280,44 +280,46 @@ extern int yydebug; T_Stats = 404, T_Statsdir = 405, T_Step = 406, - T_Stepout = 407, - T_Stratum = 408, - T_String = 409, - T_Sys = 410, - T_Sysstats = 411, - T_Tick = 412, - T_Time1 = 413, - T_Time2 = 414, - T_Timer = 415, - T_Timingstats = 416, - T_Tinker = 417, - T_Tos = 418, - T_Trap = 419, - T_True = 420, - T_Trustedkey = 421, - T_Ttl = 422, - T_Type = 423, - T_U_int = 424, - T_Unconfig = 425, - T_Unpeer = 426, - T_Version = 427, - T_WanderThreshold = 428, - T_Week = 429, - T_Wildcard = 430, - T_Xleave = 431, - T_Year = 432, - T_Flag = 433, - T_EOC = 434, - T_Simulate = 435, - T_Beep_Delay = 436, - T_Sim_Duration = 437, - T_Server_Offset = 438, - T_Duration = 439, - T_Freq_Offset = 440, - T_Wander = 441, - T_Jitter = 442, - T_Prop_Delay = 443, - T_Proc_Delay = 444 + T_Stepback = 407, + T_Stepfwd = 408, + T_Stepout = 409, + T_Stratum = 410, + T_String = 411, + T_Sys = 412, + T_Sysstats = 413, + T_Tick = 414, + T_Time1 = 415, + T_Time2 = 416, + T_Timer = 417, + T_Timingstats = 418, + T_Tinker = 419, + T_Tos = 420, + T_Trap = 421, + T_True = 422, + T_Trustedkey = 423, + T_Ttl = 424, + T_Type = 425, + T_U_int = 426, + T_Unconfig = 427, + T_Unpeer = 428, + T_Version = 429, + T_WanderThreshold = 430, + T_Week = 431, + T_Wildcard = 432, + T_Xleave = 433, + T_Year = 434, + T_Flag = 435, + T_EOC = 436, + T_Simulate = 437, + T_Beep_Delay = 438, + T_Sim_Duration = 439, + T_Server_Offset = 440, + T_Duration = 441, + T_Freq_Offset = 442, + T_Wander = 443, + T_Jitter = 444, + T_Prop_Delay = 445, + T_Proc_Delay = 446 }; #endif /* Tokens. */ @@ -470,44 +472,46 @@ extern int yydebug; #define T_Stats 404 #define T_Statsdir 405 #define T_Step 406 -#define T_Stepout 407 -#define T_Stratum 408 -#define T_String 409 -#define T_Sys 410 -#define T_Sysstats 411 -#define T_Tick 412 -#define T_Time1 413 -#define T_Time2 414 -#define T_Timer 415 -#define T_Timingstats 416 -#define T_Tinker 417 -#define T_Tos 418 -#define T_Trap 419 -#define T_True 420 -#define T_Trustedkey 421 -#define T_Ttl 422 -#define T_Type 423 -#define T_U_int 424 -#define T_Unconfig 425 -#define T_Unpeer 426 -#define T_Version 427 -#define T_WanderThreshold 428 -#define T_Week 429 -#define T_Wildcard 430 -#define T_Xleave 431 -#define T_Year 432 -#define T_Flag 433 -#define T_EOC 434 -#define T_Simulate 435 -#define T_Beep_Delay 436 -#define T_Sim_Duration 437 -#define T_Server_Offset 438 -#define T_Duration 439 -#define T_Freq_Offset 440 -#define T_Wander 441 -#define T_Jitter 442 -#define T_Prop_Delay 443 -#define T_Proc_Delay 444 +#define T_Stepback 407 +#define T_Stepfwd 408 +#define T_Stepout 409 +#define T_Stratum 410 +#define T_String 411 +#define T_Sys 412 +#define T_Sysstats 413 +#define T_Tick 414 +#define T_Time1 415 +#define T_Time2 416 +#define T_Timer 417 +#define T_Timingstats 418 +#define T_Tinker 419 +#define T_Tos 420 +#define T_Trap 421 +#define T_True 422 +#define T_Trustedkey 423 +#define T_Ttl 424 +#define T_Type 425 +#define T_U_int 426 +#define T_Unconfig 427 +#define T_Unpeer 428 +#define T_Version 429 +#define T_WanderThreshold 430 +#define T_Week 431 +#define T_Wildcard 432 +#define T_Xleave 433 +#define T_Year 434 +#define T_Flag 435 +#define T_EOC 436 +#define T_Simulate 437 +#define T_Beep_Delay 438 +#define T_Sim_Duration 439 +#define T_Server_Offset 440 +#define T_Duration 441 +#define T_Freq_Offset 442 +#define T_Wander 443 +#define T_Jitter 444 +#define T_Prop_Delay 445 +#define T_Proc_Delay 446 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -533,7 +537,7 @@ union YYSTYPE script_info * Sim_script; script_info_fifo * Sim_script_fifo; -#line 537 "ntp_parser.c" /* yacc.c:355 */ +#line 541 "ntp_parser.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -548,7 +552,7 @@ int yyparse (struct FILE_INFO *ip_file); /* Copy the second part of user declarations. */ -#line 552 "ntp_parser.c" /* yacc.c:358 */ +#line 556 "ntp_parser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -788,23 +792,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 205 +#define YYFINAL 207 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 634 +#define YYLAST 622 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 195 +#define YYNTOKENS 197 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 104 /* YYNRULES -- Number of rules. */ -#define YYNRULES 308 +#define YYNRULES 310 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 413 +#define YYNSTATES 415 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 444 +#define YYMAXUTOK 446 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -817,15 +821,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 191, 192, 2, 2, 2, 2, 2, 2, 2, 2, + 193, 194, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 190, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 192, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 193, 2, 194, 2, 2, 2, 2, + 2, 2, 2, 195, 2, 196, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -857,44 +861,45 @@ static const yytype_uint8 yytranslate[] = 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189 + 185, 186, 187, 188, 189, 190, 191 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 364, 364, 368, 369, 370, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 405, 415, 416, 417, 418, 419, 423, 424, 429, 434, - 436, 442, 443, 451, 452, 453, 457, 462, 463, 464, - 465, 466, 467, 468, 469, 473, 475, 480, 481, 482, - 483, 484, 485, 489, 494, 503, 513, 514, 524, 526, - 528, 530, 541, 548, 550, 555, 557, 559, 561, 563, - 572, 578, 579, 587, 589, 601, 602, 603, 604, 605, - 614, 619, 624, 632, 634, 636, 641, 642, 643, 644, - 645, 646, 650, 651, 652, 653, 662, 664, 673, 683, - 688, 696, 697, 698, 699, 700, 701, 702, 703, 708, - 709, 717, 727, 736, 751, 756, 757, 761, 762, 766, - 767, 768, 769, 770, 771, 772, 781, 785, 789, 797, - 805, 813, 828, 843, 856, 857, 865, 866, 867, 868, - 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, - 879, 883, 888, 896, 901, 902, 903, 907, 912, 920, - 925, 926, 927, 928, 929, 930, 931, 932, 940, 950, - 955, 963, 965, 967, 969, 971, 976, 977, 981, 982, - 983, 984, 992, 997, 1002, 1010, 1015, 1016, 1017, 1026, - 1028, 1033, 1038, 1046, 1048, 1065, 1066, 1067, 1068, 1069, - 1070, 1074, 1075, 1083, 1088, 1093, 1101, 1106, 1107, 1108, - 1109, 1110, 1111, 1112, 1113, 1122, 1123, 1124, 1131, 1138, - 1154, 1173, 1178, 1180, 1182, 1184, 1186, 1193, 1198, 1199, - 1200, 1204, 1205, 1206, 1210, 1211, 1215, 1222, 1232, 1241, - 1246, 1248, 1253, 1254, 1262, 1264, 1272, 1277, 1285, 1310, - 1317, 1327, 1328, 1332, 1333, 1334, 1335, 1339, 1340, 1341, - 1345, 1350, 1355, 1363, 1364, 1365, 1366, 1367, 1368, 1369, - 1379, 1384, 1392, 1397, 1405, 1407, 1411, 1416, 1421, 1429, - 1434, 1442, 1451, 1452, 1456, 1457, 1466, 1484, 1488, 1493, - 1501, 1506, 1507, 1511, 1516, 1524, 1529, 1534, 1539, 1544, - 1552, 1557, 1562, 1570, 1575, 1576, 1577, 1578, 1579 + 0, 366, 366, 370, 371, 372, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 407, 417, 418, 419, 420, 421, 425, 426, 431, 436, + 438, 444, 445, 453, 454, 455, 459, 464, 465, 466, + 467, 468, 469, 470, 471, 475, 477, 482, 483, 484, + 485, 486, 487, 491, 496, 505, 515, 516, 526, 528, + 530, 532, 543, 550, 552, 557, 559, 561, 563, 565, + 574, 580, 581, 589, 591, 603, 604, 605, 606, 607, + 616, 621, 626, 634, 636, 638, 643, 644, 645, 646, + 647, 648, 652, 653, 654, 655, 664, 666, 675, 685, + 690, 698, 699, 700, 701, 702, 703, 704, 705, 710, + 711, 719, 729, 738, 753, 758, 759, 763, 764, 768, + 769, 770, 771, 772, 773, 774, 783, 787, 791, 799, + 807, 815, 830, 845, 858, 859, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 885, 890, 898, 903, 904, 905, 909, 914, 922, + 927, 928, 929, 930, 931, 932, 933, 934, 942, 952, + 957, 965, 967, 969, 971, 973, 978, 979, 983, 984, + 985, 986, 994, 999, 1004, 1012, 1017, 1018, 1019, 1028, + 1030, 1035, 1040, 1048, 1050, 1067, 1068, 1069, 1070, 1071, + 1072, 1076, 1077, 1085, 1090, 1095, 1103, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1126, 1127, 1128, + 1135, 1142, 1158, 1177, 1182, 1184, 1186, 1188, 1190, 1197, + 1202, 1203, 1204, 1208, 1209, 1210, 1214, 1215, 1219, 1226, + 1236, 1245, 1250, 1252, 1257, 1258, 1266, 1268, 1276, 1281, + 1289, 1314, 1321, 1331, 1332, 1336, 1337, 1338, 1339, 1343, + 1344, 1345, 1349, 1354, 1359, 1367, 1368, 1369, 1370, 1371, + 1372, 1373, 1383, 1388, 1396, 1401, 1409, 1411, 1415, 1420, + 1425, 1433, 1438, 1446, 1455, 1456, 1460, 1461, 1470, 1488, + 1492, 1497, 1505, 1510, 1511, 1515, 1520, 1528, 1533, 1538, + 1543, 1548, 1556, 1561, 1566, 1574, 1579, 1580, 1581, 1582, + 1583 }; #endif @@ -932,31 +937,32 @@ static const char *const yytname[] = "T_Rawstats", "T_Refid", "T_Requestkey", "T_Reset", "T_Restrict", "T_Revoke", "T_Rlimit", "T_Saveconfigdir", "T_Server", "T_Setvar", "T_Source", "T_Stacksize", "T_Statistics", "T_Stats", "T_Statsdir", - "T_Step", "T_Stepout", "T_Stratum", "T_String", "T_Sys", "T_Sysstats", - "T_Tick", "T_Time1", "T_Time2", "T_Timer", "T_Timingstats", "T_Tinker", - "T_Tos", "T_Trap", "T_True", "T_Trustedkey", "T_Ttl", "T_Type", - "T_U_int", "T_Unconfig", "T_Unpeer", "T_Version", "T_WanderThreshold", - "T_Week", "T_Wildcard", "T_Xleave", "T_Year", "T_Flag", "T_EOC", - "T_Simulate", "T_Beep_Delay", "T_Sim_Duration", "T_Server_Offset", - "T_Duration", "T_Freq_Offset", "T_Wander", "T_Jitter", "T_Prop_Delay", - "T_Proc_Delay", "'='", "'('", "')'", "'{'", "'}'", "$accept", - "configuration", "command_list", "command", "server_command", - "client_type", "address", "ip_address", "address_fam", "option_list", - "option", "option_flag", "option_flag_keyword", "option_int", - "option_int_keyword", "option_str", "option_str_keyword", - "unpeer_command", "unpeer_keyword", "other_mode_command", - "authentication_command", "crypto_command_list", "crypto_command", - "crypto_str_keyword", "orphan_mode_command", "tos_option_list", - "tos_option", "tos_option_int_keyword", "tos_option_dbl_keyword", - "monitoring_command", "stats_list", "stat", "filegen_option_list", - "filegen_option", "link_nolink", "enable_disable", "filegen_type", - "access_control_command", "ac_flag_list", "access_control_flag", - "discard_option_list", "discard_option", "discard_option_keyword", - "mru_option_list", "mru_option", "mru_option_keyword", "fudge_command", - "fudge_factor_list", "fudge_factor", "fudge_factor_dbl_keyword", - "fudge_factor_bool_keyword", "rlimit_command", "rlimit_option_list", - "rlimit_option", "rlimit_option_keyword", "system_option_command", - "system_option_list", "system_option", "system_option_flag_keyword", + "T_Step", "T_Stepback", "T_Stepfwd", "T_Stepout", "T_Stratum", + "T_String", "T_Sys", "T_Sysstats", "T_Tick", "T_Time1", "T_Time2", + "T_Timer", "T_Timingstats", "T_Tinker", "T_Tos", "T_Trap", "T_True", + "T_Trustedkey", "T_Ttl", "T_Type", "T_U_int", "T_Unconfig", "T_Unpeer", + "T_Version", "T_WanderThreshold", "T_Week", "T_Wildcard", "T_Xleave", + "T_Year", "T_Flag", "T_EOC", "T_Simulate", "T_Beep_Delay", + "T_Sim_Duration", "T_Server_Offset", "T_Duration", "T_Freq_Offset", + "T_Wander", "T_Jitter", "T_Prop_Delay", "T_Proc_Delay", "'='", "'('", + "')'", "'{'", "'}'", "$accept", "configuration", "command_list", + "command", "server_command", "client_type", "address", "ip_address", + "address_fam", "option_list", "option", "option_flag", + "option_flag_keyword", "option_int", "option_int_keyword", "option_str", + "option_str_keyword", "unpeer_command", "unpeer_keyword", + "other_mode_command", "authentication_command", "crypto_command_list", + "crypto_command", "crypto_str_keyword", "orphan_mode_command", + "tos_option_list", "tos_option", "tos_option_int_keyword", + "tos_option_dbl_keyword", "monitoring_command", "stats_list", "stat", + "filegen_option_list", "filegen_option", "link_nolink", "enable_disable", + "filegen_type", "access_control_command", "ac_flag_list", + "access_control_flag", "discard_option_list", "discard_option", + "discard_option_keyword", "mru_option_list", "mru_option", + "mru_option_keyword", "fudge_command", "fudge_factor_list", + "fudge_factor", "fudge_factor_dbl_keyword", "fudge_factor_bool_keyword", + "rlimit_command", "rlimit_option_list", "rlimit_option", + "rlimit_option_keyword", "system_option_command", "system_option_list", + "system_option", "system_option_flag_keyword", "system_option_local_flag_keyword", "tinker_command", "tinker_option_list", "tinker_option", "tinker_option_keyword", "miscellaneous_command", "misc_cmd_dbl_keyword", "misc_cmd_str_keyword", @@ -998,14 +1004,14 @@ static const yytype_uint16 yytoknum[] = 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 61, 40, 41, 123, 125 + 445, 446, 61, 40, 41, 123, 125 }; # endif -#define YYPACT_NINF -180 +#define YYPACT_NINF -182 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-180))) + (!!((Yystate) == (-182))) #define YYTABLE_NINF -7 @@ -1016,48 +1022,48 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 26, -147, -9, -180, -180, -180, -6, -180, 222, 9, - -96, 222, -180, 276, -41, -180, -93, -180, -90, -86, - -180, -84, -180, -180, -41, 0, 443, -41, -180, -180, - -83, -180, -82, -180, -180, 20, 27, -20, 21, -19, - -180, -180, -68, 276, -66, -180, 221, 328, -65, -55, - 38, -180, -180, -180, 99, 188, -69, -180, -41, -180, - -41, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -3, -40, -39, -180, -4, -180, -180, -77, -180, - -180, -180, 254, -180, -180, -180, -180, -180, -180, -180, - -180, 222, -180, -180, -180, -180, -180, -180, 9, -180, - 47, 90, -180, 222, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, 98, -180, -31, 347, - -180, -180, -180, -84, -180, -180, -41, -180, -180, -180, - -180, -180, -180, -180, -180, -180, 443, -180, 61, -41, - -180, -180, -30, -180, -180, -180, -180, -180, -180, -180, - -180, 27, -180, -180, 102, 106, -180, -180, 55, -180, - -180, -180, -180, -19, -180, 87, -42, -180, 276, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, 221, - -180, -3, -180, -180, -27, -180, -180, -180, -180, -180, - -180, -180, -180, 328, -180, 91, -3, -180, -180, 93, - -55, -180, -180, -180, 96, -180, -21, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, 3, -144, - -180, -180, -180, -180, -180, 100, -180, -5, -180, -180, - -180, -180, -23, 5, -180, -180, -180, -180, 7, 103, - -180, -180, 98, -180, -3, -27, -180, -180, -180, -180, - -180, -180, -180, -180, 462, -180, -180, 462, 462, -65, - -180, -180, 8, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -47, 138, -180, -180, -180, 425, -180, - -180, -180, -180, -180, -180, -180, -180, -105, -2, -15, - -180, -180, -180, -180, 25, -180, -180, 17, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, 462, 462, -180, 154, -65, 124, -180, - 125, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -51, -180, 32, 10, 16, -116, -180, 6, -180, -3, - -180, -180, -180, -180, -180, -180, -180, -180, -180, 462, - -180, -180, -180, -180, 15, -180, -180, -180, -41, -180, - -180, -180, 18, -180, -180, -180, 22, 24, -3, 23, - -169, -180, 36, -3, -180, -180, -180, 29, -94, -180, - -180, -180, -180, -180, 89, 37, 30, -180, 40, -180, - -3, -180, -180 + 18, -161, -18, -182, -182, -182, -10, -182, 189, 11, + -103, 189, -182, 7, -49, -182, -100, -182, -97, -90, + -182, -84, -182, -182, -49, 13, 365, -49, -182, -182, + -81, -182, -80, -182, -182, 20, 86, 104, 21, -33, + -182, -182, -73, 7, -72, -182, 51, 500, -71, -54, + 26, -182, -182, -182, 90, 205, -83, -182, -49, -182, + -49, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -8, -65, -51, -182, -9, -182, -182, -91, -182, + -182, -182, -15, -182, -182, -182, -182, -182, -182, -182, + -182, 189, -182, -182, -182, -182, -182, -182, 11, -182, + 46, 85, -182, 189, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, 92, -182, -35, 366, + -182, -182, -182, -84, -182, -182, -49, -182, -182, -182, + -182, -182, -182, -182, -182, -182, 365, -182, 68, -49, + -182, -182, -23, -182, -182, -182, -182, -182, -182, -182, + -182, 86, -182, -182, 114, 121, -182, -182, 67, -182, + -182, -182, -182, -33, -182, 93, -28, -182, 7, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, 51, -182, -8, -182, -182, -17, -182, -182, -182, + -182, -182, -182, -182, -182, 500, -182, 107, -8, -182, + -182, 112, -54, -182, -182, -182, 113, -182, 8, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -2, -147, -182, -182, -182, -182, -182, 128, -182, 25, + -182, -182, -182, -182, 116, 37, -182, -182, -182, -182, + 38, 135, -182, -182, 92, -182, -8, -17, -182, -182, + -182, -182, -182, -182, -182, -182, 445, -182, -182, 445, + 445, -71, -182, -182, 40, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -52, 163, -182, -182, -182, + 261, -182, -182, -182, -182, -182, -182, -182, -182, -114, + 27, 14, -182, -182, -182, -182, 55, -182, -182, 0, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, 445, 445, -182, 185, -71, + 153, -182, 156, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -53, -182, 61, 30, 43, -133, -182, 23, + -182, -8, -182, -182, -182, -182, -182, -182, -182, -182, + -182, 445, -182, -182, -182, -182, 32, -182, -182, -182, + -49, -182, -182, -182, 45, -182, -182, -182, 41, 50, + -8, 47, -157, -182, 56, -8, -182, -182, -182, 49, + 130, -182, -182, -182, -182, -182, 110, 59, 54, -182, + 70, -182, -8, -182, -182 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1065,80 +1071,80 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 0, 0, 24, 58, 228, 0, 71, 0, 0, - 238, 0, 221, 0, 0, 231, 0, 251, 0, 0, - 232, 0, 234, 25, 0, 0, 0, 0, 252, 229, - 0, 23, 0, 233, 22, 0, 0, 0, 0, 0, - 235, 21, 0, 0, 0, 230, 0, 0, 0, 0, - 0, 56, 57, 287, 0, 2, 0, 7, 0, 8, + 0, 0, 0, 24, 58, 230, 0, 71, 0, 0, + 240, 0, 223, 0, 0, 233, 0, 253, 0, 0, + 234, 0, 236, 25, 0, 0, 0, 0, 254, 231, + 0, 23, 0, 235, 22, 0, 0, 0, 0, 0, + 237, 21, 0, 0, 0, 232, 0, 0, 0, 0, + 0, 56, 57, 289, 0, 2, 0, 7, 0, 8, 0, 9, 10, 13, 11, 12, 14, 15, 16, 17, - 18, 0, 0, 0, 215, 0, 216, 19, 0, 5, + 18, 0, 0, 0, 217, 0, 218, 19, 0, 5, 62, 63, 64, 195, 196, 197, 198, 201, 199, 200, 202, 190, 192, 193, 194, 154, 155, 156, 126, 152, - 0, 236, 222, 189, 101, 102, 103, 104, 108, 105, + 0, 238, 224, 189, 101, 102, 103, 104, 108, 105, 106, 107, 109, 29, 30, 28, 0, 26, 0, 6, - 65, 66, 248, 223, 247, 280, 59, 61, 160, 161, + 65, 66, 250, 225, 249, 282, 59, 61, 160, 161, 162, 163, 164, 165, 166, 167, 127, 158, 0, 60, - 70, 278, 224, 67, 263, 264, 265, 266, 267, 268, - 269, 260, 262, 134, 29, 30, 134, 134, 26, 68, - 188, 186, 187, 182, 184, 0, 0, 225, 96, 100, - 97, 207, 208, 209, 210, 211, 212, 213, 214, 203, - 205, 0, 91, 86, 0, 87, 95, 93, 94, 92, - 90, 88, 89, 80, 82, 0, 0, 242, 274, 0, - 69, 273, 275, 271, 227, 1, 0, 4, 31, 55, - 285, 284, 217, 218, 219, 259, 258, 257, 0, 0, - 79, 75, 76, 77, 78, 0, 72, 0, 191, 151, - 153, 237, 98, 0, 178, 179, 180, 181, 0, 0, - 176, 177, 168, 170, 0, 0, 27, 220, 246, 279, - 157, 159, 277, 261, 130, 134, 134, 133, 128, 0, - 183, 185, 0, 99, 204, 206, 283, 281, 282, 85, - 81, 83, 84, 226, 0, 272, 270, 3, 20, 253, - 254, 255, 250, 256, 249, 291, 292, 0, 0, 0, - 74, 73, 118, 117, 0, 115, 116, 0, 110, 113, - 114, 174, 175, 173, 169, 171, 172, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 135, 131, 132, 134, 241, 0, 0, 243, - 0, 37, 38, 39, 54, 47, 49, 48, 51, 40, - 41, 42, 43, 50, 52, 44, 32, 33, 36, 34, - 0, 35, 0, 0, 0, 0, 294, 0, 289, 0, - 111, 125, 121, 123, 119, 120, 122, 124, 112, 129, - 240, 239, 245, 244, 0, 45, 46, 53, 0, 288, - 286, 293, 0, 290, 276, 297, 0, 0, 0, 0, - 0, 299, 0, 0, 295, 298, 296, 0, 0, 304, - 305, 306, 307, 308, 0, 0, 0, 300, 0, 302, - 0, 301, 303 + 70, 280, 226, 67, 265, 266, 267, 268, 269, 270, + 271, 262, 264, 134, 29, 30, 134, 134, 26, 68, + 188, 186, 187, 182, 184, 0, 0, 227, 96, 100, + 97, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 203, 205, 0, 91, 86, 0, 87, 95, 93, + 94, 92, 90, 88, 89, 80, 82, 0, 0, 244, + 276, 0, 69, 275, 277, 273, 229, 1, 0, 4, + 31, 55, 287, 286, 219, 220, 221, 261, 260, 259, + 0, 0, 79, 75, 76, 77, 78, 0, 72, 0, + 191, 151, 153, 239, 98, 0, 178, 179, 180, 181, + 0, 0, 176, 177, 168, 170, 0, 0, 27, 222, + 248, 281, 157, 159, 279, 263, 130, 134, 134, 133, + 128, 0, 183, 185, 0, 99, 204, 206, 285, 283, + 284, 85, 81, 83, 84, 228, 0, 274, 272, 3, + 20, 255, 256, 257, 252, 258, 251, 293, 294, 0, + 0, 0, 74, 73, 118, 117, 0, 115, 116, 0, + 110, 113, 114, 174, 175, 173, 169, 171, 172, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 135, 131, 132, 134, 243, 0, + 0, 245, 0, 37, 38, 39, 54, 47, 49, 48, + 51, 40, 41, 42, 43, 50, 52, 44, 32, 33, + 36, 34, 0, 35, 0, 0, 0, 0, 296, 0, + 291, 0, 111, 125, 121, 123, 119, 120, 122, 124, + 112, 129, 242, 241, 247, 246, 0, 45, 46, 53, + 0, 290, 288, 295, 0, 292, 278, 299, 0, 0, + 0, 0, 0, 301, 0, 0, 297, 300, 298, 0, + 0, 306, 307, 308, 309, 310, 0, 0, 0, 302, + 0, 304, 0, 303, 305 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -180, -180, -180, -37, -180, -180, -14, -36, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, 33, -180, -180, -180, - -180, -33, -180, -180, -180, -180, -180, -180, -153, -180, - -180, 131, -180, -180, 97, -180, -180, -180, -10, -180, - -180, -180, -180, 73, -180, -180, 227, -72, -180, -180, - -180, -180, 60, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, 119, -180, -180, -180, -180, -180, - -180, 92, -180, -180, 44, -180, -180, 218, 1, -179, - -180, -180, -180, -34, -180, -180, -107, -180, -180, -180, - -140, -180, -150, -180 + -182, -182, -182, -45, -182, -182, -14, -36, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, 60, -182, -182, -182, + -182, -38, -182, -182, -182, -182, -182, -182, -142, -182, + -182, 134, -182, -182, 120, -182, -182, -182, 5, -182, + -182, -182, -182, 96, -182, -182, 250, -42, -182, -182, + -182, -182, 81, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, 140, -182, -182, -182, -182, -182, + -182, 117, -182, -182, 63, -182, -182, 240, 22, -181, + -182, -182, -182, -16, -182, -182, -86, -182, -182, -182, + -120, -182, -132, -182 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 54, 55, 56, 57, 58, 125, 117, 118, 278, - 346, 347, 348, 349, 350, 351, 352, 59, 60, 61, - 62, 82, 226, 227, 63, 193, 194, 195, 196, 64, - 168, 112, 232, 298, 299, 300, 368, 65, 254, 322, - 98, 99, 100, 136, 137, 138, 66, 242, 243, 244, - 245, 67, 163, 164, 165, 68, 91, 92, 93, 94, - 69, 179, 180, 181, 70, 71, 72, 73, 102, 167, - 371, 273, 329, 123, 124, 74, 75, 284, 218, 76, - 151, 152, 204, 200, 201, 202, 142, 126, 269, 212, - 77, 78, 287, 288, 289, 355, 356, 387, 357, 390, - 391, 404, 405, 406 + -1, 54, 55, 56, 57, 58, 125, 117, 118, 280, + 348, 349, 350, 351, 352, 353, 354, 59, 60, 61, + 62, 82, 228, 229, 63, 195, 196, 197, 198, 64, + 168, 112, 234, 300, 301, 302, 370, 65, 256, 324, + 98, 99, 100, 136, 137, 138, 66, 244, 245, 246, + 247, 67, 163, 164, 165, 68, 91, 92, 93, 94, + 69, 181, 182, 183, 70, 71, 72, 73, 102, 167, + 373, 275, 331, 123, 124, 74, 75, 286, 220, 76, + 151, 152, 206, 202, 203, 204, 142, 126, 271, 214, + 77, 78, 289, 290, 291, 357, 358, 389, 359, 392, + 393, 406, 407, 408 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1146,138 +1152,136 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 116, 158, 265, 257, 258, 198, 292, 153, 279, 375, - 169, 266, 197, 293, 327, 389, 294, 272, 206, 228, - 95, 361, 160, 157, 113, 394, 114, 1, 353, 210, - 215, 228, 79, 267, 144, 145, 2, 285, 286, 353, - 3, 4, 5, 362, 208, 154, 209, 155, 6, 7, - 216, 80, 146, 295, 81, 8, 9, 211, 101, 10, - 127, 119, 11, 12, 120, 305, 13, 280, 121, 281, - 122, 140, 141, 217, 161, 14, 285, 286, 380, 15, - 143, 159, 247, 328, 296, 16, 166, 17, 170, 115, - 147, 399, 400, 401, 402, 403, 18, 19, 203, 205, - 20, 233, 323, 324, 21, 22, 96, 230, 23, 24, - 207, 97, 249, 115, 213, 214, 219, 25, 376, 148, - 363, 251, 231, 246, 252, 249, 156, 364, 162, 255, - 26, 27, 28, 256, 115, 263, 199, 29, 268, 259, - 234, 235, 236, 237, 365, 297, 30, 261, 262, 291, - 31, 271, 32, 274, 33, 34, 276, 282, 277, 301, - 290, 302, 326, 303, 35, 36, 37, 38, 39, 40, - 41, 42, 369, 330, 43, 359, 44, 358, 283, 360, - 383, 370, 149, 45, 373, 374, 377, 150, 46, 47, - 48, 366, 49, 50, 367, 379, 51, 52, 2, 382, - 378, 386, 3, 4, 5, -6, 53, 384, 389, 392, - 6, 7, 388, 393, 397, 396, 409, 8, 9, 411, - 410, 10, 398, 325, 11, 12, 270, 171, 13, 229, - 83, 412, 304, 250, 84, 238, 260, 14, 103, 264, - 85, 15, 248, 253, 275, 139, 306, 16, 381, 17, - 395, 239, 172, 354, 408, 0, 240, 241, 18, 19, - 0, 0, 20, 0, 0, 0, 21, 22, 0, 173, - 23, 24, 174, 0, 399, 400, 401, 402, 403, 25, - 0, 0, 220, 407, 0, 0, 0, 0, 0, 0, - 86, 372, 26, 27, 28, 0, 104, 0, 0, 29, - 105, 0, 0, 0, 221, 0, 0, 222, 30, 0, - 0, 0, 31, 0, 32, 0, 33, 34, 0, 0, - 0, 0, 0, 87, 88, 0, 35, 36, 37, 38, - 39, 40, 41, 42, 0, 0, 43, 0, 44, 0, - 89, 182, 0, 0, 175, 45, 0, 183, 0, 184, - 46, 47, 48, 0, 49, 50, 106, 2, 51, 52, - 0, 3, 4, 5, 385, 0, 0, -6, 53, 6, - 7, 90, 176, 177, 0, 185, 8, 9, 178, 0, - 10, 0, 0, 11, 12, 0, 0, 13, 223, 224, - 0, 0, 0, 0, 0, 225, 14, 0, 0, 0, - 15, 107, 0, 0, 0, 0, 16, 0, 17, 108, - 0, 0, 109, 0, 186, 0, 187, 18, 19, 0, - 0, 20, 188, 0, 189, 21, 22, 190, 0, 23, - 24, 0, 110, 0, 331, 0, 0, 111, 25, 0, - 0, 0, 332, 0, 0, 0, 0, 0, 0, 191, - 192, 26, 27, 28, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, - 0, 31, 0, 32, 0, 33, 34, 333, 334, 0, - 0, 0, 0, 0, 0, 35, 36, 37, 38, 39, - 40, 41, 42, 0, 335, 43, 0, 44, 128, 129, - 130, 131, 0, 0, 45, 0, 0, 0, 307, 46, - 47, 48, 0, 49, 50, 336, 308, 51, 52, 0, - 0, 0, 0, 337, 0, 338, 0, 53, 132, 0, - 133, 0, 134, 0, 309, 310, 0, 311, 135, 339, - 0, 0, 0, 312, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 340, 341, 0, 0, + 116, 158, 267, 281, 363, 169, 200, 377, 160, 329, + 208, 355, 199, 222, 259, 260, 113, 274, 114, 1, + 79, 268, 95, 157, 212, 217, 364, 104, 2, 391, + 355, 105, 3, 4, 5, 223, 287, 288, 224, 396, + 6, 7, 80, 269, 210, 218, 211, 8, 9, 230, + 81, 10, 213, 101, 11, 12, 119, 171, 13, 120, + 161, 230, 282, 382, 283, 307, 121, 14, 219, 287, + 288, 15, 122, 127, 249, 140, 141, 16, 330, 17, + 143, 159, 172, 166, 170, 115, 205, 106, 18, 19, + 207, 215, 20, 144, 145, 235, 21, 22, 209, 173, + 23, 24, 174, 365, 221, 216, 232, 115, 96, 25, + 366, 146, 251, 97, 162, 325, 326, 233, 378, 225, + 226, 248, 26, 27, 28, 251, 227, 367, 253, 29, + 265, 153, 107, 254, 236, 237, 238, 239, 30, 201, + 108, 257, 31, 109, 32, 294, 33, 34, 258, 147, + 270, 261, 295, 263, 284, 296, 35, 36, 37, 38, + 39, 40, 41, 42, 264, 110, 43, 273, 44, 154, + 111, 155, 276, 278, 175, 285, 368, 45, 148, 369, + 385, 293, 46, 47, 48, 371, 49, 50, 292, 279, + 51, 52, 297, 303, 304, 305, 328, 83, 332, -6, + 53, 84, 176, 177, 178, 179, 361, 85, 360, 394, + 180, 362, 372, 375, 399, 2, 376, 379, 384, 3, + 4, 5, 380, 298, 381, 327, 386, 6, 7, 240, + 388, 414, 231, 390, 8, 9, 391, 398, 10, 395, + 411, 11, 12, 149, 400, 13, 412, 241, 150, 306, + 156, 413, 242, 243, 14, 272, 252, 86, 15, 262, + 115, 103, 266, 250, 16, 277, 17, 139, 255, 308, + 333, 383, 397, 356, 410, 18, 19, 0, 334, 20, + 0, 0, 0, 21, 22, 0, 299, 23, 24, 0, + 87, 88, 0, 374, 0, 0, 25, 401, 402, 403, + 404, 405, 0, 0, 0, 0, 409, 89, 0, 26, + 27, 28, 0, 335, 336, 0, 29, 401, 402, 403, + 404, 405, 0, 0, 0, 30, 0, 0, 0, 31, + 337, 32, 0, 33, 34, 0, 0, 0, 90, 0, + 0, 0, 0, 35, 36, 37, 38, 39, 40, 41, + 42, 338, 0, 43, 0, 44, 0, 0, 0, 339, + 0, 340, 0, 0, 45, 0, 387, 0, 0, 46, + 47, 48, 0, 49, 50, 341, 2, 51, 52, 0, + 3, 4, 5, 0, 0, 0, -6, 53, 6, 7, + 0, 0, 342, 343, 0, 8, 9, 0, 0, 10, + 0, 0, 11, 12, 0, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 14, 0, 0, 0, 15, + 128, 129, 130, 131, 0, 16, 0, 17, 344, 0, + 345, 0, 0, 0, 0, 346, 18, 19, 0, 347, + 20, 0, 0, 0, 21, 22, 0, 0, 23, 24, + 132, 0, 133, 0, 134, 0, 0, 25, 0, 0, + 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 26, 27, 28, 0, 0, 0, 0, 29, 0, 0, + 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, + 31, 309, 32, 0, 33, 34, 0, 0, 0, 310, + 0, 0, 0, 0, 35, 36, 37, 38, 39, 40, + 41, 42, 0, 184, 43, 0, 44, 311, 312, 185, + 313, 186, 0, 0, 0, 45, 314, 0, 0, 0, + 46, 47, 48, 0, 49, 50, 0, 0, 51, 52, + 0, 0, 0, 0, 0, 0, 0, 187, 53, 0, + 0, 0, 0, 315, 316, 0, 0, 317, 318, 0, + 319, 320, 321, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 313, 314, 0, 0, 315, 316, 0, 317, 318, 319, - 0, 320, 0, 0, 0, 0, 0, 0, 0, 0, - 342, 0, 343, 0, 0, 0, 0, 344, 0, 0, - 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 188, 0, 189, 0, + 0, 0, 0, 0, 190, 0, 191, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 321 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, + 0, 193, 194 }; static const yytype_int16 yycheck[] = { - 14, 37, 181, 156, 157, 60, 29, 27, 5, 60, - 43, 38, 48, 36, 61, 184, 39, 196, 55, 91, - 11, 4, 41, 37, 65, 194, 67, 1, 144, 32, - 34, 103, 179, 60, 7, 8, 10, 181, 182, 144, - 14, 15, 16, 26, 58, 65, 60, 67, 22, 23, - 54, 60, 25, 76, 60, 29, 30, 60, 154, 33, - 60, 154, 36, 37, 154, 244, 40, 64, 154, 66, - 154, 154, 154, 77, 93, 49, 181, 182, 194, 53, - 60, 60, 119, 130, 107, 59, 154, 61, 154, 154, - 63, 185, 186, 187, 188, 189, 70, 71, 60, 0, - 74, 3, 255, 256, 78, 79, 97, 60, 82, 83, - 179, 102, 126, 154, 154, 154, 193, 91, 169, 92, - 103, 60, 32, 154, 154, 139, 146, 110, 147, 27, - 104, 105, 106, 27, 154, 168, 191, 111, 165, 84, - 42, 43, 44, 45, 127, 168, 120, 60, 190, 154, - 124, 60, 126, 60, 128, 129, 60, 154, 179, 154, - 60, 154, 154, 60, 138, 139, 140, 141, 142, 143, - 144, 145, 325, 35, 148, 190, 150, 179, 175, 154, - 359, 27, 155, 157, 60, 60, 154, 160, 162, 163, - 164, 174, 166, 167, 177, 179, 170, 171, 10, 193, - 190, 183, 14, 15, 16, 179, 180, 192, 184, 388, - 22, 23, 190, 190, 393, 179, 179, 29, 30, 179, - 190, 33, 193, 259, 36, 37, 193, 6, 40, 98, - 8, 410, 242, 136, 12, 137, 163, 49, 11, 179, - 18, 53, 123, 151, 200, 27, 245, 59, 355, 61, - 390, 153, 31, 287, 404, -1, 158, 159, 70, 71, - -1, -1, 74, -1, -1, -1, 78, 79, -1, 48, - 82, 83, 51, -1, 185, 186, 187, 188, 189, 91, - -1, -1, 28, 194, -1, -1, -1, -1, -1, -1, - 68, 327, 104, 105, 106, -1, 20, -1, -1, 111, - 24, -1, -1, -1, 50, -1, -1, 53, 120, -1, - -1, -1, 124, -1, 126, -1, 128, 129, -1, -1, - -1, -1, -1, 101, 102, -1, 138, 139, 140, 141, - 142, 143, 144, 145, -1, -1, 148, -1, 150, -1, - 118, 13, -1, -1, 123, 157, -1, 19, -1, 21, - 162, 163, 164, -1, 166, 167, 80, 10, 170, 171, - -1, 14, 15, 16, 378, -1, -1, 179, 180, 22, - 23, 149, 151, 152, -1, 47, 29, 30, 157, -1, - 33, -1, -1, 36, 37, -1, -1, 40, 134, 135, - -1, -1, -1, -1, -1, 141, 49, -1, -1, -1, - 53, 125, -1, -1, -1, -1, 59, -1, 61, 133, - -1, -1, 136, -1, 86, -1, 88, 70, 71, -1, - -1, 74, 94, -1, 96, 78, 79, 99, -1, 82, - 83, -1, 156, -1, 9, -1, -1, 161, 91, -1, - -1, -1, 17, -1, -1, -1, -1, -1, -1, 121, - 122, 104, 105, 106, -1, -1, -1, -1, 111, -1, - -1, -1, -1, -1, -1, -1, -1, 120, -1, -1, - -1, 124, -1, 126, -1, 128, 129, 52, 53, -1, - -1, -1, -1, -1, -1, 138, 139, 140, 141, 142, - 143, 144, 145, -1, 69, 148, -1, 150, 55, 56, - 57, 58, -1, -1, 157, -1, -1, -1, 46, 162, - 163, 164, -1, 166, 167, 90, 54, 170, 171, -1, - -1, -1, -1, 98, -1, 100, -1, 180, 85, -1, - 87, -1, 89, -1, 72, 73, -1, 75, 95, 114, - -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 131, 132, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 108, 109, -1, -1, 112, 113, -1, 115, 116, 117, - -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, - 165, -1, 167, -1, -1, -1, -1, 172, -1, -1, - -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, + 14, 37, 183, 5, 4, 43, 60, 60, 41, 61, + 55, 144, 48, 28, 156, 157, 65, 198, 67, 1, + 181, 38, 11, 37, 32, 34, 26, 20, 10, 186, + 144, 24, 14, 15, 16, 50, 183, 184, 53, 196, + 22, 23, 60, 60, 58, 54, 60, 29, 30, 91, + 60, 33, 60, 156, 36, 37, 156, 6, 40, 156, + 93, 103, 64, 196, 66, 246, 156, 49, 77, 183, + 184, 53, 156, 60, 119, 156, 156, 59, 130, 61, + 60, 60, 31, 156, 156, 156, 60, 80, 70, 71, + 0, 156, 74, 7, 8, 3, 78, 79, 181, 48, + 82, 83, 51, 103, 195, 156, 60, 156, 97, 91, + 110, 25, 126, 102, 147, 257, 258, 32, 171, 134, + 135, 156, 104, 105, 106, 139, 141, 127, 60, 111, + 168, 27, 125, 156, 42, 43, 44, 45, 120, 193, + 133, 27, 124, 136, 126, 29, 128, 129, 27, 63, + 167, 84, 36, 60, 156, 39, 138, 139, 140, 141, + 142, 143, 144, 145, 192, 158, 148, 60, 150, 65, + 163, 67, 60, 60, 123, 177, 176, 159, 92, 179, + 361, 156, 164, 165, 166, 327, 168, 169, 60, 181, + 172, 173, 76, 156, 156, 60, 156, 8, 35, 181, + 182, 12, 151, 152, 153, 154, 192, 18, 181, 390, + 159, 156, 27, 60, 395, 10, 60, 156, 195, 14, + 15, 16, 192, 107, 181, 261, 194, 22, 23, 137, + 185, 412, 98, 192, 29, 30, 186, 181, 33, 192, + 181, 36, 37, 157, 195, 40, 192, 155, 162, 244, + 146, 181, 160, 161, 49, 195, 136, 68, 53, 163, + 156, 11, 181, 123, 59, 202, 61, 27, 151, 247, + 9, 357, 392, 289, 406, 70, 71, -1, 17, 74, + -1, -1, -1, 78, 79, -1, 170, 82, 83, -1, + 101, 102, -1, 329, -1, -1, 91, 187, 188, 189, + 190, 191, -1, -1, -1, -1, 196, 118, -1, 104, + 105, 106, -1, 52, 53, -1, 111, 187, 188, 189, + 190, 191, -1, -1, -1, 120, -1, -1, -1, 124, + 69, 126, -1, 128, 129, -1, -1, -1, 149, -1, + -1, -1, -1, 138, 139, 140, 141, 142, 143, 144, + 145, 90, -1, 148, -1, 150, -1, -1, -1, 98, + -1, 100, -1, -1, 159, -1, 380, -1, -1, 164, + 165, 166, -1, 168, 169, 114, 10, 172, 173, -1, + 14, 15, 16, -1, -1, -1, 181, 182, 22, 23, + -1, -1, 131, 132, -1, 29, 30, -1, -1, 33, + -1, -1, 36, 37, -1, -1, 40, -1, -1, -1, + -1, -1, -1, -1, -1, 49, -1, -1, -1, 53, + 55, 56, 57, 58, -1, 59, -1, 61, 167, -1, + 169, -1, -1, -1, -1, 174, 70, 71, -1, 178, + 74, -1, -1, -1, 78, 79, -1, -1, 82, 83, + 85, -1, 87, -1, 89, -1, -1, 91, -1, -1, + 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 104, 105, 106, -1, -1, -1, -1, 111, -1, -1, + -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, + 124, 46, 126, -1, 128, 129, -1, -1, -1, 54, + -1, -1, -1, -1, 138, 139, 140, 141, 142, 143, + 144, 145, -1, 13, 148, -1, 150, 72, 73, 19, + 75, 21, -1, -1, -1, 159, 81, -1, -1, -1, + 164, 165, 166, -1, 168, 169, -1, -1, 172, 173, + -1, -1, -1, -1, -1, -1, -1, 47, 182, -1, + -1, -1, -1, 108, 109, -1, -1, 112, 113, -1, + 115, 116, 117, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 86, -1, 88, -1, + -1, -1, -1, -1, 94, -1, 96, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 172 + -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, + -1, 121, 122 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1288,80 +1292,81 @@ static const yytype_uint16 yystos[] = 33, 36, 37, 40, 49, 53, 59, 61, 70, 71, 74, 78, 79, 82, 83, 91, 104, 105, 106, 111, 120, 124, 126, 128, 129, 138, 139, 140, 141, 142, - 143, 144, 145, 148, 150, 157, 162, 163, 164, 166, - 167, 170, 171, 180, 196, 197, 198, 199, 200, 212, - 213, 214, 215, 219, 224, 232, 241, 246, 250, 255, - 259, 260, 261, 262, 270, 271, 274, 285, 286, 179, - 60, 60, 216, 8, 12, 18, 68, 101, 102, 118, - 149, 251, 252, 253, 254, 11, 97, 102, 235, 236, - 237, 154, 263, 251, 20, 24, 80, 125, 133, 136, - 156, 161, 226, 65, 67, 154, 201, 202, 203, 154, - 154, 154, 154, 268, 269, 201, 282, 60, 55, 56, - 57, 58, 85, 87, 89, 95, 238, 239, 240, 282, - 154, 154, 281, 60, 7, 8, 25, 63, 92, 155, - 160, 275, 276, 27, 65, 67, 146, 201, 202, 60, - 41, 93, 147, 247, 248, 249, 154, 264, 225, 226, - 154, 6, 31, 48, 51, 123, 151, 152, 157, 256, - 257, 258, 13, 19, 21, 47, 86, 88, 94, 96, - 99, 121, 122, 220, 221, 222, 223, 202, 60, 191, - 278, 279, 280, 60, 277, 0, 198, 179, 201, 201, - 32, 60, 284, 154, 154, 34, 54, 77, 273, 193, - 28, 50, 53, 134, 135, 141, 217, 218, 252, 236, - 60, 32, 227, 3, 42, 43, 44, 45, 137, 153, - 158, 159, 242, 243, 244, 245, 154, 198, 269, 201, - 239, 60, 154, 276, 233, 27, 27, 233, 233, 84, - 248, 60, 190, 226, 257, 284, 38, 60, 165, 283, - 221, 60, 284, 266, 60, 279, 60, 179, 204, 5, - 64, 66, 154, 175, 272, 181, 182, 287, 288, 289, - 60, 154, 29, 36, 39, 76, 107, 168, 228, 229, - 230, 154, 154, 60, 243, 284, 283, 46, 54, 72, - 73, 75, 81, 108, 109, 112, 113, 115, 116, 117, - 119, 172, 234, 233, 233, 202, 154, 61, 130, 267, - 35, 9, 17, 52, 53, 69, 90, 98, 100, 114, - 131, 132, 165, 167, 172, 176, 205, 206, 207, 208, - 209, 210, 211, 144, 288, 290, 291, 293, 179, 190, - 154, 4, 26, 103, 110, 127, 174, 177, 231, 233, - 27, 265, 202, 60, 60, 60, 169, 154, 190, 179, - 194, 291, 193, 284, 192, 201, 183, 292, 190, 184, - 294, 295, 284, 190, 194, 295, 179, 284, 193, 185, - 186, 187, 188, 189, 296, 297, 298, 194, 297, 179, - 190, 179, 284 + 143, 144, 145, 148, 150, 159, 164, 165, 166, 168, + 169, 172, 173, 182, 198, 199, 200, 201, 202, 214, + 215, 216, 217, 221, 226, 234, 243, 248, 252, 257, + 261, 262, 263, 264, 272, 273, 276, 287, 288, 181, + 60, 60, 218, 8, 12, 18, 68, 101, 102, 118, + 149, 253, 254, 255, 256, 11, 97, 102, 237, 238, + 239, 156, 265, 253, 20, 24, 80, 125, 133, 136, + 158, 163, 228, 65, 67, 156, 203, 204, 205, 156, + 156, 156, 156, 270, 271, 203, 284, 60, 55, 56, + 57, 58, 85, 87, 89, 95, 240, 241, 242, 284, + 156, 156, 283, 60, 7, 8, 25, 63, 92, 157, + 162, 277, 278, 27, 65, 67, 146, 203, 204, 60, + 41, 93, 147, 249, 250, 251, 156, 266, 227, 228, + 156, 6, 31, 48, 51, 123, 151, 152, 153, 154, + 159, 258, 259, 260, 13, 19, 21, 47, 86, 88, + 94, 96, 99, 121, 122, 222, 223, 224, 225, 204, + 60, 193, 280, 281, 282, 60, 279, 0, 200, 181, + 203, 203, 32, 60, 286, 156, 156, 34, 54, 77, + 275, 195, 28, 50, 53, 134, 135, 141, 219, 220, + 254, 238, 60, 32, 229, 3, 42, 43, 44, 45, + 137, 155, 160, 161, 244, 245, 246, 247, 156, 200, + 271, 203, 241, 60, 156, 278, 235, 27, 27, 235, + 235, 84, 250, 60, 192, 228, 259, 286, 38, 60, + 167, 285, 223, 60, 286, 268, 60, 281, 60, 181, + 206, 5, 64, 66, 156, 177, 274, 183, 184, 289, + 290, 291, 60, 156, 29, 36, 39, 76, 107, 170, + 230, 231, 232, 156, 156, 60, 245, 286, 285, 46, + 54, 72, 73, 75, 81, 108, 109, 112, 113, 115, + 116, 117, 119, 174, 236, 235, 235, 204, 156, 61, + 130, 269, 35, 9, 17, 52, 53, 69, 90, 98, + 100, 114, 131, 132, 167, 169, 174, 178, 207, 208, + 209, 210, 211, 212, 213, 144, 290, 292, 293, 295, + 181, 192, 156, 4, 26, 103, 110, 127, 176, 179, + 233, 235, 27, 267, 204, 60, 60, 60, 171, 156, + 192, 181, 196, 293, 195, 286, 194, 203, 185, 294, + 192, 186, 296, 297, 286, 192, 196, 297, 181, 286, + 195, 187, 188, 189, 190, 191, 298, 299, 300, 196, + 299, 181, 192, 181, 286 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 195, 196, 197, 197, 197, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 199, 200, 200, 200, 200, 200, 201, 201, 202, 203, - 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, - 207, 207, 207, 207, 207, 208, 208, 209, 209, 209, - 209, 209, 209, 210, 211, 212, 213, 213, 214, 214, - 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 216, 216, 217, 217, 218, 218, 218, 218, 218, - 219, 220, 220, 221, 221, 221, 222, 222, 222, 222, - 222, 222, 223, 223, 223, 223, 224, 224, 224, 225, - 225, 226, 226, 226, 226, 226, 226, 226, 226, 227, - 227, 228, 228, 228, 228, 229, 229, 230, 230, 231, - 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, - 232, 232, 232, 232, 233, 233, 234, 234, 234, 234, - 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, - 234, 235, 235, 236, 237, 237, 237, 238, 238, 239, - 240, 240, 240, 240, 240, 240, 240, 240, 241, 242, - 242, 243, 243, 243, 243, 243, 244, 244, 245, 245, - 245, 245, 246, 247, 247, 248, 249, 249, 249, 250, - 250, 251, 251, 252, 252, 253, 253, 253, 253, 253, - 253, 254, 254, 255, 256, 256, 257, 258, 258, 258, - 258, 258, 258, 258, 258, 259, 259, 259, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 259, 260, 260, - 260, 261, 261, 261, 262, 262, 263, 263, 263, 264, - 265, 265, 266, 266, 267, 267, 268, 268, 269, 270, - 270, 271, 271, 272, 272, 272, 272, 273, 273, 273, - 274, 275, 275, 276, 276, 276, 276, 276, 276, 276, - 277, 277, 278, 278, 279, 279, 280, 281, 281, 282, - 282, 283, 283, 283, 284, 284, 285, 286, 287, 287, - 288, 289, 289, 290, 290, 291, 292, 293, 294, 294, - 295, 296, 296, 297, 298, 298, 298, 298, 298 + 0, 197, 198, 199, 199, 199, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 201, 202, 202, 202, 202, 202, 203, 203, 204, 205, + 205, 206, 206, 207, 207, 207, 208, 209, 209, 209, + 209, 209, 209, 209, 209, 210, 210, 211, 211, 211, + 211, 211, 211, 212, 213, 214, 215, 215, 216, 216, + 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 218, 218, 219, 219, 220, 220, 220, 220, 220, + 221, 222, 222, 223, 223, 223, 224, 224, 224, 224, + 224, 224, 225, 225, 225, 225, 226, 226, 226, 227, + 227, 228, 228, 228, 228, 228, 228, 228, 228, 229, + 229, 230, 230, 230, 230, 231, 231, 232, 232, 233, + 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, + 234, 234, 234, 234, 235, 235, 236, 236, 236, 236, + 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, + 236, 237, 237, 238, 239, 239, 239, 240, 240, 241, + 242, 242, 242, 242, 242, 242, 242, 242, 243, 244, + 244, 245, 245, 245, 245, 245, 246, 246, 247, 247, + 247, 247, 248, 249, 249, 250, 251, 251, 251, 252, + 252, 253, 253, 254, 254, 255, 255, 255, 255, 255, + 255, 256, 256, 257, 258, 258, 259, 260, 260, 260, + 260, 260, 260, 260, 260, 260, 260, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 262, 262, 262, 263, 263, 263, 264, 264, 265, 265, + 265, 266, 267, 267, 268, 268, 269, 269, 270, 270, + 271, 272, 272, 273, 273, 274, 274, 274, 274, 275, + 275, 275, 276, 277, 277, 278, 278, 278, 278, 278, + 278, 278, 279, 279, 280, 280, 281, 281, 282, 283, + 283, 284, 284, 285, 285, 285, 286, 286, 287, 288, + 289, 289, 290, 291, 291, 292, 292, 293, 294, 295, + 296, 296, 297, 298, 298, 299, 300, 300, 300, 300, + 300 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1388,16 +1393,17 @@ static const yytype_uint8 yyr2[] = 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 3, 1, 2, 2, 2, 2, 3, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 0, 4, - 1, 0, 0, 2, 2, 2, 2, 1, 1, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 2, 1, 1, 1, 5, 2, 1, 2, - 1, 1, 1, 1, 1, 1, 5, 1, 3, 2, - 3, 1, 1, 2, 1, 5, 4, 3, 2, 1, - 6, 3, 2, 3, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 3, 1, 2, 2, 2, 2, 3, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 0, 4, 1, 0, 0, 2, 2, 2, 2, 1, + 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 2, 1, 1, 1, 5, 2, + 1, 2, 1, 1, 1, 1, 1, 1, 5, 1, + 3, 2, 3, 1, 1, 2, 1, 5, 4, 3, + 2, 1, 6, 3, 2, 3, 1, 1, 1, 1, + 1 }; @@ -2076,7 +2082,7 @@ yyreduce: switch (yyn) { case 5: -#line 371 "ntp_parser.y" /* yacc.c:1646 */ +#line 373 "ntp_parser.y" /* yacc.c:1646 */ { /* I will need to incorporate much more fine grained * error messages. The following should suffice for @@ -2088,85 +2094,85 @@ yyreduce: ip_file->err_line_no, ip_file->err_col_no); } -#line 2092 "ntp_parser.c" /* yacc.c:1646 */ +#line 2098 "ntp_parser.c" /* yacc.c:1646 */ break; case 20: -#line 406 "ntp_parser.y" /* yacc.c:1646 */ +#line 408 "ntp_parser.y" /* yacc.c:1646 */ { peer_node *my_node; my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.peers, my_node); } -#line 2103 "ntp_parser.c" /* yacc.c:1646 */ +#line 2109 "ntp_parser.c" /* yacc.c:1646 */ break; case 27: -#line 425 "ntp_parser.y" /* yacc.c:1646 */ +#line 427 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); } -#line 2109 "ntp_parser.c" /* yacc.c:1646 */ +#line 2115 "ntp_parser.c" /* yacc.c:1646 */ break; case 28: -#line 430 "ntp_parser.y" /* yacc.c:1646 */ +#line 432 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); } -#line 2115 "ntp_parser.c" /* yacc.c:1646 */ +#line 2121 "ntp_parser.c" /* yacc.c:1646 */ break; case 29: -#line 435 "ntp_parser.y" /* yacc.c:1646 */ +#line 437 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = AF_INET; } -#line 2121 "ntp_parser.c" /* yacc.c:1646 */ +#line 2127 "ntp_parser.c" /* yacc.c:1646 */ break; case 30: -#line 437 "ntp_parser.y" /* yacc.c:1646 */ +#line 439 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = AF_INET6; } -#line 2127 "ntp_parser.c" /* yacc.c:1646 */ +#line 2133 "ntp_parser.c" /* yacc.c:1646 */ break; case 31: -#line 442 "ntp_parser.y" /* yacc.c:1646 */ +#line 444 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2133 "ntp_parser.c" /* yacc.c:1646 */ +#line 2139 "ntp_parser.c" /* yacc.c:1646 */ break; case 32: -#line 444 "ntp_parser.y" /* yacc.c:1646 */ +#line 446 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2142 "ntp_parser.c" /* yacc.c:1646 */ +#line 2148 "ntp_parser.c" /* yacc.c:1646 */ break; case 36: -#line 458 "ntp_parser.y" /* yacc.c:1646 */ +#line 460 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2148 "ntp_parser.c" /* yacc.c:1646 */ +#line 2154 "ntp_parser.c" /* yacc.c:1646 */ break; case 45: -#line 474 "ntp_parser.y" /* yacc.c:1646 */ +#line 476 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2154 "ntp_parser.c" /* yacc.c:1646 */ +#line 2160 "ntp_parser.c" /* yacc.c:1646 */ break; case 46: -#line 476 "ntp_parser.y" /* yacc.c:1646 */ +#line 478 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2160 "ntp_parser.c" /* yacc.c:1646 */ +#line 2166 "ntp_parser.c" /* yacc.c:1646 */ break; case 53: -#line 490 "ntp_parser.y" /* yacc.c:1646 */ +#line 492 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2166 "ntp_parser.c" /* yacc.c:1646 */ +#line 2172 "ntp_parser.c" /* yacc.c:1646 */ break; case 55: -#line 504 "ntp_parser.y" /* yacc.c:1646 */ +#line 506 "ntp_parser.y" /* yacc.c:1646 */ { unpeer_node *my_node; @@ -2174,85 +2180,85 @@ yyreduce: if (my_node) APPEND_G_FIFO(cfgt.unpeers, my_node); } -#line 2178 "ntp_parser.c" /* yacc.c:1646 */ +#line 2184 "ntp_parser.c" /* yacc.c:1646 */ break; case 58: -#line 525 "ntp_parser.y" /* yacc.c:1646 */ +#line 527 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.broadcastclient = 1; } -#line 2184 "ntp_parser.c" /* yacc.c:1646 */ +#line 2190 "ntp_parser.c" /* yacc.c:1646 */ break; case 59: -#line 527 "ntp_parser.y" /* yacc.c:1646 */ +#line 529 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); } -#line 2190 "ntp_parser.c" /* yacc.c:1646 */ +#line 2196 "ntp_parser.c" /* yacc.c:1646 */ break; case 60: -#line 529 "ntp_parser.y" /* yacc.c:1646 */ +#line 531 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); } -#line 2196 "ntp_parser.c" /* yacc.c:1646 */ +#line 2202 "ntp_parser.c" /* yacc.c:1646 */ break; case 61: -#line 531 "ntp_parser.y" /* yacc.c:1646 */ +#line 533 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.mdnstries = (yyvsp[0].Integer); } -#line 2202 "ntp_parser.c" /* yacc.c:1646 */ +#line 2208 "ntp_parser.c" /* yacc.c:1646 */ break; case 62: -#line 542 "ntp_parser.y" /* yacc.c:1646 */ +#line 544 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *atrv; atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); APPEND_G_FIFO(cfgt.vars, atrv); } -#line 2213 "ntp_parser.c" /* yacc.c:1646 */ +#line 2219 "ntp_parser.c" /* yacc.c:1646 */ break; case 63: -#line 549 "ntp_parser.y" /* yacc.c:1646 */ +#line 551 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.control_key = (yyvsp[0].Integer); } -#line 2219 "ntp_parser.c" /* yacc.c:1646 */ +#line 2225 "ntp_parser.c" /* yacc.c:1646 */ break; case 64: -#line 551 "ntp_parser.y" /* yacc.c:1646 */ +#line 553 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.cryptosw++; CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo)); } -#line 2228 "ntp_parser.c" /* yacc.c:1646 */ +#line 2234 "ntp_parser.c" /* yacc.c:1646 */ break; case 65: -#line 556 "ntp_parser.y" /* yacc.c:1646 */ +#line 558 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.keys = (yyvsp[0].String); } -#line 2234 "ntp_parser.c" /* yacc.c:1646 */ +#line 2240 "ntp_parser.c" /* yacc.c:1646 */ break; case 66: -#line 558 "ntp_parser.y" /* yacc.c:1646 */ +#line 560 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.keysdir = (yyvsp[0].String); } -#line 2240 "ntp_parser.c" /* yacc.c:1646 */ +#line 2246 "ntp_parser.c" /* yacc.c:1646 */ break; case 67: -#line 560 "ntp_parser.y" /* yacc.c:1646 */ +#line 562 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.request_key = (yyvsp[0].Integer); } -#line 2246 "ntp_parser.c" /* yacc.c:1646 */ +#line 2252 "ntp_parser.c" /* yacc.c:1646 */ break; case 68: -#line 562 "ntp_parser.y" /* yacc.c:1646 */ +#line 564 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.revoke = (yyvsp[0].Integer); } -#line 2252 "ntp_parser.c" /* yacc.c:1646 */ +#line 2258 "ntp_parser.c" /* yacc.c:1646 */ break; case 69: -#line 564 "ntp_parser.y" /* yacc.c:1646 */ +#line 566 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.trusted_key_list = (yyvsp[0].Attr_val_fifo); @@ -2261,38 +2267,38 @@ yyreduce: // else // LINK_SLIST(cfgt.auth.trusted_key_list, $2, link); } -#line 2265 "ntp_parser.c" /* yacc.c:1646 */ +#line 2271 "ntp_parser.c" /* yacc.c:1646 */ break; case 70: -#line 573 "ntp_parser.y" /* yacc.c:1646 */ +#line 575 "ntp_parser.y" /* yacc.c:1646 */ { cfgt.auth.ntp_signd_socket = (yyvsp[0].String); } -#line 2271 "ntp_parser.c" /* yacc.c:1646 */ +#line 2277 "ntp_parser.c" /* yacc.c:1646 */ break; case 71: -#line 578 "ntp_parser.y" /* yacc.c:1646 */ +#line 580 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2277 "ntp_parser.c" /* yacc.c:1646 */ +#line 2283 "ntp_parser.c" /* yacc.c:1646 */ break; case 72: -#line 580 "ntp_parser.y" /* yacc.c:1646 */ +#line 582 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2286 "ntp_parser.c" /* yacc.c:1646 */ +#line 2292 "ntp_parser.c" /* yacc.c:1646 */ break; case 73: -#line 588 "ntp_parser.y" /* yacc.c:1646 */ +#line 590 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2292 "ntp_parser.c" /* yacc.c:1646 */ +#line 2298 "ntp_parser.c" /* yacc.c:1646 */ break; case 74: -#line 590 "ntp_parser.y" /* yacc.c:1646 */ +#line 592 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = NULL; cfgt.auth.revoke = (yyvsp[0].Integer); @@ -2301,59 +2307,59 @@ yyreduce: "please use 'revoke %d' instead.", cfgt.auth.revoke, cfgt.auth.revoke); } -#line 2305 "ntp_parser.c" /* yacc.c:1646 */ +#line 2311 "ntp_parser.c" /* yacc.c:1646 */ break; case 80: -#line 615 "ntp_parser.y" /* yacc.c:1646 */ +#line 617 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); } -#line 2311 "ntp_parser.c" /* yacc.c:1646 */ +#line 2317 "ntp_parser.c" /* yacc.c:1646 */ break; case 81: -#line 620 "ntp_parser.y" /* yacc.c:1646 */ +#line 622 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2320 "ntp_parser.c" /* yacc.c:1646 */ +#line 2326 "ntp_parser.c" /* yacc.c:1646 */ break; case 82: -#line 625 "ntp_parser.y" /* yacc.c:1646 */ +#line 627 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2329 "ntp_parser.c" /* yacc.c:1646 */ +#line 2335 "ntp_parser.c" /* yacc.c:1646 */ break; case 83: -#line 633 "ntp_parser.y" /* yacc.c:1646 */ +#line 635 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); } -#line 2335 "ntp_parser.c" /* yacc.c:1646 */ +#line 2341 "ntp_parser.c" /* yacc.c:1646 */ break; case 84: -#line 635 "ntp_parser.y" /* yacc.c:1646 */ +#line 637 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2341 "ntp_parser.c" /* yacc.c:1646 */ +#line 2347 "ntp_parser.c" /* yacc.c:1646 */ break; case 85: -#line 637 "ntp_parser.y" /* yacc.c:1646 */ +#line 639 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); } -#line 2347 "ntp_parser.c" /* yacc.c:1646 */ +#line 2353 "ntp_parser.c" /* yacc.c:1646 */ break; case 96: -#line 663 "ntp_parser.y" /* yacc.c:1646 */ +#line 665 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); } -#line 2353 "ntp_parser.c" /* yacc.c:1646 */ +#line 2359 "ntp_parser.c" /* yacc.c:1646 */ break; case 97: -#line 665 "ntp_parser.y" /* yacc.c:1646 */ +#line 667 "ntp_parser.y" /* yacc.c:1646 */ { if (input_from_file) { cfgt.stats_dir = (yyvsp[0].String); @@ -2362,55 +2368,55 @@ yyreduce: yyerror(ip_file, "statsdir remote configuration ignored"); } } -#line 2366 "ntp_parser.c" /* yacc.c:1646 */ +#line 2372 "ntp_parser.c" /* yacc.c:1646 */ break; case 98: -#line 674 "ntp_parser.y" /* yacc.c:1646 */ +#line 676 "ntp_parser.y" /* yacc.c:1646 */ { filegen_node *fgn; fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.filegen_opts, fgn); } -#line 2377 "ntp_parser.c" /* yacc.c:1646 */ +#line 2383 "ntp_parser.c" /* yacc.c:1646 */ break; case 99: -#line 684 "ntp_parser.y" /* yacc.c:1646 */ +#line 686 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 2386 "ntp_parser.c" /* yacc.c:1646 */ +#line 2392 "ntp_parser.c" /* yacc.c:1646 */ break; case 100: -#line 689 "ntp_parser.y" /* yacc.c:1646 */ +#line 691 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 2395 "ntp_parser.c" /* yacc.c:1646 */ +#line 2401 "ntp_parser.c" /* yacc.c:1646 */ break; case 109: -#line 708 "ntp_parser.y" /* yacc.c:1646 */ +#line 710 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2401 "ntp_parser.c" /* yacc.c:1646 */ +#line 2407 "ntp_parser.c" /* yacc.c:1646 */ break; case 110: -#line 710 "ntp_parser.y" /* yacc.c:1646 */ +#line 712 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2410 "ntp_parser.c" /* yacc.c:1646 */ +#line 2416 "ntp_parser.c" /* yacc.c:1646 */ break; case 111: -#line 718 "ntp_parser.y" /* yacc.c:1646 */ +#line 720 "ntp_parser.y" /* yacc.c:1646 */ { if (input_from_file) { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); @@ -2420,11 +2426,11 @@ yyreduce: yyerror(ip_file, "filegen file remote config ignored"); } } -#line 2424 "ntp_parser.c" /* yacc.c:1646 */ +#line 2430 "ntp_parser.c" /* yacc.c:1646 */ break; case 112: -#line 728 "ntp_parser.y" /* yacc.c:1646 */ +#line 730 "ntp_parser.y" /* yacc.c:1646 */ { if (input_from_file) { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); @@ -2433,11 +2439,11 @@ yyreduce: yyerror(ip_file, "filegen type remote config ignored"); } } -#line 2437 "ntp_parser.c" /* yacc.c:1646 */ +#line 2443 "ntp_parser.c" /* yacc.c:1646 */ break; case 113: -#line 737 "ntp_parser.y" /* yacc.c:1646 */ +#line 739 "ntp_parser.y" /* yacc.c:1646 */ { const char *err; @@ -2452,33 +2458,33 @@ yyreduce: yyerror(ip_file, err); } } -#line 2456 "ntp_parser.c" /* yacc.c:1646 */ +#line 2462 "ntp_parser.c" /* yacc.c:1646 */ break; case 114: -#line 752 "ntp_parser.y" /* yacc.c:1646 */ +#line 754 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2462 "ntp_parser.c" /* yacc.c:1646 */ +#line 2468 "ntp_parser.c" /* yacc.c:1646 */ break; case 126: -#line 782 "ntp_parser.y" /* yacc.c:1646 */ +#line 784 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2470 "ntp_parser.c" /* yacc.c:1646 */ +#line 2476 "ntp_parser.c" /* yacc.c:1646 */ break; case 127: -#line 786 "ntp_parser.y" /* yacc.c:1646 */ +#line 788 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2478 "ntp_parser.c" /* yacc.c:1646 */ +#line 2484 "ntp_parser.c" /* yacc.c:1646 */ break; case 128: -#line 790 "ntp_parser.y" /* yacc.c:1646 */ +#line 792 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2486,11 +2492,11 @@ yyreduce: ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2490 "ntp_parser.c" /* yacc.c:1646 */ +#line 2496 "ntp_parser.c" /* yacc.c:1646 */ break; case 129: -#line 798 "ntp_parser.y" /* yacc.c:1646 */ +#line 800 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2498,11 +2504,11 @@ yyreduce: ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2502 "ntp_parser.c" /* yacc.c:1646 */ +#line 2508 "ntp_parser.c" /* yacc.c:1646 */ break; case 130: -#line 806 "ntp_parser.y" /* yacc.c:1646 */ +#line 808 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2510,11 +2516,11 @@ yyreduce: ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2514 "ntp_parser.c" /* yacc.c:1646 */ +#line 2520 "ntp_parser.c" /* yacc.c:1646 */ break; case 131: -#line 814 "ntp_parser.y" /* yacc.c:1646 */ +#line 816 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2529,11 +2535,11 @@ yyreduce: ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2533 "ntp_parser.c" /* yacc.c:1646 */ +#line 2539 "ntp_parser.c" /* yacc.c:1646 */ break; case 132: -#line 829 "ntp_parser.y" /* yacc.c:1646 */ +#line 831 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node *rn; @@ -2548,11 +2554,11 @@ yyreduce: ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2552 "ntp_parser.c" /* yacc.c:1646 */ +#line 2558 "ntp_parser.c" /* yacc.c:1646 */ break; case 133: -#line 844 "ntp_parser.y" /* yacc.c:1646 */ +#line 846 "ntp_parser.y" /* yacc.c:1646 */ { restrict_node * rn; @@ -2561,199 +2567,199 @@ yyreduce: NULL, NULL, (yyvsp[0].Int_fifo), ip_file->line_no); APPEND_G_FIFO(cfgt.restrict_opts, rn); } -#line 2565 "ntp_parser.c" /* yacc.c:1646 */ +#line 2571 "ntp_parser.c" /* yacc.c:1646 */ break; case 134: -#line 856 "ntp_parser.y" /* yacc.c:1646 */ +#line 858 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = NULL; } -#line 2571 "ntp_parser.c" /* yacc.c:1646 */ +#line 2577 "ntp_parser.c" /* yacc.c:1646 */ break; case 135: -#line 858 "ntp_parser.y" /* yacc.c:1646 */ +#line 860 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 2580 "ntp_parser.c" /* yacc.c:1646 */ +#line 2586 "ntp_parser.c" /* yacc.c:1646 */ break; case 151: -#line 884 "ntp_parser.y" /* yacc.c:1646 */ +#line 886 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2589 "ntp_parser.c" /* yacc.c:1646 */ +#line 2595 "ntp_parser.c" /* yacc.c:1646 */ break; case 152: -#line 889 "ntp_parser.y" /* yacc.c:1646 */ +#line 891 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2598 "ntp_parser.c" /* yacc.c:1646 */ +#line 2604 "ntp_parser.c" /* yacc.c:1646 */ break; case 153: -#line 897 "ntp_parser.y" /* yacc.c:1646 */ +#line 899 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2604 "ntp_parser.c" /* yacc.c:1646 */ +#line 2610 "ntp_parser.c" /* yacc.c:1646 */ break; case 157: -#line 908 "ntp_parser.y" /* yacc.c:1646 */ +#line 910 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2613 "ntp_parser.c" /* yacc.c:1646 */ +#line 2619 "ntp_parser.c" /* yacc.c:1646 */ break; case 158: -#line 913 "ntp_parser.y" /* yacc.c:1646 */ +#line 915 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2622 "ntp_parser.c" /* yacc.c:1646 */ +#line 2628 "ntp_parser.c" /* yacc.c:1646 */ break; case 159: -#line 921 "ntp_parser.y" /* yacc.c:1646 */ +#line 923 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2628 "ntp_parser.c" /* yacc.c:1646 */ +#line 2634 "ntp_parser.c" /* yacc.c:1646 */ break; case 168: -#line 941 "ntp_parser.y" /* yacc.c:1646 */ +#line 943 "ntp_parser.y" /* yacc.c:1646 */ { addr_opts_node *aon; aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.fudge, aon); } -#line 2639 "ntp_parser.c" /* yacc.c:1646 */ +#line 2645 "ntp_parser.c" /* yacc.c:1646 */ break; case 169: -#line 951 "ntp_parser.y" /* yacc.c:1646 */ +#line 953 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2648 "ntp_parser.c" /* yacc.c:1646 */ +#line 2654 "ntp_parser.c" /* yacc.c:1646 */ break; case 170: -#line 956 "ntp_parser.y" /* yacc.c:1646 */ +#line 958 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2657 "ntp_parser.c" /* yacc.c:1646 */ +#line 2663 "ntp_parser.c" /* yacc.c:1646 */ break; case 171: -#line 964 "ntp_parser.y" /* yacc.c:1646 */ +#line 966 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2663 "ntp_parser.c" /* yacc.c:1646 */ +#line 2669 "ntp_parser.c" /* yacc.c:1646 */ break; case 172: -#line 966 "ntp_parser.y" /* yacc.c:1646 */ +#line 968 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2669 "ntp_parser.c" /* yacc.c:1646 */ +#line 2675 "ntp_parser.c" /* yacc.c:1646 */ break; case 173: -#line 968 "ntp_parser.y" /* yacc.c:1646 */ +#line 970 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2675 "ntp_parser.c" /* yacc.c:1646 */ +#line 2681 "ntp_parser.c" /* yacc.c:1646 */ break; case 174: -#line 970 "ntp_parser.y" /* yacc.c:1646 */ +#line 972 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2681 "ntp_parser.c" /* yacc.c:1646 */ +#line 2687 "ntp_parser.c" /* yacc.c:1646 */ break; case 175: -#line 972 "ntp_parser.y" /* yacc.c:1646 */ +#line 974 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); } -#line 2687 "ntp_parser.c" /* yacc.c:1646 */ +#line 2693 "ntp_parser.c" /* yacc.c:1646 */ break; case 182: -#line 993 "ntp_parser.y" /* yacc.c:1646 */ +#line 995 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); } -#line 2693 "ntp_parser.c" /* yacc.c:1646 */ +#line 2699 "ntp_parser.c" /* yacc.c:1646 */ break; case 183: -#line 998 "ntp_parser.y" /* yacc.c:1646 */ +#line 1000 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2702 "ntp_parser.c" /* yacc.c:1646 */ +#line 2708 "ntp_parser.c" /* yacc.c:1646 */ break; case 184: -#line 1003 "ntp_parser.y" /* yacc.c:1646 */ +#line 1005 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2711 "ntp_parser.c" /* yacc.c:1646 */ +#line 2717 "ntp_parser.c" /* yacc.c:1646 */ break; case 185: -#line 1011 "ntp_parser.y" /* yacc.c:1646 */ +#line 1013 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2717 "ntp_parser.c" /* yacc.c:1646 */ +#line 2723 "ntp_parser.c" /* yacc.c:1646 */ break; case 189: -#line 1027 "ntp_parser.y" /* yacc.c:1646 */ +#line 1029 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2723 "ntp_parser.c" /* yacc.c:1646 */ +#line 2729 "ntp_parser.c" /* yacc.c:1646 */ break; case 190: -#line 1029 "ntp_parser.y" /* yacc.c:1646 */ +#line 1031 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); } -#line 2729 "ntp_parser.c" /* yacc.c:1646 */ +#line 2735 "ntp_parser.c" /* yacc.c:1646 */ break; case 191: -#line 1034 "ntp_parser.y" /* yacc.c:1646 */ +#line 1036 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2738 "ntp_parser.c" /* yacc.c:1646 */ +#line 2744 "ntp_parser.c" /* yacc.c:1646 */ break; case 192: -#line 1039 "ntp_parser.y" /* yacc.c:1646 */ +#line 1041 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2747 "ntp_parser.c" /* yacc.c:1646 */ +#line 2753 "ntp_parser.c" /* yacc.c:1646 */ break; case 193: -#line 1047 "ntp_parser.y" /* yacc.c:1646 */ +#line 1049 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); } -#line 2753 "ntp_parser.c" /* yacc.c:1646 */ +#line 2759 "ntp_parser.c" /* yacc.c:1646 */ break; case 194: -#line 1049 "ntp_parser.y" /* yacc.c:1646 */ +#line 1051 "ntp_parser.y" /* yacc.c:1646 */ { if (input_from_file) { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); @@ -2767,63 +2773,63 @@ yyreduce: yyerror(ip_file, err_str); } } -#line 2771 "ntp_parser.c" /* yacc.c:1646 */ +#line 2777 "ntp_parser.c" /* yacc.c:1646 */ break; case 203: -#line 1084 "ntp_parser.y" /* yacc.c:1646 */ +#line 1086 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); } -#line 2777 "ntp_parser.c" /* yacc.c:1646 */ +#line 2783 "ntp_parser.c" /* yacc.c:1646 */ break; case 204: -#line 1089 "ntp_parser.y" /* yacc.c:1646 */ +#line 1091 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2786 "ntp_parser.c" /* yacc.c:1646 */ +#line 2792 "ntp_parser.c" /* yacc.c:1646 */ break; case 205: -#line 1094 "ntp_parser.y" /* yacc.c:1646 */ +#line 1096 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2795 "ntp_parser.c" /* yacc.c:1646 */ +#line 2801 "ntp_parser.c" /* yacc.c:1646 */ break; case 206: -#line 1102 "ntp_parser.y" /* yacc.c:1646 */ +#line 1104 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); } -#line 2801 "ntp_parser.c" /* yacc.c:1646 */ +#line 2807 "ntp_parser.c" /* yacc.c:1646 */ break; - case 217: -#line 1125 "ntp_parser.y" /* yacc.c:1646 */ + case 219: +#line 1129 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2812 "ntp_parser.c" /* yacc.c:1646 */ +#line 2818 "ntp_parser.c" /* yacc.c:1646 */ break; - case 218: -#line 1132 "ntp_parser.y" /* yacc.c:1646 */ + case 220: +#line 1136 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2823 "ntp_parser.c" /* yacc.c:1646 */ +#line 2829 "ntp_parser.c" /* yacc.c:1646 */ break; - case 219: -#line 1139 "ntp_parser.y" /* yacc.c:1646 */ + case 221: +#line 1143 "ntp_parser.y" /* yacc.c:1646 */ { char error_text[64]; attr_val *av; @@ -2839,11 +2845,11 @@ yyreduce: yyerror(ip_file, error_text); } } -#line 2843 "ntp_parser.c" /* yacc.c:1646 */ +#line 2849 "ntp_parser.c" /* yacc.c:1646 */ break; - case 220: -#line 1155 "ntp_parser.y" /* yacc.c:1646 */ + case 222: +#line 1159 "ntp_parser.y" /* yacc.c:1646 */ { if (!input_from_file) { yyerror(ip_file, "remote includefile ignored"); @@ -2862,72 +2868,72 @@ yyreduce: } } } -#line 2866 "ntp_parser.c" /* yacc.c:1646 */ +#line 2872 "ntp_parser.c" /* yacc.c:1646 */ break; - case 221: -#line 1174 "ntp_parser.y" /* yacc.c:1646 */ + case 223: +#line 1178 "ntp_parser.y" /* yacc.c:1646 */ { while (curr_include_level != -1) FCLOSE(fp[curr_include_level--]); } -#line 2875 "ntp_parser.c" /* yacc.c:1646 */ +#line 2881 "ntp_parser.c" /* yacc.c:1646 */ break; - case 222: -#line 1179 "ntp_parser.y" /* yacc.c:1646 */ + case 224: +#line 1183 "ntp_parser.y" /* yacc.c:1646 */ { /* see drift_parm below for actions */ } -#line 2881 "ntp_parser.c" /* yacc.c:1646 */ +#line 2887 "ntp_parser.c" /* yacc.c:1646 */ break; - case 223: -#line 1181 "ntp_parser.y" /* yacc.c:1646 */ + case 225: +#line 1185 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); } -#line 2887 "ntp_parser.c" /* yacc.c:1646 */ +#line 2893 "ntp_parser.c" /* yacc.c:1646 */ break; - case 224: -#line 1183 "ntp_parser.y" /* yacc.c:1646 */ + case 226: +#line 1187 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); } -#line 2893 "ntp_parser.c" /* yacc.c:1646 */ +#line 2899 "ntp_parser.c" /* yacc.c:1646 */ break; - case 225: -#line 1185 "ntp_parser.y" /* yacc.c:1646 */ + case 227: +#line 1189 "ntp_parser.y" /* yacc.c:1646 */ { APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); } -#line 2899 "ntp_parser.c" /* yacc.c:1646 */ +#line 2905 "ntp_parser.c" /* yacc.c:1646 */ break; - case 226: -#line 1187 "ntp_parser.y" /* yacc.c:1646 */ + case 228: +#line 1191 "ntp_parser.y" /* yacc.c:1646 */ { addr_opts_node *aon; aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo)); APPEND_G_FIFO(cfgt.trap, aon); } -#line 2910 "ntp_parser.c" /* yacc.c:1646 */ +#line 2916 "ntp_parser.c" /* yacc.c:1646 */ break; - case 227: -#line 1194 "ntp_parser.y" /* yacc.c:1646 */ + case 229: +#line 1198 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); } -#line 2916 "ntp_parser.c" /* yacc.c:1646 */ +#line 2922 "ntp_parser.c" /* yacc.c:1646 */ break; - case 236: -#line 1216 "ntp_parser.y" /* yacc.c:1646 */ + case 238: +#line 1220 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_sval(T_Driftfile, (yyvsp[0].String)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2927 "ntp_parser.c" /* yacc.c:1646 */ +#line 2933 "ntp_parser.c" /* yacc.c:1646 */ break; - case 237: -#line 1223 "ntp_parser.y" /* yacc.c:1646 */ + case 239: +#line 1227 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; @@ -2936,82 +2942,82 @@ yyreduce: av = create_attr_dval(T_WanderThreshold, (yyvsp[0].Double)); APPEND_G_FIFO(cfgt.vars, av); } -#line 2940 "ntp_parser.c" /* yacc.c:1646 */ +#line 2946 "ntp_parser.c" /* yacc.c:1646 */ break; - case 238: -#line 1232 "ntp_parser.y" /* yacc.c:1646 */ + case 240: +#line 1236 "ntp_parser.y" /* yacc.c:1646 */ { attr_val *av; av = create_attr_sval(T_Driftfile, ""); APPEND_G_FIFO(cfgt.vars, av); } -#line 2951 "ntp_parser.c" /* yacc.c:1646 */ +#line 2957 "ntp_parser.c" /* yacc.c:1646 */ break; - case 239: -#line 1242 "ntp_parser.y" /* yacc.c:1646 */ + case 241: +#line 1246 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); } -#line 2957 "ntp_parser.c" /* yacc.c:1646 */ +#line 2963 "ntp_parser.c" /* yacc.c:1646 */ break; - case 241: -#line 1248 "ntp_parser.y" /* yacc.c:1646 */ + case 243: +#line 1252 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Integer) = 0; } -#line 2963 "ntp_parser.c" /* yacc.c:1646 */ +#line 2969 "ntp_parser.c" /* yacc.c:1646 */ break; - case 242: -#line 1253 "ntp_parser.y" /* yacc.c:1646 */ + case 244: +#line 1257 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; } -#line 2969 "ntp_parser.c" /* yacc.c:1646 */ +#line 2975 "ntp_parser.c" /* yacc.c:1646 */ break; - case 243: -#line 1255 "ntp_parser.y" /* yacc.c:1646 */ + case 245: +#line 1259 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 2978 "ntp_parser.c" /* yacc.c:1646 */ +#line 2984 "ntp_parser.c" /* yacc.c:1646 */ break; - case 244: -#line 1263 "ntp_parser.y" /* yacc.c:1646 */ + case 246: +#line 1267 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); } -#line 2984 "ntp_parser.c" /* yacc.c:1646 */ +#line 2990 "ntp_parser.c" /* yacc.c:1646 */ break; - case 245: -#line 1265 "ntp_parser.y" /* yacc.c:1646 */ + case 247: +#line 1269 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address)); destroy_address_node((yyvsp[0].Address_node)); } -#line 2993 "ntp_parser.c" /* yacc.c:1646 */ +#line 2999 "ntp_parser.c" /* yacc.c:1646 */ break; - case 246: -#line 1273 "ntp_parser.y" /* yacc.c:1646 */ + case 248: +#line 1277 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3002 "ntp_parser.c" /* yacc.c:1646 */ +#line 3008 "ntp_parser.c" /* yacc.c:1646 */ break; - case 247: -#line 1278 "ntp_parser.y" /* yacc.c:1646 */ + case 249: +#line 1282 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3011 "ntp_parser.c" /* yacc.c:1646 */ +#line 3017 "ntp_parser.c" /* yacc.c:1646 */ break; - case 248: -#line 1286 "ntp_parser.y" /* yacc.c:1646 */ + case 250: +#line 1290 "ntp_parser.y" /* yacc.c:1646 */ { char prefix; char * type; @@ -3033,141 +3039,141 @@ yyreduce: (yyval.Attr_val) = create_attr_sval(prefix, estrdup(type)); YYFREE((yyvsp[0].String)); } -#line 3037 "ntp_parser.c" /* yacc.c:1646 */ +#line 3043 "ntp_parser.c" /* yacc.c:1646 */ break; - case 249: -#line 1311 "ntp_parser.y" /* yacc.c:1646 */ + case 251: +#line 1315 "ntp_parser.y" /* yacc.c:1646 */ { nic_rule_node *nrn; nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer)); APPEND_G_FIFO(cfgt.nic_rules, nrn); } -#line 3048 "ntp_parser.c" /* yacc.c:1646 */ +#line 3054 "ntp_parser.c" /* yacc.c:1646 */ break; - case 250: -#line 1318 "ntp_parser.y" /* yacc.c:1646 */ + case 252: +#line 1322 "ntp_parser.y" /* yacc.c:1646 */ { nic_rule_node *nrn; nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer)); APPEND_G_FIFO(cfgt.nic_rules, nrn); } -#line 3059 "ntp_parser.c" /* yacc.c:1646 */ +#line 3065 "ntp_parser.c" /* yacc.c:1646 */ break; - case 260: -#line 1346 "ntp_parser.y" /* yacc.c:1646 */ + case 262: +#line 1350 "ntp_parser.y" /* yacc.c:1646 */ { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); } -#line 3065 "ntp_parser.c" /* yacc.c:1646 */ +#line 3071 "ntp_parser.c" /* yacc.c:1646 */ break; - case 261: -#line 1351 "ntp_parser.y" /* yacc.c:1646 */ + case 263: +#line 1355 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = (yyvsp[-1].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3074 "ntp_parser.c" /* yacc.c:1646 */ +#line 3080 "ntp_parser.c" /* yacc.c:1646 */ break; - case 262: -#line 1356 "ntp_parser.y" /* yacc.c:1646 */ + case 264: +#line 1360 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3083 "ntp_parser.c" /* yacc.c:1646 */ +#line 3089 "ntp_parser.c" /* yacc.c:1646 */ break; - case 270: -#line 1380 "ntp_parser.y" /* yacc.c:1646 */ + case 272: +#line 1384 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3092 "ntp_parser.c" /* yacc.c:1646 */ +#line 3098 "ntp_parser.c" /* yacc.c:1646 */ break; - case 271: -#line 1385 "ntp_parser.y" /* yacc.c:1646 */ + case 273: +#line 1389 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer))); } -#line 3101 "ntp_parser.c" /* yacc.c:1646 */ +#line 3107 "ntp_parser.c" /* yacc.c:1646 */ break; - case 272: -#line 1393 "ntp_parser.y" /* yacc.c:1646 */ + case 274: +#line 1397 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3110 "ntp_parser.c" /* yacc.c:1646 */ +#line 3116 "ntp_parser.c" /* yacc.c:1646 */ break; - case 273: -#line 1398 "ntp_parser.y" /* yacc.c:1646 */ + case 275: +#line 1402 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val)); } -#line 3119 "ntp_parser.c" /* yacc.c:1646 */ +#line 3125 "ntp_parser.c" /* yacc.c:1646 */ break; - case 274: -#line 1406 "ntp_parser.y" /* yacc.c:1646 */ + case 276: +#line 1410 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); } -#line 3125 "ntp_parser.c" /* yacc.c:1646 */ +#line 3131 "ntp_parser.c" /* yacc.c:1646 */ break; - case 276: -#line 1412 "ntp_parser.y" /* yacc.c:1646 */ + case 278: +#line 1416 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); } -#line 3131 "ntp_parser.c" /* yacc.c:1646 */ +#line 3137 "ntp_parser.c" /* yacc.c:1646 */ break; - case 277: -#line 1417 "ntp_parser.y" /* yacc.c:1646 */ + case 279: +#line 1421 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.String_fifo) = (yyvsp[-1].String_fifo); APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String))); } -#line 3140 "ntp_parser.c" /* yacc.c:1646 */ +#line 3146 "ntp_parser.c" /* yacc.c:1646 */ break; - case 278: -#line 1422 "ntp_parser.y" /* yacc.c:1646 */ + case 280: +#line 1426 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.String_fifo) = NULL; APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String))); } -#line 3149 "ntp_parser.c" /* yacc.c:1646 */ +#line 3155 "ntp_parser.c" /* yacc.c:1646 */ break; - case 279: -#line 1430 "ntp_parser.y" /* yacc.c:1646 */ + case 281: +#line 1434 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_fifo) = (yyvsp[-1].Address_fifo); APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node)); } -#line 3158 "ntp_parser.c" /* yacc.c:1646 */ +#line 3164 "ntp_parser.c" /* yacc.c:1646 */ break; - case 280: -#line 1435 "ntp_parser.y" /* yacc.c:1646 */ + case 282: +#line 1439 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_fifo) = NULL; APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node)); } -#line 3167 "ntp_parser.c" /* yacc.c:1646 */ +#line 3173 "ntp_parser.c" /* yacc.c:1646 */ break; - case 281: -#line 1443 "ntp_parser.y" /* yacc.c:1646 */ + case 283: +#line 1447 "ntp_parser.y" /* yacc.c:1646 */ { if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) { yyerror(ip_file, "Integer value is not boolean (0 or 1). Assuming 1"); @@ -3176,29 +3182,29 @@ yyreduce: (yyval.Integer) = (yyvsp[0].Integer); } } -#line 3180 "ntp_parser.c" /* yacc.c:1646 */ - break; - - case 282: -#line 1451 "ntp_parser.y" /* yacc.c:1646 */ - { (yyval.Integer) = 1; } #line 3186 "ntp_parser.c" /* yacc.c:1646 */ break; - case 283: -#line 1452 "ntp_parser.y" /* yacc.c:1646 */ - { (yyval.Integer) = 0; } + case 284: +#line 1455 "ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Integer) = 1; } #line 3192 "ntp_parser.c" /* yacc.c:1646 */ break; - case 284: + case 285: #line 1456 "ntp_parser.y" /* yacc.c:1646 */ - { (yyval.Double) = (double)(yyvsp[0].Integer); } + { (yyval.Integer) = 0; } #line 3198 "ntp_parser.c" /* yacc.c:1646 */ break; case 286: -#line 1467 "ntp_parser.y" /* yacc.c:1646 */ +#line 1460 "ntp_parser.y" /* yacc.c:1646 */ + { (yyval.Double) = (double)(yyvsp[0].Integer); } +#line 3204 "ntp_parser.c" /* yacc.c:1646 */ + break; + + case 288: +#line 1471 "ntp_parser.y" /* yacc.c:1646 */ { sim_node *sn; @@ -3208,125 +3214,125 @@ yyreduce: /* Revert from ; to \n for end-of-command */ old_config_style = 1; } -#line 3212 "ntp_parser.c" /* yacc.c:1646 */ +#line 3218 "ntp_parser.c" /* yacc.c:1646 */ break; - case 287: -#line 1484 "ntp_parser.y" /* yacc.c:1646 */ + case 289: +#line 1488 "ntp_parser.y" /* yacc.c:1646 */ { old_config_style = 0; } -#line 3218 "ntp_parser.c" /* yacc.c:1646 */ +#line 3224 "ntp_parser.c" /* yacc.c:1646 */ break; - case 288: -#line 1489 "ntp_parser.y" /* yacc.c:1646 */ + case 290: +#line 1493 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3227 "ntp_parser.c" /* yacc.c:1646 */ +#line 3233 "ntp_parser.c" /* yacc.c:1646 */ break; - case 289: -#line 1494 "ntp_parser.y" /* yacc.c:1646 */ + case 291: +#line 1498 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3236 "ntp_parser.c" /* yacc.c:1646 */ +#line 3242 "ntp_parser.c" /* yacc.c:1646 */ break; - case 290: -#line 1502 "ntp_parser.y" /* yacc.c:1646 */ + case 292: +#line 1506 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); } -#line 3242 "ntp_parser.c" /* yacc.c:1646 */ +#line 3248 "ntp_parser.c" /* yacc.c:1646 */ break; - case 293: -#line 1512 "ntp_parser.y" /* yacc.c:1646 */ + case 295: +#line 1516 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo); APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server)); } -#line 3251 "ntp_parser.c" /* yacc.c:1646 */ +#line 3257 "ntp_parser.c" /* yacc.c:1646 */ break; - case 294: -#line 1517 "ntp_parser.y" /* yacc.c:1646 */ + case 296: +#line 1521 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server)); } -#line 3260 "ntp_parser.c" /* yacc.c:1646 */ +#line 3266 "ntp_parser.c" /* yacc.c:1646 */ break; - case 295: -#line 1525 "ntp_parser.y" /* yacc.c:1646 */ + case 297: +#line 1529 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[-4].Address_node), (yyvsp[-2].Double), (yyvsp[-1].Sim_script_fifo))); } -#line 3266 "ntp_parser.c" /* yacc.c:1646 */ +#line 3272 "ntp_parser.c" /* yacc.c:1646 */ break; - case 296: -#line 1530 "ntp_parser.y" /* yacc.c:1646 */ + case 298: +#line 1534 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Double) = (yyvsp[-1].Double); } -#line 3272 "ntp_parser.c" /* yacc.c:1646 */ +#line 3278 "ntp_parser.c" /* yacc.c:1646 */ break; - case 297: -#line 1535 "ntp_parser.y" /* yacc.c:1646 */ + case 299: +#line 1539 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Address_node) = (yyvsp[0].Address_node); } -#line 3278 "ntp_parser.c" /* yacc.c:1646 */ +#line 3284 "ntp_parser.c" /* yacc.c:1646 */ break; - case 298: -#line 1540 "ntp_parser.y" /* yacc.c:1646 */ + case 300: +#line 1544 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo); APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script)); } -#line 3287 "ntp_parser.c" /* yacc.c:1646 */ +#line 3293 "ntp_parser.c" /* yacc.c:1646 */ break; - case 299: -#line 1545 "ntp_parser.y" /* yacc.c:1646 */ + case 301: +#line 1549 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script)); } -#line 3296 "ntp_parser.c" /* yacc.c:1646 */ +#line 3302 "ntp_parser.c" /* yacc.c:1646 */ break; - case 300: -#line 1553 "ntp_parser.y" /* yacc.c:1646 */ + case 302: +#line 1557 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); } -#line 3302 "ntp_parser.c" /* yacc.c:1646 */ +#line 3308 "ntp_parser.c" /* yacc.c:1646 */ break; - case 301: -#line 1558 "ntp_parser.y" /* yacc.c:1646 */ + case 303: +#line 1562 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3311 "ntp_parser.c" /* yacc.c:1646 */ +#line 3317 "ntp_parser.c" /* yacc.c:1646 */ break; - case 302: -#line 1563 "ntp_parser.y" /* yacc.c:1646 */ + case 304: +#line 1567 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val)); } -#line 3320 "ntp_parser.c" /* yacc.c:1646 */ +#line 3326 "ntp_parser.c" /* yacc.c:1646 */ break; - case 303: -#line 1571 "ntp_parser.y" /* yacc.c:1646 */ + case 305: +#line 1575 "ntp_parser.y" /* yacc.c:1646 */ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); } -#line 3326 "ntp_parser.c" /* yacc.c:1646 */ +#line 3332 "ntp_parser.c" /* yacc.c:1646 */ break; -#line 3330 "ntp_parser.c" /* yacc.c:1646 */ +#line 3336 "ntp_parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3554,7 +3560,7 @@ yyreturn: #endif return yyresult; } -#line 1582 "ntp_parser.y" /* yacc.c:1906 */ +#line 1586 "ntp_parser.y" /* yacc.c:1906 */ void diff --git a/contrib/ntp/ntpd/ntp_parser.h b/contrib/ntp/ntpd/ntp_parser.h index fc2e971ce0a9e..2804e544973cd 100644 --- a/contrib/ntp/ntpd/ntp_parser.h +++ b/contrib/ntp/ntpd/ntp_parser.h @@ -194,44 +194,46 @@ extern int yydebug; T_Stats = 404, T_Statsdir = 405, T_Step = 406, - T_Stepout = 407, - T_Stratum = 408, - T_String = 409, - T_Sys = 410, - T_Sysstats = 411, - T_Tick = 412, - T_Time1 = 413, - T_Time2 = 414, - T_Timer = 415, - T_Timingstats = 416, - T_Tinker = 417, - T_Tos = 418, - T_Trap = 419, - T_True = 420, - T_Trustedkey = 421, - T_Ttl = 422, - T_Type = 423, - T_U_int = 424, - T_Unconfig = 425, - T_Unpeer = 426, - T_Version = 427, - T_WanderThreshold = 428, - T_Week = 429, - T_Wildcard = 430, - T_Xleave = 431, - T_Year = 432, - T_Flag = 433, - T_EOC = 434, - T_Simulate = 435, - T_Beep_Delay = 436, - T_Sim_Duration = 437, - T_Server_Offset = 438, - T_Duration = 439, - T_Freq_Offset = 440, - T_Wander = 441, - T_Jitter = 442, - T_Prop_Delay = 443, - T_Proc_Delay = 444 + T_Stepback = 407, + T_Stepfwd = 408, + T_Stepout = 409, + T_Stratum = 410, + T_String = 411, + T_Sys = 412, + T_Sysstats = 413, + T_Tick = 414, + T_Time1 = 415, + T_Time2 = 416, + T_Timer = 417, + T_Timingstats = 418, + T_Tinker = 419, + T_Tos = 420, + T_Trap = 421, + T_True = 422, + T_Trustedkey = 423, + T_Ttl = 424, + T_Type = 425, + T_U_int = 426, + T_Unconfig = 427, + T_Unpeer = 428, + T_Version = 429, + T_WanderThreshold = 430, + T_Week = 431, + T_Wildcard = 432, + T_Xleave = 433, + T_Year = 434, + T_Flag = 435, + T_EOC = 436, + T_Simulate = 437, + T_Beep_Delay = 438, + T_Sim_Duration = 439, + T_Server_Offset = 440, + T_Duration = 441, + T_Freq_Offset = 442, + T_Wander = 443, + T_Jitter = 444, + T_Prop_Delay = 445, + T_Proc_Delay = 446 }; #endif /* Tokens. */ @@ -384,44 +386,46 @@ extern int yydebug; #define T_Stats 404 #define T_Statsdir 405 #define T_Step 406 -#define T_Stepout 407 -#define T_Stratum 408 -#define T_String 409 -#define T_Sys 410 -#define T_Sysstats 411 -#define T_Tick 412 -#define T_Time1 413 -#define T_Time2 414 -#define T_Timer 415 -#define T_Timingstats 416 -#define T_Tinker 417 -#define T_Tos 418 -#define T_Trap 419 -#define T_True 420 -#define T_Trustedkey 421 -#define T_Ttl 422 -#define T_Type 423 -#define T_U_int 424 -#define T_Unconfig 425 -#define T_Unpeer 426 -#define T_Version 427 -#define T_WanderThreshold 428 -#define T_Week 429 -#define T_Wildcard 430 -#define T_Xleave 431 -#define T_Year 432 -#define T_Flag 433 -#define T_EOC 434 -#define T_Simulate 435 -#define T_Beep_Delay 436 -#define T_Sim_Duration 437 -#define T_Server_Offset 438 -#define T_Duration 439 -#define T_Freq_Offset 440 -#define T_Wander 441 -#define T_Jitter 442 -#define T_Prop_Delay 443 -#define T_Proc_Delay 444 +#define T_Stepback 407 +#define T_Stepfwd 408 +#define T_Stepout 409 +#define T_Stratum 410 +#define T_String 411 +#define T_Sys 412 +#define T_Sysstats 413 +#define T_Tick 414 +#define T_Time1 415 +#define T_Time2 416 +#define T_Timer 417 +#define T_Timingstats 418 +#define T_Tinker 419 +#define T_Tos 420 +#define T_Trap 421 +#define T_True 422 +#define T_Trustedkey 423 +#define T_Ttl 424 +#define T_Type 425 +#define T_U_int 426 +#define T_Unconfig 427 +#define T_Unpeer 428 +#define T_Version 429 +#define T_WanderThreshold 430 +#define T_Week 431 +#define T_Wildcard 432 +#define T_Xleave 433 +#define T_Year 434 +#define T_Flag 435 +#define T_EOC 436 +#define T_Simulate 437 +#define T_Beep_Delay 438 +#define T_Sim_Duration 439 +#define T_Server_Offset 440 +#define T_Duration 441 +#define T_Freq_Offset 442 +#define T_Wander 443 +#define T_Jitter 444 +#define T_Prop_Delay 445 +#define T_Proc_Delay 446 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -447,7 +451,7 @@ union YYSTYPE script_info * Sim_script; script_info_fifo * Sim_script_fifo; -#line 451 "ntp_parser.h" /* yacc.c:1909 */ +#line 455 "ntp_parser.h" /* yacc.c:1909 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 diff --git a/contrib/ntp/ntpd/ntp_peer.c b/contrib/ntp/ntpd/ntp_peer.c index 495ee30af1a17..d42d804d444d4 100644 --- a/contrib/ntp/ntpd/ntp_peer.c +++ b/contrib/ntp/ntpd/ntp_peer.c @@ -92,6 +92,7 @@ int peer_free_count; /* count of free structures */ * value every time an association is mobilized. */ static associd_t current_association_ID; /* association ID */ +static associd_t initial_association_ID; /* association ID */ /* * Memory allocation watermarks. @@ -147,6 +148,7 @@ init_peer(void) do current_association_ID = ntp_random() & ASSOCID_MAX; while (!current_association_ID); + initial_association_ID = current_association_ID; } @@ -1036,3 +1038,21 @@ findmanycastpeer( return peer; } + +/* peer_cleanup - clean peer list prior to shutdown */ +void peer_cleanup(void) +{ + struct peer *peer; + associd_t assoc; + + for (assoc = initial_association_ID; assoc != current_association_ID; assoc++) { + if (assoc != 0U) { + peer = findpeerbyassoc(assoc); + if (peer != NULL) + unpeer(peer); + } + } + peer = findpeerbyassoc(current_association_ID); + if (peer != NULL) + unpeer(peer); +} diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c index 37c3f0325e07f..577b5fb0af5a2 100644 --- a/contrib/ntp/ntpd/ntp_proto.c +++ b/contrib/ntp/ntpd/ntp_proto.c @@ -245,7 +245,7 @@ transmit( /* * Update the reachability status. If not heard for * three consecutive polls, stuff infinity in the clock - * filter. + * filter. */ oreach = peer->reach; peer->outdate = current_time; @@ -290,7 +290,7 @@ transmit( * If preemptible and we have more peers than maxclock, * and this peer has the minimum score of preemptibles, * demobilize. - */ + */ if (peer->unreach >= NTP_UNREACH) { hpoll++; /* ephemeral: no FLAG_CONFIG nor FLAG_PREEMPT */ @@ -335,7 +335,7 @@ transmit( peer->retry--; /* - * Do not transmit if in broadcast client mode. + * Do not transmit if in broadcast client mode. */ if (peer->hmode != MODE_BCLIENT) peer_xmit(peer); @@ -442,7 +442,7 @@ receive( return; /* no flakeway */ } } - + /* * Version check must be after the query packets, since they * intentionally use an early version. @@ -659,7 +659,7 @@ receive( * If the signature is 20 bytes long, the last 16 of * which are zero, then this is a Microsoft client * wanting AD-style authentication of the server's - * reply. + * reply. * * This is described in Microsoft's WSPP docs, in MS-SNTP: * http://msdn.microsoft.com/en-us/library/cc212930.aspx @@ -680,7 +680,7 @@ receive( * broadcast or unicast address as appropriate. */ if (crypto_flags && skeyid > NTP_MAXKEY) { - + /* * More on the autokey dance (AKD). A cookie is * constructed from public and private values. @@ -874,7 +874,7 @@ receive( * curious and could be an intruder attempting to clog, so we * just ignore it. * - * If the packet is authentic and the manycastclient or pool + * If the packet is authentic and the manycastclient or pool * association is found, we mobilize a client association and * copy pertinent variables from the manycastclient or pool * association to the new client association. If not, just @@ -1256,16 +1256,6 @@ receive( } /* - * Update the state variables. - */ - if (peer->flip == 0) { - if (hismode != MODE_BROADCAST) - peer->rec = p_xmt; - peer->dst = rbufp->recv_time; - } - peer->xmt = p_xmt; - - /* * If this is a crypto_NAK, the server cannot authenticate a * client packet. The server might have just changed keys. Clear * the association and restart the protocol. @@ -1284,19 +1274,21 @@ receive( #endif /* AUTOKEY */ return; - /* - * If the digest fails, the client cannot authenticate a server + /* + * If the digest fails or it's missing for authenticated + * associations, the client cannot authenticate a server * reply to a client packet previously sent. The loopback check * is designed to avoid a bait-and-switch attack, which was * possible in past versions. If symmetric modes, return a * crypto-NAK. The peer should restart the protocol. */ - } else if (!AUTH(has_mac || (restrict_mask & RES_DONTTRUST), - is_authentic)) { + } else if (!AUTH(peer->keyid || has_mac || + (restrict_mask & RES_DONTTRUST), is_authentic)) { report_event(PEVNT_AUTH, peer, "digest"); peer->flash |= TEST5; /* bad auth */ peer->badauth++; - if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE) + if (has_mac && + (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)) fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask); if (peer->flags & FLAG_PREEMPT) { unpeer(peer); @@ -1310,6 +1302,16 @@ receive( } /* + * Update the state variables. + */ + if (peer->flip == 0) { + if (hismode != MODE_BROADCAST) + peer->rec = p_xmt; + peer->dst = rbufp->recv_time; + } + peer->xmt = p_xmt; + + /* * Set the peer ppoll to the maximum of the packet ppoll and the * peer minpoll. If a kiss-o'-death, set the peer minpoll to * this maximum and advance the headway to give the sender some @@ -1577,7 +1579,7 @@ process_packet( /* * If the peer was previously unreachable, raise a trap. In any * case, mark it reachable. - */ + */ if (!peer->reach) { report_event(PEVNT_REACH, peer, NULL); peer->timereachable = current_time; @@ -1644,8 +1646,8 @@ process_packet( * Interleaved broadcast mode. Use interleaved timestamps. * t1 = peer->borg, t2 = p_org, t3 = p_org, t4 = aorg */ - if (peer->flags & FLAG_XB) { - ci = p_org; /* delay */ + if (peer->flags & FLAG_XB) { + ci = p_org; /* delay */ L_SUB(&ci, &peer->aorg); LFPTOD(&ci, t34); ci = p_org; /* t2 - t1 */ @@ -1774,7 +1776,7 @@ process_packet( p_del, peer->r21 / 1e3, peer->r34 / 1e3, td); #endif - } + } #endif /* ASSYM */ /* @@ -2240,7 +2242,7 @@ clock_filter( for (i = NTP_SHIFT - 1; i >= 0; i--) { if (i != 0) peer->filter_disp[j] += dtemp; - if (peer->filter_disp[j] >= MAXDISPERSE) { + if (peer->filter_disp[j] >= MAXDISPERSE) { peer->filter_disp[j] = MAXDISPERSE; dst[i] = MAXDISPERSE; } else if (peer->update - peer->filter_epoch[j] > @@ -2255,7 +2257,7 @@ clock_filter( } /* - * If the clock has stabilized, sort the samples by distance. + * If the clock has stabilized, sort the samples by distance. */ if (freq_cnt == 0) { for (i = 1; i < NTP_SHIFT; i++) { @@ -2289,7 +2291,7 @@ clock_filter( continue; m++; } - + /* * Compute the dispersion and jitter. The dispersion is weighted * exponentially by NTP_FWEIGHT (0.5) so it is normalized close @@ -2493,9 +2495,9 @@ clock_select(void) /* * If this peer could have the orphan parent * as a synchronization ancestor, exclude it - * from selection to avoid forming a + * from selection to avoid forming a * synchronization loop within the orphan mesh, - * triggering stratum climb to infinity + * triggering stratum climb to infinity * instability. Peers at stratum higher than * the orphan stratum could have the orphan * parent in ancestry so are excluded. @@ -2603,7 +2605,7 @@ clock_select(void) for (allow = 0; 2 * allow < nlist; allow++) { /* - * Bound the interval (low, high) as the smallest + * Bound the interval (low, high) as the smallest * interval containing points from the most sources. */ n = 0; @@ -2639,7 +2641,7 @@ clock_select(void) * We assert the correct time is contained in the interval, but * the best offset estimate for the interval might not be * contained in the interval. For this purpose, a truechimer is - * defined as the midpoint of an interval that overlaps the + * defined as the midpoint of an interval that overlaps the * intersection interval. */ j = 0; @@ -2659,9 +2661,10 @@ clock_select(void) * include any of them in the cluster population. */ if (peer->flags & FLAG_PPS) { - if (typepps == NULL) + if (typepps == NULL) typepps = peer; - continue; + if (!(peer->flags & FLAG_TSTAMP_PPS)) + continue; } #endif /* REFCLOCK */ @@ -2672,7 +2675,7 @@ clock_select(void) nlist = j; /* - * If no survivors remain at this point, check if the modem + * If no survivors remain at this point, check if the modem * driver, local driver or orphan parent in that order. If so, * nominate the first one found as the only survivor. * Otherwise, give up and leave the island to the rats. @@ -2709,7 +2712,7 @@ clock_select(void) * by root distance. Continue voting as long as there are more * than sys_minclock survivors and the select jitter of the peer * with the worst metric is greater than the minimum peer - * jitter. Stop if we are about to discard a TRUE or PREFER + * jitter. Stop if we are about to discard a TRUE or PREFER * peer, who of course have the immunity idol. */ while (1) { @@ -2815,7 +2818,7 @@ clock_select(void) typesystem = peers[speer].peer; if (osys_peer == NULL || osys_peer == typesystem) { - sys_clockhop = 0; + sys_clockhop = 0; } else if ((x = fabs(typesystem->offset - osys_peer->offset)) < sys_mindisp) { if (sys_clockhop == 0) @@ -3113,7 +3116,7 @@ peer_xmit( * the session key is generated. */ while (1) { - + /* * Allocate and initialize a keylist if not * already done. Then, use the list in inverse @@ -3165,7 +3168,7 @@ peer_xmit( break; /* - * In symmetric modes the parameter, certificate, + * In symmetric modes the parameter, certificate, * identity, cookie and autokey exchanges are * required. The leapsecond exchange is optional. But, a * peer will not believe the other peer until the other @@ -3324,7 +3327,7 @@ peer_xmit( session_key(&peer->dstadr->sin, &peer->srcadr, xkeyid, 0, 2); } - } + } #endif /* AUTOKEY */ /* @@ -3619,7 +3622,7 @@ pool_xmit( return; /* out of addresses, re-query DNS next poll */ restrict_mask = restrictions(rmtadr); if (RES_FLAGS & restrict_mask) - restrict_source(rmtadr, 0, + restrict_source(rmtadr, 0, current_time + POOL_SOLICIT_WINDOW + 1); lcladr = findinterface(rmtadr); memset(&xpkt, 0, sizeof(xpkt)); diff --git a/contrib/ntp/ntpd/ntpd-opts.c b/contrib/ntp/ntpd/ntpd-opts.c index 953f39750de68..910689d1ea973 100644 --- a/contrib/ntp/ntpd/ntpd-opts.c +++ b/contrib/ntp/ntpd/ntpd-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:39:17 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:23:14 AM by AutoGen 5.18.5pre4 * From the definitions ntpd-opts.def * and the template file options * @@ -74,8 +74,8 @@ extern FILE * option_usage_fp; /** * static const strings for ntpd options */ -static char const ntpd_opt_strs[3061] = -/* 0 */ "ntpd 4.2.8p1\n" +static char const ntpd_opt_strs[3129] = +/* 0 */ "ntpd 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -122,92 +122,95 @@ static char const ntpd_opt_strs[3061] = /* 1460 */ "Allow the first adjustment to be Big\0" /* 1497 */ "PANICGATE\0" /* 1507 */ "panicgate\0" -/* 1517 */ "Jail directory\0" -/* 1532 */ "JAILDIR\0" -/* 1540 */ "jaildir\0" -/* 1548 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0" -/* 1627 */ "Listen on an interface name or address\0" -/* 1666 */ "INTERFACE\0" -/* 1676 */ "interface\0" -/* 1686 */ "path to symmetric keys\0" -/* 1709 */ "KEYFILE\0" -/* 1717 */ "keyfile\0" -/* 1725 */ "path to the log file\0" -/* 1746 */ "LOGFILE\0" -/* 1754 */ "logfile\0" -/* 1762 */ "Do not listen to virtual interfaces\0" -/* 1798 */ "NOVIRTUALIPS\0" -/* 1811 */ "novirtualips\0" -/* 1824 */ "Modify Multimedia Timer (Windows only)\0" -/* 1863 */ "MODIFYMMTIMER\0" -/* 1877 */ "modifymmtimer\0" -/* 1891 */ "Do not fork\0" -/* 1903 */ "NOFORK\0" -/* 1910 */ "nofork\0" -/* 1917 */ "Run at high priority\0" -/* 1938 */ "NICE\0" -/* 1943 */ "nice\0" -/* 1948 */ "path to the PID file\0" -/* 1969 */ "PIDFILE\0" -/* 1977 */ "pidfile\0" -/* 1985 */ "Process priority\0" -/* 2002 */ "PRIORITY\0" -/* 2011 */ "priority\0" -/* 2020 */ "Set the time and quit\0" -/* 2042 */ "QUIT\0" -/* 2047 */ "quit\0" -/* 2052 */ "Broadcast/propagation delay\0" -/* 2080 */ "PROPAGATIONDELAY\0" -/* 2097 */ "propagationdelay\0" -/* 2114 */ "Save parsed configuration and quit\0" -/* 2149 */ "SAVECONFIGQUIT\0" -/* 2164 */ "saveconfigquit\0" -/* 2179 */ "Statistics file location\0" -/* 2204 */ "STATSDIR\0" -/* 2213 */ "statsdir\0" -/* 2222 */ "Trusted key number\0" -/* 2241 */ "TRUSTEDKEY\0" -/* 2252 */ "trustedkey\0" -/* 2263 */ "Run as userid (or userid:groupid)\0" -/* 2297 */ "USER\0" -/* 2302 */ "user\0" -/* 2307 */ "interval in seconds between scans for new or dropped interfaces\0" -/* 2371 */ "UPDATEINTERVAL\0" -/* 2386 */ "updateinterval\0" -/* 2401 */ "make ARG an ntp variable (RW)\0" -/* 2431 */ "VAR\0" -/* 2435 */ "var\0" -/* 2439 */ "make ARG an ntp variable (RW|DEF)\0" -/* 2473 */ "DVAR\0" -/* 2478 */ "dvar\0" -/* 2483 */ "Seconds to wait for first clock sync\0" -/* 2520 */ "WAIT_SYNC\0" -/* 2530 */ "wait-sync\0" -/* 2540 */ "Slew up to 600 seconds\0" -/* 2563 */ "SLEW\0" -/* 2568 */ "slew\0" -/* 2573 */ "Use CPU cycle counter (Windows only)\0" -/* 2610 */ "USEPCC\0" -/* 2617 */ "usepcc\0" -/* 2624 */ "Force CPU cycle counter use (Windows only)\0" -/* 2667 */ "PCCFREQ\0" -/* 2675 */ "pccfreq\0" -/* 2683 */ "Register with mDNS as a NTP server\0" -/* 2718 */ "MDNS\0" -/* 2723 */ "mdns\0" -/* 2728 */ "display extended usage information and exit\0" -/* 2772 */ "help\0" -/* 2777 */ "extended usage information passed thru pager\0" -/* 2822 */ "more-help\0" -/* 2832 */ "output version information and exit\0" -/* 2868 */ "version\0" -/* 2876 */ "NTPD\0" -/* 2881 */ "ntpd - NTP daemon program - Ver. 4.2.8p1\n" +/* 1517 */ "Step any initial offset correction.\0" +/* 1553 */ "FORCE_STEP_ONCE\0" +/* 1569 */ "force-step-once\0" +/* 1585 */ "Jail directory\0" +/* 1600 */ "JAILDIR\0" +/* 1608 */ "jaildir\0" +/* 1616 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0" +/* 1695 */ "Listen on an interface name or address\0" +/* 1734 */ "INTERFACE\0" +/* 1744 */ "interface\0" +/* 1754 */ "path to symmetric keys\0" +/* 1777 */ "KEYFILE\0" +/* 1785 */ "keyfile\0" +/* 1793 */ "path to the log file\0" +/* 1814 */ "LOGFILE\0" +/* 1822 */ "logfile\0" +/* 1830 */ "Do not listen to virtual interfaces\0" +/* 1866 */ "NOVIRTUALIPS\0" +/* 1879 */ "novirtualips\0" +/* 1892 */ "Modify Multimedia Timer (Windows only)\0" +/* 1931 */ "MODIFYMMTIMER\0" +/* 1945 */ "modifymmtimer\0" +/* 1959 */ "Do not fork\0" +/* 1971 */ "NOFORK\0" +/* 1978 */ "nofork\0" +/* 1985 */ "Run at high priority\0" +/* 2006 */ "NICE\0" +/* 2011 */ "nice\0" +/* 2016 */ "path to the PID file\0" +/* 2037 */ "PIDFILE\0" +/* 2045 */ "pidfile\0" +/* 2053 */ "Process priority\0" +/* 2070 */ "PRIORITY\0" +/* 2079 */ "priority\0" +/* 2088 */ "Set the time and quit\0" +/* 2110 */ "QUIT\0" +/* 2115 */ "quit\0" +/* 2120 */ "Broadcast/propagation delay\0" +/* 2148 */ "PROPAGATIONDELAY\0" +/* 2165 */ "propagationdelay\0" +/* 2182 */ "Save parsed configuration and quit\0" +/* 2217 */ "SAVECONFIGQUIT\0" +/* 2232 */ "saveconfigquit\0" +/* 2247 */ "Statistics file location\0" +/* 2272 */ "STATSDIR\0" +/* 2281 */ "statsdir\0" +/* 2290 */ "Trusted key number\0" +/* 2309 */ "TRUSTEDKEY\0" +/* 2320 */ "trustedkey\0" +/* 2331 */ "Run as userid (or userid:groupid)\0" +/* 2365 */ "USER\0" +/* 2370 */ "user\0" +/* 2375 */ "interval in seconds between scans for new or dropped interfaces\0" +/* 2439 */ "UPDATEINTERVAL\0" +/* 2454 */ "updateinterval\0" +/* 2469 */ "make ARG an ntp variable (RW)\0" +/* 2499 */ "VAR\0" +/* 2503 */ "var\0" +/* 2507 */ "make ARG an ntp variable (RW|DEF)\0" +/* 2541 */ "DVAR\0" +/* 2546 */ "dvar\0" +/* 2551 */ "Seconds to wait for first clock sync\0" +/* 2588 */ "WAIT_SYNC\0" +/* 2598 */ "wait-sync\0" +/* 2608 */ "Slew up to 600 seconds\0" +/* 2631 */ "SLEW\0" +/* 2636 */ "slew\0" +/* 2641 */ "Use CPU cycle counter (Windows only)\0" +/* 2678 */ "USEPCC\0" +/* 2685 */ "usepcc\0" +/* 2692 */ "Force CPU cycle counter use (Windows only)\0" +/* 2735 */ "PCCFREQ\0" +/* 2743 */ "pccfreq\0" +/* 2751 */ "Register with mDNS as a NTP server\0" +/* 2786 */ "MDNS\0" +/* 2791 */ "mdns\0" +/* 2796 */ "display extended usage information and exit\0" +/* 2840 */ "help\0" +/* 2845 */ "extended usage information passed thru pager\0" +/* 2890 */ "more-help\0" +/* 2900 */ "output version information and exit\0" +/* 2936 */ "version\0" +/* 2944 */ "NTPD\0" +/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" "\t\t[ <server1> ... <serverN> ]\n\0" -/* 3012 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 3046 */ "\n\0" -/* 3048 */ "ntpd 4.2.8p1"; +/* 3080 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 3114 */ "\n\0" +/* 3116 */ "ntpd 4.2.8p2"; /** * ipv4 option description with @@ -349,15 +352,27 @@ static int const aAuthnoreqCantList[] = { #define PANICGATE_FLAGS (OPTST_DISABLED) /** + * force_step_once option description: + */ +/** Descriptive text for the force_step_once option */ +#define FORCE_STEP_ONCE_DESC (ntpd_opt_strs+1517) +/** Upper-cased name for the force_step_once option */ +#define FORCE_STEP_ONCE_NAME (ntpd_opt_strs+1553) +/** Name string for the force_step_once option */ +#define FORCE_STEP_ONCE_name (ntpd_opt_strs+1569) +/** Compiled in flag settings for the force_step_once option */ +#define FORCE_STEP_ONCE_FLAGS (OPTST_DISABLED) + +/** * jaildir option description: */ #ifdef HAVE_DROPROOT /** Descriptive text for the jaildir option */ -#define JAILDIR_DESC (ntpd_opt_strs+1517) +#define JAILDIR_DESC (ntpd_opt_strs+1585) /** Upper-cased name for the jaildir option */ -#define JAILDIR_NAME (ntpd_opt_strs+1532) +#define JAILDIR_NAME (ntpd_opt_strs+1600) /** Name string for the jaildir option */ -#define JAILDIR_name (ntpd_opt_strs+1540) +#define JAILDIR_name (ntpd_opt_strs+1608) /** Compiled in flag settings for the jaildir option */ #define JAILDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -366,19 +381,19 @@ static int const aAuthnoreqCantList[] = { #define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define JAILDIR_NAME NULL /** Descriptive text for the jaildir option */ -#define JAILDIR_DESC (ntpd_opt_strs+1548) -#define JAILDIR_name (ntpd_opt_strs+1540) +#define JAILDIR_DESC (ntpd_opt_strs+1616) +#define JAILDIR_name (ntpd_opt_strs+1608) #endif /* HAVE_DROPROOT */ /** * interface option description: */ /** Descriptive text for the interface option */ -#define INTERFACE_DESC (ntpd_opt_strs+1627) +#define INTERFACE_DESC (ntpd_opt_strs+1695) /** Upper-cased name for the interface option */ -#define INTERFACE_NAME (ntpd_opt_strs+1666) +#define INTERFACE_NAME (ntpd_opt_strs+1734) /** Name string for the interface option */ -#define INTERFACE_name (ntpd_opt_strs+1676) +#define INTERFACE_name (ntpd_opt_strs+1744) /** Compiled in flag settings for the interface option */ #define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -387,11 +402,11 @@ static int const aAuthnoreqCantList[] = { * keyfile option description: */ /** Descriptive text for the keyfile option */ -#define KEYFILE_DESC (ntpd_opt_strs+1686) +#define KEYFILE_DESC (ntpd_opt_strs+1754) /** Upper-cased name for the keyfile option */ -#define KEYFILE_NAME (ntpd_opt_strs+1709) +#define KEYFILE_NAME (ntpd_opt_strs+1777) /** Name string for the keyfile option */ -#define KEYFILE_name (ntpd_opt_strs+1717) +#define KEYFILE_name (ntpd_opt_strs+1785) /** Compiled in flag settings for the keyfile option */ #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -400,11 +415,11 @@ static int const aAuthnoreqCantList[] = { * logfile option description: */ /** Descriptive text for the logfile option */ -#define LOGFILE_DESC (ntpd_opt_strs+1725) +#define LOGFILE_DESC (ntpd_opt_strs+1793) /** Upper-cased name for the logfile option */ -#define LOGFILE_NAME (ntpd_opt_strs+1746) +#define LOGFILE_NAME (ntpd_opt_strs+1814) /** Name string for the logfile option */ -#define LOGFILE_name (ntpd_opt_strs+1754) +#define LOGFILE_name (ntpd_opt_strs+1822) /** Compiled in flag settings for the logfile option */ #define LOGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -413,11 +428,11 @@ static int const aAuthnoreqCantList[] = { * novirtualips option description: */ /** Descriptive text for the novirtualips option */ -#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1762) +#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1830) /** Upper-cased name for the novirtualips option */ -#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1798) +#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1866) /** Name string for the novirtualips option */ -#define NOVIRTUALIPS_name (ntpd_opt_strs+1811) +#define NOVIRTUALIPS_name (ntpd_opt_strs+1879) /** Compiled in flag settings for the novirtualips option */ #define NOVIRTUALIPS_FLAGS (OPTST_DISABLED) @@ -426,11 +441,11 @@ static int const aAuthnoreqCantList[] = { */ #ifdef SYS_WINNT /** Descriptive text for the modifymmtimer option */ -#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1824) +#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1892) /** Upper-cased name for the modifymmtimer option */ -#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1863) +#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1931) /** Name string for the modifymmtimer option */ -#define MODIFYMMTIMER_name (ntpd_opt_strs+1877) +#define MODIFYMMTIMER_name (ntpd_opt_strs+1945) /** Compiled in flag settings for the modifymmtimer option */ #define MODIFYMMTIMER_FLAGS (OPTST_DISABLED) @@ -446,11 +461,11 @@ static int const aAuthnoreqCantList[] = { * "Must also have options" and "Incompatible options": */ /** Descriptive text for the nofork option */ -#define NOFORK_DESC (ntpd_opt_strs+1891) +#define NOFORK_DESC (ntpd_opt_strs+1959) /** Upper-cased name for the nofork option */ -#define NOFORK_NAME (ntpd_opt_strs+1903) +#define NOFORK_NAME (ntpd_opt_strs+1971) /** Name string for the nofork option */ -#define NOFORK_name (ntpd_opt_strs+1910) +#define NOFORK_name (ntpd_opt_strs+1978) /** Other options that appear in conjunction with the nofork option */ static int const aNoforkCantList[] = { INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; @@ -461,11 +476,11 @@ static int const aNoforkCantList[] = { * nice option description: */ /** Descriptive text for the nice option */ -#define NICE_DESC (ntpd_opt_strs+1917) +#define NICE_DESC (ntpd_opt_strs+1985) /** Upper-cased name for the nice option */ -#define NICE_NAME (ntpd_opt_strs+1938) +#define NICE_NAME (ntpd_opt_strs+2006) /** Name string for the nice option */ -#define NICE_name (ntpd_opt_strs+1943) +#define NICE_name (ntpd_opt_strs+2011) /** Compiled in flag settings for the nice option */ #define NICE_FLAGS (OPTST_DISABLED) @@ -473,11 +488,11 @@ static int const aNoforkCantList[] = { * pidfile option description: */ /** Descriptive text for the pidfile option */ -#define PIDFILE_DESC (ntpd_opt_strs+1948) +#define PIDFILE_DESC (ntpd_opt_strs+2016) /** Upper-cased name for the pidfile option */ -#define PIDFILE_NAME (ntpd_opt_strs+1969) +#define PIDFILE_NAME (ntpd_opt_strs+2037) /** Name string for the pidfile option */ -#define PIDFILE_name (ntpd_opt_strs+1977) +#define PIDFILE_name (ntpd_opt_strs+2045) /** Compiled in flag settings for the pidfile option */ #define PIDFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -486,11 +501,11 @@ static int const aNoforkCantList[] = { * priority option description: */ /** Descriptive text for the priority option */ -#define PRIORITY_DESC (ntpd_opt_strs+1985) +#define PRIORITY_DESC (ntpd_opt_strs+2053) /** Upper-cased name for the priority option */ -#define PRIORITY_NAME (ntpd_opt_strs+2002) +#define PRIORITY_NAME (ntpd_opt_strs+2070) /** Name string for the priority option */ -#define PRIORITY_name (ntpd_opt_strs+2011) +#define PRIORITY_name (ntpd_opt_strs+2079) /** Compiled in flag settings for the priority option */ #define PRIORITY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -500,11 +515,11 @@ static int const aNoforkCantList[] = { * "Must also have options" and "Incompatible options": */ /** Descriptive text for the quit option */ -#define QUIT_DESC (ntpd_opt_strs+2020) +#define QUIT_DESC (ntpd_opt_strs+2088) /** Upper-cased name for the quit option */ -#define QUIT_NAME (ntpd_opt_strs+2042) +#define QUIT_NAME (ntpd_opt_strs+2110) /** Name string for the quit option */ -#define QUIT_name (ntpd_opt_strs+2047) +#define QUIT_name (ntpd_opt_strs+2115) /** Other options that appear in conjunction with the quit option */ static int const aQuitCantList[] = { INDEX_OPT_SAVECONFIGQUIT, @@ -516,11 +531,11 @@ static int const aQuitCantList[] = { * propagationdelay option description: */ /** Descriptive text for the propagationdelay option */ -#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2052) +#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2120) /** Upper-cased name for the propagationdelay option */ -#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2080) +#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2148) /** Name string for the propagationdelay option */ -#define PROPAGATIONDELAY_name (ntpd_opt_strs+2097) +#define PROPAGATIONDELAY_name (ntpd_opt_strs+2165) /** Compiled in flag settings for the propagationdelay option */ #define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -531,11 +546,11 @@ static int const aQuitCantList[] = { */ #ifdef SAVECONFIG /** Descriptive text for the saveconfigquit option */ -#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2114) +#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2182) /** Upper-cased name for the saveconfigquit option */ -#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2149) +#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2217) /** Name string for the saveconfigquit option */ -#define SAVECONFIGQUIT_name (ntpd_opt_strs+2164) +#define SAVECONFIGQUIT_name (ntpd_opt_strs+2232) /** Other options that appear in conjunction with the saveconfigquit option */ static int const aSaveconfigquitCantList[] = { INDEX_OPT_QUIT, @@ -556,11 +571,11 @@ static int const aSaveconfigquitCantList[] = { * statsdir option description: */ /** Descriptive text for the statsdir option */ -#define STATSDIR_DESC (ntpd_opt_strs+2179) +#define STATSDIR_DESC (ntpd_opt_strs+2247) /** Upper-cased name for the statsdir option */ -#define STATSDIR_NAME (ntpd_opt_strs+2204) +#define STATSDIR_NAME (ntpd_opt_strs+2272) /** Name string for the statsdir option */ -#define STATSDIR_name (ntpd_opt_strs+2213) +#define STATSDIR_name (ntpd_opt_strs+2281) /** Compiled in flag settings for the statsdir option */ #define STATSDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -569,11 +584,11 @@ static int const aSaveconfigquitCantList[] = { * trustedkey option description: */ /** Descriptive text for the trustedkey option */ -#define TRUSTEDKEY_DESC (ntpd_opt_strs+2222) +#define TRUSTEDKEY_DESC (ntpd_opt_strs+2290) /** Upper-cased name for the trustedkey option */ -#define TRUSTEDKEY_NAME (ntpd_opt_strs+2241) +#define TRUSTEDKEY_NAME (ntpd_opt_strs+2309) /** Name string for the trustedkey option */ -#define TRUSTEDKEY_name (ntpd_opt_strs+2252) +#define TRUSTEDKEY_name (ntpd_opt_strs+2320) /** Compiled in flag settings for the trustedkey option */ #define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -583,11 +598,11 @@ static int const aSaveconfigquitCantList[] = { */ #ifdef HAVE_DROPROOT /** Descriptive text for the user option */ -#define USER_DESC (ntpd_opt_strs+2263) +#define USER_DESC (ntpd_opt_strs+2331) /** Upper-cased name for the user option */ -#define USER_NAME (ntpd_opt_strs+2297) +#define USER_NAME (ntpd_opt_strs+2365) /** Name string for the user option */ -#define USER_name (ntpd_opt_strs+2302) +#define USER_name (ntpd_opt_strs+2370) /** Compiled in flag settings for the user option */ #define USER_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -596,19 +611,19 @@ static int const aSaveconfigquitCantList[] = { #define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define USER_NAME NULL /** Descriptive text for the user option */ -#define USER_DESC (ntpd_opt_strs+1548) -#define USER_name (ntpd_opt_strs+2302) +#define USER_DESC (ntpd_opt_strs+1616) +#define USER_name (ntpd_opt_strs+2370) #endif /* HAVE_DROPROOT */ /** * updateinterval option description: */ /** Descriptive text for the updateinterval option */ -#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2307) +#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2375) /** Upper-cased name for the updateinterval option */ -#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2371) +#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2439) /** Name string for the updateinterval option */ -#define UPDATEINTERVAL_name (ntpd_opt_strs+2386) +#define UPDATEINTERVAL_name (ntpd_opt_strs+2454) /** Compiled in flag settings for the updateinterval option */ #define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -617,11 +632,11 @@ static int const aSaveconfigquitCantList[] = { * var option description: */ /** Descriptive text for the var option */ -#define VAR_DESC (ntpd_opt_strs+2401) +#define VAR_DESC (ntpd_opt_strs+2469) /** Upper-cased name for the var option */ -#define VAR_NAME (ntpd_opt_strs+2431) +#define VAR_NAME (ntpd_opt_strs+2499) /** Name string for the var option */ -#define VAR_name (ntpd_opt_strs+2435) +#define VAR_name (ntpd_opt_strs+2503) /** Compiled in flag settings for the var option */ #define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -630,11 +645,11 @@ static int const aSaveconfigquitCantList[] = { * dvar option description: */ /** Descriptive text for the dvar option */ -#define DVAR_DESC (ntpd_opt_strs+2439) +#define DVAR_DESC (ntpd_opt_strs+2507) /** Upper-cased name for the dvar option */ -#define DVAR_NAME (ntpd_opt_strs+2473) +#define DVAR_NAME (ntpd_opt_strs+2541) /** Name string for the dvar option */ -#define DVAR_name (ntpd_opt_strs+2478) +#define DVAR_name (ntpd_opt_strs+2546) /** Compiled in flag settings for the dvar option */ #define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -645,11 +660,11 @@ static int const aSaveconfigquitCantList[] = { */ #ifdef HAVE_WORKING_FORK /** Descriptive text for the wait-sync option */ -#define WAIT_SYNC_DESC (ntpd_opt_strs+2483) +#define WAIT_SYNC_DESC (ntpd_opt_strs+2551) /** Upper-cased name for the wait-sync option */ -#define WAIT_SYNC_NAME (ntpd_opt_strs+2520) +#define WAIT_SYNC_NAME (ntpd_opt_strs+2588) /** Name string for the wait-sync option */ -#define WAIT_SYNC_name (ntpd_opt_strs+2530) +#define WAIT_SYNC_name (ntpd_opt_strs+2598) /** Other options that appear in conjunction with the wait-sync option */ static int const aWait_SyncCantList[] = { INDEX_OPT_NOFORK, @@ -671,11 +686,11 @@ static int const aWait_SyncCantList[] = { * slew option description: */ /** Descriptive text for the slew option */ -#define SLEW_DESC (ntpd_opt_strs+2540) +#define SLEW_DESC (ntpd_opt_strs+2608) /** Upper-cased name for the slew option */ -#define SLEW_NAME (ntpd_opt_strs+2563) +#define SLEW_NAME (ntpd_opt_strs+2631) /** Name string for the slew option */ -#define SLEW_name (ntpd_opt_strs+2568) +#define SLEW_name (ntpd_opt_strs+2636) /** Compiled in flag settings for the slew option */ #define SLEW_FLAGS (OPTST_DISABLED) @@ -684,11 +699,11 @@ static int const aWait_SyncCantList[] = { */ #ifdef SYS_WINNT /** Descriptive text for the usepcc option */ -#define USEPCC_DESC (ntpd_opt_strs+2573) +#define USEPCC_DESC (ntpd_opt_strs+2641) /** Upper-cased name for the usepcc option */ -#define USEPCC_NAME (ntpd_opt_strs+2610) +#define USEPCC_NAME (ntpd_opt_strs+2678) /** Name string for the usepcc option */ -#define USEPCC_name (ntpd_opt_strs+2617) +#define USEPCC_name (ntpd_opt_strs+2685) /** Compiled in flag settings for the usepcc option */ #define USEPCC_FLAGS (OPTST_DISABLED) @@ -704,11 +719,11 @@ static int const aWait_SyncCantList[] = { */ #ifdef SYS_WINNT /** Descriptive text for the pccfreq option */ -#define PCCFREQ_DESC (ntpd_opt_strs+2624) +#define PCCFREQ_DESC (ntpd_opt_strs+2692) /** Upper-cased name for the pccfreq option */ -#define PCCFREQ_NAME (ntpd_opt_strs+2667) +#define PCCFREQ_NAME (ntpd_opt_strs+2735) /** Name string for the pccfreq option */ -#define PCCFREQ_name (ntpd_opt_strs+2675) +#define PCCFREQ_name (ntpd_opt_strs+2743) /** Compiled in flag settings for the pccfreq option */ #define PCCFREQ_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -725,11 +740,11 @@ static int const aWait_SyncCantList[] = { */ #ifdef HAVE_DNSREGISTRATION /** Descriptive text for the mdns option */ -#define MDNS_DESC (ntpd_opt_strs+2683) +#define MDNS_DESC (ntpd_opt_strs+2751) /** Upper-cased name for the mdns option */ -#define MDNS_NAME (ntpd_opt_strs+2718) +#define MDNS_NAME (ntpd_opt_strs+2786) /** Name string for the mdns option */ -#define MDNS_name (ntpd_opt_strs+2723) +#define MDNS_name (ntpd_opt_strs+2791) /** Compiled in flag settings for the mdns option */ #define MDNS_FLAGS (OPTST_DISABLED) @@ -743,11 +758,11 @@ static int const aWait_SyncCantList[] = { /* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (ntpd_opt_strs+2728) -#define HELP_name (ntpd_opt_strs+2772) +#define HELP_DESC (ntpd_opt_strs+2796) +#define HELP_name (ntpd_opt_strs+2840) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpd_opt_strs+2777) -#define MORE_HELP_name (ntpd_opt_strs+2822) +#define MORE_HELP_DESC (ntpd_opt_strs+2845) +#define MORE_HELP_name (ntpd_opt_strs+2890) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC HELP_DESC @@ -760,8 +775,8 @@ static int const aWait_SyncCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpd_opt_strs+2832) -#define VER_name (ntpd_opt_strs+2868) +#define VER_DESC (ntpd_opt_strs+2900) +#define VER_name (ntpd_opt_strs+2936) /** * Declare option callback procedures */ @@ -901,8 +916,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 10, VALUE_OPT_JAILDIR, - /* equiv idx, value */ 10, VALUE_OPT_JAILDIR, + { /* entry idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE, + /* equiv idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ FORCE_STEP_ONCE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --force_step_once */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ FORCE_STEP_ONCE_DESC, FORCE_STEP_ONCE_NAME, FORCE_STEP_ONCE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_JAILDIR, + /* equiv idx, value */ 11, VALUE_OPT_JAILDIR, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ JAILDIR_FLAGS, 0, @@ -913,8 +940,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 11, VALUE_OPT_INTERFACE, - /* equiv idx, value */ 11, VALUE_OPT_INTERFACE, + { /* entry idx, value */ 12, VALUE_OPT_INTERFACE, + /* equiv idx, value */ 12, VALUE_OPT_INTERFACE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ INTERFACE_FLAGS, 0, @@ -925,8 +952,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 12, VALUE_OPT_KEYFILE, - /* equiv idx, value */ 12, VALUE_OPT_KEYFILE, + { /* entry idx, value */ 13, VALUE_OPT_KEYFILE, + /* equiv idx, value */ 13, VALUE_OPT_KEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ KEYFILE_FLAGS, 0, @@ -937,8 +964,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 13, VALUE_OPT_LOGFILE, - /* equiv idx, value */ 13, VALUE_OPT_LOGFILE, + { /* entry idx, value */ 14, VALUE_OPT_LOGFILE, + /* equiv idx, value */ 14, VALUE_OPT_LOGFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ LOGFILE_FLAGS, 0, @@ -949,8 +976,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS, - /* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS, + { /* entry idx, value */ 15, VALUE_OPT_NOVIRTUALIPS, + /* equiv idx, value */ 15, VALUE_OPT_NOVIRTUALIPS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NOVIRTUALIPS_FLAGS, 0, @@ -961,8 +988,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER, - /* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER, + { /* entry idx, value */ 16, VALUE_OPT_MODIFYMMTIMER, + /* equiv idx, value */ 16, VALUE_OPT_MODIFYMMTIMER, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MODIFYMMTIMER_FLAGS, 0, @@ -973,8 +1000,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 16, VALUE_OPT_NOFORK, - /* equiv idx, value */ 16, VALUE_OPT_NOFORK, + { /* entry idx, value */ 17, VALUE_OPT_NOFORK, + /* equiv idx, value */ 17, VALUE_OPT_NOFORK, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NOFORK_FLAGS, 0, @@ -985,8 +1012,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 17, VALUE_OPT_NICE, - /* equiv idx, value */ 17, VALUE_OPT_NICE, + { /* entry idx, value */ 18, VALUE_OPT_NICE, + /* equiv idx, value */ 18, VALUE_OPT_NICE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NICE_FLAGS, 0, @@ -997,8 +1024,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 18, VALUE_OPT_PIDFILE, - /* equiv idx, value */ 18, VALUE_OPT_PIDFILE, + { /* entry idx, value */ 19, VALUE_OPT_PIDFILE, + /* equiv idx, value */ 19, VALUE_OPT_PIDFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PIDFILE_FLAGS, 0, @@ -1009,8 +1036,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 19, VALUE_OPT_PRIORITY, - /* equiv idx, value */ 19, VALUE_OPT_PRIORITY, + { /* entry idx, value */ 20, VALUE_OPT_PRIORITY, + /* equiv idx, value */ 20, VALUE_OPT_PRIORITY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PRIORITY_FLAGS, 0, @@ -1021,8 +1048,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 20, VALUE_OPT_QUIT, - /* equiv idx, value */ 20, VALUE_OPT_QUIT, + { /* entry idx, value */ 21, VALUE_OPT_QUIT, + /* equiv idx, value */ 21, VALUE_OPT_QUIT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ QUIT_FLAGS, 0, @@ -1033,8 +1060,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY, - /* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY, + { /* entry idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY, + /* equiv idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PROPAGATIONDELAY_FLAGS, 0, @@ -1045,8 +1072,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT, - /* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT, + { /* entry idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT, + /* equiv idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SAVECONFIGQUIT_FLAGS, 0, @@ -1057,8 +1084,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 23, VALUE_OPT_STATSDIR, - /* equiv idx, value */ 23, VALUE_OPT_STATSDIR, + { /* entry idx, value */ 24, VALUE_OPT_STATSDIR, + /* equiv idx, value */ 24, VALUE_OPT_STATSDIR, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ STATSDIR_FLAGS, 0, @@ -1069,8 +1096,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY, - /* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY, + { /* entry idx, value */ 25, VALUE_OPT_TRUSTEDKEY, + /* equiv idx, value */ 25, VALUE_OPT_TRUSTEDKEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ TRUSTEDKEY_FLAGS, 0, @@ -1081,8 +1108,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 25, VALUE_OPT_USER, - /* equiv idx, value */ 25, VALUE_OPT_USER, + { /* entry idx, value */ 26, VALUE_OPT_USER, + /* equiv idx, value */ 26, VALUE_OPT_USER, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ USER_FLAGS, 0, @@ -1093,8 +1120,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL, - /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL, + { /* entry idx, value */ 27, VALUE_OPT_UPDATEINTERVAL, + /* equiv idx, value */ 27, VALUE_OPT_UPDATEINTERVAL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ UPDATEINTERVAL_FLAGS, 0, @@ -1105,8 +1132,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 27, VALUE_OPT_VAR, - /* equiv idx, value */ 27, VALUE_OPT_VAR, + { /* entry idx, value */ 28, VALUE_OPT_VAR, + /* equiv idx, value */ 28, VALUE_OPT_VAR, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ VAR_FLAGS, 0, @@ -1117,8 +1144,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 28, VALUE_OPT_DVAR, - /* equiv idx, value */ 28, VALUE_OPT_DVAR, + { /* entry idx, value */ 29, VALUE_OPT_DVAR, + /* equiv idx, value */ 29, VALUE_OPT_DVAR, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ DVAR_FLAGS, 0, @@ -1129,8 +1156,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 29, VALUE_OPT_WAIT_SYNC, - /* equiv idx, value */ 29, VALUE_OPT_WAIT_SYNC, + { /* entry idx, value */ 30, VALUE_OPT_WAIT_SYNC, + /* equiv idx, value */ 30, VALUE_OPT_WAIT_SYNC, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ WAIT_SYNC_FLAGS, 0, @@ -1141,8 +1168,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 30, VALUE_OPT_SLEW, - /* equiv idx, value */ 30, VALUE_OPT_SLEW, + { /* entry idx, value */ 31, VALUE_OPT_SLEW, + /* equiv idx, value */ 31, VALUE_OPT_SLEW, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SLEW_FLAGS, 0, @@ -1153,8 +1180,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 31, VALUE_OPT_USEPCC, - /* equiv idx, value */ 31, VALUE_OPT_USEPCC, + { /* entry idx, value */ 32, VALUE_OPT_USEPCC, + /* equiv idx, value */ 32, VALUE_OPT_USEPCC, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ USEPCC_FLAGS, 0, @@ -1165,8 +1192,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 32, VALUE_OPT_PCCFREQ, - /* equiv idx, value */ 32, VALUE_OPT_PCCFREQ, + { /* entry idx, value */ 33, VALUE_OPT_PCCFREQ, + /* equiv idx, value */ 33, VALUE_OPT_PCCFREQ, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PCCFREQ_FLAGS, 0, @@ -1177,8 +1204,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 33, VALUE_OPT_MDNS, - /* equiv idx, value */ 33, VALUE_OPT_MDNS, + { /* entry idx, value */ 34, VALUE_OPT_MDNS, + /* equiv idx, value */ 34, VALUE_OPT_MDNS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MDNS_FLAGS, 0, @@ -1231,21 +1258,21 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** Reference to the upper cased version of ntpd. */ -#define zPROGNAME (ntpd_opt_strs+2876) +#define zPROGNAME (ntpd_opt_strs+2944) /** Reference to the title line for ntpd usage. */ -#define zUsageTitle (ntpd_opt_strs+2881) +#define zUsageTitle (ntpd_opt_strs+2949) /** There is no ntpd configuration file. */ #define zRcName NULL /** There are no directories to search for ntpd config files. */ #define apzHomeList NULL /** The ntpd program bug email address. */ -#define zBugsAddr (ntpd_opt_strs+3012) +#define zBugsAddr (ntpd_opt_strs+3080) /** Clarification/explanation of what ntpd does. */ -#define zExplain (ntpd_opt_strs+3046) +#define zExplain (ntpd_opt_strs+3114) /** Extra detail explaining what ntpd does. */ #define zDetail (NULL) /** The full version string for ntpd. */ -#define zFullVersion (ntpd_opt_strs+3048) +#define zFullVersion (ntpd_opt_strs+3116) /* extracted from optcode.tlib near line 364 */ #if defined(ENABLE_NLS) @@ -1367,7 +1394,7 @@ tOptions ntpdOptions = { NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, - 37 /* full option count */, 34 /* user option count */, + 38 /* full option count */, 35 /* user option count */, ntpd_full_usage, ntpd_short_usage, NULL, NULL, PKGDATADIR, ntpd_packager_info @@ -1502,7 +1529,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpdOptions.pzCopyright */ - puts(_("ntpd 4.2.8p1\n\ + puts(_("ntpd 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -1553,6 +1580,9 @@ implied warranty.\n")); puts(_("Allow the first adjustment to be Big")); /* referenced via ntpdOptions.pOptDesc->pzText */ + puts(_("Step any initial offset correction.")); + + /* referenced via ntpdOptions.pOptDesc->pzText */ puts(_("Jail directory")); /* referenced via ntpdOptions.pOptDesc->pzText */ @@ -1640,7 +1670,7 @@ implied warranty.\n")); puts(_("output version information and exit")); /* referenced via ntpdOptions.pzUsageTitle */ - puts(_("ntpd - NTP daemon program - Ver. 4.2.8p1\n\ + puts(_("ntpd - NTP daemon program - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ \t\t[ <server1> ... <serverN> ]\n")); @@ -1648,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ puts(_("\n")); /* referenced via ntpdOptions.pzFullVersion */ - puts(_("ntpd 4.2.8p1")); + puts(_("ntpd 4.2.8p2")); /* referenced via ntpdOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpd/ntpd-opts.h b/contrib/ntp/ntpd/ntpd-opts.h index f4eb47b8e355b..682aebda41aff 100644 --- a/contrib/ntp/ntpd/ntpd-opts.h +++ b/contrib/ntp/ntpd/ntpd-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:39:16 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:23:13 AM by AutoGen 5.18.5pre4 * From the definitions ntpd-opts.def * and the template file options * @@ -74,40 +74,41 @@ typedef enum { INDEX_OPT_SET_DEBUG_LEVEL = 7, INDEX_OPT_DRIFTFILE = 8, INDEX_OPT_PANICGATE = 9, - INDEX_OPT_JAILDIR = 10, - INDEX_OPT_INTERFACE = 11, - INDEX_OPT_KEYFILE = 12, - INDEX_OPT_LOGFILE = 13, - INDEX_OPT_NOVIRTUALIPS = 14, - INDEX_OPT_MODIFYMMTIMER = 15, - INDEX_OPT_NOFORK = 16, - INDEX_OPT_NICE = 17, - INDEX_OPT_PIDFILE = 18, - INDEX_OPT_PRIORITY = 19, - INDEX_OPT_QUIT = 20, - INDEX_OPT_PROPAGATIONDELAY = 21, - INDEX_OPT_SAVECONFIGQUIT = 22, - INDEX_OPT_STATSDIR = 23, - INDEX_OPT_TRUSTEDKEY = 24, - INDEX_OPT_USER = 25, - INDEX_OPT_UPDATEINTERVAL = 26, - INDEX_OPT_VAR = 27, - INDEX_OPT_DVAR = 28, - INDEX_OPT_WAIT_SYNC = 29, - INDEX_OPT_SLEW = 30, - INDEX_OPT_USEPCC = 31, - INDEX_OPT_PCCFREQ = 32, - INDEX_OPT_MDNS = 33, - INDEX_OPT_VERSION = 34, - INDEX_OPT_HELP = 35, - INDEX_OPT_MORE_HELP = 36 + INDEX_OPT_FORCE_STEP_ONCE = 10, + INDEX_OPT_JAILDIR = 11, + INDEX_OPT_INTERFACE = 12, + INDEX_OPT_KEYFILE = 13, + INDEX_OPT_LOGFILE = 14, + INDEX_OPT_NOVIRTUALIPS = 15, + INDEX_OPT_MODIFYMMTIMER = 16, + INDEX_OPT_NOFORK = 17, + INDEX_OPT_NICE = 18, + INDEX_OPT_PIDFILE = 19, + INDEX_OPT_PRIORITY = 20, + INDEX_OPT_QUIT = 21, + INDEX_OPT_PROPAGATIONDELAY = 22, + INDEX_OPT_SAVECONFIGQUIT = 23, + INDEX_OPT_STATSDIR = 24, + INDEX_OPT_TRUSTEDKEY = 25, + INDEX_OPT_USER = 26, + INDEX_OPT_UPDATEINTERVAL = 27, + INDEX_OPT_VAR = 28, + INDEX_OPT_DVAR = 29, + INDEX_OPT_WAIT_SYNC = 30, + INDEX_OPT_SLEW = 31, + INDEX_OPT_USEPCC = 32, + INDEX_OPT_PCCFREQ = 33, + INDEX_OPT_MDNS = 34, + INDEX_OPT_VERSION = 35, + INDEX_OPT_HELP = 36, + INDEX_OPT_MORE_HELP = 37 } teOptIndex; /** count of all options for ntpd */ -#define OPTION_CT 37 +#define OPTION_CT 38 /** ntpd version */ -#define NTPD_VERSION "4.2.8p1" +#define NTPD_VERSION "4.2.8p2" /** Full ntpd version text */ -#define NTPD_FULL_VERSION "ntpd 4.2.8p1" +#define NTPD_FULL_VERSION "ntpd 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED @@ -199,6 +200,10 @@ typedef enum { # warning undefining PANICGATE due to option name conflict # undef PANICGATE # endif +# ifdef FORCE_STEP_ONCE +# warning undefining FORCE_STEP_ONCE due to option name conflict +# undef FORCE_STEP_ONCE +# endif # ifdef JAILDIR # warning undefining JAILDIR due to option name conflict # undef JAILDIR @@ -306,6 +311,7 @@ typedef enum { # undef SET_DEBUG_LEVEL # undef DRIFTFILE # undef PANICGATE +# undef FORCE_STEP_ONCE # undef JAILDIR # undef INTERFACE # undef KEYFILE @@ -348,6 +354,7 @@ typedef enum { #define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt) #define VALUE_OPT_DRIFTFILE 'f' #define VALUE_OPT_PANICGATE 'g' +#define VALUE_OPT_FORCE_STEP_ONCE 'G' #define VALUE_OPT_JAILDIR 'i' #define VALUE_OPT_INTERFACE 'I' #define VALUE_OPT_KEYFILE 'k' diff --git a/contrib/ntp/ntpd/ntpd.1ntpdman b/contrib/ntp/ntpd/ntpd.1ntpdman index 4b37913615d58..5ded89b0cac00 100644 --- a/contrib/ntp/ntpd/ntpd.1ntpdman +++ b/contrib/ntp/ntpd/ntpd.1ntpdman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpd 1ntpdman "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpd 1ntpdman "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-YYaqWo/ag-.YaiVo) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:54 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -175,7 +175,7 @@ The name and path of the frequency file, by default. This is the same operation as the \fBdriftfile\fP \fIdriftfile\fP -configuration specification in the +configuration specification in the \fI/etc/ntp.conf\fP file. .TP @@ -196,6 +196,20 @@ See the \fBtinker\fP configuration file directive for other options. .TP +.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[] +Step any initial offset correction.. +.sp +Normally, +\fBntpd\fP +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the \fBtinker\fP configuration file directive for other options. +.TP .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[] Jail directory. .sp @@ -220,7 +234,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -\fBinterface\fP command, which is more versatile. +\fBinterface\fP command, which is more versatile. .TP .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[] path to symmetric keys. diff --git a/contrib/ntp/ntpd/ntpd.1ntpdmdoc b/contrib/ntp/ntpd/ntpd.1ntpdmdoc index 96d77e9fb0db8..14b38e40a8611 100644 --- a/contrib/ntp/ntpd/ntpd.1ntpdmdoc +++ b/contrib/ntp/ntpd/ntpd.1ntpdmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPD 1ntpdmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -144,7 +144,7 @@ The name and path of the frequency file, by default. This is the same operation as the \fBdriftfile\fP \fIdriftfile\fP -configuration specification in the +configuration specification in the \fI/etc/ntp.conf\fP file. .It Fl g , Fl \-panicgate @@ -163,6 +163,19 @@ options. See the \fBtinker\fP configuration file directive for other options. +.It Fl G , Fl \-force\-step\-once +Step any initial offset correction.. +.sp +Normally, +\fBntpd\fP +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the \fBtinker\fP configuration file directive for other options. .It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string Jail directory. .sp @@ -186,7 +199,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -\fBinterface\fP command, which is more versatile. +\fBinterface\fP command, which is more versatile. .It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string path to symmetric keys. .sp diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c index c017ef34d7db3..529e6ce1b0cc5 100644 --- a/contrib/ntp/ntpd/ntpd.c +++ b/contrib/ntp/ntpd/ntpd.c @@ -1262,6 +1262,7 @@ finish( if (mdns != NULL) DNSServiceRefDeallocate(mdns); # endif + peer_cleanup(); exit(0); } #endif /* !SIM && SIGDIE1 */ diff --git a/contrib/ntp/ntpd/ntpd.html b/contrib/ntp/ntpd/ntpd.html index fe00030dde2bc..8919ee90d241a 100644 --- a/contrib/ntp/ntpd/ntpd.html +++ b/contrib/ntp/ntpd/ntpd.html @@ -39,7 +39,7 @@ The program can operate in any of several modes, including client/server, symmetric and broadcast modes, and with both symmetric-key and public-key cryptography. - <p>This document applies to version 4.2.8p1 of <code>ntpd</code>. + <p>This document applies to version 4.2.8p2 of <code>ntpd</code>. <ul class="menu"> <li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description @@ -169,7 +169,8 @@ This software is released under the NTP license, <http://ntp.org/license>. <li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>: configfile option (-c) <li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>: driftfile option (-f) <li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>: panicgate option (-g) -<li><a accesskey="9" href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i) +<li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>: force-step-once option (-G) +<li><a href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i) <li><a href="#ntpd-interface">ntpd interface</a>: interface option (-I) <li><a href="#ntpd-keyfile">ntpd keyfile</a>: keyfile option (-k) <li><a href="#ntpd-logfile">ntpd logfile</a>: logfile option (-l) @@ -219,7 +220,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p1-RC2 +<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p2-RC3 Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \ [ <server1> ... <serverN> ] Flg Arg Option-Name Description @@ -240,6 +241,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]. -f Str driftfile frequency drift file name -g no panicgate Allow the first adjustment to be Big - may appear multiple times + -G no force-step-once Step any initial offset correction. -i Str jaildir Jail directory -I Str interface Listen on an interface name or address - may appear multiple times @@ -413,7 +415,7 @@ configuration specification in the file. <div class="node"> <p><hr> -<a name="ntpd-panicgate"></a>Next: <a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>, +<a name="ntpd-panicgate"></a>Next: <a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>, Previous: <a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>, Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <br> @@ -443,15 +445,37 @@ See the configuration file directive for other options. <div class="node"> <p><hr> -<a name="ntpd-jaildir"></a>Next: <a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>, +<a name="ntpd-force_002dstep_002donce"></a>Next: <a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>, Previous: <a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>, Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <br> </div> +<h4 class="subsection">force-step-once option (-G)</h4> + +<p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a> +This is the “step any initial offset correction.” option. +Normally, +<code>ntpd</code> +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the <code>tinker</code> configuration file directive for other options. +<div class="node"> +<p><hr> +<a name="ntpd-jaildir"></a>Next: <a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>, +Previous: <a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>, +Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> +<br> +</div> + <h4 class="subsection">jaildir option (-i)</h4> -<p><a name="index-ntpd_002djaildir-11"></a> +<p><a name="index-ntpd_002djaildir-12"></a> This is the “jail directory” option. This option takes a string argument. @@ -482,7 +506,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">interface option (-I)</h4> -<p><a name="index-ntpd_002dinterface-12"></a> +<p><a name="index-ntpd_002dinterface-13"></a> This is the “listen on an interface name or address” option. This option takes a string argument <span class="file">iface</span>. @@ -506,7 +530,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">keyfile option (-k)</h4> -<p><a name="index-ntpd_002dkeyfile-13"></a> +<p><a name="index-ntpd_002dkeyfile-14"></a> This is the “path to symmetric keys” option. This option takes a string argument. Specify the name and path of the symmetric key file. @@ -525,7 +549,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">logfile option (-l)</h4> -<p><a name="index-ntpd_002dlogfile-14"></a> +<p><a name="index-ntpd_002dlogfile-15"></a> This is the “path to the log file” option. This option takes a string argument. Specify the name and path of the log file. @@ -543,7 +567,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">novirtualips option (-L)</h4> -<p><a name="index-ntpd_002dnovirtualips-15"></a> +<p><a name="index-ntpd_002dnovirtualips-16"></a> This is the “do not listen to virtual interfaces” option. Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please @@ -559,7 +583,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">modifymmtimer option (-M)</h4> -<p><a name="index-ntpd_002dmodifymmtimer-16"></a> +<p><a name="index-ntpd_002dmodifymmtimer-17"></a> This is the “modify multimedia timer (windows only)” option. <p class="noindent">This option has some usage constraints. It: @@ -580,7 +604,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">nice option (-N)</h4> -<p><a name="index-ntpd_002dnice-17"></a> +<p><a name="index-ntpd_002dnice-18"></a> This is the “run at high priority” option. To the extent permitted by the operating system, run <code>ntpd</code> @@ -595,7 +619,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">pidfile option (-p)</h4> -<p><a name="index-ntpd_002dpidfile-18"></a> +<p><a name="index-ntpd_002dpidfile-19"></a> This is the “path to the pid file” option. This option takes a string argument. Specify the name and path of the file used to record @@ -614,7 +638,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">priority option (-P)</h4> -<p><a name="index-ntpd_002dpriority-19"></a> +<p><a name="index-ntpd_002dpriority-20"></a> This is the “process priority” option. This option takes a number argument. To the extent permitted by the operating system, run @@ -632,7 +656,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">quit option (-q)</h4> -<p><a name="index-ntpd_002dquit-20"></a> +<p><a name="index-ntpd_002dquit-21"></a> This is the “set the time and quit” option. <p class="noindent">This option has some usage constraints. It: @@ -662,7 +686,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">propagationdelay option (-r)</h4> -<p><a name="index-ntpd_002dpropagationdelay-21"></a> +<p><a name="index-ntpd_002dpropagationdelay-22"></a> This is the “broadcast/propagation delay” option. This option takes a string argument. Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol. @@ -676,7 +700,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">saveconfigquit option</h4> -<p><a name="index-ntpd_002dsaveconfigquit-22"></a> +<p><a name="index-ntpd_002dsaveconfigquit-23"></a> This is the “save parsed configuration and quit” option. This option takes a string argument. @@ -700,7 +724,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">statsdir option (-s)</h4> -<p><a name="index-ntpd_002dstatsdir-23"></a> +<p><a name="index-ntpd_002dstatsdir-24"></a> This is the “statistics file location” option. This option takes a string argument. Specify the directory path for files created by the statistics facility. @@ -717,7 +741,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">trustedkey option (-t)</h4> -<p><a name="index-ntpd_002dtrustedkey-24"></a> +<p><a name="index-ntpd_002dtrustedkey-25"></a> This is the “trusted key number” option. This option takes a string argument <span class="file">tkey</span>. @@ -737,7 +761,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">user option (-u)</h4> -<p><a name="index-ntpd_002duser-25"></a> +<p><a name="index-ntpd_002duser-26"></a> This is the “run as userid (or userid:groupid)” option. This option takes a string argument. @@ -762,7 +786,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">updateinterval option (-U)</h4> -<p><a name="index-ntpd_002dupdateinterval-26"></a> +<p><a name="index-ntpd_002dupdateinterval-27"></a> This is the “interval in seconds between scans for new or dropped interfaces” option. This option takes a number argument. Give the time in seconds between two scans for new or dropped interfaces. @@ -779,7 +803,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">wait-sync option (-w)</h4> -<p><a name="index-ntpd_002dwait_002dsync-27"></a> +<p><a name="index-ntpd_002dwait_002dsync-28"></a> This is the “seconds to wait for first clock sync” option. This option takes a number argument. @@ -808,7 +832,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">slew option (-x)</h4> -<p><a name="index-ntpd_002dslew-28"></a> +<p><a name="index-ntpd_002dslew-29"></a> This is the “slew up to 600 seconds” option. Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. @@ -833,7 +857,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">usepcc option</h4> -<p><a name="index-ntpd_002dusepcc-29"></a> +<p><a name="index-ntpd_002dusepcc-30"></a> This is the “use cpu cycle counter (windows only)” option. <p class="noindent">This option has some usage constraints. It: @@ -855,7 +879,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">pccfreq option</h4> -<p><a name="index-ntpd_002dpccfreq-30"></a> +<p><a name="index-ntpd_002dpccfreq-31"></a> This is the “force cpu cycle counter use (windows only)” option. This option takes a string argument. @@ -877,7 +901,7 @@ Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a> <h4 class="subsection">mdns option (-m)</h4> -<p><a name="index-ntpd_002dmdns-31"></a> +<p><a name="index-ntpd_002dmdns-32"></a> This is the “register with mdns as a ntp server” option. <p class="noindent">This option has some usage constraints. It: diff --git a/contrib/ntp/ntpd/ntpd.man.in b/contrib/ntp/ntpd/ntpd.man.in index a5403086ae839..d9497a3ec46ce 100644 --- a/contrib/ntp/ntpd/ntpd.man.in +++ b/contrib/ntp/ntpd/ntpd.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpd @NTPD_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpd @NTPD_MS@ "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-YYaqWo/ag-.YaiVo) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:41:54 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -175,7 +175,7 @@ The name and path of the frequency file, by default. This is the same operation as the \fBdriftfile\fP \fIdriftfile\fP -configuration specification in the +configuration specification in the \fI/etc/ntp.conf\fP file. .TP @@ -196,6 +196,20 @@ See the \fBtinker\fP configuration file directive for other options. .TP +.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[] +Step any initial offset correction.. +.sp +Normally, +\fBntpd\fP +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the \fBtinker\fP configuration file directive for other options. +.TP .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[] Jail directory. .sp @@ -220,7 +234,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -\fBinterface\fP command, which is more versatile. +\fBinterface\fP command, which is more versatile. .TP .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[] path to symmetric keys. diff --git a/contrib/ntp/ntpd/ntpd.mdoc.in b/contrib/ntp/ntpd/ntpd.mdoc.in index 3017dc8d54d4e..4458532848871 100644 --- a/contrib/ntp/ntpd/ntpd.mdoc.in +++ b/contrib/ntp/ntpd/ntpd.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPD @NTPD_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -144,7 +144,7 @@ The name and path of the frequency file, by default. This is the same operation as the \fBdriftfile\fP \fIdriftfile\fP -configuration specification in the +configuration specification in the \fI/etc/ntp.conf\fP file. .It Fl g , Fl \-panicgate @@ -163,6 +163,19 @@ options. See the \fBtinker\fP configuration file directive for other options. +.It Fl G , Fl \-force\-step\-once +Step any initial offset correction.. +.sp +Normally, +\fBntpd\fP +steps the time if the time offset exceeds the step threshold, +which is 128 ms by default, and otherwise slews the time. +This option forces the initial offset correction to be stepped, +so the highest time accuracy can be achieved quickly. +However, this may also cause the time to be stepped back +so this option must not be used if +applications requiring monotonic time are running. +See the \fBtinker\fP configuration file directive for other options. .It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string Jail directory. .sp @@ -186,7 +199,7 @@ Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file -\fBinterface\fP command, which is more versatile. +\fBinterface\fP command, which is more versatile. .It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string path to symmetric keys. .sp diff --git a/contrib/ntp/ntpd/ntpdbase-opts.def b/contrib/ntp/ntpd/ntpdbase-opts.def index 110504e5c0766..66b953528c7a2 100644 --- a/contrib/ntp/ntpd/ntpdbase-opts.def +++ b/contrib/ntp/ntpd/ntpdbase-opts.def @@ -87,7 +87,7 @@ flag = { by default. This is the same operation as the @code{driftfile} @kbd{driftfile} - configuration specification in the + configuration specification in the @file{/etc/ntp.conf} file. _EndOfDoc_; @@ -115,6 +115,24 @@ flag = { }; flag = { + name = force_step_once; + value = G; + descrip = "Step any initial offset correction."; + doc = <<- _EndOfDoc_ + Normally, + @code{ntpd} + steps the time if the time offset exceeds the step threshold, + which is 128 ms by default, and otherwise slews the time. + This option forces the initial offset correction to be stepped, + so the highest time accuracy can be achieved quickly. + However, this may also cause the time to be stepped back + so this option must not be used if + applications requiring monotonic time are running. + See the @code{tinker} configuration file directive for other options. + _EndOfDoc_; +}; + +flag = { ifdef = HAVE_DROPROOT; name = jaildir; value = i; @@ -150,7 +168,7 @@ flag = { given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file - @code{interface} command, which is more versatile. + @code{interface} command, which is more versatile. _EndOfDoc_; }; diff --git a/contrib/ntp/ntpd/refclock_palisade.c b/contrib/ntp/ntpd/refclock_palisade.c index 2b396d8a51a19..0520311d1bc7a 100644 --- a/contrib/ntp/ntpd/refclock_palisade.c +++ b/contrib/ntp/ntpd/refclock_palisade.c @@ -584,7 +584,10 @@ TSIP_decode ( break; } - if (up->leap_status & PALISADE_LEAP_PENDING) { + up->month = mb(15); + if ( (up->leap_status & PALISADE_LEAP_PENDING) && + /* Avoid early announce: https://bugs.ntp.org/2773 */ + (6 == up->month || 12 == up->month) ) { if (up->leap_status & PALISADE_UTC_TIME) pp->leap = LEAP_ADDSECOND; else @@ -615,6 +618,7 @@ TSIP_decode ( pp->hour = mb(11); pp->minute = mb(12); pp->second = mb(13); + up->month = mb(14); /* Save for LEAP check */ #ifdef DEBUG if (debug > 1) @@ -645,7 +649,9 @@ TSIP_decode ( printf("TSIP_decode: unit %d\n", up->unit); } #endif - if (getint((u_char *) &mb(10)) & 0x80) + if ( (getint((u_char *) &mb(10)) & 0x80) && + /* Avoid early announce: https://bugs.ntp.org/2773 */ + (6 == up->month || 12 == up->month) ) pp->leap = LEAP_ADDSECOND; /* we ASSUME addsecond */ else pp->leap = LEAP_NOWARNING; diff --git a/contrib/ntp/ntpd/refclock_palisade.h b/contrib/ntp/ntpd/refclock_palisade.h index 4f1ab266eef34..3782a5eb92c77 100644 --- a/contrib/ntp/ntpd/refclock_palisade.h +++ b/contrib/ntp/ntpd/refclock_palisade.h @@ -169,6 +169,7 @@ struct palisade_unit { short rpt_cnt; /* TSIP packet length so far */ char rpt_buf[BMAX]; /* packet assembly buffer */ int type; /* Clock mode type */ + int month; /* for LEAP filter */ }; /* diff --git a/contrib/ntp/ntpd/refclock_parse.c b/contrib/ntp/ntpd/refclock_parse.c index aa4be6063c1d1..195ec39cb4f05 100644 --- a/contrib/ntp/ntpd/refclock_parse.c +++ b/contrib/ntp/ntpd/refclock_parse.c @@ -54,36 +54,36 @@ /* * This driver currently provides the support for - * - Meinberg receiver DCF77 PZF 535 (TCXO version) (DCF) - * - Meinberg receiver DCF77 PZF 535 (OCXO version) (DCF) - * - Meinberg receiver DCF77 PZF 509 (DCF) + * - Meinberg receiver DCF77 PZF535 (TCXO version) (DCF) + * - Meinberg receiver DCF77 PZF535 (OCXO version) (DCF) + * - Meinberg receiver DCF77 PZF509 (DCF) * - Meinberg receiver DCF77 AM receivers (e.g. C51) (DCF) * - IGEL CLOCK (DCF) * - ELV DCF7000 (DCF) * - Schmid clock (DCF) * - Conrad DCF77 receiver module (DCF) * - FAU DCF77 NTP receiver (TimeBrick) (DCF) - * - WHARTON 400A Series clock (DCF) + * - WHARTON 400A Series clock (DCF) * - * - Meinberg GPS166/GPS167 (GPS) + * - Meinberg GPS receivers (GPS) * - Trimble (TSIP and TAIP protocol) (GPS) * * - RCC8000 MSF Receiver (MSF) - * - VARITEXT clock (MSF) + * - VARITEXT clock (MSF) */ /* * Meinberg receivers are usually connected via a - * 9600 baud serial line + * 9600/7E1 or 19200/8N1 serial line. * * The Meinberg GPS receivers also have a special NTP time stamp * format. The firmware release is Uni-Erlangen. * * Meinberg generic receiver setup: - * output time code every second - * Baud rate 9600 7E2S + * output time code every second + * Baud rate 9600 7E2S * - * Meinberg GPS16x setup: + * Meinberg GPS receiver setup: * output time code every second * Baudrate 19200 8N1 * @@ -91,7 +91,9 @@ * in Meinberg receivers. * * Special software versions are only sensible for the - * GPS 16x family of receivers. + * oldest GPS receiver, GPS16x. For newer receiver types + * the output string format can be configured at the device, + * and the device name is generally GPSxxx instead of GPS16x. * * Meinberg can be reached via: http://www.meinberg.de/ */ @@ -156,13 +158,13 @@ # endif #endif -#define BUFFER_SIZE(_BUF, _PTR) ((_BUF) + sizeof(_BUF) - (_PTR)) -#define BUFFER_SIZES(_BUF, _PTR, _SZ) ((_BUF) + (_SZ) - (_PTR)) +# define BUFFER_SIZE(_BUF, _PTR) ((int)((_BUF) + sizeof(_BUF) - (_PTR))) +# define BUFFER_SIZES(_BUF, _PTR, _SZ) ((int)((_BUF) + (_SZ) - (_PTR))) /* * document type of PPS interfacing - copy of ifdef mechanism in local_input() */ -#undef PPS_METHOD +#undef PPS_METHOD #ifdef HAVE_PPSAPI #define PPS_METHOD "PPS API" @@ -181,6 +183,18 @@ #endif /* TIOCDCDTIMESTAMP */ #endif /* HAVE_PPSAPI */ +/* + * COND_DEF can be conditionally defined as DEF or 0. If defined as DEF + * then some more parse-specific variables are flagged to be printed with + * "ntpq -c cv <assid>". This can be lengthy, so by default COND_DEF + * should be defined as 0. + */ +#if 0 +# define COND_DEF DEF // enable this for testing +#else +# define COND_DEF 0 // enable this by default +#endif + #include "ntp_io.h" #include "ntp_stdlib.h" @@ -382,7 +396,7 @@ struct parseunit * PARSE io */ bind_t *binding; /* io handling binding */ - + /* * parse state */ @@ -450,23 +464,23 @@ typedef struct poll_info #define DCF_P_ID "DCFp" /* psuedo random phase shift */ #define GPS_ID "GPS" /* GPS receiver */ -#define NOCLOCK_ROOTDELAY 0.0 -#define NOCLOCK_BASEDELAY 0.0 -#define NOCLOCK_DESCRIPTION 0 +#define NOCLOCK_ROOTDELAY 0.0 +#define NOCLOCK_BASEDELAY 0.0 +#define NOCLOCK_DESCRIPTION 0 #define NOCLOCK_MAXUNSYNC 0 #define NOCLOCK_CFLAG 0 #define NOCLOCK_IFLAG 0 #define NOCLOCK_OFLAG 0 #define NOCLOCK_LFLAG 0 -#define NOCLOCK_ID "TILT" -#define NOCLOCK_POLL NO_POLL -#define NOCLOCK_INIT NO_INIT -#define NOCLOCK_END NO_END -#define NOCLOCK_DATA NO_LCLDATA -#define NOCLOCK_FORMAT "" -#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC -#define NOCLOCK_SAMPLES 0 -#define NOCLOCK_KEEP 0 +#define NOCLOCK_ID "TILT" +#define NOCLOCK_POLL NO_POLL +#define NOCLOCK_INIT NO_INIT +#define NOCLOCK_END NO_END +#define NOCLOCK_DATA NO_LCLDATA +#define NOCLOCK_FORMAT "" +#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC +#define NOCLOCK_SAMPLES 0 +#define NOCLOCK_KEEP 0 #define DCF_TYPE CTL_SST_TS_LF #define GPS_TYPE CTL_SST_TS_UHF @@ -536,14 +550,14 @@ typedef struct poll_info #define DCFPZF535OCXO_FORMAT "Meinberg Standard" /* - * Meinberg GPS16X receiver + * Meinberg GPS receivers */ static void gps16x_message (struct parseunit *, parsetime_t *); static int gps16x_poll_init (struct parseunit *); #define GPS16X_ROOTDELAY 0.0 /* nothing here */ #define GPS16X_BASEDELAY 0.001968 /* XXX to be fixed ! 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */ -#define GPS16X_DESCRIPTION "Meinberg GPS16x receiver" +#define GPS16X_DESCRIPTION "Meinberg GPS receiver" #define GPS16X_MAXUNSYNC 60*60*96 /* only trust clock for 4 days * @ 5e-9df/f we have accumulated * at most an error of 1.73 ms @@ -745,9 +759,9 @@ static void trimbletsip_event (struct parseunit *, int); #define TRIMBLETAIP_INIT trimbletaip_init #define TRIMBLETSIP_INIT trimbletsip_init -#define TRIMBLETAIP_EVENT trimbletaip_event +#define TRIMBLETAIP_EVENT trimbletaip_event -#define TRIMBLETSIP_EVENT trimbletsip_event +#define TRIMBLETSIP_EVENT trimbletsip_event #define TRIMBLETSIP_MESSAGE trimbletsip_message #define TRIMBLETAIP_END 0 @@ -804,7 +818,7 @@ static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE } #define RCC8000_KEEP 3 /* - * Hopf Radio clock 6021 Format + * Hopf Radio clock 6021 Format * */ #define HOPF6021_ROOTDELAY 0.0 @@ -1200,7 +1214,7 @@ static struct parse_clockinfo }, { /* mode 12 */ HOPF6021_FLAGS, - NO_POLL, + NO_POLL, NO_INIT, NO_EVENT, NO_END, @@ -1576,7 +1590,7 @@ list_err( if (do_it) err->err_cnt++; - + if (err->err_stage->err_count && (err->err_cnt >= err->err_stage->err_count)) { @@ -1600,7 +1614,7 @@ list_err( l_mktime(current_time - err->err_started)); err->err_suppressed = 0; } - + return do_it; } @@ -1715,7 +1729,7 @@ static int stream_setfmt (struct parseunit *, parsectl_t *); static int stream_timecode (struct parseunit *, parsectl_t *); static void stream_receive (struct recvbuf *); #endif - + static int local_init (struct parseunit *); static void local_end (struct parseunit *); static int local_nop (struct parseunit *); @@ -1796,7 +1810,7 @@ ppsclock_init( { static char m1[] = "ppsclocd"; static char m2[] = "ppsclock"; - + /* * now push the parse streams module * it will ensure exclusive access to the device @@ -1885,7 +1899,7 @@ stream_setcs( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_SETCS; strioc.ic_timout = 0; strioc.ic_dp = (char *)tcl; @@ -1908,7 +1922,7 @@ stream_enable( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_ENABLE; strioc.ic_timout = 0; strioc.ic_dp = (char *)0; @@ -1932,7 +1946,7 @@ stream_disable( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_DISABLE; strioc.ic_timout = 0; strioc.ic_dp = (char *)0; @@ -1957,7 +1971,7 @@ stream_getfmt( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_GETFMT; strioc.ic_timout = 0; strioc.ic_dp = (char *)tcl; @@ -1980,7 +1994,7 @@ stream_setfmt( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_SETFMT; strioc.ic_timout = 0; strioc.ic_dp = (char *)tcl; @@ -2005,12 +2019,12 @@ stream_timecode( ) { struct strioctl strioc; - + strioc.ic_cmd = PARSEIOC_TIMECODE; strioc.ic_timout = 0; strioc.ic_dp = (char *)tcl; strioc.ic_len = sizeof (*tcl); - + if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1) { ERR(ERR_INTERNAL) @@ -2045,7 +2059,7 @@ stream_receive( return; } clear_err(parse, ERR_BADIO); - + memmove((caddr_t)&parsetime, (caddr_t)rbufp->recv_buffer, sizeof(parsetime_t)); @@ -2211,7 +2225,7 @@ local_input( { struct timespec pps_timeout; pps_info_t pps_info; - + pps_timeout.tv_sec = 0; pps_timeout.tv_nsec = 0; @@ -2232,9 +2246,9 @@ local_input( else pts = pps_info.assert_timestamp; - parse->parseio.parse_dtime.parse_ptime.fp.l_ui = pts.tv_sec + JAN_1970; + parse->parseio.parse_dtime.parse_ptime.fp.l_ui = (uint32_t) (pts.tv_sec + JAN_1970); - dtemp = pts.tv_nsec / 1e9; + dtemp = (double) pts.tv_nsec / 1e9; if (dtemp < 0.) { dtemp += 1; parse->parseio.parse_dtime.parse_ptime.fp.l_ui--; @@ -2243,9 +2257,9 @@ local_input( dtemp -= 1; parse->parseio.parse_dtime.parse_ptime.fp.l_ui++; } - parse->parseio.parse_dtime.parse_ptime.fp.l_uf = dtemp * FRAC; + parse->parseio.parse_dtime.parse_ptime.fp.l_uf = (uint32_t)(dtemp * FRAC); - parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; + parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; #ifdef DEBUG if (debug > 3) { @@ -2287,11 +2301,11 @@ local_input( #else #ifdef TIOCDCDTIMESTAMP struct timeval dcd_time; - + if (ioctl(parse->ppsfd, TIOCDCDTIMESTAMP, &dcd_time) != -1) { l_fp tstmp; - + TVTOTS(&dcd_time, &tstmp); tstmp.l_ui += JAN_1970; L_SUB(&ts.fp, &tstmp); @@ -2413,7 +2427,7 @@ local_receive( return; } clear_err(parse, ERR_BADIO); - + memmove((caddr_t)&parsetime, (caddr_t)rbufp->recv_buffer, sizeof(parsetime_t)); @@ -2511,7 +2525,7 @@ parsestate( { PARSEB_LEAPADD, "LEAP ADD WARNING" }, { PARSEB_LEAPDEL, "LEAP DELETE WARNING" }, { PARSEB_LEAPSECOND, "LEAP SECOND" }, - { PARSEB_ALTERNATE, "ALTERNATE ANTENNA" }, + { PARSEB_CALLBIT, "CALL BIT" }, { PARSEB_TIMECODE, "TIME CODE" }, { PARSEB_PPS, "PPS" }, { PARSEB_POSITION, "POSITION" }, @@ -2566,7 +2580,7 @@ parsestate( { t = ap(buffer, size, t, "; "); } - + t = ap(buffer, size, t, "%s", sflagstrings[i].name); } @@ -2808,7 +2822,7 @@ parse_shutdown( { parse->parse_type->cl_end(parse); } - + /* * cleanup before leaving this world */ @@ -2821,7 +2835,7 @@ parse_shutdown( io_closeclock(&parse->generic->io); free_varlist(parse->kv); - + NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */ msyslog(LOG_INFO, "PARSE receiver #%d: reference clock \"%s\" removed", CLK_UNIT(parse->peer), parse->parse_type->cl_description); @@ -2847,14 +2861,14 @@ parse_hardpps( if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) { int i = 0; - if (mode == PARSE_HARDPPS_ENABLE) + if (mode == PARSE_HARDPPS_ENABLE) { if (parse->flags & PARSE_CLEAR) i = PPS_CAPTURECLEAR; else i = PPS_CAPTUREASSERT; } - + if (time_pps_kcbind(parse->atom.handle, PPS_KC_HARDPPS, i, PPS_TSFMT_TSPEC) < 0) { msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m", @@ -2884,8 +2898,8 @@ parse_ppsapi( { int cap, mode_ppsoffset; const char *cp; - - parse->flags &= ~PARSE_PPSCLOCK; + + parse->flags &= (u_char) (~PARSE_PPSCLOCK); /* * collect PPSAPI offset capability - should move into generic handling @@ -2893,7 +2907,7 @@ parse_ppsapi( if (time_pps_getcap(parse->atom.handle, &cap) < 0) { msyslog(LOG_ERR, "PARSE receiver #%d: parse_ppsapi: time_pps_getcap failed: %m", CLK_UNIT(parse->peer)); - + return 0; } @@ -2927,19 +2941,19 @@ parse_ppsapi( CLK_UNIT(parse->peer), cp, cap); mode_ppsoffset = 0; } else { - if (mode_ppsoffset == PPS_OFFSETCLEAR) - { - parse->atom.pps_params.clear_offset.tv_sec = -parse->ppsphaseadjust; - parse->atom.pps_params.clear_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust); + if (mode_ppsoffset == PPS_OFFSETCLEAR) + { + parse->atom.pps_params.clear_offset.tv_sec = (time_t)(-parse->ppsphaseadjust); + parse->atom.pps_params.clear_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust)); } - + if (mode_ppsoffset == PPS_OFFSETASSERT) - { - parse->atom.pps_params.assert_offset.tv_sec = -parse->ppsphaseadjust; - parse->atom.pps_params.assert_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust); + { + parse->atom.pps_params.assert_offset.tv_sec = (time_t)(-parse->ppsphaseadjust); + parse->atom.pps_params.assert_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust)); } } - + parse->atom.pps_params.mode |= mode_ppsoffset; if (time_pps_setparams(parse->atom.handle, &parse->atom.pps_params) < 0) { @@ -3043,9 +3057,9 @@ parse_start( parse->kv = (struct ctl_var *)0; clear_err(parse, ERR_ALL); - + parse->parse_type = &parse_clockinfo[type]; - + parse->maxunsync = parse->parse_type->cl_maxunsync; parse->generic->fudgetime1 = parse->parse_type->cl_basedelay; @@ -3058,16 +3072,16 @@ parse_start( peer->rootdelay = parse->parse_type->cl_rootdelay; peer->sstclktype = parse->parse_type->cl_type; peer->precision = sys_precision; - + peer->stratum = STRATUM_REFCLOCK; if (peer->stratum <= 1) memmove((char *)&parse->generic->refid, parse->parse_type->cl_id, 4); else parse->generic->refid = htonl(PARSEHSREFID); - + parse->generic->io.fd = fd232; - + parse->peer = peer; /* marks it also as busy */ /* @@ -3110,15 +3124,15 @@ parse_start( } #endif - tio.c_cflag = parse_clockinfo[type].cl_cflag; - tio.c_iflag = parse_clockinfo[type].cl_iflag; - tio.c_oflag = parse_clockinfo[type].cl_oflag; - tio.c_lflag = parse_clockinfo[type].cl_lflag; - + tio.c_cflag = (tcflag_t) parse_clockinfo[type].cl_cflag; + tio.c_iflag = (tcflag_t) parse_clockinfo[type].cl_iflag; + tio.c_oflag = (tcflag_t) parse_clockinfo[type].cl_oflag; + tio.c_lflag = (tcflag_t) parse_clockinfo[type].cl_lflag; + #ifdef HAVE_TERMIOS - if ((cfsetospeed(&tio, parse_clockinfo[type].cl_speed) == -1) || - (cfsetispeed(&tio, parse_clockinfo[type].cl_speed) == -1)) + if ((cfsetospeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1) || + (cfsetispeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1)) { msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcset{i,o}speed(&tio, speed): %m", unit); parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */ @@ -3178,7 +3192,7 @@ parse_start( if (CLK_PPS(parse->peer)) { int i = 1; - + if (ioctl(parse->ppsfd, TIOCSPPS, (caddr_t)&i) == 0) { parse->flags |= PARSE_PPSCLOCK; @@ -3217,7 +3231,7 @@ parse_start( */ parse->generic->io.srcclock = peer; parse->generic->io.datalen = 0; - + parse->binding = init_iobinding(parse); if (parse->binding == (bind_t *)0) @@ -3263,9 +3277,9 @@ parse_start( parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */ return 0; /* well, ok - special initialisation broke */ } - + strlcpy(tmp_ctl.parseformat.parse_buffer, parse->parse_type->cl_format, sizeof(tmp_ctl.parseformat.parse_buffer)); - tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer); + tmp_ctl.parseformat.parse_count = (u_short) strlen(tmp_ctl.parseformat.parse_buffer); if (!PARSE_SETFMT(parse, &tmp_ctl)) { @@ -3273,7 +3287,7 @@ parse_start( parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */ return 0; /* well, ok - special initialisation broke */ } - + /* * get rid of all IO accumulated so far */ @@ -3300,7 +3314,7 @@ parse_start( return 0; /* well, ok - special initialisation broke */ } } - + /* * Insert in async io device list. */ @@ -3365,8 +3379,8 @@ parse_ctl( { if (in->haveflags & (CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4)) { - parse->flags = (parse->flags & ~(CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4)) | - (in->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4)); + u_char mask = CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4; + parse->flags = (parse->flags & (u_char)(~mask)) | (in->flags & mask); #if defined(HAVE_PPSAPI) if (CLK_PPS(parse->peer)) { @@ -3374,7 +3388,7 @@ parse_ctl( } #endif } - + if (in->haveflags & CLK_HAVETIME1) { parse->generic->fudgetime1 = in->fudgetime1; @@ -3382,11 +3396,11 @@ parse_ctl( CLK_UNIT(parse->peer), parse->generic->fudgetime1); } - + if (in->haveflags & CLK_HAVETIME2) { parse->generic->fudgetime2 = in->fudgetime2; - if (parse->flags & PARSE_TRUSTTIME) + if (parse->flags & PARSE_TRUSTTIME) { parse->maxunsync = (u_long)ABS(in->fudgetime2); msyslog(LOG_INFO, "PARSE receiver #%d: new trust time %s", @@ -3434,7 +3448,7 @@ parse_poll( */ parse->generic->polls++; - if (parse->pollneeddata && + if (parse->pollneeddata && ((int)(current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll))))) { /* @@ -3443,7 +3457,7 @@ parse_poll( */ parse->lastmissed = current_time; parse_event(parse, CEVNT_TIMEOUT); - + ERR(ERR_NODATA) msyslog(LOG_WARNING, "PARSE receiver #%d: no data from device within poll interval (check receiver / wiring)", CLK_UNIT(parse->peer)); } @@ -3501,7 +3515,7 @@ parse_control( * handle changes */ parse_ctl(parse, in); - + /* * supply data */ @@ -3587,9 +3601,9 @@ parse_control( tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count)); } - + tmpctl.parseformat.parse_format = tmpctl.parsegettc.parse_format; - + if (!PARSE_GETFMT(parse, &tmpctl)) { ERR(ERR_INTERNAL) @@ -3603,7 +3617,7 @@ parse_control( tt = ap(start, 80, tt, "refclock_format=\""); if (count > 0) { - tt = ap(start, 80, tt, "%*.*s", + tt = ap(start, 80, tt, "%*.*s", count, count, tmpctl.parseformat.parse_buffer); @@ -3632,7 +3646,7 @@ parse_control( percent /= 10; d /= 10; } - + if (d) percent = (percent * 10000) / d; else @@ -3642,14 +3656,14 @@ parse_control( { char item[80]; int count; - + snprintf(item, 80, "%s%s%s: %s (%d.%02d%%)", sum ? "; " : "", (parse->generic->currentstatus == i) ? "*" : "", clockstatus((unsigned int)i), l_mktime(s_time), (int)(percent / 100), (int)(percent % 100)); - if ((count = strlen(item)) < (LEN_STATES - 40 - (tt - start))) + if ((count = (int) strlen(item)) < (LEN_STATES - 40 - (tt - start))) { tt = ap(start, LEN_STATES, tt, "%s", item); @@ -3657,22 +3671,22 @@ parse_control( sum += s_time; } } - + tt = ap(start, LEN_STATES, tt, "; running time: %s\"", l_mktime(sum)); - + tt = add_var(&out->kv_list, 32, RO); snprintf(tt, 32, "refclock_id=\"%s\"", parse->parse_type->cl_id); - + tt = add_var(&out->kv_list, 80, RO); snprintf(tt, 80, "refclock_iomode=\"%s\"", parse->binding->bd_description); tt = add_var(&out->kv_list, 128, RO); snprintf(tt, 128, "refclock_driver_version=\"%s\"", rcsid); - + { struct ctl_var *k; - + k = parse->kv; while (k && !(k->flags & EOV)) { @@ -3680,8 +3694,8 @@ parse_control( k++; } } - - out->lencode = strlen(outstatus); + + out->lencode = (u_short) strlen(outstatus); out->p_lastcode = outstatus; } } @@ -3730,7 +3744,7 @@ parse_process( { l_fp off, rectime, reftime; double fudge; - + /* silence warning: 'off.Ul_i.Xl_i' may be used uninitialized in this function */ ZERO(off); @@ -3743,11 +3757,11 @@ parse_process( (parse->timedata.parse_status != parsetime->parse_status)) { char buffer[400]; - + NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */ msyslog(LOG_WARNING, "PARSE receiver #%d: conversion status \"%s\"", CLK_UNIT(parse->peer), parsestatus(parsetime->parse_status, buffer, sizeof(buffer))); - + if ((parsetime->parse_status & CVT_MASK) == CVT_FAIL) { /* @@ -3756,7 +3770,7 @@ parse_process( * the time code might be overwritten by the next packet */ parsectl_t tmpctl; - + if (!PARSE_GETTIMECODE(parse, &tmpctl)) { ERR(ERR_INTERNAL) @@ -3794,7 +3808,7 @@ parse_process( parse->timedata.parse_ptime = parsetime->parse_ptime; } break; /* well, still waiting - timeout is handled at higher levels */ - + case CVT_FAIL: if (parsetime->parse_status & CVT_BADFMT) { @@ -3825,7 +3839,7 @@ parse_process( if (parse->lastformat != parsetime->parse_format) { parsectl_t tmpctl; - + tmpctl.parseformat.parse_format = parsetime->parse_format; if (!PARSE_GETFMT(parse, &tmpctl)) @@ -3853,10 +3867,10 @@ parse_process( /* * something happend - except for PPS events */ - + (void) parsestate(parsetime->parse_state, tmp1, sizeof(tmp1)); (void) parsestate(parse->timedata.parse_state, tmp2, sizeof(tmp2)); - + NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */ msyslog(LOG_INFO,"PARSE receiver #%d: STATE CHANGE: %s -> %s", CLK_UNIT(parse->peer), tmp2, tmp1); @@ -3959,12 +3973,12 @@ parse_process( } fudge = parse->generic->fudgetime1; /* standard RS232 Fudgefactor */ - + if (PARSE_TIMECODE(parsetime->parse_state)) { rectime = parsetime->parse_stime.fp; off = reftime = parsetime->parse_time.fp; - + L_SUB(&off, &rectime); /* prepare for PPS adjustments logic */ #ifdef DEBUG @@ -4009,7 +4023,7 @@ parse_process( M_ISGEQ(0, 0x7fffffff, off.l_i, off.l_uf)) { fudge = ppsphaseadjust; /* pick PPS fudge factor */ - + /* * RS232 offsets within [-0.5..0.5[ - take PPS offsets */ @@ -4021,7 +4035,7 @@ parse_process( reftime.l_ui++; reftime.l_uf = 0; - + /* * implied on second offset */ @@ -4087,7 +4101,7 @@ parse_process( rectime = reftime; L_SUB(&rectime, &off); /* just to keep the ntp interface happy */ - + #ifdef DEBUG if (debug > 3) printf("PARSE receiver #%d: calculated Reftime %s, Recvtime %s\n", @@ -4112,14 +4126,14 @@ parse_process( clear_err(parse, ERR_BADDATA); clear_err(parse, ERR_NODATA); clear_err(parse, ERR_INTERNAL); - + /* * and now stick it into the clock machine * samples are only valid iff lastsync is not too old and * we have seen the clock in sync at least once * after the last time we didn't see an expected data telegram * at startup being not in sync is also bad just like - * POWERUP state unless PARSE_F_POWERUPTRUST is set + * POWERUP state unless PARSE_F_POWERUPTRUST is set * see the clock states section above for more reasoning */ if (((current_time - parse->lastsync) > parse->maxunsync) || @@ -4159,9 +4173,9 @@ parse_process( * only good/trusted samples are interesting */ #ifdef DEBUG - if (debug > 2) - { - printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n", + if (debug > 2) + { + printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n", CLK_UNIT(parse->peer), prettydate(&reftime), prettydate(&rectime), @@ -4169,7 +4183,7 @@ parse_process( } #endif parse->generic->lastref = reftime; - + refclock_process_offset(parse->generic, reftime, rectime, fudge); #ifdef HAVE_PPSAPI @@ -4177,18 +4191,18 @@ parse_process( * pass PPS information on to PPS clock */ if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer)) - { - parse->peer->flags |= FLAG_PPS; + { + parse->peer->flags |= (FLAG_PPS | FLAG_TSTAMP_PPS); parse_hardpps(parse, PARSE_HARDPPS_ENABLE); } #endif } else { - parse_hardpps(parse, PARSE_HARDPPS_DISABLE); - parse->peer->flags &= ~FLAG_PPS; + parse_hardpps(parse, PARSE_HARDPPS_DISABLE); + parse->peer->flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS); } /* - * ready, unless the machine wants a sample or + * ready, unless the machine wants a sample or * we are in fast startup mode (peer->dist > MAXDISTANCE) */ if (!parse->pollneeddata && parse->peer->disp <= MAXDISTANCE) @@ -4200,56 +4214,71 @@ parse_process( refclock_receive(parse->peer); } - + /**=========================================================================== ** special code for special clocks **/ static void mk_utcinfo( - char *t, + char *t, // pointer to the output string buffer int wnt, int wnlsf, int dn, int dtls, int dtlsf, - int size + int size // size of the output string buffer ) { - l_fp leapdate; - char *start = t; - - snprintf(t, size, "current correction %d sec", dtls); - t += strlen(t); - - if (wnlsf < 990) - wnlsf += 1024; - - if (wnt < 990) - wnt += 1024; - - gpstolfp((unsigned short)wnlsf, (unsigned short)dn, 0, &leapdate); - - if ((dtlsf != dtls) && - ((wnlsf - wnt) < 52)) - { - snprintf(t, BUFFER_SIZES(start, t, size), ", next correction %d sec on %s, new GPS-UTC offset %d", - dtlsf - dtls, gmprettydate(&leapdate), dtlsf); - } - else - { - snprintf(t, BUFFER_SIZES(start, t, size), ", last correction on %s", - gmprettydate(&leapdate)); - } + /* + * The week number transmitted by the GPS satellites for the leap date + * is truncated to 8 bits only. If the nearest leap second date is off + * the current date by more than +/- 128 weeks then conversion to a + * calendar date is ambiguous. On the other hand, if a leap second is + * currently being announced (i.e. dtlsf != dtls) then the week number + * wnlsf is close enough, and we can unambiguously determine the date + * for which the leap second is scheduled. + */ + if ( dtlsf != dtls ) + { + time_t t_ls; + struct tm *tm; + int n = 0; + + if (wnlsf < GPSWRAP) + wnlsf += GPSWEEKS; + + if (wnt < GPSWRAP) + wnt += GPSWEEKS; + + t_ls = (time_t) wnlsf * SECSPERWEEK + + (time_t) dn * SECSPERDAY + + GPS_SEC_BIAS - 1; + + tm = gmtime( &t_ls ); + if (tm == NULL) // gmtime() failed + { + snprintf( t, size, "** (gmtime() failed in mk_utcinfo())" ); + return; + } + + n += snprintf( t, size, "UTC offset transition from %is to %is due to leap second %s", + dtls, dtlsf, ( dtls < dtlsf ) ? "insertion" : "deletion" ); + n += snprintf( t + n, size - n, " at UTC midnight at the end of %s, %04i-%02i-%02i", + daynames[tm->tm_wday], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday ); + } + else + snprintf( t, size, "UTC offset parameter: %is, no leap second announced.\n", dtls ); + } #ifdef CLOCK_MEINBERG /**=========================================================================== - ** Meinberg GPS166/GPS167 support + ** Meinberg GPS receiver support **/ /*------------------------------------------------------------ - * gps16x_message - process GPS16x messages + * gps16x_message - process messages from Meinberg GPS receiver */ static void gps16x_message( @@ -4261,12 +4290,12 @@ gps16x_message( { GPS_MSG_HDR header; unsigned char *bufp = (unsigned char *)parsetime->parse_msg + 1; - + #ifdef DEBUG if (debug > 2) { char msgbuffer[600]; - + mkreadable(msgbuffer, sizeof(msgbuffer), (char *)parsetime->parse_msg, parsetime->parse_msglen, 1); printf("PARSE receiver #%d: received message (%d bytes) >%s<\n", CLK_UNIT(parse->peer), @@ -4275,21 +4304,21 @@ gps16x_message( } #endif get_mbg_header(&bufp, &header); - if (header.gps_hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) && - (header.gps_len == 0 || - (header.gps_len < sizeof(parsetime->parse_msg) && - header.gps_data_csum == mbg_csum(bufp, header.gps_len)))) + if (header.hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) && + (header.len == 0 || + (header.len < sizeof(parsetime->parse_msg) && + header.data_csum == mbg_csum(bufp, header.len)))) { /* * clean message */ - switch (header.gps_cmd) + switch (header.cmd) { case GPS_SW_REV: { char buffer[64]; SW_REV gps_sw_rev; - + get_mbg_sw_rev(&bufp, &gps_sw_rev); snprintf(buffer, sizeof(buffer), "meinberg_gps_version=\"%x.%02x%s%s\"", (gps_sw_rev.code >> 8) & 0xFF, @@ -4300,33 +4329,35 @@ gps16x_message( } break; - case GPS_STAT: + case GPS_BVAR_STAT: { static struct state { - unsigned short flag; /* status flag */ - unsigned const char *string; /* bit name */ + BVAR_STAT flag; /* status flag */ + const char *string; /* bit name */ } states[] = { - { TM_ANT_DISCONN, (const unsigned char *)"ANTENNA FAULTY" }, - { TM_SYN_FLAG, (const unsigned char *)"NO SYNC SIGNAL" }, - { TM_NO_SYNC, (const unsigned char *)"NO SYNC POWERUP" }, - { TM_NO_POS, (const unsigned char *)"NO POSITION" }, - { 0, (const unsigned char *)"" } + { BVAR_CFGH_INVALID, "Configuration/Health" }, + { BVAR_ALM_NOT_COMPLETE, "Almanachs" }, + { BVAR_UTC_INVALID, "UTC Correction" }, + { BVAR_IONO_INVALID, "Ionospheric Correction" }, + { BVAR_RCVR_POS_INVALID, "Receiver Position" }, + { 0, "" } }; - unsigned short status; + BVAR_STAT status; struct state *s = states; char buffer[512]; char *p, *b; - - status = get_lsb_short(&bufp); + + status = (BVAR_STAT) get_lsb_short(&bufp); p = b = buffer; p = ap(buffer, sizeof(buffer), p, "meinberg_gps_status=\"[0x%04x] ", status); - + if (status) { + p = ap(buffer, sizeof(buffer), p, "incomplete buffered data: "); b = p; while (s->flag) { @@ -4336,7 +4367,7 @@ gps16x_message( { p = ap(buffer, sizeof(buffer), p, ", "); } - + p = ap(buffer, sizeof(buffer), p, "%s", (const char *)s->string); } s++; @@ -4345,9 +4376,9 @@ gps16x_message( } else { - p = ap(buffer, sizeof(buffer), p, "<OK>\""); + p = ap(buffer, sizeof(buffer), p, "<all buffered data complete>\""); } - + set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF); } break; @@ -4356,228 +4387,204 @@ gps16x_message( { XYZ xyz; char buffer[256]; - + get_mbg_xyz(&bufp, xyz); snprintf(buffer, sizeof(buffer), "gps_position(XYZ)=\"%s m, %s m, %s m\"", mfptoa(xyz[XP].l_ui, xyz[XP].l_uf, 1), mfptoa(xyz[YP].l_ui, xyz[YP].l_uf, 1), mfptoa(xyz[ZP].l_ui, xyz[ZP].l_uf, 1)); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF); } break; - + case GPS_POS_LLA: { LLA lla; char buffer[256]; - + get_mbg_lla(&bufp, lla); - + snprintf(buffer, sizeof(buffer), "gps_position(LLA)=\"%s deg, %s deg, %s m\"", mfptoa(lla[LAT].l_ui, lla[LAT].l_uf, 4), - mfptoa(lla[LON].l_ui, lla[LON].l_uf, 4), + mfptoa(lla[LON].l_ui, lla[LON].l_uf, 4), mfptoa(lla[ALT].l_ui, lla[ALT].l_uf, 1)); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF); } break; - + case GPS_TZDL: break; - + case GPS_PORT_PARM: break; - + case GPS_SYNTH: break; - + case GPS_ANT_INFO: { ANT_INFO antinfo; char buffer[512]; char *p, *q; - + get_mbg_antinfo(&bufp, &antinfo); p = buffer; p = ap(buffer, sizeof(buffer), p, "meinberg_antenna_status=\""); switch (antinfo.status) { - case ANT_INVALID: + case ANT_INVALID: // No other fields valid since antenna has not yet been disconnected p = ap(buffer, sizeof(buffer), p, "<OK>"); break; - - case ANT_DISCONN: + + case ANT_DISCONN: // Antenna is disconnected, tm_reconn and delta_t not yet set q = ap(buffer, sizeof(buffer), p, "DISCONNECTED since "); NLOG(NLOG_CLOCKSTATUS) ERR(ERR_BADSTATUS) msyslog(LOG_ERR,"PARSE receiver #%d: ANTENNA FAILURE: %s", CLK_UNIT(parse->peer), p); - + p = q; - mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p)); + mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0); *p = '\0'; break; - - case ANT_RECONN: + + case ANT_RECONN: // Antenna had been disconnect, but receiver sync. after reconnect, so all fields valid p = ap(buffer, sizeof(buffer), - p, "RECONNECTED on "); - mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p)); + p, "SYNC AFTER RECONNECT on "); + mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p), 0); p = ap(buffer, sizeof(buffer), - p, ", reconnect clockoffset %c%ld.%07ld s, disconnect time ", + p, ", clock offset at reconnect %c%ld.%07ld s, disconnect time ", (antinfo.delta_t < 0) ? '-' : '+', - ABS(antinfo.delta_t) / 10000, - ABS(antinfo.delta_t) % 10000); - mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p)); + (long) ABS(antinfo.delta_t) / 10000, + (long) ABS(antinfo.delta_t) % 10000); + mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0); *p = '\0'; break; - + default: p = ap(buffer, sizeof(buffer), p, "bad status 0x%04x", antinfo.status); break; } - + p = ap(buffer, sizeof(buffer), p, "\""); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF); } break; - + case GPS_UCAP: break; - + case GPS_CFGH: { CFGH cfgh; char buffer[512]; char *p; - + get_mbg_cfgh(&bufp, &cfgh); if (cfgh.valid) { + const char *cp; + uint16_t tmp_val; int i; - + p = buffer; p = ap(buffer, sizeof(buffer), p, "gps_tot_51=\""); mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p)); p = ap(buffer, sizeof(buffer), p, "\""); - set_var(&parse->kv, buffer, sizeof(buffer), RO); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF); + p = buffer; p = ap(buffer, sizeof(buffer), p, "gps_tot_63=\""); mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p)); p = ap(buffer, sizeof(buffer), p, "\""); - set_var(&parse->kv, buffer, sizeof(buffer), RO); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF); + p = buffer; p = ap(buffer, sizeof(buffer), p, "gps_t0a=\""); mbg_tgps_str(&p, &cfgh.t0a, BUFFER_SIZE(buffer, p)); p = ap(buffer, sizeof(buffer), p, "\""); - set_var(&parse->kv, buffer, sizeof(buffer), RO); - - for (i = MIN_SVNO; i < MAX_SVNO; i++) + set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF); + + for (i = 0; i < N_SVNO_GPS; i++) { p = buffer; - p = ap(buffer, sizeof(buffer), p, "gps_cfg[%d]=\"[0x%x] ", i, cfgh.cfg[i]); - switch (cfgh.cfg[i] & 0x7) - { - case 0: - p = ap(buffer, sizeof(buffer), p, "BLOCK I"); - break; - case 1: - p = ap(buffer, sizeof(buffer), p, "BLOCK II"); - break; - default: - p = ap(buffer, sizeof(buffer), p, "bad CFG"); - break; - } - p = ap(buffer, sizeof(buffer), p, "\""); - set_var(&parse->kv, buffer, sizeof(buffer), RO); - - p = buffer; - p = ap(buffer, sizeof(buffer), p, "gps_health[%d]=\"[0x%x] ", i, cfgh.health[i]); - switch ((cfgh.health[i] >> 5) & 0x7 ) - { - case 0: - p = ap(buffer, sizeof(buffer), p, "OK;"); - break; - case 1: - p = ap(buffer, sizeof(buffer), p, "PARITY;"); - break; - case 2: - p = ap(buffer, sizeof(buffer), p, "TLM/HOW;"); - break; - case 3: - p = ap(buffer, sizeof(buffer), p, "Z-COUNT;"); - break; - case 4: - p = ap(buffer, sizeof(buffer), p, "SUBFRAME 1,2,3;"); - break; - case 5: - p = ap(buffer, sizeof(buffer), p, "SUBFRAME 4,5;"); - break; - case 6: - p = ap(buffer, sizeof(buffer), p, "UPLOAD BAD;"); - break; - case 7: - p = ap(buffer, sizeof(buffer), p, "DATA BAD;"); - break; + p = ap(buffer, sizeof(buffer), p, "sv_info[%d]=\"PRN%d", i, i + N_SVNO_GPS); + + tmp_val = cfgh.health[i]; /* a 6 bit SV health code */ + p = ap(buffer, sizeof(buffer), p, "; health=0x%02x (", tmp_val); + /* "All Ones" has a special meaning" */ + if (tmp_val == 0x3F) /* satellite is unusable or doesn't even exist */ + cp = "SV UNAVAILABLE"; + else { + /* The MSB contains a summary of the 3 MSBs of the 8 bit health code, + * indicating if the data sent by the satellite is OK or not. */ + p = ap(buffer, sizeof(buffer), p, "DATA %s, ", (tmp_val & 0x20) ? "BAD" : "OK" ); + + /* The 5 LSBs contain the status of the different signals sent by the satellite. */ + switch (tmp_val & 0x1F) + { + case 0x00: cp = "SIGNAL OK"; break; + /* codes 0x01 through 0x1B indicate that one or more + * specific signal components are weak or dead. + * We don't decode this here in detail. */ + case 0x1C: cp = "SV IS TEMP OUT"; break; + case 0x1D: cp = "SV WILL BE TEMP OUT"; break; + default: cp = "TRANSMISSION PROBLEMS"; break; + } } - - switch (cfgh.health[i] & 0x1F) + p = ap(buffer, sizeof(buffer), p, "%s)", cp ); + + tmp_val = cfgh.cfg[i]; /* a 4 bit SV configuration/type code */ + p = ap(buffer, sizeof(buffer), p, "; cfg=0x%02x (", tmp_val); + switch (tmp_val & 0x7) { - case 0: - p = ap(buffer, sizeof(buffer), p, "SIGNAL OK"); - break; - case 0x1C: - p = ap(buffer, sizeof(buffer), p, "SV TEMP OUT"); - break; - case 0x1D: - p = ap(buffer, sizeof(buffer), p, "SV WILL BE TEMP OUT"); - break; - case 0x1E: - break; - case 0x1F: - p = ap(buffer, sizeof(buffer), p, "MULTIPLE ERRS"); - break; - default: - p = ap(buffer, sizeof(buffer), p, "TRANSMISSION PROBLEMS"); - break; + case 0x00: cp = "(reserved)"; break; + case 0x01: cp = "BLOCK II/IIA/IIR"; break; + case 0x02: cp = "BLOCK IIR-M"; break; + case 0x03: cp = "BLOCK IIF"; break; + case 0x04: cp = "BLOCK III"; break; + default: cp = "unknown SV type"; break; } - - p = ap(buffer, sizeof(buffer), p, "\""); - set_var(&parse->kv, buffer, sizeof(buffer), RO); + p = ap(buffer, sizeof(buffer), p, "%s", cp ); + if (tmp_val & 0x08) /* A-S is on, P-code is encrypted */ + p = ap( buffer, sizeof(buffer), p, ", A-S on" ); + + p = ap(buffer, sizeof(buffer), p, ")\""); + set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF); } } } break; - + case GPS_ALM: break; - + case GPS_EPH: break; - + case GPS_UTC: { UTC utc; char buffer[512]; char *p; - + p = buffer; - + get_mbg_utc(&bufp, &utc); - + if (utc.valid) { p = ap(buffer, sizeof(buffer), p, "gps_utc_correction=\""); @@ -4592,46 +4599,47 @@ gps16x_message( set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF); } break; - + case GPS_IONO: break; - + case GPS_ASCII_MSG: { ASCII_MSG gps_ascii_msg; char buffer[128]; - + get_mbg_ascii_msg(&bufp, &gps_ascii_msg); - + if (gps_ascii_msg.valid) { char buffer1[128]; mkreadable(buffer1, sizeof(buffer1), gps_ascii_msg.s, strlen(gps_ascii_msg.s), (int)0); - + snprintf(buffer, sizeof(buffer), "gps_message=\"%s\"", buffer1); } else snprintf(buffer, sizeof(buffer), "gps_message=<NONE>"); - + set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF); } - + break; - + default: break; } } else { - msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%lx), data_len = %d, data_csum = 0x%x (expected 0x%lx)", + msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%x), " + "data_len = %d, data_csum = 0x%x (expected 0x%x)", CLK_UNIT(parse->peer), - header.gps_hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6), - header.gps_len, - header.gps_data_csum, mbg_csum(bufp, (unsigned)((header.gps_len < sizeof(parsetime->parse_msg)) ? header.gps_len : 0))); + header.hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6), + header.len, + header.data_csum, mbg_csum(bufp, (unsigned)((header.len < sizeof(parsetime->parse_msg)) ? header.len : 0))); } } - + return; } @@ -4644,11 +4652,11 @@ gps16x_poll( ) { struct parseunit *parse = peer->procptr->unitptr; - - static GPS_MSG_HDR sequence[] = + + static GPS_MSG_HDR sequence[] = { { GPS_SW_REV, 0, 0, 0 }, - { GPS_STAT, 0, 0, 0 }, + { GPS_BVAR_STAT, 0, 0, 0 }, { GPS_UTC, 0, 0, 0 }, { GPS_ASCII_MSG, 0, 0, 0 }, { GPS_ANT_INFO, 0, 0, 0 }, @@ -4662,41 +4670,41 @@ gps16x_poll( unsigned char cmd_buffer[64]; unsigned char *outp = cmd_buffer; GPS_MSG_HDR *header; - + if (((poll_info_t *)parse->parse_type->cl_data)->rate) { parse->peer->procptr->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate; } - if (sequence[parse->localstate].gps_cmd == (unsigned short)~0) + if (sequence[parse->localstate].cmd == (unsigned short)~0) parse->localstate = 0; - + header = sequence + parse->localstate++; - + *outp++ = SOH; /* start command */ - + put_mbg_header(&outp, header); outp = cmd_buffer + 1; - - header->gps_hdr_csum = (short)mbg_csum(outp, 6); + + header->hdr_csum = (short)mbg_csum(outp, 6); put_mbg_header(&outp, header); - + #ifdef DEBUG if (debug > 2) { char buffer[128]; - + mkreadable(buffer, sizeof(buffer), (char *)cmd_buffer, (unsigned)(outp - cmd_buffer), 1); printf("PARSE receiver #%d: transmitted message #%ld (%d bytes) >%s<\n", CLK_UNIT(parse->peer), parse->localstate - 1, (int)(outp - cmd_buffer), - buffer); + buffer); } #endif - - rtc = write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer)); - + + rtc = (int) write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer)); + if (rtc < 0) { ERR(ERR_BADIO) @@ -4745,7 +4753,7 @@ gps16x_poll_init( return 1; } #endif /* CLOCK_MEINBERG */ - + /**=========================================================================== ** clock polling support **/ @@ -4758,11 +4766,11 @@ poll_dpoll( struct parseunit *parse ) { - int rtc; + long rtc; const char *ps = ((poll_info_t *)parse->parse_type->cl_data)->string; - int ct = ((poll_info_t *)parse->parse_type->cl_data)->count; + long ct = ((poll_info_t *)parse->parse_type->cl_data)->count; - rtc = write(parse->generic->io.fd, ps, (unsigned long)ct); + rtc = write(parse->generic->io.fd, ps, ct); if (rtc < 0) { ERR(ERR_BADIO) @@ -4772,7 +4780,7 @@ poll_dpoll( if (rtc != ct) { ERR(ERR_BADIO) - msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, ct); + msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%ld of %ld bytes sent)", CLK_UNIT(parse->peer), rtc, ct); } clear_err(parse, ERR_BADIO); } @@ -4786,7 +4794,7 @@ poll_poll( ) { struct parseunit *parse = peer->procptr->unitptr; - + if (parse->parse_type->cl_poll) parse->parse_type->cl_poll(parse); @@ -4812,7 +4820,7 @@ poll_init( return 0; } - + /**=========================================================================== ** Trimble support **/ @@ -4842,7 +4850,7 @@ trimbletaip_init( else { tio.c_cc[VEOL] = TRIMBLETAIP_EOL; - + if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1) { msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_init: tcsetattr(fd, &tio): %m", CLK_UNIT(parse->peer)); @@ -4861,7 +4869,7 @@ static const char *taipinit[] = { ">FTM00020001<", (char *)0 }; - + static void trimbletaip_event( struct parseunit *parse, @@ -4878,7 +4886,7 @@ trimbletaip_event( iv = taipinit; while (*iv) { - int rtc = write(parse->generic->io.fd, *iv, strlen(*iv)); + int rtc = (int) write(parse->generic->io.fd, *iv, strlen(*iv)); if (rtc < 0) { msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd to clock: %m", CLK_UNIT(parse->peer)); @@ -5006,19 +5014,19 @@ union uval { float fv; double dv; }; - + struct txbuf { short idx; /* index to first unused byte */ u_char *txt; /* pointer to actual data buffer */ }; -void sendcmd (struct txbuf *buf, int c); -void sendbyte (struct txbuf *buf, int b); -void sendetx (struct txbuf *buf, struct parseunit *parse); -void sendint (struct txbuf *buf, int a); -void sendflt (struct txbuf *buf, double a); - +void sendcmd (struct txbuf *buf, int c); +void sendbyte (struct txbuf *buf, int b); +void sendetx (struct txbuf *buf, struct parseunit *parse); +void sendint (struct txbuf *buf, int a); +void sendflt (struct txbuf *buf, double a); + void sendcmd( struct txbuf *buf, @@ -5030,12 +5038,12 @@ sendcmd( buf->idx = 2; } -void sendcmd (struct txbuf *buf, int c); -void sendbyte (struct txbuf *buf, int b); -void sendetx (struct txbuf *buf, struct parseunit *parse); -void sendint (struct txbuf *buf, int a); -void sendflt (struct txbuf *buf, double a); - +void sendcmd (struct txbuf *buf, int c); +void sendbyte (struct txbuf *buf, int b); +void sendetx (struct txbuf *buf, struct parseunit *parse); +void sendint (struct txbuf *buf, int a); +void sendflt (struct txbuf *buf, double a); + void sendbyte( struct txbuf *buf, @@ -5067,18 +5075,18 @@ sendetx( if (debug > 2) { char buffer[256]; - + mkreadable(buffer, sizeof(buffer), (char *)buf->txt, (unsigned)buf->idx, 1); printf("PARSE receiver #%d: transmitted message (%d bytes) >%s<\n", CLK_UNIT(parse->peer), - buf->idx, buffer); + buf->idx, buffer); } #endif clear_err(parse, ERR_BADIO); } } -void +void sendint( struct txbuf *buf, int a @@ -5098,7 +5106,7 @@ sendflt( int i; union uval uval; - uval.fv = a; + uval.fv = (float) a; #ifdef WORDS_BIGENDIAN for (i=0; i<=3; i++) #else @@ -5130,12 +5138,12 @@ trimbletsip_setup( if (t) t->last_reset = current_time; - + buf.txt = buffer; - + sendcmd(&buf, CMD_CVERSION); /* request software versions */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_COPERPARAM); /* set operating parameters */ sendbyte(&buf, 4); /* static */ sendflt(&buf, 5.0*D2R); /* elevation angle mask = 10 deg XXX */ @@ -5143,25 +5151,25 @@ trimbletsip_setup( sendflt(&buf, 12.0); /* PDOP mask = 12 */ sendflt(&buf, 8.0); /* PDOP switch level = 8 */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_CMODESEL); /* fix mode select */ sendbyte(&buf, 1); /* time transfer mode */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_CMESSAGE); /* request system message */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_CSUPER); /* superpacket fix */ sendbyte(&buf, 0x2); /* binary mode */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_CIOOPTIONS); /* set I/O options */ sendbyte(&buf, TRIM_POS_OPT); /* position output */ sendbyte(&buf, 0x00); /* no velocity output */ sendbyte(&buf, TRIM_TIME_OPT); /* UTC, compute on seconds */ sendbyte(&buf, 0x00); /* no raw measurements */ sendetx(&buf, parse); - + sendcmd(&buf, CMD_CUTCPARAM); /* request UTC correction data */ sendetx(&buf, parse); @@ -5185,7 +5193,7 @@ trimble_check( u_char buffer[256]; struct txbuf buf; buf.txt = buffer; - + if (t) { if (current_time > t->last_msg + TRIMBLETSIP_IDLE_TIME) @@ -5193,18 +5201,18 @@ trimble_check( } poll_poll(parse->peer); /* emit query string and re-arm timer */ - + if (t && t->qtracking) { u_long oldsats = t->ltrack & ~t->ctrack; - + t->qtracking = 0; t->ltrack = t->ctrack; - + if (oldsats) { int i; - + for (i = 0; oldsats; i++) { if (oldsats & (1 << i)) { @@ -5215,7 +5223,7 @@ trimble_check( oldsats &= ~(1 << i); } } - + sendcmd(&buf, CMD_CSTATTRACK); sendbyte(&buf, 0x00); /* current tracking set */ sendetx(&buf, parse); @@ -5230,7 +5238,7 @@ trimbletsip_end( struct parseunit *parse ) { trimble_t *t = parse->localdata; - + if (t) { free(t); @@ -5261,9 +5269,9 @@ trimbletsip_init( if (!parse->localdata) { trimble_t *t; - + t = (trimble_t *)(parse->localdata = emalloc(sizeof(trimble_t))); - + if (t) { memset((char *)t, 0, sizeof(trimble_t)); @@ -5343,7 +5351,7 @@ getflt( ) { union uval uval; - + #ifdef WORDS_BIGENDIAN uval.bd[0] = *bp++; uval.bd[1] = *bp++; @@ -5364,7 +5372,7 @@ getdbl( ) { union uval uval; - + #ifdef WORDS_BIGENDIAN uval.bd[0] = *bp++; uval.bd[1] = *bp++; @@ -5392,7 +5400,7 @@ getshort( unsigned char *p ) { - return get_msb_short(&p); + return (int) get_msb_short(&p); } /*-------------------------------------------------- @@ -5409,7 +5417,7 @@ trimbletsip_message( { unsigned char *buffer = parsetime->parse_msg; unsigned int size = parsetime->parse_msglen; - + if ((size < 4) || (buffer[0] != DLE) || (buffer[size-1] != ETX) || @@ -5431,13 +5439,13 @@ trimbletsip_message( } else { - int var_flag; + u_short var_flag; trimble_t *tr = parse->localdata; unsigned int cmd = buffer[1]; char pbuffer[200]; char *t = pbuffer; cmd_info_t *s; - + #ifdef DEBUG if (debug > 3) { size_t i; @@ -5453,9 +5461,9 @@ trimbletsip_message( if (tr) tr->last_msg = current_time; - + s = trimble_convert(cmd, trimble_rcmds); - + if (s) { t = ap(pbuffer, sizeof(pbuffer), t, "%s=\"", s->varname); @@ -5466,7 +5474,7 @@ trimbletsip_message( return; } - var_flag = s->varmode; + var_flag = (u_short) s->varmode; switch(cmd) { @@ -5475,7 +5483,7 @@ trimbletsip_message( getflt((unsigned char *)&mb(0)), getshort((unsigned char *)&mb(4)), getflt((unsigned char *)&mb(6))); break; - + case CMD_RBEST4: t = ap(pbuffer, sizeof(pbuffer), t, "mode: "); switch (mb(0) & 0xF) @@ -5488,11 +5496,11 @@ trimbletsip_message( case 1: t = ap(pbuffer, sizeof(pbuffer), t, "0D"); break; - + case 3: t = ap(pbuffer, sizeof(pbuffer), t, "2D"); break; - + case 4: t = ap(pbuffer, sizeof(pbuffer), t, "3D"); break; @@ -5501,7 +5509,7 @@ trimbletsip_message( t = ap(pbuffer, sizeof(pbuffer), t, "-MANUAL, "); else t = ap(pbuffer, sizeof(pbuffer), t, "-AUTO, "); - + t = ap(pbuffer, sizeof(pbuffer), t, "satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f", mb(1), mb(2), mb(3), mb(4), getflt((unsigned char *)&mb(5)), @@ -5510,12 +5518,12 @@ trimbletsip_message( getflt((unsigned char *)&mb(17))); break; - + case CMD_RVERSION: t = ap(pbuffer, sizeof(pbuffer), t, "%d.%d (%d/%d/%d)", mb(0)&0xff, mb(1)&0xff, 1900+(mb(4)&0xff), mb(2)&0xff, mb(3)&0xff); break; - + case CMD_RRECVHEALTH: { static const char *msgs[] = @@ -5529,9 +5537,9 @@ trimbletsip_message( "<BIT 6>", "<BIT 7>" }; - + int i, bits; - + switch (mb(0) & 0xFF) { default: @@ -5564,7 +5572,7 @@ trimbletsip_message( } bits = mb(1) & 0xFF; - + for (i = 0; i < 8; i++) if (bits & (0x1<<i)) { @@ -5572,11 +5580,11 @@ trimbletsip_message( } } break; - + case CMD_RMESSAGE: mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0), (unsigned)(size - 2 - (&mb(0) - buffer)), 0); break; - + case CMD_RMACHSTAT: { static const char *msgs[] = @@ -5590,12 +5598,12 @@ trimbletsip_message( "<BIT 6>", "<BIT 7>" }; - + int i, bits; t = ap(pbuffer, sizeof(pbuffer), t, "machine id 0x%02x", mb(0) & 0xFF); bits = mb(1) & 0xFF; - + for (i = 0; i < 8; i++) if (bits & (0x1<<i)) { @@ -5605,21 +5613,21 @@ trimbletsip_message( t = ap(pbuffer, sizeof(pbuffer), t, ", Superpackets %ssupported", (mb(2) & 0xFF) ? "" :"un" ); } break; - + case CMD_ROPERPARAM: t = ap(pbuffer, sizeof(pbuffer), t, "%2x %.1f %.1f %.1f %.1f", mb(0), getflt((unsigned char *)&mb(1)), getflt((unsigned char *)&mb(5)), getflt((unsigned char *)&mb(9)), getflt((unsigned char *)&mb(13))); break; - + case CMD_RUTCPARAM: { float t0t = getflt((unsigned char *)&mb(14)); - short wnt = getshort((unsigned char *)&mb(18)); - short dtls = getshort((unsigned char *)&mb(12)); - short wnlsf = getshort((unsigned char *)&mb(20)); - short dn = getshort((unsigned char *)&mb(22)); - short dtlsf = getshort((unsigned char *)&mb(24)); + short wnt = (short) getshort((unsigned char *)&mb(18)); + short dtls = (short) getshort((unsigned char *)&mb(12)); + short wnlsf = (short) getshort((unsigned char *)&mb(20)); + short dn = (short) getshort((unsigned char *)&mb(22)); + short dtlsf = (short) getshort((unsigned char *)&mb(24)); if ((int)t0t != 0) { @@ -5648,14 +5656,14 @@ trimbletsip_message( } } break; - + case CMD_RSPOSXYZ: { double x = getflt((unsigned char *)&mb(0)); double y = getflt((unsigned char *)&mb(4)); double z = getflt((unsigned char *)&mb(8)); double f = getflt((unsigned char *)&mb(12)); - + if (f > 0.0) t = ap(pbuffer, sizeof(pbuffer), t, "x= %.1fm, y= %.1fm, z= %.1fm, time_of_fix= %f sec", x, y, z, @@ -5670,7 +5678,7 @@ trimbletsip_message( double lat = getflt((unsigned char *)&mb(0)); double lng = getflt((unsigned char *)&mb(4)); double f = getflt((unsigned char *)&mb(12)); - + if (f > 0.0) t = ap(pbuffer, sizeof(pbuffer), t, "lat %f %c, long %f %c, alt %.2fm", ((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'), @@ -5690,7 +5698,7 @@ trimbletsip_message( x, y, z); } break; - + case CMD_RDOUBLELLA: { double lat = getdbl((unsigned char *)&mb(0)); @@ -5705,7 +5713,7 @@ trimbletsip_message( case CMD_RALLINVIEW: { int i, sats; - + t = ap(pbuffer, sizeof(pbuffer), t, "mode: "); switch (mb(0) & 0x7) { @@ -5716,7 +5724,7 @@ trimbletsip_message( case 3: t = ap(pbuffer, sizeof(pbuffer), t, "2D"); break; - + case 4: t = ap(pbuffer, sizeof(pbuffer), t, "3D"); break; @@ -5725,9 +5733,9 @@ trimbletsip_message( t = ap(pbuffer, sizeof(pbuffer), t, "-MANUAL, "); else t = ap(pbuffer, sizeof(pbuffer), t, "-AUTO, "); - + sats = (mb(0)>>4) & 0xF; - + t = ap(pbuffer, sizeof(pbuffer), t, "PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f, %d satellite%s in view: ", getflt((unsigned char *)&mb(1)), getflt((unsigned char *)&mb(5)), @@ -5748,17 +5756,17 @@ trimbletsip_message( } } break; - + case CMD_RSTATTRACK: { t = ap(pbuffer, sizeof(pbuffer), t-2, "[%02d]=\"", mb(0)); /* add index to var name */ if (getflt((unsigned char *)&mb(4)) < 0.0) { t = ap(pbuffer, sizeof(pbuffer), t, "<NO MEASUREMENTS>"); - var_flag &= ~DEF; + var_flag &= (u_short)(~DEF); } else - { + { t = ap(pbuffer, sizeof(pbuffer), t, "ch=%d, acq=%s, eph=%d, signal_level= %5.2f, elevation= %5.2f, azimuth= %6.2f", (mb(1) & 0xFF)>>3, mb(2) ? ((mb(2) == 1) ? "ACQ" : "SRCH") : "NEVER", @@ -5768,7 +5776,7 @@ trimbletsip_message( getflt((unsigned char *)&mb(16)) * RTOD); if (mb(20)) { - var_flag &= ~DEF; + var_flag &= (u_short)(~DEF); t = ap(pbuffer, sizeof(pbuffer), t, ", OLD"); } if (mb(22)) @@ -5784,18 +5792,18 @@ trimbletsip_message( } } break; - + default: t = ap(pbuffer, sizeof(pbuffer), t, "<UNDECODED>"); break; } - t = ap(pbuffer, sizeof(pbuffer), t,"\""); + t = ap(pbuffer, sizeof(pbuffer), t, "\""); set_var(&parse->kv, pbuffer, sizeof(pbuffer), var_flag); } } - + /**============================================================ ** RAWDCF support **/ diff --git a/contrib/ntp/ntpdate/Makefile.in b/contrib/ntp/ntpdate/Makefile.in index e0e0ec2d02ea7..0dcac192e7cff 100644 --- a/contrib/ntp/ntpdate/Makefile.in +++ b/contrib/ntp/ntpdate/Makefile.in @@ -48,8 +48,7 @@ subdir = ntpdate ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -78,6 +77,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -329,6 +330,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/ntpdc/Makefile.in b/contrib/ntp/ntpdc/Makefile.in index 0837bac4b93d4..0bb1e30e94884 100644 --- a/contrib/ntp/ntpdc/Makefile.in +++ b/contrib/ntp/ntpdc/Makefile.in @@ -50,8 +50,7 @@ subdir = ntpdc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -80,6 +79,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -363,6 +364,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/ntpdc/invoke-ntpdc.texi b/contrib/ntp/ntpdc/invoke-ntpdc.texi index 8a9eb270d8628..246e51ec8ac8e 100644 --- a/contrib/ntp/ntpdc/invoke-ntpdc.texi +++ b/contrib/ntp/ntpdc/invoke-ntpdc.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:42:41 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:26:32 AM by AutoGen 5.18.5pre4 # From the definitions ntpdc-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -76,7 +76,7 @@ with a status code of 0. @exampleindent 0 @example -ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p1 +ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2 Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpdc/ntpdc-opts.c b/contrib/ntp/ntpdc/ntpdc-opts.c index 070501d00e6ce..94ccea7570acf 100644 --- a/contrib/ntp/ntpdc/ntpdc-opts.c +++ b/contrib/ntp/ntpdc/ntpdc-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:42:23 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:26:14 AM by AutoGen 5.18.5pre4 * From the definitions ntpdc-opts.def * and the template file options * @@ -69,7 +69,7 @@ extern FILE * option_usage_fp; * static const strings for ntpdc options */ static char const ntpdc_opt_strs[1911] = -/* 0 */ "ntpdc 4.2.8p1\n" +/* 0 */ "ntpdc 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1911] = /* 1694 */ "no-load-opts\0" /* 1707 */ "no\0" /* 1710 */ "NTPDC\0" -/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p1\n" +/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0" /* 1846 */ "$HOME\0" /* 1852 */ ".\0" /* 1854 */ ".ntprc\0" /* 1861 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 1895 */ "\n\0" -/* 1897 */ "ntpdc 4.2.8p1"; +/* 1897 */ "ntpdc 4.2.8p2"; /** * ipv4 option description with @@ -796,7 +796,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpdcOptions.pzCopyright */ - puts(_("ntpdc 4.2.8p1\n\ + puts(_("ntpdc 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -862,14 +862,14 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntpdcOptions.pzUsageTitle */ - puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p1\n\ + puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n")); /* referenced via ntpdcOptions.pzExplain */ puts(_("\n")); /* referenced via ntpdcOptions.pzFullVersion */ - puts(_("ntpdc 4.2.8p1")); + puts(_("ntpdc 4.2.8p2")); /* referenced via ntpdcOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpdc/ntpdc-opts.h b/contrib/ntp/ntpdc/ntpdc-opts.h index e9a3f2c8ee8ef..84763592b2f3b 100644 --- a/contrib/ntp/ntpdc/ntpdc-opts.h +++ b/contrib/ntp/ntpdc/ntpdc-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:42:23 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:26:14 AM by AutoGen 5.18.5pre4 * From the definitions ntpdc-opts.def * and the template file options * @@ -83,9 +83,9 @@ typedef enum { /** count of all options for ntpdc */ #define OPTION_CT 15 /** ntpdc version */ -#define NTPDC_VERSION "4.2.8p1" +#define NTPDC_VERSION "4.2.8p2" /** Full ntpdc version text */ -#define NTPDC_FULL_VERSION "ntpdc 4.2.8p1" +#define NTPDC_FULL_VERSION "ntpdc 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcman b/contrib/ntp/ntpdc/ntpdc.1ntpdcman index 5a9e253541901..ecff16b0c8d77 100644 --- a/contrib/ntp/ntpdc/ntpdc.1ntpdcman +++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpdc 1ntpdcman "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpdc 1ntpdcman "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DnaiLq/ag-QnaaKq) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dXaWh5/ag-rXaOg5) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:37 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:27 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc index c1681b026a508..7f0c3634456e1 100644 --- a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc +++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPDC 1ntpdcmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:44 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:34 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpdc/ntpdc.html b/contrib/ntp/ntpdc/ntpdc.html index 1b6260bf1e032..37e195c4f626f 100644 --- a/contrib/ntp/ntpdc/ntpdc.html +++ b/contrib/ntp/ntpdc/ntpdc.html @@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server clock. Run as root, it can correct the system clock to this offset as well. It can be run as an interactive command or from a cron job. - <p>This document applies to version 4.2.8p1 of <code>ntpdc</code>. + <p>This document applies to version 4.2.8p2 of <code>ntpdc</code>. <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. @@ -152,7 +152,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p1 +<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2 Usage: ntpdc [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpdc/ntpdc.man.in b/contrib/ntp/ntpdc/ntpdc.man.in index 281727e4e24bb..71aa128acd6b4 100644 --- a/contrib/ntp/ntpdc/ntpdc.man.in +++ b/contrib/ntp/ntpdc/ntpdc.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpdc @NTPDC_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpdc @NTPDC_MS@ "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DnaiLq/ag-QnaaKq) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dXaWh5/ag-rXaOg5) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:37 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:27 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpdc/ntpdc.mdoc.in b/contrib/ntp/ntpdc/ntpdc.mdoc.in index d6f3feb6cef13..8a89e48377cdd 100644 --- a/contrib/ntp/ntpdc/ntpdc.mdoc.in +++ b/contrib/ntp/ntpdc/ntpdc.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPDC @NTPDC_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:42:44 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:26:34 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in index a58363ca8c7c2..fad90018b7611 100644 --- a/contrib/ntp/ntpq/Makefile.in +++ b/contrib/ntp/ntpq/Makefile.in @@ -50,8 +50,7 @@ subdir = ntpq ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -80,6 +79,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -370,6 +371,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/ntpq/invoke-ntpq.texi b/contrib/ntp/ntpq/invoke-ntpq.texi index 7a1b8950222bd..505bb23d8c3cc 100644 --- a/contrib/ntp/ntpq/invoke-ntpq.texi +++ b/contrib/ntp/ntpq/invoke-ntpq.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:43:17 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:27:07 AM by AutoGen 5.18.5pre4 # From the definitions ntpq-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -835,7 +835,7 @@ with a status code of 0. @exampleindent 0 @example -ntpq - standard NTP query program - Ver. 4.2.8p1 +ntpq - standard NTP query program - Ver. 4.2.8p2 Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpq/ntpq-opts.c b/contrib/ntp/ntpq/ntpq-opts.c index 9c4de559130f2..74f3d3d8e51a8 100644 --- a/contrib/ntp/ntpq/ntpq-opts.c +++ b/contrib/ntp/ntpq/ntpq-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:42:46 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:26:37 AM by AutoGen 5.18.5pre4 * From the definitions ntpq-opts.def * and the template file options * @@ -69,7 +69,7 @@ extern FILE * option_usage_fp; * static const strings for ntpq options */ static char const ntpq_opt_strs[1925] = -/* 0 */ "ntpq 4.2.8p1\n" +/* 0 */ "ntpq 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -129,13 +129,13 @@ static char const ntpq_opt_strs[1925] = /* 1723 */ "no-load-opts\0" /* 1736 */ "no\0" /* 1739 */ "NTPQ\0" -/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p1\n" +/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0" /* 1863 */ "$HOME\0" /* 1869 */ ".\0" /* 1871 */ ".ntprc\0" /* 1878 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 1912 */ "ntpq 4.2.8p1"; +/* 1912 */ "ntpq 4.2.8p2"; /** * ipv4 option description with @@ -786,7 +786,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpqOptions.pzCopyright */ - puts(_("ntpq 4.2.8p1\n\ + puts(_("ntpq 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -852,11 +852,11 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntpqOptions.pzUsageTitle */ - puts(_("ntpq - standard NTP query program - Ver. 4.2.8p1\n\ + puts(_("ntpq - standard NTP query program - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n")); /* referenced via ntpqOptions.pzFullVersion */ - puts(_("ntpq 4.2.8p1")); + puts(_("ntpq 4.2.8p2")); /* referenced via ntpqOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpq/ntpq-opts.h b/contrib/ntp/ntpq/ntpq-opts.h index 0dfe3dd6e734b..43301b9a69f5d 100644 --- a/contrib/ntp/ntpq/ntpq-opts.h +++ b/contrib/ntp/ntpq/ntpq-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:42:46 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:26:37 AM by AutoGen 5.18.5pre4 * From the definitions ntpq-opts.def * and the template file options * @@ -83,9 +83,9 @@ typedef enum { /** count of all options for ntpq */ #define OPTION_CT 15 /** ntpq version */ -#define NTPQ_VERSION "4.2.8p1" +#define NTPQ_VERSION "4.2.8p2" /** Full ntpq version text */ -#define NTPQ_FULL_VERSION "ntpq 4.2.8p1" +#define NTPQ_FULL_VERSION "ntpq 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/ntpq/ntpq-subs.c b/contrib/ntp/ntpq/ntpq-subs.c index 56bc2280223ff..8bd4fdbbcf4e8 100644 --- a/contrib/ntp/ntpq/ntpq-subs.c +++ b/contrib/ntp/ntpq/ntpq-subs.c @@ -330,7 +330,7 @@ typedef struct var_display_collection_tag { l_fp lfp; /* NTP_LFP */ } v; /* retrieved value */ } vdc; -#if !defined(MISSING_C99_STYLE_INIT) +#if !defined(MISSING_C99_STRUCT_INIT) # define VDC_INIT(a, b, c) { .tag = a, .display = b, .type = c } #else # define VDC_INIT(a, b, c) { a, b, c } diff --git a/contrib/ntp/ntpq/ntpq.1ntpqman b/contrib/ntp/ntpq/ntpq.1ntpqman index a92f61ec3d7fa..444a91f4e9a2e 100644 --- a/contrib/ntp/ntpq/ntpq.1ntpqman +++ b/contrib/ntp/ntpq/ntpq.1ntpqman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq 1ntpqman "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpq 1ntpqman "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-oaaWVr/ag-CaaOUr) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-SOays6/ag-4Oaqr6) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:13 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:03 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpq/ntpq.1ntpqmdoc b/contrib/ntp/ntpq/ntpq.1ntpqmdoc index c55a5329c788d..d28b09eadbde6 100644 --- a/contrib/ntp/ntpq/ntpq.1ntpqmdoc +++ b/contrib/ntp/ntpq/ntpq.1ntpqmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPQ 1ntpqmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:19 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:09 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpq/ntpq.html b/contrib/ntp/ntpq/ntpq.html index 757dd2baa338a..5d7a8f3c54bdc 100644 --- a/contrib/ntp/ntpq/ntpq.html +++ b/contrib/ntp/ntpq/ntpq.html @@ -44,7 +44,7 @@ monitor the operational status and determine the performance of <code>ntpd</code>, the NTP daemon. - <p>This document applies to version 4.2.8p1 of <code>ntpq</code>. + <p>This document applies to version 4.2.8p2 of <code>ntpq</code>. <ul class="menu"> <li><a accesskey="1" href="#ntpq-Description">ntpq Description</a> @@ -759,7 +759,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p1-RC2 +<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p2-RC3 Usage: ntpq [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpq/ntpq.man.in b/contrib/ntp/ntpq/ntpq.man.in index f6d28cc952418..c5b9fb560a3e1 100644 --- a/contrib/ntp/ntpq/ntpq.man.in +++ b/contrib/ntp/ntpq/ntpq.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq @NTPQ_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpq @NTPQ_MS@ "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-oaaWVr/ag-CaaOUr) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-SOays6/ag-4Oaqr6) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:13 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:03 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpq/ntpq.mdoc.in b/contrib/ntp/ntpq/ntpq.mdoc.in index 23fe10242d78e..32224f2bb6e98 100644 --- a/contrib/ntp/ntpq/ntpq.mdoc.in +++ b/contrib/ntp/ntpq/ntpq.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPQ @NTPQ_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:19 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:09 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpsnmpd/Makefile.in b/contrib/ntp/ntpsnmpd/Makefile.in index 2532f07824686..de2a81c80fd11 100644 --- a/contrib/ntp/ntpsnmpd/Makefile.in +++ b/contrib/ntp/ntpsnmpd/Makefile.in @@ -48,8 +48,7 @@ subdir = ntpsnmpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -78,6 +77,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -358,6 +359,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi index 513d70cfc9657..addadab55bd0e 100644 --- a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi +++ b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:43:32 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:27:22 AM by AutoGen 5.18.5pre4 # From the definitions ntpsnmpd-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -47,7 +47,7 @@ with a status code of 0. @exampleindent 0 @example -ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1 +ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2 Usage: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... Flg Arg Option-Name Description -n no nofork Do not fork diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c index 0f8622e7aa5f6..7e0d34ce7454e 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:43:22 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:27:12 AM by AutoGen 5.18.5pre4 * From the definitions ntpsnmpd-opts.def * and the template file options * @@ -61,7 +61,7 @@ extern FILE * option_usage_fp; * static const strings for ntpsnmpd options */ static char const ntpsnmpd_opt_strs[1610] = -/* 0 */ "ntpsnmpd 4.2.8p1\n" +/* 0 */ "ntpsnmpd 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -101,14 +101,14 @@ static char const ntpsnmpd_opt_strs[1610] = /* 1414 */ "no-load-opts\0" /* 1427 */ "no\0" /* 1430 */ "NTPSNMPD\0" -/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1\n" +/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" /* 1542 */ "$HOME\0" /* 1548 */ ".\0" /* 1550 */ ".ntprc\0" /* 1557 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 1591 */ "\n\0" -/* 1593 */ "ntpsnmpd 4.2.8p1"; +/* 1593 */ "ntpsnmpd 4.2.8p2"; /** * nofork option description: @@ -554,7 +554,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpsnmpdOptions.pzCopyright */ - puts(_("ntpsnmpd 4.2.8p1\n\ + puts(_("ntpsnmpd 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -599,14 +599,14 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntpsnmpdOptions.pzUsageTitle */ - puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1\n\ + puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); /* referenced via ntpsnmpdOptions.pzExplain */ puts(_("\n")); /* referenced via ntpsnmpdOptions.pzFullVersion */ - puts(_("ntpsnmpd 4.2.8p1")); + puts(_("ntpsnmpd 4.2.8p2")); /* referenced via ntpsnmpdOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h index 9b9204133ecfe..54696153edee3 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:43:21 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:27:12 AM by AutoGen 5.18.5pre4 * From the definitions ntpsnmpd-opts.def * and the template file options * @@ -76,9 +76,9 @@ typedef enum { /** count of all options for ntpsnmpd */ #define OPTION_CT 8 /** ntpsnmpd version */ -#define NTPSNMPD_VERSION "4.2.8p1" +#define NTPSNMPD_VERSION "4.2.8p2" /** Full ntpsnmpd version text */ -#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p1" +#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman index 1c44243be1a3d..9724e26e35193 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpsnmpd 1ntpsnmpdman "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpsnmpd 1ntpsnmpdman "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-T1aO3s/ag-51aG2s) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-wFai4a/ag-JFaa3a) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:29 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:19 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc index 9374142cb83e9..7326bee989600 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPSNMPD 1ntpsnmpdmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:34 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:25 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.html b/contrib/ntp/ntpsnmpd/ntpsnmpd.html index 983b6dee87aa5..9d570bb6b0468 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd.html +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.html @@ -42,7 +42,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <p>The <code>ntpsnmpd</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance. It uses the standard NTP mode 6 control - <p>This document applies to version 4.2.8p1 of <code>ntpsnmpd</code>. + <p>This document applies to version 4.2.8p2 of <code>ntpsnmpd</code>. <ul class="menu"> <li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>: Description diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in index f0de336492b34..15ee8a20286c2 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpsnmpd @NTPSNMPD_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.TH ntpsnmpd @NTPSNMPD_MS@ "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-T1aO3s/ag-51aG2s) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-wFai4a/ag-JFaa3a) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:29 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:19 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in index d8d183d636577..5bf8bb998e7b4 100644 --- a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPSNMPD @NTPSNMPD_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:34 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:25 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/packageinfo.sh b/contrib/ntp/packageinfo.sh index f3b727e61a511..81106fe40be6c 100644 --- a/contrib/ntp/packageinfo.sh +++ b/contrib/ntp/packageinfo.sh @@ -41,7 +41,7 @@ # To see what UpdatePoint will do without modifying packageinfo.sh as it # does by default, use the -t/--test option before the repo type: # -# shell# scripts/UpdatePoint -t stable +# shell# scripts/build/UpdatePoint -t stable # # repotype must be stable or dev @@ -83,7 +83,7 @@ CLTAG=NTP_4_2_0 # - Numeric values increment # - empty 'increments' to 1 # - NEW 'increments' to empty -point=1 +point=2 ### betapoint is normally modified by script. # ntp-stable Beta number (betapoint) diff --git a/contrib/ntp/parseutil/Makefile.in b/contrib/ntp/parseutil/Makefile.in index e741a93e1a02d..999f4f1cc0fd7 100644 --- a/contrib/ntp/parseutil/Makefile.in +++ b/contrib/ntp/parseutil/Makefile.in @@ -41,8 +41,7 @@ subdir = parseutil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -324,6 +325,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/parseutil/dcfd.c b/contrib/ntp/parseutil/dcfd.c index 0db94c0be973f..652b375f78d73 100644 --- a/contrib/ntp/parseutil/dcfd.c +++ b/contrib/ntp/parseutil/dcfd.c @@ -1,6 +1,6 @@ /* * /src/NTP/REPOSITORY/ntp4-dev/parseutil/dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A - * + * * dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A * * DCF77 100/200ms pulse synchronisation daemon program (via 50Baud serial line) @@ -14,7 +14,7 @@ * Leap second handling (at that level you should switch to NTP Version 4 - really!) * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -198,7 +198,7 @@ static char skip_adjust = 1; /* discard first adjustment (bad samples) */ #define DCFB_ANNOUNCE 0x0001 /* switch time zone warning (DST switch) */ #define DCFB_DST 0x0002 /* DST in effect */ #define DCFB_LEAP 0x0004 /* LEAP warning (1 hour prior to occurrence) */ -#define DCFB_ALTERNATE 0x0008 /* alternate antenna used */ +#define DCFB_CALLBIT 0x0008 /* "call bit" used to signalize irregularities in the control facilities */ struct clocktime /* clock time broken up from time code */ { @@ -219,9 +219,16 @@ typedef struct clocktime clocktime_t; /* * (usually) quick constant multiplications */ +#ifndef TIMES10 #define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1)) /* *8 + *2 */ +#endif +#ifndef TIMES24 #define TIMES24(_X_) (((_X_) << 4) + ((_X_) << 3)) /* *16 + *8 */ +#endif +#ifndef TIMES60 #define TIMES60(_X_) ((((_X_) << 4) - (_X_)) << 2) /* *(16 - 1) *4 */ +#endif + /* * generic l_abs() function */ @@ -260,7 +267,8 @@ typedef struct clocktime clocktime_t; * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free - * 15 R - alternate antenna + * 15 R - "call bit" used to signalize irregularities in the control facilities + * (until 2003 indicated transmission via alternate antenna) * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal @@ -294,7 +302,7 @@ typedef struct clocktime clocktime_t; * while the length is given as the difference between the start index and * the start index of the following field. */ -static struct rawdcfcode +static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = @@ -361,7 +369,7 @@ static struct dcfparam { unsigned char onebits[60]; unsigned char zerobits[60]; -} dcfparam = +} dcfparam = { "###############RADMLS1248124P124812P1248121241248112481248P", /* 'ONE' representation */ "--------------------s-------p------p----------------------p" /* 'ZERO' representation */ @@ -384,7 +392,7 @@ ext_bf( register int i, first; first = rawdcfcode[idx].offset; - + for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; @@ -438,7 +446,7 @@ convert_rawdcf( PRINTF("%-30s", "*** INCOMPLETE"); return CVT_NONE; } - + /* * check Start and Parity bits */ @@ -495,7 +503,7 @@ convert_rawdcf( clock_time->flags |= DCFB_LEAP; if (ext_bf(buffer, DCF_R)) - clock_time->flags |= DCFB_ALTERNATE; + clock_time->flags |= DCFB_CALLBIT; return CVT_OK; } @@ -739,7 +747,7 @@ cvt_rawdcf( * if everything went well so far return the result of the symbolic * conversion routine else just the accumulated errors */ - if (rtc != CVT_NONE) + if (rtc != CVT_NONE) { PRINTF("%-30s", "*** BAD DATA"); } @@ -758,13 +766,13 @@ dcf_to_unixtime( ) { #define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); } - static int days_of_month[] = + static int days_of_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; register int i; time_t t; - + /* * map 2 digit years to 19xx (DCF77 is a 20th century item) */ @@ -847,7 +855,7 @@ dcf_to_unixtime( */ t = TIMES60(t) + clock_time->minute; /* sec */ - + /* * calculate UTC in minutes */ @@ -1247,7 +1255,7 @@ usage( */ static int check_y2k( void ) -{ +{ int year; /* current working year */ int year0 = 1900; /* sarting year for NTP time */ int yearend; /* ending year we test for NTP time. @@ -1306,7 +1314,7 @@ check_y2k( void ) * *a minor difference to arg2 type */ if ( ct.year != year ) { - fprintf( stdout, + fprintf( stdout, "%04d: dcf_to_unixtime(,%d) CORRUPTED ct.year: was %d\n", (int)year, (int)Flag, (int)ct.year ); Error(year); @@ -1316,9 +1324,9 @@ check_y2k( void ) Expected = t * 24 * 60 * 60; if ( Observed != Expected || Flag ) { /* time difference */ - fprintf( stdout, + fprintf( stdout, "%04d: dcf_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu (%ld)\n", - year, (int)Flag, + year, (int)Flag, (unsigned long)Observed, (unsigned long)Expected, ((long)Observed - (long)Expected) ); Error(year); @@ -1344,7 +1352,7 @@ rawdcf_init( * Here a voltage between the DTR and the RTS line is used. Unfortunately * the name has changed from CIOCM_DTR to TIOCM_DTR recently. */ - + #ifdef TIOCM_DTR int sl232 = TIOCM_DTR; /* turn on DTR for power supply */ #else @@ -1438,7 +1446,7 @@ main( errs=1; } break; - + case 'd': if (ac > 1) { @@ -1451,8 +1459,8 @@ main( errs=1; } break; - - case 'Y': + + case 'Y': errs=check_y2k(); exit( errs ? 1 : 0 ); @@ -1519,7 +1527,7 @@ main( unsigned int rtc = CVT_NONE; rawdcf_init(fd); - + timeout.tv_sec = 1; timeout.tv_usec = 500000; @@ -1560,7 +1568,7 @@ main( */ if (!interactive) detach(); - + /* * get syslog() initialized */ @@ -1618,7 +1626,7 @@ main( it.it_interval.tv_usec = 0; it.it_value.tv_sec = 1<<ADJINTERVAL; it.it_value.tv_usec = 0; - + if (setitimer(ITIMER_REAL, &it, (struct itimerval *)0) == -1) { syslog(LOG_ERR, "setitimer: %m"); @@ -1797,7 +1805,7 @@ main( wday[clock_time.wday], clock_time.hour, clock_time.minute, i, clock_time.day, clock_time.month, clock_time.year, - (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_", + (clock_time.flags & DCFB_CALLBIT) ? "R" : "_", (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_", (clock_time.flags & DCFB_DST) ? "D" : "_", (clock_time.flags & DCFB_LEAP) ? "L" : "_", @@ -1829,7 +1837,7 @@ main( fflush(stdout); } } while ((rrc == -1) && (errno == EINTR)); - + /* * lost IO - sorry guys */ @@ -1839,7 +1847,7 @@ main( } closelog(); - + return 0; } diff --git a/contrib/ntp/parseutil/testdcf.c b/contrib/ntp/parseutil/testdcf.c index c78c2424eb2fd..00bf05937fabb 100644 --- a/contrib/ntp/parseutil/testdcf.c +++ b/contrib/ntp/parseutil/testdcf.c @@ -2,11 +2,11 @@ * /src/NTP/ntp4-dev/parseutil/testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A * * testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A - * + * * simple DCF77 100/200ms pulse test program (via 50Baud serial line) * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,10 +46,10 @@ /* * state flags */ -#define DCFB_ANNOUNCE 0x0001 /* switch time zone warning (DST switch) */ -#define DCFB_DST 0x0002 /* DST in effect */ -#define DCFB_LEAP 0x0004 /* LEAP warning (1 hour prior to occurrence) */ -#define DCFB_ALTERNATE 0x0008 /* alternate antenna used */ +#define DCFB_ANNOUNCE 0x0001 /* switch time zone warning (DST switch) */ +#define DCFB_DST 0x0002 /* DST in effect */ +#define DCFB_LEAP 0x0004 /* LEAP warning (1 hour prior to occurrence) */ +#define DCFB_CALLBIT 0x0008 /* "call bit" used to signalize irregularities in the control facilities */ struct clocktime /* clock time broken up from time code */ { @@ -102,7 +102,8 @@ static char type(unsigned int); * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free - * 15 R - alternate antenna + * 15 R - "call bit" used to signalize irregularities in the control facilities + * (until 2003 indicated transmission via alternate antenna) * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal @@ -130,7 +131,7 @@ static char type(unsigned int); static char revision[] = "4.10"; -static struct rawdcfcode +static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = @@ -185,7 +186,7 @@ ext_bf( register int i, first; first = rawdcfcode[idx].offset; - + for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; @@ -223,7 +224,7 @@ convert_rawdcf( printf("%-30s", "*** INCOMPLETE"); return CVT_NONE; } - + /* * check Start and Parity bits */ @@ -274,7 +275,7 @@ convert_rawdcf( clock_time->flags |= DCFB_LEAP; if (ext_bf(buffer, DCF_R)) - clock_time->flags |= DCFB_ALTERNATE; + clock_time->flags |= DCFB_CALLBIT; return CVT_OK; } @@ -490,7 +491,7 @@ main( wday[clock_time.wday], (int)clock_time.hour, (int)clock_time.minute, (int)i, (int)clock_time.day, (int)clock_time.month, (int)clock_time.year, - (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_", + (clock_time.flags & DCFB_CALLBIT) ? "R" : "_", (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_", (clock_time.flags & DCFB_DST) ? "D" : "_", (clock_time.flags & DCFB_LEAP) ? "L" : "_" diff --git a/contrib/ntp/scripts/Makefile.am b/contrib/ntp/scripts/Makefile.am index 7ddf4247bf479..2664bef4def8c 100644 --- a/contrib/ntp/scripts/Makefile.am +++ b/contrib/ntp/scripts/Makefile.am @@ -6,6 +6,7 @@ SUBDIRS= \ ntpsweep \ ntptrace \ lib \ + update-leap \ $(NULL) man1_MANS= diff --git a/contrib/ntp/scripts/Makefile.in b/contrib/ntp/scripts/Makefile.in index 2222f3bc5f060..c0ff722108e0b 100644 --- a/contrib/ntp/scripts/Makefile.in +++ b/contrib/ntp/scripts/Makefile.in @@ -42,8 +42,7 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -72,6 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -356,6 +357,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ @@ -422,6 +428,7 @@ SUBDIRS = \ ntpsweep \ ntptrace \ lib \ + update-leap \ $(NULL) man1_MANS = diff --git a/contrib/ntp/scripts/build/Makefile.in b/contrib/ntp/scripts/build/Makefile.in index 13e9011bd0542..2f6b0260d0653 100644 --- a/contrib/ntp/scripts/build/Makefile.in +++ b/contrib/ntp/scripts/build/Makefile.in @@ -40,8 +40,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -287,6 +288,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/calc_tickadj/Makefile.in b/contrib/ntp/scripts/calc_tickadj/Makefile.in index 197f48460f3c4..154e4a3a0493b 100644 --- a/contrib/ntp/scripts/calc_tickadj/Makefile.in +++ b/contrib/ntp/scripts/calc_tickadj/Makefile.in @@ -42,8 +42,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -72,6 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -318,6 +319,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman index 4d3ce1a18db42..e5008ccc700a5 100644 --- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman +++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH calc_tickadj 1calc_tickadjman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH calc_tickadj 1calc_tickadjman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-1GaySe/ag-cHaGRe) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_1aOBS/ag-n2aWAS) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:11 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:04 AM by AutoGen 5.18.5pre4 .\" From the definitions calc_tickadj-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc index ac992ab7a1b3b..7135beb2bdba2 100644 --- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc +++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:14 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:08 AM by AutoGen 5.18.5pre4 .\" From the definitions calc_tickadj-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html index 0b68e58a62476..b64096d9269e4 100644 --- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html +++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html @@ -31,7 +31,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <h2 class="unnumbered">calc_tickadj User's Manual</h2> <p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program. -This document applies to version 4.2.8p1 of <code>calc_tickadj</code>. +This document applies to version 4.2.8p2 of <code>calc_tickadj</code>. <div class="shortcontents"> <h2>Short Contents</h2> diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in index 4d3ce1a18db42..e5008ccc700a5 100644 --- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in +++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH calc_tickadj 1calc_tickadjman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH calc_tickadj 1calc_tickadjman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-1GaySe/ag-cHaGRe) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_1aOBS/ag-n2aWAS) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:11 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:04 AM by AutoGen 5.18.5pre4 .\" From the definitions calc_tickadj-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in index ac992ab7a1b3b..7135beb2bdba2 100644 --- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in +++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:14 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:08 AM by AutoGen 5.18.5pre4 .\" From the definitions calc_tickadj-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi index 163380103dbdd..c9e44b82ca93c 100644 --- a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi +++ b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-calc_tickadj.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:16 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:09 AM by AutoGen 5.18.5pre4 # From the definitions calc_tickadj-opts.def # and the template file agtexi-cmd.tpl @end ignore diff --git a/contrib/ntp/scripts/invoke-plot_summary.texi b/contrib/ntp/scripts/invoke-plot_summary.texi index 6f482f8441425..48ea5b48e1e72 100644 --- a/contrib/ntp/scripts/invoke-plot_summary.texi +++ b/contrib/ntp/scripts/invoke-plot_summary.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-plot_summary.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:53 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:51 AM by AutoGen 5.18.5pre4 # From the definitions plot_summary-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -41,7 +41,7 @@ with a status code of 0. @exampleindent 0 @example -plot_summary - plot statistics generated by summary script - Ver. 4.2.8p1 +plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2 USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... --directory=str Where the summary files are diff --git a/contrib/ntp/scripts/invoke-summary.texi b/contrib/ntp/scripts/invoke-summary.texi index cfac1b1dfb885..16fc2220a82e2 100644 --- a/contrib/ntp/scripts/invoke-summary.texi +++ b/contrib/ntp/scripts/invoke-summary.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-summary.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:59 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:57 AM by AutoGen 5.18.5pre4 # From the definitions summary-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -42,7 +42,7 @@ with a status code of 0. @exampleindent 0 @example -summary - compute various stastics from NTP stat files - Ver. 4.2.8p1 +summary - compute various stastics from NTP stat files - Ver. 4.2.8p2 USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... --directory=str Directory containing stat files diff --git a/contrib/ntp/scripts/lib/Makefile.in b/contrib/ntp/scripts/lib/Makefile.in index c1437a49d88e0..2b0f097ad839e 100644 --- a/contrib/ntp/scripts/lib/Makefile.in +++ b/contrib/ntp/scripts/lib/Makefile.in @@ -39,8 +39,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -69,6 +68,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -308,6 +309,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/lib/NTP/Util.pm b/contrib/ntp/scripts/lib/NTP/Util.pm index 66f2453bf0cfd..cd2f9e5a7a5d5 100644 --- a/contrib/ntp/scripts/lib/NTP/Util.pm +++ b/contrib/ntp/scripts/lib/NTP/Util.pm @@ -93,18 +93,27 @@ sub do_dns { sub ntp_peers { my ($host) = @_; - my $cmd = "$ntpq_path -np $host |"; + $host ||= ''; + my $cmd = "$ntpq_path -npw $host |"; open my $fh, $cmd or croak "Could not start ntpq: $!"; <$fh> for 1 .. 2; - my @columns = qw(remote refid st t when poll reach delay offset jitter); + my @columns = qw(tally host refid st t when poll reach delay offset jitter); my @peers; while (<$fh>) { - if (/(?:[\w\.\*-]+\s*){10}/) { + if (/^([ x+#*o-])((?:[\w.*:-]+\s+){10}|([\w.*:-]+\s+))$/) { my $col = 0; - push @peers, { map {; $columns[ $col++ ] => $_ } split /(?<=.)\s+/ }; + my @line = ($1, split /\s+/, $2); + if( @line == 2 ) { + defined ($_ = <$fh>) or last; + s/^\s+//; + push @line, split /\s+/; + } + my $r = { map {; $columns[ $col++ ] => $_ } @line }; + $r->{remote} = $r->{tally} . $r->{host}; + push @peers, $r; } else { #TODO return error (but not needed anywhere now) @@ -135,3 +144,5 @@ sub ntp_sntp_line { close $fh or croak "running sntp failed: $! (exit status $?)"; return ($offset, $stratum); } + +1; diff --git a/contrib/ntp/scripts/ntp-wait/Makefile.in b/contrib/ntp/scripts/ntp-wait/Makefile.in index 4b2c58f2521e7..a18414da0912a 100644 --- a/contrib/ntp/scripts/ntp-wait/Makefile.in +++ b/contrib/ntp/scripts/ntp-wait/Makefile.in @@ -41,8 +41,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -317,6 +318,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi index 19f3953f7dc33..9053e8af9f54f 100644 --- a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi +++ b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:23 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:17 AM by AutoGen 5.18.5pre4 # From the definitions ntp-wait-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -61,7 +61,7 @@ with a status code of 0. @exampleindent 0 @example -ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p1 +ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... -n, --tries=num Number of times to check ntpd diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts index b8f832585f24e..ff99fe57db350 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts @@ -1,6 +1,6 @@ # EDIT THIS FILE WITH CAUTION (ntp-wait-opts) # -# It has been AutoGen-ed February 4, 2015 at 02:37:18 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:11 AM by AutoGen 5.18.5pre4 # From the definitions ntp-wait-opts.def # and the template file perlopt @@ -40,7 +40,7 @@ sub processOptions { 'help|?', 'more-help')); $usage = <<'USAGE'; -ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p1 +ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]... -n, --tries=num Number of times to check ntpd diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman index 4d41ede4a259d..65a97fd18c274 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp-wait 1ntp-waitman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntp-wait 1ntp-waitman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yXaGgg/ag-LXaOfg) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CkaW1T/ag-Oka40T) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:20 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:13 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-wait-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc index 9720e45a43fe9..1340e5a22203d 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_WAIT 1ntp-waitmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:26 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:20 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-wait-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.html b/contrib/ntp/scripts/ntp-wait/ntp-wait.html index 01840fde56497..7cc8b992a1bff 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait.html +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.html @@ -39,7 +39,7 @@ until the system's time has stabilized and synchronized, and only then start any applicaitons (like database servers) that require accurate and stable time. - <p>This document applies to version 4.2.8p1 of <code>ntp-wait</code>. + <p>This document applies to version 4.2.8p2 of <code>ntp-wait</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -114,7 +114,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p1 +<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]... -n, --tries=num Number of times to check ntpd diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in index 8d569c0cd4a59..a4edec4dc6e23 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp-wait @NTP_WAIT_MS@ "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntp-wait @NTP_WAIT_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yXaGgg/ag-LXaOfg) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CkaW1T/ag-Oka40T) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:20 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:13 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-wait-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in index 43514a03017b3..c61340d0528be 100644 --- a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in +++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_WAIT @NTP_WAIT_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:26 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:20 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-wait-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/ntpsweep/Makefile.in b/contrib/ntp/scripts/ntpsweep/Makefile.in index e0d1dc6eb881b..38af36a858691 100644 --- a/contrib/ntp/scripts/ntpsweep/Makefile.in +++ b/contrib/ntp/scripts/ntpsweep/Makefile.in @@ -41,8 +41,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -318,6 +319,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi index fef89ae402ad4..207577a436d7a 100644 --- a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi +++ b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpsweep.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:33 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:23 AM by AutoGen 5.18.5pre4 # From the definitions ntpsweep-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -45,7 +45,7 @@ with a status code of 0. @exampleindent 0 @example -ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p1 +ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2 USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile] -l, --host-list=str Host to execute actions on diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts index cacc78bc13df3..b833b08dca4d9 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts @@ -1,6 +1,6 @@ # EDIT THIS FILE WITH CAUTION (ntpsweep-opts) # -# It has been AutoGen-ed February 4, 2015 at 02:37:31 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:21 AM by AutoGen 5.18.5pre4 # From the definitions ntpsweep-opts.def # and the template file perlopt @@ -43,7 +43,7 @@ sub processOptions { 'help|?', 'more-help')); $usage = <<'USAGE'; -ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p1 +ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2 USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile] -l, --host-list=str Host to execute actions on diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman index 624884435584d..9ba96830b8459 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpsweep 1ntpsweepman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntpsweep 1ntpsweepman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8JaOIh/ag-jKaWHh) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pka4rV/ag-CkaarV) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:35 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:25 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsweep-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc index d51cd4540d88f..d933c83a1d0f6 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPSWEEP 1ntpsweepmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:39 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:29 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsweep-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.html b/contrib/ntp/scripts/ntpsweep/ntpsweep.html index 453899bd72e29..1fc5f54b39a7c 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep.html +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.html @@ -30,7 +30,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <p>This document describes the use of the NTP Project's <code>ntpsweep</code> program. - <p>This document applies to version 4.2.8p1 of <code>ntpsweep</code>. + <p>This document applies to version 4.2.8p2 of <code>ntpsweep</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -90,7 +90,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p1 +<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2 USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile] -l, --host-list=str Host to execute actions on diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in index 624884435584d..9ba96830b8459 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpsweep 1ntpsweepman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntpsweep 1ntpsweepman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8JaOIh/ag-jKaWHh) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pka4rV/ag-CkaarV) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:35 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:25 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsweep-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in index d51cd4540d88f..d933c83a1d0f6 100644 --- a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in +++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPSWEEP 1ntpsweepmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:39 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:29 AM by AutoGen 5.18.5pre4 .\" From the definitions ntpsweep-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/ntptrace/Makefile.in b/contrib/ntp/scripts/ntptrace/Makefile.in index f123f16dd267b..8d7db402d8320 100644 --- a/contrib/ntp/scripts/ntptrace/Makefile.in +++ b/contrib/ntp/scripts/ntptrace/Makefile.in @@ -41,8 +41,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -317,6 +318,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi index b3792dd0cddb4..58548c11e748b 100644 --- a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi +++ b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:37:46 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:36 AM by AutoGen 5.18.5pre4 # From the definitions ntptrace-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -62,7 +62,7 @@ with a status code of 0. @exampleindent 0 @example -ntptrace - Trace peers of an NTP server - Ver. 4.2.8p1 +ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2 USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host] -n, --numeric Print IP addresses instead of hostnames diff --git a/contrib/ntp/scripts/ntptrace/ntptrace-opts b/contrib/ntp/scripts/ntptrace/ntptrace-opts index 7bbdeb3532eb5..3012392b38acb 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace-opts +++ b/contrib/ntp/scripts/ntptrace/ntptrace-opts @@ -1,6 +1,6 @@ # EDIT THIS FILE WITH CAUTION (ntptrace-opts) # -# It has been AutoGen-ed February 4, 2015 at 02:37:40 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:31 AM by AutoGen 5.18.5pre4 # From the definitions ntptrace-opts.def # and the template file perlopt @@ -40,7 +40,7 @@ sub processOptions { 'help|?', 'more-help')); $usage = <<'USAGE'; -ntptrace - Trace peers of an NTP server - Ver. 4.2.8p1 +ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2 USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host] -n, --numeric Print IP addresses instead of hostnames diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman index 82bc037e86c6b..ff02de0e62798 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman +++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntptrace 1ntptraceman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntptrace 1ntptraceman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nrai1i/ag-Araq0i) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-j_aqKW/ag-w_ayJW) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:42 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:33 AM by AutoGen 5.18.5pre4 .\" From the definitions ntptrace-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc index 5528eea74a12f..352b659931ae6 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc +++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPTRACE 1ntptracemdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:48 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:38 AM by AutoGen 5.18.5pre4 .\" From the definitions ntptrace-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.html b/contrib/ntp/scripts/ntptrace/ntptrace.html index 291b9e91d6fe0..86e1a9b4684ae 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace.html +++ b/contrib/ntp/scripts/ntptrace/ntptrace.html @@ -31,7 +31,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <h2 class="unnumbered">Simple Network Time Protocol User Manual</h2> <p>This document describes the use of the NTP Project's <code>ntptrace</code> program. -This document applies to version 4.2.8p1 of <code>ntptrace</code>. +This document applies to version 4.2.8p2 of <code>ntptrace</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -107,7 +107,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p1 +<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2 USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host] -n, --numeric Print IP addresses instead of hostnames diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.man.in b/contrib/ntp/scripts/ntptrace/ntptrace.man.in index c30859799753a..f48a071b56d84 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace.man.in +++ b/contrib/ntp/scripts/ntptrace/ntptrace.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntptrace @NTPTRACE_MS@ "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntptrace @NTPTRACE_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nrai1i/ag-Araq0i) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-j_aqKW/ag-w_ayJW) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:42 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:33 AM by AutoGen 5.18.5pre4 .\" From the definitions ntptrace-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in index c8fffcf1381f8..c06e718c02b51 100644 --- a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in +++ b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTPTRACE @NTPTRACE_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:48 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:38 AM by AutoGen 5.18.5pre4 .\" From the definitions ntptrace-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/plot_summary-opts b/contrib/ntp/scripts/plot_summary-opts index ed27025d829fc..3f03890986529 100644 --- a/contrib/ntp/scripts/plot_summary-opts +++ b/contrib/ntp/scripts/plot_summary-opts @@ -1,6 +1,6 @@ # EDIT THIS FILE WITH CAUTION (plot_summary-opts) # -# It has been AutoGen-ed February 4, 2015 at 02:37:49 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:47 AM by AutoGen 5.18.5pre4 # From the definitions plot_summary-opts.def # and the template file perlopt @@ -46,7 +46,7 @@ sub processOptions { 'help|?', 'more-help')); $usage = <<'USAGE'; -plot_summary - plot statistics generated by summary script - Ver. 4.2.8p1 +plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2 USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... --directory=str Where the summary files are diff --git a/contrib/ntp/scripts/plot_summary.1plot_summaryman b/contrib/ntp/scripts/plot_summary.1plot_summaryman index dd3d842128eef..03dc6c54ed8a0 100644 --- a/contrib/ntp/scripts/plot_summary.1plot_summaryman +++ b/contrib/ntp/scripts/plot_summary.1plot_summaryman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH plot_summary 1plot_summaryman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH plot_summary 1plot_summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-GxaG3k/ag-VxaO2k) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-48aGzZ/ag-f9aOyZ) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:55 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:53 AM by AutoGen 5.18.5pre4 .\" From the definitions plot_summary-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc index 1d6ba70c415cb..4d7f49228982a 100644 --- a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc +++ b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:57 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:55 AM by AutoGen 5.18.5pre4 .\" From the definitions plot_summary-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/plot_summary.html b/contrib/ntp/scripts/plot_summary.html index d4a023539b573..b2fbc66cf6d75 100644 --- a/contrib/ntp/scripts/plot_summary.html +++ b/contrib/ntp/scripts/plot_summary.html @@ -31,7 +31,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <h2 class="unnumbered">Plot_summary User Manual</h2> <p>This document describes the use of the NTP Project's <code>plot_summary</code> program. -This document applies to version 4.2.8p1 of <code>plot_summary</code>. +This document applies to version 4.2.8p2 of <code>plot_summary</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -89,7 +89,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p1 +<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2 USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... --directory=str Where the summary files are diff --git a/contrib/ntp/scripts/plot_summary.man.in b/contrib/ntp/scripts/plot_summary.man.in index dd3d842128eef..03dc6c54ed8a0 100644 --- a/contrib/ntp/scripts/plot_summary.man.in +++ b/contrib/ntp/scripts/plot_summary.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH plot_summary 1plot_summaryman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH plot_summary 1plot_summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-GxaG3k/ag-VxaO2k) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-48aGzZ/ag-f9aOyZ) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:55 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:53 AM by AutoGen 5.18.5pre4 .\" From the definitions plot_summary-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/plot_summary.mdoc.in b/contrib/ntp/scripts/plot_summary.mdoc.in index 1d6ba70c415cb..4d7f49228982a 100644 --- a/contrib/ntp/scripts/plot_summary.mdoc.in +++ b/contrib/ntp/scripts/plot_summary.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:37:57 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:55 AM by AutoGen 5.18.5pre4 .\" From the definitions plot_summary-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/summary-opts b/contrib/ntp/scripts/summary-opts index 5f6921b5aa93c..adb228dcb2888 100644 --- a/contrib/ntp/scripts/summary-opts +++ b/contrib/ntp/scripts/summary-opts @@ -1,6 +1,6 @@ # EDIT THIS FILE WITH CAUTION (summary-opts) # -# It has been AutoGen-ed February 4, 2015 at 02:37:51 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:21:49 AM by AutoGen 5.18.5pre4 # From the definitions summary-opts.def # and the template file perlopt @@ -44,7 +44,7 @@ sub processOptions { 'help|?', 'more-help')); $usage = <<'USAGE'; -summary - compute various stastics from NTP stat files - Ver. 4.2.8p1 +summary - compute various stastics from NTP stat files - Ver. 4.2.8p2 USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... --directory=str Directory containing stat files diff --git a/contrib/ntp/scripts/summary.1summaryman b/contrib/ntp/scripts/summary.1summaryman index 5f3cf6b649d8f..d1eeb4898aaa9 100644 --- a/contrib/ntp/scripts/summary.1summaryman +++ b/contrib/ntp/scripts/summary.1summaryman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH summary 1summaryman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH summary 1summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-kPaifl/ag-xPaqel) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jpaiNZ/ag-wpaqMZ) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:38:00 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:58 AM by AutoGen 5.18.5pre4 .\" From the definitions summary-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/summary.1summarymdoc b/contrib/ntp/scripts/summary.1summarymdoc index 8fc7836f63f23..3c77a8cceea9c 100644 --- a/contrib/ntp/scripts/summary.1summarymdoc +++ b/contrib/ntp/scripts/summary.1summarymdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt SUMMARY 1summarymdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:38:02 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:22:00 AM by AutoGen 5.18.5pre4 .\" From the definitions summary-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/summary.html b/contrib/ntp/scripts/summary.html index 81080966e1403..5326c6a6ce0f5 100644 --- a/contrib/ntp/scripts/summary.html +++ b/contrib/ntp/scripts/summary.html @@ -31,7 +31,7 @@ Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> <h2 class="unnumbered">Summary User Manual</h2> <p>This document describes the use of the NTP Project's <code>summary</code> program. -This document applies to version 4.2.8p1 of <code>summary</code>. +This document applies to version 4.2.8p2 of <code>summary</code>. <div class="shortcontents"> <h2>Short Contents</h2> @@ -88,7 +88,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p1 +<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p2 USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... --directory=str Directory containing stat files diff --git a/contrib/ntp/scripts/summary.man.in b/contrib/ntp/scripts/summary.man.in index 5f3cf6b649d8f..d1eeb4898aaa9 100644 --- a/contrib/ntp/scripts/summary.man.in +++ b/contrib/ntp/scripts/summary.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH summary 1summaryman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH summary 1summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-kPaifl/ag-xPaqel) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jpaiNZ/ag-wpaqMZ) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:38:00 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:21:58 AM by AutoGen 5.18.5pre4 .\" From the definitions summary-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/scripts/summary.mdoc.in b/contrib/ntp/scripts/summary.mdoc.in index 8fc7836f63f23..3c77a8cceea9c 100644 --- a/contrib/ntp/scripts/summary.mdoc.in +++ b/contrib/ntp/scripts/summary.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt SUMMARY 1summarymdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:38:02 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:22:00 AM by AutoGen 5.18.5pre4 .\" From the definitions summary-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/scripts/update-leap/Makefile.am b/contrib/ntp/scripts/update-leap/Makefile.am new file mode 100644 index 0000000000000..163810233b19d --- /dev/null +++ b/contrib/ntp/scripts/update-leap/Makefile.am @@ -0,0 +1,97 @@ +NULL= +run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \ + autogen -L ../../sntp/include -L ../../sntp/ag-tpl \ + --writable +std_def_list = \ + $(top_srcdir)/sntp/include/debug-opt.def \ + $(top_srcdir)/sntp/include/autogen-version.def \ + $(top_srcdir)/sntp/include/copyright.def \ + $(top_srcdir)/sntp/include/homerc.def \ + $(top_srcdir)/sntp/include/ntp.lic \ + $(top_srcdir)/sntp/include/version.def \ + $(NULL) + +bin_SCRIPTS= $(UPDATE_LEAP_DB) +sbin_SCRIPTS= $(UPDATE_LEAP_DS) +libexec_SCRIPTS= $(UPDATE_LEAP_DL) +noinst_SCRIPTS= $(UPDATE_LEAP_NI) +EXTRA_SCRIPTS= update-leap + +man1_MANS= +man8_MANS= +if INSTALL_UPDATE_LEAP +man_MANS= update-leap.$(UPDATE_LEAP_MS) +else +noinst_MANS= update-leap.$(UPDATE_LEAP_MS) +endif + +EXTRA_DIST = \ + invoke-update-leap.menu \ + invoke-update-leap.texi \ + update-leap \ + update-leap-opts.def \ + update-leap-opts \ + update-leap.1update-leapman \ + update-leap.1update-leapmdoc \ + update-leap.man.in \ + update-leap.mdoc.in \ + update-leap.texi \ + update-leap.html \ + $(NULL) + +html_DATA = update-leap.html + +#CLEANFILES = update-leap.1 +DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS) + +noinst_DATA = \ + invoke-update-leap.menu \ + invoke-update-leap.texi \ + update-leap.man.in \ + update-leap.mdoc.in \ + update-leap-opts \ + $(NULL) + +$(srcdir)/update-leap: $(srcdir)/update-leap-opts + @: do-nothing action to avoid default SCCS get + +$(srcdir)/update-leap-opts: update-leap-opts.def $(std_def_list) + $(run_ag) update-leap-opts.def + +### Man + +$(srcdir)/update-leap.1update-leapman: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def + +$(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapman > $(srcdir)/update-leap.man.in+ + mv $(srcdir)/update-leap.man.in+ $(srcdir)/update-leap.man.in + +### Mdoc + +$(srcdir)/update-leap.1update-leapmdoc: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def + +$(srcdir)/update-leap.mdoc.in: $(srcdir)/update-leap.1update-leapmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapmdoc > $(srcdir)/update-leap.mdoc.in+ + mv $(srcdir)/update-leap.mdoc.in+ $(srcdir)/update-leap.mdoc.in + +### Manpage + +update-leap.$(UPDATE_LEAP_MS): $(srcdir)/update-leap.$(MANTAGFMT).in $(top_builddir)/config.status + $(top_builddir)/config.status --file=update-leap.$(UPDATE_LEAP_MS)+:$(srcdir)/update-leap.$(MANTAGFMT).in + mv update-leap.$(UPDATE_LEAP_MS)+ update-leap.$(UPDATE_LEAP_MS) + +### Texinfo + +$(srcdir)/invoke-update-leap.menu: $(srcdir)/invoke-update-leap.texi + @: do-nothing action to avoid default SCCS get, .menu built with .texi + +$(srcdir)/invoke-update-leap.texi: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def + $(top_srcdir)/scripts/build/check--help $@ + +### HTML + +$(srcdir)/update-leap.html: $(srcdir)/update-leap.texi $(top_srcdir)/sntp/include/version.texi + cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o update-leap.html update-leap.texi || true ) diff --git a/contrib/ntp/scripts/update-leap/Makefile.in b/contrib/ntp/scripts/update-leap/Makefile.in new file mode 100644 index 0000000000000..3ac6ac6949dde --- /dev/null +++ b/contrib/ntp/scripts/update-leap/Makefile.in @@ -0,0 +1,887 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = scripts/update-leap +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ + $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ + $(top_srcdir)/sntp/m4/define_dir.m4 \ + $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ + $(top_srcdir)/sntp/m4/libtool.m4 \ + $(top_srcdir)/sntp/m4/ltoptions.m4 \ + $(top_srcdir)/sntp/m4/ltsugar.m4 \ + $(top_srcdir)/sntp/m4/ltversion.m4 \ + $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ + $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ + $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ + $(top_srcdir)/sntp/m4/ntp_crypto_rand.m4 \ + $(top_srcdir)/sntp/m4/ntp_debug.m4 \ + $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ + $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ + $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ + $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ + $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ + $(top_srcdir)/sntp/m4/ntp_libevent.m4 \ + $(top_srcdir)/sntp/m4/ntp_libntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \ + $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \ + $(top_srcdir)/sntp/m4/ntp_openssl.m4 \ + $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \ + $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \ + $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \ + $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ + $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/snprintf.m4 \ + $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)" +SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(noinst_SCRIPTS) \ + $(sbin_SCRIPTS) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +man1dir = $(mandir)/man1 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man1_MANS) $(man8_MANS) $(man_MANS) +DATA = $(html_DATA) $(noinst_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CALC_TICKADJ_DB = @CALC_TICKADJ_DB@ +CALC_TICKADJ_DL = @CALC_TICKADJ_DL@ +CALC_TICKADJ_DS = @CALC_TICKADJ_DS@ +CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ +CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAGS_NTP = @CFLAGS_NTP@ +CHUTEST = @CHUTEST@ +CONFIG_SHELL = @CONFIG_SHELL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ +CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DCFD = @DCFD@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EDITLINE_LIBS = @EDITLINE_LIBS@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ +GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +GTEST_LIBS = @GTEST_LIBS@ +HAVE_INLINE = @HAVE_INLINE@ +HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ +HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD_LIBEVENT = @LDADD_LIBEVENT@ +LDADD_LIBNTP = @LDADD_LIBNTP@ +LDADD_LIBUTIL = @LDADD_LIBUTIL@ +LDADD_NLIST = @LDADD_NLIST@ +LDADD_NTP = @LDADD_NTP@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_NTP = @LDFLAGS_NTP@ +LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ +LIBOPTS_DIR = @LIBOPTS_DIR@ +LIBOPTS_LDADD = @LIBOPTS_LDADD@ +LIBPARSE = @LIBPARSE@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LSCF = @LSCF@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_ADJTIMED = @MAKE_ADJTIMED@ +MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@ +MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ +MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ +MAKE_LIBPARSE = @MAKE_LIBPARSE@ +MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ +MAKE_NTPDSIM = @MAKE_NTPDSIM@ +MAKE_NTPSNMPD = @MAKE_NTPSNMPD@ +MAKE_NTPTIME = @MAKE_NTPTIME@ +MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ +MAKE_TICKADJ = @MAKE_TICKADJ@ +MAKE_TIMETRIM = @MAKE_TIMETRIM@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANTAGFMT = @MANTAGFMT@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NTPDATE_DB = @NTPDATE_DB@ +NTPDATE_DL = @NTPDATE_DL@ +NTPDATE_DS = @NTPDATE_DS@ +NTPDATE_MS = @NTPDATE_MS@ +NTPDATE_NI = @NTPDATE_NI@ +NTPDC_DB = @NTPDC_DB@ +NTPDC_DL = @NTPDC_DL@ +NTPDC_DS = @NTPDC_DS@ +NTPDC_MS = @NTPDC_MS@ +NTPDC_NI = @NTPDC_NI@ +NTPDSIM_DB = @NTPDSIM_DB@ +NTPDSIM_DL = @NTPDSIM_DL@ +NTPDSIM_DS = @NTPDSIM_DS@ +NTPDSIM_MS = @NTPDSIM_MS@ +NTPDSIM_NI = @NTPDSIM_NI@ +NTPD_DB = @NTPD_DB@ +NTPD_DL = @NTPD_DL@ +NTPD_DS = @NTPD_DS@ +NTPD_MS = @NTPD_MS@ +NTPD_NI = @NTPD_NI@ +NTPQ_DB = @NTPQ_DB@ +NTPQ_DL = @NTPQ_DL@ +NTPQ_DS = @NTPQ_DS@ +NTPQ_MS = @NTPQ_MS@ +NTPQ_NI = @NTPQ_NI@ +NTPSNMPD_DB = @NTPSNMPD_DB@ +NTPSNMPD_DL = @NTPSNMPD_DL@ +NTPSNMPD_DS = @NTPSNMPD_DS@ +NTPSNMPD_MS = @NTPSNMPD_MS@ +NTPSNMPD_NI = @NTPSNMPD_NI@ +NTPSWEEP_DB = @NTPSWEEP_DB@ +NTPSWEEP_DL = @NTPSWEEP_DL@ +NTPSWEEP_DS = @NTPSWEEP_DS@ +NTPSWEEP_MS = @NTPSWEEP_MS@ +NTPSWEEP_NI = @NTPSWEEP_NI@ +NTPTIME_DB = @NTPTIME_DB@ +NTPTIME_DL = @NTPTIME_DL@ +NTPTIME_DS = @NTPTIME_DS@ +NTPTIME_MS = @NTPTIME_MS@ +NTPTIME_NI = @NTPTIME_NI@ +NTPTRACE_DB = @NTPTRACE_DB@ +NTPTRACE_DL = @NTPTRACE_DL@ +NTPTRACE_DS = @NTPTRACE_DS@ +NTPTRACE_MS = @NTPTRACE_MS@ +NTPTRACE_NI = @NTPTRACE_NI@ +NTP_KEYGEN_DB = @NTP_KEYGEN_DB@ +NTP_KEYGEN_DL = @NTP_KEYGEN_DL@ +NTP_KEYGEN_DS = @NTP_KEYGEN_DS@ +NTP_KEYGEN_MS = @NTP_KEYGEN_MS@ +NTP_KEYGEN_NI = @NTP_KEYGEN_NI@ +NTP_KEYSDIR = @NTP_KEYSDIR@ +NTP_WAIT_DB = @NTP_WAIT_DB@ +NTP_WAIT_DL = @NTP_WAIT_DL@ +NTP_WAIT_DS = @NTP_WAIT_DS@ +NTP_WAIT_MS = @NTP_WAIT_MS@ +NTP_WAIT_NI = @NTP_WAIT_NI@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@ +PATH_PERL = @PATH_PERL@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TEST = @PATH_TEST@ +PERLLIBDIR = @PERLLIBDIR@ +PKG_CONFIG = @PKG_CONFIG@ +POSIX_SHELL = @POSIX_SHELL@ +PROPDELAY = @PROPDELAY@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SNTP = @SNTP@ +SNTP_DB = @SNTP_DB@ +SNTP_DL = @SNTP_DL@ +SNTP_DS = @SNTP_DS@ +SNTP_MS = @SNTP_MS@ +SNTP_NI = @SNTP_NI@ +STDNORETURN_H = @STDNORETURN_H@ +STRIP = @STRIP@ +TESTDCF = @TESTDCF@ +TICKADJ_DB = @TICKADJ_DB@ +TICKADJ_DL = @TICKADJ_DL@ +TICKADJ_DS = @TICKADJ_DS@ +TICKADJ_MS = @TICKADJ_MS@ +TICKADJ_NI = @TICKADJ_NI@ +TIMETRIM_DB = @TIMETRIM_DB@ +TIMETRIM_DL = @TIMETRIM_DL@ +TIMETRIM_DS = @TIMETRIM_DS@ +TIMETRIM_MS = @TIMETRIM_MS@ +TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ +VERSION = @VERSION@ +VER_SUFFIX = @VER_SUFFIX@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NULL = +run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \ + autogen -L ../../sntp/include -L ../../sntp/ag-tpl \ + --writable + +std_def_list = \ + $(top_srcdir)/sntp/include/debug-opt.def \ + $(top_srcdir)/sntp/include/autogen-version.def \ + $(top_srcdir)/sntp/include/copyright.def \ + $(top_srcdir)/sntp/include/homerc.def \ + $(top_srcdir)/sntp/include/ntp.lic \ + $(top_srcdir)/sntp/include/version.def \ + $(NULL) + +bin_SCRIPTS = $(UPDATE_LEAP_DB) +sbin_SCRIPTS = $(UPDATE_LEAP_DS) +libexec_SCRIPTS = $(UPDATE_LEAP_DL) +noinst_SCRIPTS = $(UPDATE_LEAP_NI) +EXTRA_SCRIPTS = update-leap +man1_MANS = +man8_MANS = +@INSTALL_UPDATE_LEAP_TRUE@man_MANS = update-leap.$(UPDATE_LEAP_MS) +@INSTALL_UPDATE_LEAP_FALSE@noinst_MANS = update-leap.$(UPDATE_LEAP_MS) +EXTRA_DIST = \ + invoke-update-leap.menu \ + invoke-update-leap.texi \ + update-leap \ + update-leap-opts.def \ + update-leap-opts \ + update-leap.1update-leapman \ + update-leap.1update-leapmdoc \ + update-leap.man.in \ + update-leap.mdoc.in \ + update-leap.texi \ + update-leap.html \ + $(NULL) + +html_DATA = update-leap.html + +#CLEANFILES = update-leap.1 +DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS) +noinst_DATA = \ + invoke-update-leap.menu \ + invoke-update-leap.texi \ + update-leap.man.in \ + update-leap.mdoc.in \ + update-leap-opts \ + $(NULL) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/update-leap/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign scripts/update-leap/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files +install-libexecSCRIPTS: $(libexec_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" + @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } +install-htmlDATA: $(html_DATA) + @$(NORMAL_INSTALL) + test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" + @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done + +uninstall-htmlDATA: + @$(NORMAL_UNINSTALL) + @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(htmldir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-htmlDATA install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \ + install-sbinSCRIPTS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man8 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \ + uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binSCRIPTS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-htmlDATA install-info install-info-am \ + install-libexecSCRIPTS install-man install-man1 install-man8 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-sbinSCRIPTS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \ + uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS + + +$(srcdir)/update-leap: $(srcdir)/update-leap-opts + @: do-nothing action to avoid default SCCS get + +$(srcdir)/update-leap-opts: update-leap-opts.def $(std_def_list) + $(run_ag) update-leap-opts.def + +### Man + +$(srcdir)/update-leap.1update-leapman: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def + +$(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapman > $(srcdir)/update-leap.man.in+ + mv $(srcdir)/update-leap.man.in+ $(srcdir)/update-leap.man.in + +### Mdoc + +$(srcdir)/update-leap.1update-leapmdoc: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def + +$(srcdir)/update-leap.mdoc.in: $(srcdir)/update-leap.1update-leapmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapmdoc > $(srcdir)/update-leap.mdoc.in+ + mv $(srcdir)/update-leap.mdoc.in+ $(srcdir)/update-leap.mdoc.in + +### Manpage + +update-leap.$(UPDATE_LEAP_MS): $(srcdir)/update-leap.$(MANTAGFMT).in $(top_builddir)/config.status + $(top_builddir)/config.status --file=update-leap.$(UPDATE_LEAP_MS)+:$(srcdir)/update-leap.$(MANTAGFMT).in + mv update-leap.$(UPDATE_LEAP_MS)+ update-leap.$(UPDATE_LEAP_MS) + +### Texinfo + +$(srcdir)/invoke-update-leap.menu: $(srcdir)/invoke-update-leap.texi + @: do-nothing action to avoid default SCCS get, .menu built with .texi + +$(srcdir)/invoke-update-leap.texi: $(srcdir)/update-leap-opts.def $(std_def_list) + $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def + $(top_srcdir)/scripts/build/check--help $@ + +### HTML + +$(srcdir)/update-leap.html: $(srcdir)/update-leap.texi $(top_srcdir)/sntp/include/version.texi + cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o update-leap.html update-leap.texi || true ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/ntp/scripts/update-leap/invoke-update-leap.menu b/contrib/ntp/scripts/update-leap/invoke-update-leap.menu new file mode 100644 index 0000000000000..e27e34925faa8 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/invoke-update-leap.menu @@ -0,0 +1 @@ +* update-leap Invocation:: Invoking update-leap diff --git a/contrib/ntp/scripts/update-leap/invoke-update-leap.texi b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi new file mode 100644 index 0000000000000..8fc25dbe9a6d4 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi @@ -0,0 +1,170 @@ +@node update-leap Invocation +@section Invoking update-leap +@pindex update-leap +@cindex leap-seconds file manager/updater +@ignore +# +# EDIT THIS FILE WITH CAUTION (invoke-update-leap.texi) +# +# It has been AutoGen-ed April 7, 2015 at 04:21:44 AM by AutoGen 5.18.5pre4 +# From the definitions update-leap-opts.def +# and the template file agtexi-cmd.tpl +@end ignore + + + +@code{update-leap} +will validate the file currently on the local system +and if necessary, updates leap-second definition file. + +Ordinarily, the file is found using the "leapfile" directive in +@code{ntp.conf(5)}. +However, an alternate location can be specified on the command line. + +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. + +If the current file is acceptable, no download or restart occurs. + +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS + +This section was generated by @strong{AutoGen}, +using the @code{agtexi-cmd} template and the option descriptions for the @code{update-leap} program. + +@menu +* update-leap usage:: update-leap help/usage (@option{--help}) +* update-leap source-url:: source-url option (-s) +* update-leap ipv4:: ipv4 option (-4) +* update-leap destination:: destination option (-d) +* update-leap expiration:: expiration option (-e) +* update-leap ntp-conf-file:: ntp-conf-file option (-f) +* update-leap force-update:: force-update option (-F) +* update-leap exit status:: exit status +* update-leap Usage:: Usage +* update-leap Authors:: Authors +@end menu + +@node update-leap usage +@subsection update-leap help/usage (@option{--help}) +@cindex update-leap help + +This is the automatically generated usage text for update-leap. + +The text printed is the same whether selected with the @code{help} option +(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print +the usage text by passing it through a pager program. +@code{more-help} is disabled on platforms without a working +@code{fork(2)} function. The @code{PAGER} environment variable is +used to select the program, defaulting to @file{more}. Both will exit +with a status code of 0. + +@exampleindent 0 +@example +/bin/bash: line 136: ./update-leap: Permission denied +@end example +@exampleindent 4 + +@node update-leap source-url +@subsection source-url option (-s) +@cindex update-leap-source-url + +This is the ``the url of the master copy of the leapseconds file'' option. +This option takes a string argument. +Specify the URL of the master copy to download +$LEAPSRC +@node update-leap ipv4 +@subsection ipv4 option (-4) +@cindex update-leap-ipv4 + +This is the ``use only ipv4 addresses for dns name resolution'' option. + +@noindent +This option has some usage constraints. It: +@itemize @bullet +@item +must not appear in combination with any of the following options: +ipv6. +@end itemize + + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; + +flag = { + name = ipv6; + flags-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; + +flag = { + name = prefer; + flags-cant = ipv4, ipv6; + value = p; + arg-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +@node update-leap destination +@subsection destination option (-d) +@cindex update-leap-destination + +This is the ``filename on the local system'' option. +This option takes a string argument @file{float}. +The name to use to store the leapfile on the local system. +$LEAPFILE +@node update-leap expiration +@subsection expiration option (-e) +@cindex update-leap-expiration + +This is the ``refresh the leapfile this long before it expires'' option. +This option takes a string argument. +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +@node update-leap ntp-conf-file +@subsection ntp-conf-file option (-f) +@cindex update-leap-ntp-conf-file + +This is the ``location of the ntp.conf file'' option. +This option takes a string argument. +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +@node update-leap force-update +@subsection force-update option (-F) +@cindex update-leap-force-update + +This is the ``force update of the leapfile'' option. +Force update even if current file is OK and not close to expiring. +@node update-leap exit status +@subsection update-leap exit status + +One of the following exit values will be returned: +@table @samp +@item 0 (EXIT_SUCCESS) +Successful program execution. +@item 1 (EXIT_FAILURE) +The operation failed or the command syntax was not valid. +@end table +@node update-leap Usage +@subsection update-leap Usage +@node update-leap Authors +@subsection update-leap Authors diff --git a/contrib/ntp/scripts/update-leap/update-leap b/contrib/ntp/scripts/update-leap/update-leap new file mode 100644 index 0000000000000..2dab4eca3224b --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap @@ -0,0 +1,434 @@ +#!/bin/bash + +# Copyright (C) 2014 Timothe Litt litt at acm dot org + +# This script may be freely copied, used and modified providing that +# this notice and the copyright statement are included in all copies +# and derivative works. No warranty is offered, and use is entirely at +# your own risk. Bugfixes and improvements would be appreciated by the +# author. + +VERSION="1.003" + +# leap-seconds file manager/updater + +# Depends on: +# wget sed, tr, shasum, logger + +# ########## Default configuration ########## +# +# Where to get the file +LEAPSRC="ftp://time.nist.gov/pub/leap-seconds.list" + +# How many times to try to download new file +MAXTRIES=6 +INTERVAL=10 + +# Where to find ntp config file +NTPCONF=/etc/ntp.conf + +# How long before expiration to get updated file +PREFETCH="60 days" + +# How to restart NTP - older NTP: service ntpd? try-restart | condrestart +# Recent NTP checks for new file daily, so there's nothing to do +RESTART= + +# Where to put temporary copy before it's validated +TMPFILE="/tmp/leap-seconds.$$.tmp" + +# Syslog facility +LOGFAC=daemon +# ########################################### + +# Places to look for commands. Allows for CRON having path to +# old utilities on embedded systems + +PATHLIST="/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:" + +REQUIREDCMDS=" wget logger tr sed shasum" + +SELF="`basename $0`" + +function displayHelp { + cat <<EOF +Usage: $SELF [options] [leapfile] + +Verifies and if necessary, updates leap-second definition file + +All arguments are optional: Default (or current value) shown: + -s Specify the URL of the master copy to download + $LEAPSRC + -4 Use only IPv4 + -6 Use only IPv6 + -p 4|6 + Prefer IPv4 or IPv6 (as specified) addresses, but use either + -d Specify the filename on the local system + $LEAPFILE + -e Specify how long before expiration the file is to be refreshed + Units are required, e.g. "-e 60 days" Note that larger values + imply more frequent refreshes. + "$PREFETCH" + -f Specify location of ntp.conf (used to make sure leapfile directive is + present and to default leapfile) + $NTPCONF + -F Force update even if current file is OK and not close to expiring. + -c Command to restart NTP after installing a new file + <none> - ntpd checks file daily + -r Specify number of times to retry on get failure + $MAXTRIES + -i Specify number of minutes between retries + $INTERVAL + -l Use syslog for output (Implied if CRONJOB is set) + -L Don't use syslog for output + -P Specify the syslog facility for logging + $LOGFAC + -t Name of temporary file used in validation + $TMPFILE + -q Only report errors to stdout + -v Verbose output + -z Specify path for utilities + $PATHLIST + -Z Only use system path + +$SELF will validate the file currently on the local system + +Ordinarily, the file is found using the "leapfile" directive in $NTPCONF. +However, an alternate location can be specified on the command line. + +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. + +If the current file is acceptable, no download or restart occurs. + +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. + +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. + +For cron-friendly behavior, define CRONJOB=1 in the crontab. + +This script depends on$REQUIREDCMDS + +Version $VERSION +EOF + return 0 +} + +# Default: Use syslog for logging if running under cron + +SYSLOG="$CRONJOB" + +if [ "$1" = "--help" ]; then + displayHelp + exit 0 +fi + +# Parse options + +while getopts 46p:P:s:e:f:Fc:r:i:lLt:hqvz:Z opt; do + case $opt in + 4) + PROTO="-4" + ;; + 6) + PROTO="-6" + ;; + p) + if [ "$OPTARG" = '4' -o "$OPTARG" = '6' ]; then + PREFER="--prefer-family=IPv$OPTARG" + else + echo "Invalid -p $OPTARG" >&2 + exit 1; + fi + ;; + P) + LOGFAC="$OPTARG" + ;; + s) + LEAPSRC="$OPTARG" + ;; + e) + PREFETCH="$OPTARG" + ;; + f) + NTPCONF="$OPTARG" + ;; + F) + FORCE="Y" + ;; + c) + RESTART="$OPTARG" + ;; + r) + MAXTRIES="$OPTARG" + ;; + i) + INTERVAL="$OPTARG" + ;; + t) + TMPFILE="$OPTARG" + ;; + l) + SYSLOG="y" + ;; + L) + SYSLOG= + ;; + h) + displayHelp + exit 0 + ;; + q) + QUIET="Y" + ;; + v) + VERBOSE="Y" + ;; + z) + PATHLIST="$OPTARG:" + ;; + Z) + PATHLIST= + ;; + *) + echo "$SELF -h for usage" >&2 + exit 1 + ;; + esac +done +shift $((OPTIND-1)) + +export PATH="$PATHLIST$PATH" + +# Add to path to deal with embedded systems +# +for P in $REQUIREDCMDS ; do + if >/dev/null 2>&1 which "$P" ; then + continue + fi + [ "$P" = "logger" ] && continue + echo "FATAL: missing $P command, please install" + exit 1 +done + +# Handle logging + +if ! LOGGER="`2>/dev/null which logger`" ; then + LOGGER= +fi + +function log { + # "priority" "message" + # + # Stdout unless syslog specified or logger isn't available + # + if [ -z "$SYSLOG" -o -z "$LOGGER" ]; then + if [ -n "$QUIET" -a \( "$1" = "info" -o "$1" = "notice" -o "$1" = "debug" \) ]; then + return 0 + fi + echo "`echo \"$1\" | tr a-z A-Z`: $2" + return 0 + fi + + # Also log to stdout if cron job && notice or higher + local S + if [ -n "$CRONJOB" -a \( "$1" != "info" \) -a \( "$1" != "debug" \) ] || [ -n "$VERBOSE" ]; then + S="-s" + fi + $LOGGER $S -t "$SELF[$$]" -p "$LOGFAC.$1" "$2" +} + +# Verify interval +INTERVAL=$(( $INTERVAL *1 )) + +# Validate a leap-seconds file checksum +# +# File format: (full description in files) +# # marks comments, except: +# #$ number : the NTP date of the last update +# #@ number : the NTP date that the file expires +# Date (seconds since 1900) leaps : leaps is the # of seconds to add for times >= Date +# Date lines have comments. +# #h hex hex hex hex hex is the SHA-1 checksum of the data & dates, excluding whitespace w/o leading zeroes + +function verifySHA { + + if [ ! -f "$1" ]; then + return 1 + fi + + # Remove comments, except those that are markers for last update, expires and hash + + local RAW="`sed $1 -e'/^\\([0-9]\\|#[\$@h]\)/!d' -e'/^#[\$@h]/!s/#.*\$//g'`" + + # Extract just the data, removing all whitespace + + local DATA="`echo \"$RAW\" | sed -e'/^#h/d' -e's/^#[\$@]//g' | tr -d '[:space:]'`" + + # Compute the SHA hash of the data, removing the marker and filename + # Computed in binary mode, which shouldn't matter since whitespace has been removed + # shasum comes in several flavors; a portable one is available in Perl (with Digest::SHA) + + local DSHA="`echo -n \"$DATA\" | shasum | sed -e's/[? *].*$//'`" + + # Extract the file's hash. Restore any leading zeroes in hash segments. + + # The sed [] includes a tab (\t) and space; #h is followed by a tab and space + local FSHA="`echo \"$RAW\" | sed -e'/^#h/!d' -e's/^#h//' -e's/[ ] */ 0x/g'`" + FSHA=`printf '%08x%08x%08x%08x%08x' $FSHA` + + if [ -n "$FSHA" -a \( "$FSHA" = "$DSHA" \) ]; then + if [ -n "$2" ]; then + log "info" "Checksum of $1 validated" + fi + else + log "error" "Checksum of $1 is invalid:" + [ -z "$FSHA" ] && FSHA="(no checksum record found in file)" + log "error" "EXPECTED: $FSHA" + log "error" "COMPUTED: $DSHA" + return 1 + fi + + # Check the expiration date, converting NTP epoch to Unix epoch used by date + + EXPIRES="`echo \"$RAW\" | sed -e'/^#@/!d' -e's/^#@//' | tr -d '[:space:]'`" + EXPIRES="$(($EXPIRES - 2208988800 ))" + + if [ $EXPIRES -lt `date -u +%s` ]; then + log "notice" "File expired on `date -u -d \"Jan 1, 1970 00:00:00 +0000 + $EXPIRES seconds\"`" + return 2 + fi + +} + +# Verify ntp.conf + +if ! [ -f "$NTPCONF" ]; then + log "critical" "Missing ntp configuration $NTPCONF" + exit 1 +fi + +# Parse ntp.conf for leapfile directive + +LEAPFILE="`sed $NTPCONF -e'/^ *leapfile *.*$/!d' -e's/^ *leapfile *//'`" +if [ -z "$LEAPFILE" ]; then + log "error" "$NTPCONF does not specify a leapfile" +fi + +# Allow placing the file someplace else - testing + +if [ -n "$1" ]; then + if [ "$1" != "$LEAPFILE" ]; then + log "notice" "Requested install to $1, but $NTPCONF specifies $LEAPFILE" + fi + LEAPFILE="$1" +fi + +# Verify the current file +# If it is missing, doesn't validate or expired +# Or is expiring soon +# Download a new one + +if [ -n "$FORCE" ] || ! verifySHA $LEAPFILE "$VERBOSE" || [ $EXPIRES -lt `date -d "NOW + $PREFETCH" +%s` ] ; then + TRY=0 + while true; do + TRY=$(( $TRY + 1 )) + if [ -n "$VERBOSE" ]; then + log "info" "Attempting download from $LEAPSRC, try $TRY.." + fi + if wget $PROTO $PREFER -o ${TMPFILE}.log $LEAPSRC -O $TMPFILE ; then + log "info" "Download of $LEAPSRC succeeded" + if [ -n "$VERBOSE" ]; then + cat ${TMPFILE}.log + fi + + if ! verifySHA $TMPFILE "$VERBOSE" ; then + # There is no point in retrying, as the file on the server is almost + # certainly corrupt. + + log "warning" "Downloaded file $TMPFILE rejected -- saved for diagnosis" + cat ${TMPFILE}.log + rm -f ${TMPFILE}.log + exit 1 + fi + rm -f ${TMPFILE}.log + + # Set correct permissions on temporary file + + REFFILE="$LEAPFILE" + if [ ! -f $LEAPFILE ]; then + log "notice" "$LEAPFILE was missing, creating new copy - check permissions" + touch $LEAPFILE + # Can't copy permissions from old file, copy from NTPCONF instead + REFFILE="$NTPCONF" + fi + chmod --reference $REFFILE $TMPFILE + chown --reference $REFFILE $TMPFILE + ( which selinuxenabled && selinuxenabled && which chcon ) >/dev/null 2>&1 + if [ $? == 0 ] ; then + chcon --reference $REFFILE $TMPFILE + fi + + # Replace current file with validated new one + + if mv -f $TMPFILE $LEAPFILE ; then + log "notice" "Installed new $LEAPFILE from $LEAPSRC" + else + log "error" "Install $TMPFILE => $LEAPFILE failed -- saved for diagnosis" + exit 1 + fi + + # Restart NTP (or whatever else is specified) + + if [ -n "$RESTART" ]; then + if [ -n "$VERBOSE" ]; then + log "info" "Attempting restart action: $RESTART" + fi + R="$( 2>&1 $RESTART )" + if [ $? -eq 0 ]; then + log "notice" "Restart action succeeded" + if [ -n "$VERBOSE" -a -n "$R" ]; then + log "info" "$R" + fi + else + log "error" "Restart action failed" + if [ -n "$R" ]; then + log "error" "$R" + fi + exit 2 + fi + fi + exit 0 + fi + + # Failed to download. See about trying again + + rm -f $TMPFILE + if [ $TRY -ge $MAXTRIES ]; then + break; + fi + if [ -n "$VERBOSE" ]; then + cat ${TMPFILE}.log + log "info" "Waiting $INTERVAL minutes before retrying..." + fi + sleep $(( $INTERVAL * 60)) + done + + # Failed and out of retries + + log "warning" "Download from $LEAPSRC failed after $TRY attempts" + if [ -f ${TMPFILE}.log ]; then + cat ${TMPFILE}.log + rm -f ${TMPFILE}.log $TMPFILE + fi + exit 1 +fi +log "info" "Not time to replace $LEAPFILE" + +exit 0 + +# EOF
\ No newline at end of file diff --git a/contrib/ntp/scripts/update-leap/update-leap-opts b/contrib/ntp/scripts/update-leap/update-leap-opts new file mode 100644 index 0000000000000..69dba650b8c54 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap-opts @@ -0,0 +1,72 @@ +# EDIT THIS FILE WITH CAUTION (update-leap-opts) +# +# It has been AutoGen-ed April 7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4 +# From the definitions update-leap-opts.def +# and the template file perlopt + +use Getopt::Long qw(GetOptionsFromArray); +Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always)); + +my $usage; + +sub usage { + my ($ret) = @_; + print STDERR $usage; + exit $ret; +} + +sub paged_usage { + my ($ret) = @_; + my $pager = $ENV{PAGER} || '(less || more)'; + + open STDOUT, "| $pager" or die "Can't fork a pager: $!"; + print $usage; + + exit $ret; +} + +sub processOptions { + my $args = shift; + + my $opts = { + 'source-url' => '', + 'ipv4' => '', + 'destination' => '', + 'expiration' => '', + 'ntp-conf-file' => '', + 'force-update' => '', + 'dont-wait' => '', + 'help' => '', 'more-help' => '' + }; + my $argument = ''; + my $ret = GetOptionsFromArray($args, $opts, ( + 'source-url|s=s', 'ipv4|4', 'destination|d=f', + 'expiration|e=s', 'ntp-conf-file|f=s', 'force-update|F', + 'dont-wait', + 'help|?', 'more-help')); + + $usage = <<'USAGE'; +update-leap - leap-seconds file manager/updater - Ver. 4.2.8p2 +USAGE: update-leap [ -<flag> [<val>] | --<name>[{=| }<val>] ]... + + -s, --source-url=str The URL of the master copy of the leapseconds file + -4, --ipv4 Use only IPv4 addresses for DNS name resolution + -d, --destination=float Filename on the local system + -e, --expiration=str Refresh the leapfile this long before it expires + -f, --ntp-conf-file=str Location of the ntp.conf file + -F, --force-update Force update of the leapfile + --dont-wait Don't wait for keystroke between plots + -?, --help Display usage information and exit + --more-help Pass the extended usage text through a pager + +Options are specified by doubled hyphens and their name or by a single +hyphen and the flag character. +USAGE + + usage(0) if $opts->{'help'}; + paged_usage(0) if $opts->{'more-help'}; + $_[0] = $opts; + return $ret; +} + +END { close STDOUT }; diff --git a/contrib/ntp/scripts/update-leap/update-leap-opts.def b/contrib/ntp/scripts/update-leap/update-leap-opts.def new file mode 100644 index 0000000000000..9e73916ba1191 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap-opts.def @@ -0,0 +1,163 @@ +/* -*- Mode: Text -*- */ +autogen definitions perlopt; + +#include autogen-version.def + +prog-name = 'update-leap'; +prog-title = 'leap-seconds file manager/updater'; +package = ntp; +#include version.def + +long-opts; +gnu-usage; + +flag = { + name = source-url; + value = s; + arg-type = string; + descrip = 'The URL of the master copy of the leapseconds file'; + doc = <<- _EndOfDoc_ + Specify the URL of the master copy to download + $LEAPSRC + _EndOfDoc_; +}; +flag = { + name = ipv4; + flags-cant = ipv6; + value = 4; + descrip = "Use only IPv4 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; + +flag = { + name = ipv6; + flags-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; + +flag = { + name = prefer; + flags-cant = ipv4, ipv6; + value = p; + arg-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<- _EndOfDoc_ + Prefer IPv4 or IPv6 (as specified) addresses, but use either. + _EndOfDoc_; +}; + +flag = { + name = destination; + value = d; + arg-type = string; + arg-name = float; + descrip = 'Filename on the local system'; + doc = <<- _EndOfDoc_ + The name to use to store the leapfile on the local system. + $LEAPFILE + _EndOfDoc_; +}; + +flag = { + name = expiration; + value = e; + arg-type = string; + descrip = 'Refresh the leapfile this long before it expires'; + doc = <<- _EndOfDoc_ + Specify how long before expiration the file is to be refreshed + Units are required, e.g. "-e 60 days" Note that larger values + imply more frequent refreshes. + "$PREFETCH" + _EndOfDoc_; +}; + +flag = { + name = ntp-conf-file; + value = f; + arg-type = string; + descrip = 'Location of the ntp.conf file'; + doc = <<- _EndOfDoc_ + Specify location of ntp.conf (used to make sure leapfile directive is + present and to default leapfile) + /etc/ntp.conf + _EndOfDoc_; +}; + +flag = { + name = force-update; + value = F; + descrip = 'Force update of the leapfile'; + doc = <<- _EndOfDoc_ + Force update even if current file is OK and not close to expiring. + _EndOfDoc_; +}; + +flag = { + name = dont-wait; + descrip = "Don't wait for keystroke between plots"; + doc = <<- _EndOfDoc_ + _EndOfDoc_; +}; + +/* explain: Additional information whenever the usage routine is invoked */ +explain = <<- _END_EXPLAIN + _END_EXPLAIN; + +doc-section = { + ds-type = 'DESCRIPTION'; + ds-format = 'mdoc'; + ds-text = <<- _END_PROG_MDOC_DESCRIP +.Nm +will validate the file currently on the local system +and if necessary, updates leap-second definition file. +.Pp +Ordinarily, the file is found using the "leapfile" directive in +.Xr ntp.conf 5 . +However, an alternate location can be specified on the command line. +.Pp +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. +.Pp +If the current file is acceptable, no download or restart occurs. +.Pp +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS + _END_PROG_MDOC_DESCRIP; +}; + + +doc-section = { + ds-type = 'USAGE'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_USAGE + +Usage stuff + + _END_MDOC_USAGE; +}; + +doc-section = { + ds-type = 'AUTHORS'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_AUTHORS +.An "Timothe Litt" + _END_MDOC_AUTHORS; +}; diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapman b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman new file mode 100644 index 0000000000000..a16434777fd3f --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman @@ -0,0 +1,169 @@ +.de1 NOP +. it 1 an-trap +. if \\n[.$] \,\\$*\/ +.. +.ie t \ +.ds B-Font [CB] +.ds I-Font [CI] +.ds R-Font [CR] +.el \ +.ds B-Font B +.ds I-Font I +.ds R-Font R +.TH update-leap 1update-leapman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" +.\" +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E0ayAX/ag-R0aGzX) +.\" +.\" It has been AutoGen-ed April 7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4 +.\" From the definitions update-leap-opts.def +.\" and the template file agman-cmd.tpl +.SH NAME +\f\*[B-Font]update-leap\fP +\- leap-seconds file manager/updater +.SH SYNOPSIS +\f\*[B-Font]update-leap\fP +.\" Mixture of short (flag) options and long options +[\f\*[B-Font]\-flags\f[]] +[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] +[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] +.sp \n(Ppu +.ne 2 + +All arguments must be options. +.sp \n(Ppu +.ne 2 + +.SH DESCRIPTION +\f\*[B-Font]update-leap\fP +will validate the file currently on the local system +and if necessary, updates leap-second definition file. +.sp \n(Ppu +.ne 2 + +Ordinarily, the file is found using the "leapfile" directive in +\fCntp.conf\fR(5)\f[]. +However, an alternate location can be specified on the command line. +.sp \n(Ppu +.ne 2 + +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. +.sp \n(Ppu +.ne 2 + +If the current file is acceptable, no download or restart occurs. +.sp \n(Ppu +.ne 2 + +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS +.SH "OPTIONS" +.TP +.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-source\-url\f[]=\f\*[I-Font]string\f[] +The URL of the master copy of the leapseconds file. +.sp +Specify the URL of the master copy to download +$LEAPSRC +.TP +.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] +Use only IPv4 addresses for DNS name resolution. +This option must not appear in combination with any of the following options: +ipv6. +.sp + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = ipv6; + flags-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = prefer; + flags-cant = ipv4, ipv6; + value = p; + arg-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +.TP +.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]float\f[], \f\*[B-Font]\-\-destination\f[]=\f\*[I-Font]float\f[] +Filename on the local system. +.sp +The name to use to store the leapfile on the local system. +$LEAPFILE +.TP +.NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-expiration\f[]=\f\*[I-Font]string\f[] +Refresh the leapfile this long before it expires. +.sp +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +.TP +.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-ntp\-conf\-file\f[]=\f\*[I-Font]string\f[] +Location of the ntp.conf file. +.sp +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +.TP +.NOP \f\*[B-Font]\-F\f[], \f\*[B-Font]\-\-force\-update\f[] +Force update of the leapfile. +.sp +Force update even if current file is OK and not close to expiring. +.TP +.NOP \f\*[B-Font]\-\-dont\-wait\f[] +Don't wait for keystroke between plots. +.sp +.TP +.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] +Display usage information and exit. +.TP +.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] +Pass the extended usage information through a pager. +.TP +.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}] +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.PP +.SH USAGE +Usage stuff +.SH "EXIT STATUS" +One of the following exit values will be returned: +.TP +.NOP 0 " (EXIT_SUCCESS)" +Successful program execution. +.TP +.NOP 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.TP +.NOP 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +.PP +.SH AUTHORS +.NOP "Timothe Litt" +.br +.SH "NOTES" +This manual page was \fIAutoGen\fP-erated from the \fBupdate-leap\fP +option definitions. diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc new file mode 100644 index 0000000000000..9fb3a12013345 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc @@ -0,0 +1,134 @@ +.Dd April 7 2015 +.Dt UPDATE_LEAP 1update-leapmdoc User Commands +.Os +.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc) +.\" +.\" It has been AutoGen-ed April 7, 2015 at 04:21:46 AM by AutoGen 5.18.5pre4 +.\" From the definitions update-leap-opts.def +.\" and the template file agmdoc-cmd.tpl +.Sh NAME +.Nm update-leap +.Nd leap-seconds file manager/updater +.Sh SYNOPSIS +.Nm +.\" Mixture of short (flag) options and long options +.Op Fl flags +.Op Fl flag Op Ar value +.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc +.Pp +All arguments must be options. +.Pp +.Sh DESCRIPTION +.Nm +will validate the file currently on the local system +and if necessary, updates leap\-second definition file. +.Pp +Ordinarily, the file is found using the "leapfile" directive in +.Xr ntp.conf 5 . +However, an alternate location can be specified on the command line. +.Pp +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. +.Pp +If the current file is acceptable, no download or restart occurs. +.Pp +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron\-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS +.Sh "OPTIONS" +.Bl -tag +.It Fl s Ar string , Fl \-source\-url Ns = Ns Ar string +The URL of the master copy of the leapseconds file. +.sp +Specify the URL of the master copy to download +$LEAPSRC +.It Fl 4 , Fl \-ipv4 +Use only IPv4 addresses for DNS name resolution. +This option must not appear in combination with any of the following options: +ipv6. +.sp + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = ipv6; + flags\-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<\- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = prefer; + flags\-cant = ipv4, ipv6; + value = p; + arg\-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<\- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +.It Fl d Ar float , Fl \-destination Ns = Ns Ar float +Filename on the local system. +.sp +The name to use to store the leapfile on the local system. +$LEAPFILE +.It Fl e Ar string , Fl \-expiration Ns = Ns Ar string +Refresh the leapfile this long before it expires. +.sp +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "\-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +.It Fl f Ar string , Fl \-ntp\-conf\-file Ns = Ns Ar string +Location of the ntp.conf file. +.sp +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +.It Fl F , Fl \-force\-update +Force update of the leapfile. +.sp +Force update even if current file is OK and not close to expiring. +.It Fl \-dont\-wait +Don't wait for keystroke between plots. +.sp +.It Fl \&? , Fl \-help +Display usage information and exit. +.It Fl \&! , Fl \-more\-help +Pass the extended usage information through a pager. +.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.El +.Sh USAGE +Usage stuff +.Sh "EXIT STATUS" +One of the following exit values will be returned: +.Bl -tag +.It 0 " (EXIT_SUCCESS)" +Successful program execution. +.It 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen\-users@lists.sourceforge.net. Thank you. +.El +.Sh AUTHORS +.An "Timothe Litt" +.Sh "NOTES" +This manual page was \fIAutoGen\fP\-erated from the \fBupdate\-leap\fP +option definitions. diff --git a/contrib/ntp/scripts/update-leap/update-leap.html b/contrib/ntp/scripts/update-leap/update-leap.html new file mode 100644 index 0000000000000..3a731ac760661 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.html @@ -0,0 +1,274 @@ +<html lang="en"> +<head> +<title>update-leap User's Manual</title> +<meta http-equiv="Content-Type" content="text/html"> +<meta name="description" content="update-leap User's Manual"> +<meta name="generator" content="makeinfo 4.7"> +<link title="Top" rel="top" href="#Top"> +<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<style type="text/css"><!-- + pre.display { font-family:inherit } + pre.format { font-family:inherit } + pre.smalldisplay { font-family:inherit; font-size:smaller } + pre.smallformat { font-family:inherit; font-size:smaller } + pre.smallexample { font-size:smaller } + pre.smalllisp { font-size:smaller } + span.sc { font-variant:small-caps } + span.roman { font-family: serif; font-weight: normal; } +--></style> +</head> +<body> +<h1 class="settitle">update-leap User's Manual</h1> +<div class="node"> +<p><hr> +<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>, +Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>, +Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> +<br> +</div> + + <p>This document describes the use of the NTP Project's <code>update-leap</code> program. + + <p>This document applies to version 4.2.8p2 of <code>update-leap</code>. + +<div class="shortcontents"> +<h2>Short Contents</h2> +<ul> +</ul> +</div> + +<ul class="menu"> +<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>: Description +<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: Invoking update-leap +</ul> + +<div class="node"> +<p><hr> +<a name="update_002dleap-Invocation"></a> +<br> +</div> + +<h3 class="section">0.1 Invoking update-leap</h3> + +<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a> + + <p><code>update-leap</code> +will validate the file currently on the local system +and if necessary, updates leap-second definition file. + + <p>Ordinarily, the file is found using the "leapfile" directive in +<code>ntp.conf(5)</code>. +However, an alternate location can be specified on the command line. + + <p>If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. + + <p>If the current file is acceptable, no download or restart occurs. + + <p>-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS + + <p>This section was generated by <strong>AutoGen</strong>, +using the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program. + +<ul class="menu"> +<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>: update-leap help/usage (<span class="option">--help</span>) +<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>: source-url option (-s) +<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>: ipv4 option (-4) +<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>: destination option (-d) +<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>: expiration option (-e) +<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>: ntp-conf-file option (-f) +<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>: force-update option (-F) +<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>: exit status +<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>: Usage +<li><a href="#update_002dleap-Authors">update-leap Authors</a>: Authors +</ul> + +<div class="node"> +<p><hr> +<a name="update_002dleap-usage"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4> + +<p><a name="index-update_002dleap-help-3"></a> +This is the automatically generated usage text for update-leap. + + <p>The text printed is the same whether selected with the <code>help</code> option +(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print +the usage text by passing it through a pager program. +<code>more-help</code> is disabled on platforms without a working +<code>fork(2)</code> function. The <code>PAGER</code> environment variable is +used to select the program, defaulting to <span class="file">more</span>. Both will exit +with a status code of 0. + +<pre class="example">/bin/bash: line 136: ./update-leap: Permission denied +</pre> + <div class="node"> +<p><hr> +<a name="update_002dleap-source_002durl"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.2 source-url option (-s)</h4> + +<p><a name="index-update_002dleap_002dsource_002durl-4"></a> +This is the “the url of the master copy of the leapseconds file” option. +This option takes a string argument. +Specify the URL of the master copy to download +$LEAPSRC +<div class="node"> +<p><hr> +<a name="update_002dleap-ipv4"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.3 ipv4 option (-4)</h4> + +<p><a name="index-update_002dleap_002dipv4-5"></a> +This is the “use only ipv4 addresses for dns name resolution” option. + +<p class="noindent">This option has some usage constraints. It: + <ul> +<li>must not appear in combination with any of the following options: +ipv6. +</ul> + + <p>Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +; + + <p>flag = + name = ipv6; + flags-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +; + + <p>flag = + name = prefer; + flags-cant = ipv4, ipv6; + value = p; + arg-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +<div class="node"> +<p><hr> +<a name="update_002dleap-destination"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.4 destination option (-d)</h4> + +<p><a name="index-update_002dleap_002ddestination-6"></a> +This is the “filename on the local system” option. +This option takes a string argument <span class="file">float</span>. +The name to use to store the leapfile on the local system. +$LEAPFILE +<div class="node"> +<p><hr> +<a name="update_002dleap-expiration"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.5 expiration option (-e)</h4> + +<p><a name="index-update_002dleap_002dexpiration-7"></a> +This is the “refresh the leapfile this long before it expires” option. +This option takes a string argument. +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +<div class="node"> +<p><hr> +<a name="update_002dleap-ntp_002dconf_002dfile"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-force_002dupdate">update-leap force-update</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4> + +<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a> +This is the “location of the ntp.conf file” option. +This option takes a string argument. +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +<div class="node"> +<p><hr> +<a name="update_002dleap-force_002dupdate"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.7 force-update option (-F)</h4> + +<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a> +This is the “force update of the leapfile” option. +Force update even if current file is OK and not close to expiring. +<div class="node"> +<p><hr> +<a name="update_002dleap-exit-status"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.8 update-leap exit status</h4> + +<p>One of the following exit values will be returned: + <dl> +<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. +<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. +</dl> + <div class="node"> +<p><hr> +<a name="update_002dleap-Usage"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>, +Previous: <a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.9 update-leap Usage</h4> + +<div class="node"> +<p><hr> +<a name="update_002dleap-Authors"></a>Previous: <a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>, +Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a> +<br> +</div> + +<h4 class="subsection">0.1.10 update-leap Authors</h4> + +</body></html> + diff --git a/contrib/ntp/scripts/update-leap/update-leap.man.in b/contrib/ntp/scripts/update-leap/update-leap.man.in new file mode 100644 index 0000000000000..a16434777fd3f --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.man.in @@ -0,0 +1,169 @@ +.de1 NOP +. it 1 an-trap +. if \\n[.$] \,\\$*\/ +.. +.ie t \ +.ds B-Font [CB] +.ds I-Font [CI] +.ds R-Font [CR] +.el \ +.ds B-Font B +.ds I-Font I +.ds R-Font R +.TH update-leap 1update-leapman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" +.\" +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E0ayAX/ag-R0aGzX) +.\" +.\" It has been AutoGen-ed April 7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4 +.\" From the definitions update-leap-opts.def +.\" and the template file agman-cmd.tpl +.SH NAME +\f\*[B-Font]update-leap\fP +\- leap-seconds file manager/updater +.SH SYNOPSIS +\f\*[B-Font]update-leap\fP +.\" Mixture of short (flag) options and long options +[\f\*[B-Font]\-flags\f[]] +[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] +[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] +.sp \n(Ppu +.ne 2 + +All arguments must be options. +.sp \n(Ppu +.ne 2 + +.SH DESCRIPTION +\f\*[B-Font]update-leap\fP +will validate the file currently on the local system +and if necessary, updates leap-second definition file. +.sp \n(Ppu +.ne 2 + +Ordinarily, the file is found using the "leapfile" directive in +\fCntp.conf\fR(5)\f[]. +However, an alternate location can be specified on the command line. +.sp \n(Ppu +.ne 2 + +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. +.sp \n(Ppu +.ne 2 + +If the current file is acceptable, no download or restart occurs. +.sp \n(Ppu +.ne 2 + +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS +.SH "OPTIONS" +.TP +.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-source\-url\f[]=\f\*[I-Font]string\f[] +The URL of the master copy of the leapseconds file. +.sp +Specify the URL of the master copy to download +$LEAPSRC +.TP +.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] +Use only IPv4 addresses for DNS name resolution. +This option must not appear in combination with any of the following options: +ipv6. +.sp + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = ipv6; + flags-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = prefer; + flags-cant = ipv4, ipv6; + value = p; + arg-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +.TP +.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]float\f[], \f\*[B-Font]\-\-destination\f[]=\f\*[I-Font]float\f[] +Filename on the local system. +.sp +The name to use to store the leapfile on the local system. +$LEAPFILE +.TP +.NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-expiration\f[]=\f\*[I-Font]string\f[] +Refresh the leapfile this long before it expires. +.sp +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +.TP +.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-ntp\-conf\-file\f[]=\f\*[I-Font]string\f[] +Location of the ntp.conf file. +.sp +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +.TP +.NOP \f\*[B-Font]\-F\f[], \f\*[B-Font]\-\-force\-update\f[] +Force update of the leapfile. +.sp +Force update even if current file is OK and not close to expiring. +.TP +.NOP \f\*[B-Font]\-\-dont\-wait\f[] +Don't wait for keystroke between plots. +.sp +.TP +.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] +Display usage information and exit. +.TP +.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] +Pass the extended usage information through a pager. +.TP +.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}] +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.PP +.SH USAGE +Usage stuff +.SH "EXIT STATUS" +One of the following exit values will be returned: +.TP +.NOP 0 " (EXIT_SUCCESS)" +Successful program execution. +.TP +.NOP 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.TP +.NOP 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +.PP +.SH AUTHORS +.NOP "Timothe Litt" +.br +.SH "NOTES" +This manual page was \fIAutoGen\fP-erated from the \fBupdate-leap\fP +option definitions. diff --git a/contrib/ntp/scripts/update-leap/update-leap.mdoc.in b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in new file mode 100644 index 0000000000000..9fb3a12013345 --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in @@ -0,0 +1,134 @@ +.Dd April 7 2015 +.Dt UPDATE_LEAP 1update-leapmdoc User Commands +.Os +.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc) +.\" +.\" It has been AutoGen-ed April 7, 2015 at 04:21:46 AM by AutoGen 5.18.5pre4 +.\" From the definitions update-leap-opts.def +.\" and the template file agmdoc-cmd.tpl +.Sh NAME +.Nm update-leap +.Nd leap-seconds file manager/updater +.Sh SYNOPSIS +.Nm +.\" Mixture of short (flag) options and long options +.Op Fl flags +.Op Fl flag Op Ar value +.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc +.Pp +All arguments must be options. +.Pp +.Sh DESCRIPTION +.Nm +will validate the file currently on the local system +and if necessary, updates leap\-second definition file. +.Pp +Ordinarily, the file is found using the "leapfile" directive in +.Xr ntp.conf 5 . +However, an alternate location can be specified on the command line. +.Pp +If the file does not exist, is not valid, has expired, or is expiring soon, +a new copy will be downloaded. If the new copy validates, it is installed and +NTP is (optionally) restarted. +.Pp +If the current file is acceptable, no download or restart occurs. +.Pp +-c can also be used to invoke another script to perform administrative +functions, e.g. to copy the file to other local systems. +.PP +This can be run as a cron job. As the file is rarely updated, and leap +seconds are announced at least one month in advance (usually longer), it +need not be run more frequently than about once every three weeks. +.PP +For cron\-friendly behavior, define CRONJOB=1 in the crontab. +.PP +This script depends on$REQUIREDCMDS +.Sh "OPTIONS" +.Bl -tag +.It Fl s Ar string , Fl \-source\-url Ns = Ns Ar string +The URL of the master copy of the leapseconds file. +.sp +Specify the URL of the master copy to download +$LEAPSRC +.It Fl 4 , Fl \-ipv4 +Use only IPv4 addresses for DNS name resolution. +This option must not appear in combination with any of the following options: +ipv6. +.sp + Force DNS resolution of following host names on the command line + to the IPv4 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = ipv6; + flags\-cant = ipv4, prefer; + value = 6; + descrip = "Use only IPv6 addresses for DNS name resolution"; + doc = <<\- _EndOfDoc_ + Force DNS resolution of following host names on the command line + to the IPv6 namespace. + _EndOfDoc_; +}; +.sp +flag = { + name = prefer; + flags\-cant = ipv4, ipv6; + value = p; + arg\-type = keyword; + keyword = 4, 6; + descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either'; + doc = <<\- _EndOfDoc_ +Prefer IPv4 or IPv6 (as specified) addresses, but use either. +.It Fl d Ar float , Fl \-destination Ns = Ns Ar float +Filename on the local system. +.sp +The name to use to store the leapfile on the local system. +$LEAPFILE +.It Fl e Ar string , Fl \-expiration Ns = Ns Ar string +Refresh the leapfile this long before it expires. +.sp +Specify how long before expiration the file is to be refreshed +Units are required, e.g. "\-e 60 days" Note that larger values +imply more frequent refreshes. +"$PREFETCH" +.It Fl f Ar string , Fl \-ntp\-conf\-file Ns = Ns Ar string +Location of the ntp.conf file. +.sp +Specify location of ntp.conf (used to make sure leapfile directive is +present and to default leapfile) +/etc/ntp.conf +.It Fl F , Fl \-force\-update +Force update of the leapfile. +.sp +Force update even if current file is OK and not close to expiring. +.It Fl \-dont\-wait +Don't wait for keystroke between plots. +.sp +.It Fl \&? , Fl \-help +Display usage information and exit. +.It Fl \&! , Fl \-more\-help +Pass the extended usage information through a pager. +.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.El +.Sh USAGE +Usage stuff +.Sh "EXIT STATUS" +One of the following exit values will be returned: +.Bl -tag +.It 0 " (EXIT_SUCCESS)" +Successful program execution. +.It 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen\-users@lists.sourceforge.net. Thank you. +.El +.Sh AUTHORS +.An "Timothe Litt" +.Sh "NOTES" +This manual page was \fIAutoGen\fP\-erated from the \fBupdate\-leap\fP +option definitions. diff --git a/contrib/ntp/scripts/update-leap/update-leap.texi b/contrib/ntp/scripts/update-leap/update-leap.texi new file mode 100644 index 0000000000000..1a96ae09b3eeb --- /dev/null +++ b/contrib/ntp/scripts/update-leap/update-leap.texi @@ -0,0 +1,43 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename update-leap.info +@settitle update-leap User's Manual +@include ../../sntp/include/version.texi +@paragraphindent 2 +@c %**end of header + +@ifinfo +This file documents the use of @code{update-leap}, +a program from +the NTP Project, +that is used to wait until @code{ntpd} has been able to +synchronize and stabilize the time on the current host. +@end ifinfo + +@direntry +* update-leap: (update-leap). Check the leapfile and update it if needed. +@end direntry + +@titlepage +@title update-leap User's Manual +@subtitle update-leap, version @value{VERSION}, @value{UPDATED} +@c @author Max @email{foo@ntp.org} +@end titlepage + +@c @page +@c @vskip 0pt plus 1filll + +@node Top, update-leap Description, (dir), (dir) + +This document describes the use of the NTP Project's @code{update-leap} program. + +This document applies to version @value{VERSION} of @code{update-leap}. + +@shortcontents + +@menu +* update-leap Description:: Description +* update-leap Invocation:: Invoking update-leap +@end menu + +@include invoke-update-leap.texi diff --git a/contrib/ntp/sntp/Makefile.in b/contrib/ntp/sntp/Makefile.in index f58700593da3f..fac19cc2a50b2 100644 --- a/contrib/ntp/sntp/Makefile.in +++ b/contrib/ntp/sntp/Makefile.in @@ -61,8 +61,6 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/libevent/m4/openldap.m4 \ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -82,8 +80,10 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \ - $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/openldap-thread-check.m4 \ + $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -394,6 +394,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ abs_builddir = @abs_builddir@ diff --git a/contrib/ntp/sntp/aclocal.m4 b/contrib/ntp/sntp/aclocal.m4 index aff791b83646e..5d30c4211d888 100644 --- a/contrib/ntp/sntp/aclocal.m4 +++ b/contrib/ntp/sntp/aclocal.m4 @@ -1132,8 +1132,6 @@ AC_SUBST([am__untar]) m4_include([libopts/m4/libopts.m4]) m4_include([libopts/m4/stdnoreturn.m4]) -m4_include([libevent/m4/openldap-thread-check.m4]) -m4_include([libevent/m4/openldap.m4]) m4_include([m4/hms_search_lib.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) @@ -1159,5 +1157,7 @@ m4_include([m4/ntp_prog_cc.m4]) m4_include([m4/ntp_sntp.m4]) m4_include([m4/ntp_sysexits.m4]) m4_include([m4/ntp_ver_suffix.m4]) +m4_include([m4/openldap-thread-check.m4]) +m4_include([m4/openldap.m4]) m4_include([m4/os_cflags.m4]) m4_include([m4/snprintf.m4]) diff --git a/contrib/ntp/sntp/configure b/contrib/ntp/sntp/configure index b4c66f743b5e0..76bdd28f9c70d 100755 --- a/contrib/ntp/sntp/configure +++ b/contrib/ntp/sntp/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for sntp 4.2.8p1. +# Generated by GNU Autoconf 2.68 for sntp 4.2.8p2. # # Report bugs to <http://bugs.ntp.org./>. # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sntp' PACKAGE_TARNAME='sntp' -PACKAGE_VERSION='4.2.8p1' -PACKAGE_STRING='sntp 4.2.8p1' +PACKAGE_VERSION='4.2.8p2' +PACKAGE_STRING='sntp 4.2.8p2' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -686,6 +686,13 @@ SED LDADD_LIBNTP NTP_CROSSCOMPILE_FALSE NTP_CROSSCOMPILE_TRUE +INSTALL_UPDATE_LEAP_FALSE +INSTALL_UPDATE_LEAP_TRUE +UPDATE_LEAP_NI +UPDATE_LEAP_MS +UPDATE_LEAP_DS +UPDATE_LEAP_DL +UPDATE_LEAP_DB TIMETRIM_NI TIMETRIM_MS TIMETRIM_DS @@ -1457,7 +1464,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sntp 4.2.8p1 to adapt to many kinds of systems. +\`configure' configures sntp 4.2.8p2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1534,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sntp 4.2.8p1:";; + short | recursive ) echo "Configuration of sntp 4.2.8p2:";; esac cat <<\_ACEOF @@ -1670,7 +1677,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sntp configure 4.2.8p1 +sntp configure 4.2.8p2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2495,7 +2502,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sntp $as_me 4.2.8p1, which was +It was created by sntp $as_me 4.2.8p2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3438,7 +3445,7 @@ fi # Define the identity of the package. PACKAGE='sntp' - VERSION='4.2.8p1' + VERSION='4.2.8p2' cat >>confdefs.h <<_ACEOF @@ -7032,6 +7039,19 @@ fi + if test -z "$UPDATE_LEAP_NI" ; then + INSTALL_UPDATE_LEAP_TRUE= + INSTALL_UPDATE_LEAP_FALSE='#' +else + INSTALL_UPDATE_LEAP_TRUE='#' + INSTALL_UPDATE_LEAP_FALSE= +fi + + + + + + # Expose a cross-compilation indicator to makefiles @@ -30185,6 +30205,10 @@ if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; th as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${INSTALL_UPDATE_LEAP_TRUE}" && test -z "${INSTALL_UPDATE_LEAP_FALSE}"; then + as_fn_error $? "conditional \"INSTALL_UPDATE_LEAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; then as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30630,7 +30654,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sntp $as_me 4.2.8p1, which was +This file was extended by sntp $as_me 4.2.8p2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30697,7 +30721,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sntp config.status 4.2.8p1 +sntp config.status 4.2.8p2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/contrib/ntp/sntp/include/Makefile.in b/contrib/ntp/sntp/include/Makefile.in index 9f5c92a83a76d..31db061256cb8 100644 --- a/contrib/ntp/sntp/include/Makefile.in +++ b/contrib/ntp/sntp/include/Makefile.in @@ -40,8 +40,6 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/libevent/m4/openldap.m4 \ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -61,8 +59,10 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \ - $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/openldap-thread-check.m4 \ + $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -249,6 +249,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ abs_builddir = @abs_builddir@ diff --git a/contrib/ntp/sntp/include/version.def b/contrib/ntp/sntp/include/version.def index 47e57c8c3bbcf..c315fe80be277 100644 --- a/contrib/ntp/sntp/include/version.def +++ b/contrib/ntp/sntp/include/version.def @@ -1 +1 @@ -version = '4.2.8p1'; +version = '4.2.8p2'; diff --git a/contrib/ntp/sntp/include/version.texi b/contrib/ntp/sntp/include/version.texi index bc3cc0638b968..d5ea0c033919b 100644 --- a/contrib/ntp/sntp/include/version.texi +++ b/contrib/ntp/sntp/include/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 04 February 2015 -@set EDITION 4.2.8p1 -@set VERSION 4.2.8p1 +@set UPDATED 07 April 2015 +@set EDITION 4.2.8p2 +@set VERSION 4.2.8p2 diff --git a/contrib/ntp/sntp/invoke-sntp.texi b/contrib/ntp/sntp/invoke-sntp.texi index e9be80c17f153..bed49ec2cacc2 100644 --- a/contrib/ntp/sntp/invoke-sntp.texi +++ b/contrib/ntp/sntp/invoke-sntp.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-sntp.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:34:17 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:18:04 AM by AutoGen 5.18.5pre4 # From the definitions sntp-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -56,7 +56,8 @@ Otherwise, only the is displayed. Finally, the @emph{stratum} -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program. @@ -100,7 +101,7 @@ with a status code of 0. @exampleindent 0 @example -sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1 +sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2 Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \ [ hostname-or-IP ...] Flg Arg Option-Name Description diff --git a/contrib/ntp/sntp/libevent/ChangeLog b/contrib/ntp/sntp/libevent/ChangeLog index 8bb76cafff4e8..1499637504963 100644 --- a/contrib/ntp/sntp/libevent/ChangeLog +++ b/contrib/ntp/sntp/libevent/ChangeLog @@ -1,23 +1,282 @@ -Changes in version 2.1.4-beta (?? Dec 2013) +Changes in version 2.1.5-beta (5 January 2015) - (As of 735d838b0a537ae04f1e6a2e9cbc5f3f45ebb541) + Security Fixes (evbuffers) + o Avoid integer overflow bugs in evbuffer_add() and related functions. See CVE-2014-6272 advisory for more information. (d49bc0e88b81a5812116074dc007f1db0ca1eecd) + New APIs (evconnlistener) + o Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT (b625361 Maciej Soltysiak) + + Bugfixes (core) + o Fix use-after-free error in EV_CLOSURE_EVENT callback (3cc0eac John Ohl) + o Fix race caused by event_active (3c7d6fc vjpai) + + Bugfixes (evbuffer) + o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (ba59923) + o Consistently check for failure from evbuffer_pullup() (60f8f72) + o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a) + + Bugfixes (windows, IOCP) + o be async: avoid double close() (f133b86 Azat Khuzhin) + + Bugfixes (bufferevents) + o Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE (2c82aa0 John Ohl) + o make bufferevent_getwatermark api more robust (a21e510 ufo2243) + o [Bugfix] fix bufferevent setwatermark suspend_read (b34e4ac ufo2243) + o bufferevent_openssl: reset fd_is_set when setfd with -1 is called (3da84c2 Azat Khuzhin) + o Fix compilation for older OpenSSL versions. (5c7282f Joakim Soderberg) + + New APIs (evhttp) + o Add evhttp_connection_set_family() to set addrinfo->family for DNS requests (12c29b0 Azat Khuzhin) + o Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed (2b9ec4c,10fe4f John Ohl) + + New APIs (core) + o Implement new/free for struct evutil_monotonic_timer and export monotonic time functions (f2645f8 Andrea Shepard) + + Bugfixes (evdns) + o Load hosts file on Windows. (a0b247c Vilmos Nebehaj) + o Don't truncate hosts file path on Windows. (d0dc861 Vilmos Nebehaj) + o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749) + o evdns: avoid read-after-free in evdns_request_timeout_callback() (61262a0 Azat Khuzhin) + o Correctly handle allocation failures in evdns_getaddrinfo (6a53d15) + o evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry (74d0eee Azat Khuzhin) + o evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE (3ca9d43 Azat Khuzhin) + o evdns: fail ns after we are failing/retrasmitting request (97c750d Azat Khuzhin) + + Bugfixes (evhttp) + o http: reset connection before installing retry timer (fix http retries handling) (bc79cc5 Azat Khuzhin) + + + Testing + o regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests (2fdc5f2 Azat Khuzhin) + o test: add family argument for http_connection_test_() (177b8a7 Azat Khuzhin) + o test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC (42aefeb Azat Khuzhin) + o test/http: add regress test for set family to AF_INET6 (3fbf3cc Azat Khuzhin) + o Update to a more recent tinytest_macros. (8da5a18) + o test/regress: add simplestsignal: to track reorder bugs separately (b897bef Azat Khuzhin) + o test/evbuffer_peek: add regress in case we have first buffer greater (e2d139d Azat Khuzhin) + o More evbuffer_peek() test cases (154006a) + o use correct tt macro for pointer compare (08c88ea) + o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov) + o Fix a use-after-free in unit tests. CID 752027 (3739057) + o Fix a dead-code warning in unit tests. CID 1193548 (c119f24) + o Use evutil_weakrand() in unit tests. (a677b72, 364c110) + o Use a more precise calculation for max in time-ratelim.c (ca5b5c7) + o Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from() (fb57b8b) + o Fix several memory leaks in the unit tests. (89c1a3b) + o Add test for evhttp_connection_free_on_completion (b0e9924 John Ohl) + o Fix annoying heisenbug in test-time.c (cb73704) + + Sample code + o Make http-server.c output into good html5 (6d72bdc) + o Use FindClose for handle from FindFirstFile in http-server.c (6466e88) + o https-client: add -retries argument, for connection retries (d9da844 Azat Khuzhin) + + Bugfixes (build) + o Add missing headerfile for cmake (15d90cc Trond Norbye) + o ignore one more test binary (b6593aa Michael Richardson) + o ignore config.cache/test-driver files (c83f333 Mike Frysinger) + o add a --disable-samples configure flag (0c492b3 Mike Frysinger) + o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf) + o updates in cmake build (27bd9fa Sergey Nikulov) + o Fix cmake error when the Module path has more than one entry. (befbd13 Acer Yang) + o Fix CMake shared library build (e69d910 Nobuaki Sukegawa) + o Fix warnings when compiling with clang 3.5 (f5b4765 John Ohl) + o Fix mixed declarations and code (forbidden by ISO C90) (8afbdbc Thomas Bernard) + + Bugfixes (miscellaneous) + o tree.h: drop duplicated content of tree.h (6193187 Azat Khuzhin) + o evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE (610410b,ad0493e,fea86a6,d83b337,5ca9e97 Azat Khuzhin) + o [Bugfix] fix grammer error (3a4d249 ufo2243) + o Change return type of evutil_load_windows_system_library_ to HMODULE (f691389) + o Fix a c90 warning (76643dd) + o Fix a typo in a doxygen comment. Reported by 亦得. (be1aeff) + o remove trailing comma from enum (b361b8a Jean-Philippe Ouellet) + + Bugfixes (FreeBSD) + o Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the changelist is for an FD that has been closed. (6fd7394 Adrian Chadd) + + + +Changes in version 2.1.4-alpha (21 Mar 2014) + + Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make + Libevent more useful, including support for early close detection with + epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more + evhttp callbacks, and more. There are also numerous bugfixes, including + a number for finalize-related issues from 2.1.3-alpha; and an + alternative (non-primary!) cmake-based build mechanism. + + New APIs (core) + o Added event_base_get_num_events() (0fa107d Mobai Zhang) + o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0) + o Add event_base_active_by_signal by analogy (4865943) + o Add access to max event count stats (5173bef, efbd3dc, 26230a2 + Andrew Sweeney) + o Implemented EV_CLOSED event for epoll backend + (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52 + Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e) + + New APIs (evutil_secure_rng) + o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + + New APIs (bufferevents) + o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey) + o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb + Mark Ellzey) + o Add watermark introspection (4ce242b OndÅ™ej KuznÃk) + o Add an option to trigger bufferevent I/O callbacks (61ee18b OndÅ™ej KuznÃk) + o Add an option to trigger bufferevent event callbacks (a7384c7 + OndÅ™ej KuznÃk) + o Clarifications in response to merge req. comments (bd41947 OndÅ™ej + KuznÃk) + o Minor optimizations on bufferevent_trigger options (a3172a4) + + New APIs (evhttp) + o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion) + o add a http default content type option (5a5acd9 Nicolas Martyanoff) + o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat + Khuzhin) + o Add a variant of evhttp_send_reply_chunk() with a callback on + evhttp_write_buffer() (8d8decf Julien BLACHE) + o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey) + o Provide on request complete callback facility (b083ca0 Andrew Sweeney) + o evhttp_request_set_on_complete_cb to be more specific about what + the function actually does and usage (da86dda Andrew Sweeney) + o Update unit test to make sure that the callback happens after the + output data is written (b85f398 Andrew Sweeney) + + Features (evdns) + o bug fix for issues #293 evdns_base_load_hosts doesn't remove + outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta) + + Features: (cmake build support) + o Initial CMake commit. (e415196 Joakim Soderberg) + o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg) + o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg) + o Generate a dummy evconfig-private.h so things build + properly. (ce14def Joakim Soderberg) + o Link libm on unix platforms. (58fcd42 Joakim Soderberg) + o Added some GCC specific options. (19222e5 Joakim Soderberg) + o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg) + o Add copyright and licensing files for CMake modules. (c259d53 + Joakim Soderberg) + o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg) + o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg) + o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg) + o Only test the event backends available on the system. (7ea4159 + Joakim Soderberg) + o Added a "make verify" target. (e053c4f Joakim Soderberg) + o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg) + o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516 + Joakim Söderberg) + o Fix kqueue support. (a831f2f Joakim Söderberg) + o Added a test for testing if kqueue works with pipes. (2799b35 + Joakim Söderberg) + o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg) + o Minimum required python version is 2.4. (968e97b Joakim Soderberg) + o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg) + o Add a "make verify_coverage" target generation coverage + info. (f2483f8 Joakim Soderberg) + o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg) + o Only look for ZLib when it is used (if tests are + included). (f780593 Joakim Soderberg) + o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into + errors. (dd413bd Joakim Soderberg) + o Add CMake config and install targets. (f3446ed Joakim Soderberg) + o Fix typo (4b754df Joakim Soderberg) + o Some work on making it possible to simply do add_subdirectory() on + the project. (49ab363 Joakim Soderberg) + o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg) + o Fix so that old nmake project still builds. (24d6466 Joakim + Soderberg) + o Rename README to README.md and use markdown to format. (d2bc39a + Joakim Soderberg) + o Update README with CMake build instructions. (604b8cc Joakim Soderberg) + o Clean up the README some. (8d4cb35 JoakimSoderberg) + o Forgotten headers for old nmake project compatability. (8697b99 + Joakim Soderberg) + o Change all uses of WIN32 to _WIN32 (4e14395 Joakim Söderberg) + o Fix include bug. (2024467 Joakim Söderberg) + o Check if we're on OSX before disabling deprecation in le-proxy + (8b40a5b Joakim Söderberg) + o Fix broken autotools build. (ae1bd82 Joakim Söderberg) + o Disclaimerize cmake a little in the README (d03b5bf) + o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim + Söderberg) + o CMake: Get rid of python not found warning when regress tests + turned off. (d38d798 Joakim Söderberg) + o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg) + o Guard against EVENT_NOWIN32 being set during testing. (f1715b4 + Joakim Soderberg) + o Check for OSX when checking for clang. (e212c54 Joakim Soderberg) + o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg) + o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye) + o Rename event_extras to event_extra (a0dd5df Trond Norbye) + o Add option to build shared library (4545fa9 Trond Norbye) + o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye) + o Add cmake-related files to .gitignore (e061321 Trond Norbye) + o Export event_extra not event_extras. (2b41bcf Joakim Söderberg) + + Bugfixes (core) + o If evsel->del() fails, don't leave the evmap in an inconsistent + state (9b5a527 Maxime Henrion) + o Move event_debug_note_teardown_ before mm_free. (69b5c64) + o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3) + o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe) + o Tweaked callbacks to prevent race condition + (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed + John Ohl) + o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE + case (9805972) + + Bugfixes (evhttp) + o Fix a double close() bug in evhttp when the underlying bufferevent uses + BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion) + o Fix an unlikely but possible error case for http connections (f22049e) + o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) + + Bugfixes on 2.0 (Windows) + o Use windows vsnprintf fixup logic on all windows environments (e826f19) + o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) + (b8f5980 Frank Denis) + + Bugfixes (evutil_secure_rng) + o When we seed from /proc/sys/kernel/random/uuid, count it as success + (e35b540) + o We should return after arc4random_buf() (1ea1f26 Makoto Kato) + o Avoid other RNG initialization FS reads when urandom file is + specified (9695e9c) + o Really remove RNG seeds from the stack (f5ced88) + o Fix another arc4random_buf-related warning (e64a2b0) + + Bugfixes (bufferevents) + o Initialize async bufferevent timeout CBs unconditionally (af9b2a7) Bugfixes (evdns) o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey) - o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (14971a8 - Azat Khuzhin) + o Fix SEGFAULT after evdns_base_resume if no nameservers + installed. (14971a8 Azat Khuzhin) o Actually use the log facility for reporting evdns problems. (e1766a1) - o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin) + o Fix SEGFAULT after evdns_base_resume if no nameservers + installed. (f8d7df8 Azat Khuzhin) + o fix for ServFail from RIPE Atlas release (62f596b Antony Antony) - Bugfixes (compilatin) + Bugfixes (compilation) o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7) o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e) - o Don't use return since return type is void and build error occurs using clang (838161d Makoto Kato) + o Don't use return since return type is void and build error occurs + using clang (838161d Makoto Kato) o Use void casts to suppress some "unchecked return value" warns (7080d55) - o rpcgen: Generate regress.gen.[c,h] in build rather than src dir (243386c Ross Lagerwall) - o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865) + o rpcgen: Generate regress.gen.[c,h] in build rather than src dir + (243386c Ross Lagerwall) + o Fix a compiler warning when checking for arc4random_buf linker + breakage. (5cb3865) + o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES + (239d834) + + o Fix a c90 warning (c207682) + o Fix consts in WIN32-Code/getopt*.[ch] (57abb35) Bugfixes (locks, synchronization) o Missed lock acquire/release in event_base_cancel_single_callback_() @@ -30,7 +289,8 @@ Changes in version 2.1.4-beta (?? Dec 2013) Testing o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin) o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin) - o Add checks for evhttp_connection_get_server() in unit tests. (fbc323b Maxime Henrion) + o Add checks for evhttp_connection_get_server() in unit + tests. (fbc323b Maxime Henrion) o Fix a (failure-only) null dereference in the unit tests (1104d0b) o Fix a logic error in test_evbuffer_freeze (7765884) o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506) @@ -38,15 +298,12 @@ Changes in version 2.1.4-beta (?? Dec 2013) o DNS tests: add a missing check (f314900) o Finalize tests: add a missing check (82b6956) o test_evutil_rtrim: add another missing check. (e193c95) - o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset (611e28b Azat Khuzhin) - o regress_http: add tests for evhttp_connection_get_addr() (4dd500c Azat Khuzhin) - - Bugfixes (core) - o If evsel->del() fails, don't leave the evmap in an inconsistent state - (9b5a527 Maxime Henrion) - o Move event_debug_note_teardown_ before mm_free. (69b5c64) - o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3) - o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe) + o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset + (611e28b Azat Khuzhin) + o regress_http: add tests for evhttp_connection_get_addr() (4dd500c + Azat Khuzhin) + o Update to the latest version of tinytest (7a80476) + o Heap-allocate zlib data structure in regress_zlib tests (4947c18) Performance tweaks (core) o Avoid redundant syscall to make a nonblocking socket nonblocking @@ -54,56 +311,42 @@ Changes in version 2.1.4-beta (?? Dec 2013) o Avoid redundant syscall if making a socket cloexec twice (1f29b18) o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) - Bugfixes (evhttp) - o Fix a double close() bug in evhttp when the underlying bufferevent uses - BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion) - o Fix an unlikely but possible error case for http connections (f22049e) - o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) - - Bugfixes on 2.0 (Windows) - o Use windows vsnprintf fixup logic on all windows environments (e826f19) - o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis) - - Bugfixes (evutil_secure_rng) - o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540) - o We should return after arc4random_buf() (1ea1f26 Makoto Kato) - o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c) - o Really remove RNG seeds from the stack (f5ced88) - o Fix another arc4random_buf-related warning (e64a2b0) - - New APIs (core) - o Added event_base_get_num_events() (0fa107d Mobai Zhang) - o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey) - o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb Mark Ellzey) - - New APIs (evhttp) - o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion) - o add a http default content type option (5a5acd9 Nicolas Martyanoff) - o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat Khuzhin) - - Documentation o Document that arc4random is not a great cryptographic PRNG. (6e49696) o Small doxygen tweaks (6e67b51) o Try another doxygen tweak (ccf432b) + o Clarify event_base_loop exit conditions (031a803) + o Fix a typo (be7bf2c OndÅ™ej KuznÃk) + o Document deferred eventcb behaviour (13a9a02 OndÅ™ej KuznÃk) + o Typo fixes from Linus Nordberg (cec62cb, 8cd695b) + o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee) - New APIs (evutil_secure_rng) - o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + Code Improvements (coverity) + o Fix a pile of coverity warnings in the unit tests (867f401) + o Fix coverity warnings in benchmark tools. (ff7f739) + o Whoops; fix compilation in bench.c (544cf88) + o Remove spurious checks in evrpc.c error cases (coverity) (991b362) + o Fix a couple of compilation warnings in regress_http.c (860767e) + o Fix even more coverity warnings. (d240328) + o Stop checking for inet_aton; we don't use it. (f665d5c) + o Add an include to evrpc-internal to fix openbsd compilation warning + (5e161c6) Cleanups o Remove an unreachable return statement in minheap-internal.h (e639a9e) + o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e) + o Fix needless bufferevent includes in evdns.c (254c04e) + o Fix a couple of "#ifdef WIN32" instances (88ecda3) + o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd) Sample code - o sample/le-proxy: Fail more gracefully if opening listener fails (44b2491) - o sample: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin) - - - - - - - - + o le-proxy: Fail more gracefully if opening listener fails (44b2491) + o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin) + o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky) + o https-client: code cleanup (29af65e Alexey Ozeritsky) + o https-client: Small tweaks to https-client.c (90786eb) + o https-client: Set hostname for SNI extension (by f69m) (d1976f8) + o https-client: add a cast to https-client.c (462e6b6) @@ -377,6 +620,429 @@ INFRASTRUCTURE (Active-later events): o Refactor event_persist_closure: raise and extract some common logic (bec22b4) o Remove the unused bits from EVLIST_ALL (9889a3d) +||||||| merged common ancestors +Changes in version 2.0.22-stable (?? Dec 2013) + + (As of 3b77d62829c4393bda6f9105a5d3b73b48a64b71.) + +BUGFIXES (evhttp) + o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel) + o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) + +BUGFIXES (compilation and portability) + o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) + o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) + o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling) + o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36) + o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) + o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) + o Use windows vsnprintf fixup logic on all windows environments (e826f19) + o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865) + o Fix another arc4random_buf-related warning (e64a2b0) + +BUGFIXES (resource leaks/lock errors on error) + o Avoid leaking fds on evconnlistener with no callback set (69db261) + o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6) + o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) + o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis) + +BUGFIXES (miscellaneous) + o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471) + o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) + +BUFGIXES (evdns) + o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey) + o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin) + +BUGFIXES (evutil_secure_random) + o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540) + o Document that arc4random is not a great cryptographic PRNG. (6e49696) + o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + o Really remove RNG seeds from the stack (f5ced88) + + +DOCUMENTATION FIXES + o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam) + o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) + + + +Changes in version 2.0.21-stable (18 Nov 2012) +BUGFIXES: + o ssl: Don't discard SSL read event when timeout and read come close together (576b29f) + o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch) + o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch) + o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev) + o build: Use python2 rather than python (0eb0109 Ross Lagerwall) + o build: Compile without warnings on mingw64 (94866c2) + o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4) + o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4) + o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez) + o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3) + o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier) + o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) + o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9) + + +Changes in version 2.0.20-stable (23 Aug 2012) +BUGFIXES: + o core: Make event_pending() threadsafe. (be7a95c Simon Liu) + o win32: avoid crash when waiting forever on zero fds. (160e58b) + o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31) + o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c) + o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67) + o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3) + o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel) + o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43) + + +PORTABILITY FIXES: + o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel) + o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn) + o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6) + +BUILD FIXES: + o Add GCC annotations so that the vsprintf functions get checked properly (117e327) + o Fix an unused variable warning on *BSD. (c0720c1) + +UNIT TEST FIXES: + o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall) + o Remove deadcode in http regression tests. Found by coverity. (5553346) + o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777) + o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d) + o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d) + o Fix resource leaks in the unit tests; found by coverity (270f279) + o Add some missing null checks to unit tests; found by coverity (f021c3d) + o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf) + o Remove unused variable; spotted by coverity (6355b2a) + o Add checks to various return values in unit tests. Found by coverity (b9e7329) + o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0) + + + +Changes in version 2.0.19-stable (3 May 2012) +BUGFIXES (CORE): + o Refactor event_persist_closure: raise and extract some common logic (bec22b4) + o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c) + o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40) + +BUGFIXES (SSL): + o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey) + +BUGFIXES (DNS): + o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel) + o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel) + o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a) + +DOCUMENTATION FIXES: + o Fix a typo in the bufferevent documentation (98e9119) + o Add missing ) to changelog; spotted by rransom (4c7ee6b) + o Fix the website URL in the readme (f775521) + +COMPILATION FIXES: + o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae) + o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn) + o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg) + +FORWARD-COMPATIBILITY: + o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2) + +TESTING/DEBUGGING SUPPORT: + o dns-example.c can now take a resolv.conf file on the commandline (6610fa5) + o Make some evdns.c debug logs more verbose (d873d67) + o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd) + + + +Changes in version 2.0.18-stable (22 Mar 2012) +BUGFIXES (core): + o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42) + +BUGFIXES (kqueue): + o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn) + +BUILD FIXES: + o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey) + o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey) + o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn) + +BUGFIXES (dns): + o Stop crashing in evdns when nameserver probes give a weird error (bec5068) + + +Changes in version 2.0.17-stable (10 Feb 2012) + +BUGFIXES (core): + o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5) + o check for sysctl before we use it (358c745 Mike Frysinger) + o Remove bogus casts of socket to int before calling ev_callback (f032516) + o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720) + o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc) + o Fix a fd leak in event_reinit() (3f18ad1) + o Do a memberwise comparison of threading function tables (c94a5f2 Nate R) + o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill) + o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6) + o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott) + +BUGFIXES (evbuffer and bufferevents): + o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg) + o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812) + +BUGFIXES (evhttp): + o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea) + +BUGFIXES (evdns): + o evdns: fix a bug in circular-queue implementation (d6094b1) + +BUILD FIXES: + o Fix a silly compilation error with the sun compiler (1927776 Colin Watt) + o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c) + +DOCUMENTATION FIXES: + o Slightly clarify evbuffer_peek documentation (7bbf6ca) + o Update copyright notices to 2012 (e49e289) + +NEW APIS: + o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker) + +TESTS AND TEST FIXES: + o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7) + o Add function to check referential integrity of an event_base (27737d5) + o Check event_base correctness at end of each unit test (3312b02) + o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187) + o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259) + +Changes in version 2.0.16-stable (18 Nov 2011) +BUGFIXES (core): + o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov) + o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles) + o Fix compile warning from saying event2/*.h inside a comment (447b0ba) + o Warn when unable to construct base because of failing make_base_notifiable (4e797f3) + o Don't try to make notifiable event_base when no threading fns are configured (e787413) + +BUGFIXES (evbuffer): + o unit test for remove_buffer bug (90bd620 Greg Hazel) + o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c) + +BUGFIXES (bufferevent_openssl): + o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey) + o Move SSL rate-limit enforcement into bytes_to_read() (96c562f) + o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey) + +BUGFIXES (dns) + o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov) + +TESTING: + o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov) + o Test for commit aff6ba1 (f7841bf Leonid Evdokimov) + o Style and comment tweaks for dns/leak* tests (5e42202) + o improve test to remove at least one buffer from src (7eb52eb Greg Hazel) + +DOCUMENTATION: + o Add note about evhttp_send_reply_end to its doxygen (724bfb5) + o Update copyright dates to 2011. (3c824bd) + o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid) + o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem) + + + +Changes in version 2.0.15-stable (12 Oct 2011) +BUGFIXES (DNS): + o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov) + o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov) + +BUFGIXES (bufferevents and evbuffers): + o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex) + o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9) + +BUGFIXES (event loop): + o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a) + +DOCUMENTATION FIXES: + o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov) + o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel) + +BUILD AND TESTING FIXES: + o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev) + o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382) + o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey) + o Make write-checking fixes use tt_fail_perror (2b76847) + o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7) + + + +Changes in version 2.0.14-stable (31 Aug 2011) +BUGFIXES (bufferevents and evbuffers): + o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch) + o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn) + o Fix handling of group rate limits under 64 bytes of burst (6d5440e) + o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf) + o Make rate limiting work with common_timeout logic (5b18f13) + o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch) + +BUGFIXES (IOCP): + o IOCP: don't launch reads or writes on an unconnected socket (495c227) + o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b) + o Have test-ratelim.c support IOCP (0ff2c5a) + o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd) + o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d) + +BUGFIXES (other): + o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov) + o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov) + +BUILD AND TESTING FIXES: + o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston) + o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart) + o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn) + + +Changes in version 2.0.13-stable (18 Jul 2011) +BUGFIXES + o Avoid race-condition when initializing global locks (b683cae) + o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch) + o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey) + o Avoid a segfault when all methods are disabled or broken (27ce38b) + o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a) + o Add some missing checks for mm_calloc failures (89d5e09) + o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d) + o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab) + o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid) + o Use the correct printf args when formatting size_t (3203f88) + o Complain if the caller tries to change threading cbs after setting them (cb6ecee) + +DOCUMENTATION FIXES AND IMPROVEMENTS + o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac) + o Update Doxyfile to produce more useful output (aea0555) + +TEST FIXES + o Fix up test_evutil_snprintf (caf695a) + o Fix tinytest invocation from windows shell (57def34 Ed Day) + +BUILD FIXES + o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d) + o Fix select.c compilation on systems with no NFDBITS (49d1136) + o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott) + o Don't break when building tests from git without python installed (b031adf) + o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn) + o Fix AIX build issue with TAILQ_FOREACH definition (e934096) + + +Changes in version 2.0.12-stable (4 Jun 2011) +BUGFIXES + o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0) + o Fix an assert-inducing fencepost bug in the select backend (d90149d) + o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko) + o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1) + o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid) + o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey) + o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey) + +DOCUMENTATION: + o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d) + +BUILD FIXES + o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin) + o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin) + o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn) + o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn) + o Correctly detect openssl on windows (6619385 Sebastian Hahn) + o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn) + o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart) + o Fix new warnings from GCC 4.6 (06a714f) + o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin) + o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin) + o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin) + o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin) + o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin) + o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin) + o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin) + o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin) + o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn) + o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin) + o cygwin: make it possible to build DLLs (d54d3fc) + + + +Changes in version 2.0.11-stable (27 Apr 2011) + [Autogenerated from the Git log, sorted and cleaned by hand.] +BUGFIXES: + o Fix evport handling of POLLHUP and POLLERR (b42ce4b) + o Fix compilation on Windows with NDEBUG (cb8059d) + o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye) + o Detect and handle more allocation failures. (666b096 Jardel Weyrich) + o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich) + o Handle resize failures in the select backend better. (83e805a) + o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b) + o Make --enable-gcc-warnings a no-op if not using gcc (3267703) + o Fix a type error in our (unused) arc4random_stir() (f736198) + o Correctly detect and stop non-chunked http requests when the body is too long (63a715e) + o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7) + o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko) + o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot) + o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko) + o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko) + o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko) + o Fix a crash bug in evdns server circular list code (00e91b3) + o Handle calloc failure in evdns. (Found by Dave Hart) (364291e) + o Fix a memory leak on win32 socket->event map. (b4f89f0) + o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn) + o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn) + +PORTABILITY: + o Fall back to sscanf if we have no other way to implement strtoll (453317b) + o Build correctly on platforms without sockaddr_storage (9184563) + o Try to build correctly on platforms with no IPv6 support (713c254) + o Build on systems without AI_PASSIVE (cb92113) + o Fix http unit test on non-windows platforms without getaddrinfo (6092f12) + o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0) + o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn) + o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn) + o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn) + o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn) + o Check for allocation failures in apply_socktype_protocol_hack (637d17a) + o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b) + o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68) + +DEFENSIVE PROGRAMMING: + o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7) + +BUGS IN TESTS: + o Fix test.sh output on solaris (b4f89b6 Dave Hart) + o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn) + o Use %s with printf in test.sh (039b9bd) + o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn) + o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn) + o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn) + o add some (void) casts for unused variables (65707d7 Sebastian Hahn) + o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn) + o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn) + o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn) + o Remote some dead code from dns-example.c (744c745 Sebastian Hahn) + o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn) + +BUILD FIXES: + o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn) + o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn) + o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn) + o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart) + o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart) + o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn) + +FEATURES: + o Make URI parser able to tolerate nonconformant URIs. (95060b5) + +DOCUMENTATION: + o Clarify event_set_mem_functions doc (926f816) + o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924) + o fix spelling mistake in whatsnew-2.0.txt (deb2f73) + o Fix sample/http-server ipv6 fixes (eb692be) + o Comment internal headers used in sample code. (4eb281c) + o Be explicit about how long event loops run in event.h documentation (f95bafb) + o Add comment to configure.in to explain gc-sections test logic (c621359) + o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665) + + BUILD IMPROVEMENTS: Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes diff --git a/contrib/ntp/sntp/libevent/Makefile.am b/contrib/ntp/sntp/libevent/Makefile.am index 58f1f016a81d2..3053cc016a524 100644 --- a/contrib/ntp/sntp/libevent/Makefile.am +++ b/contrib/ntp/sntp/libevent/Makefile.am @@ -38,7 +38,7 @@ RELEASE = -release 2.1 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 3:0:0 +VERSION_INFO = 5:0:0 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -67,6 +67,8 @@ VERSION_INFO = 3:0:0 # 2.1.1-alpha -- 2.1 1:0:0 # 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1) # 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly) +# 2.1.4-alpha -- 2.1 4:0:0 (ABI changed slightly) +# 2.1.5-beta -- 2.1 5:0:0 (ABI changed slightly) # ABI version history for this package effectively restarts every time # we change RELEASE. Version 1.4.x had RELEASE of 1.4. diff --git a/contrib/ntp/sntp/libevent/Makefile.in b/contrib/ntp/sntp/libevent/Makefile.in index 463ae8cb82d8e..4caff8facefbe 100644 --- a/contrib/ntp/sntp/libevent/Makefile.in +++ b/contrib/ntp/sntp/libevent/Makefile.in @@ -66,15 +66,14 @@ host_triplet = @host@ @PTHREADS_TRUE@am__append_2 = libevent_pthreads.pc @OPENSSL_TRUE@am__append_3 = libevent_openssl.la @OPENSSL_TRUE@am__append_4 = libevent_openssl.pc -noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_5) +noinst_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_6) EXTRA_PROGRAMS = $(am__EXEEXT_1) -DIST_COMMON = README $(am__configure_deps) \ - $(am__dist_bin_SCRIPTS_DIST) $(am__include_HEADERS_DIST) \ - $(am__include_event2_HEADERS_DIST) $(am__noinst_HEADERS_DIST) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in $(srcdir)/evconfig-private.h.in \ - $(srcdir)/include/include.am $(srcdir)/libevent.pc.in \ - $(srcdir)/libevent_openssl.pc.in \ +DIST_COMMON = $(am__configure_deps) $(am__dist_bin_SCRIPTS_DIST) \ + $(am__include_HEADERS_DIST) $(am__include_event2_HEADERS_DIST) \ + $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/evconfig-private.h.in $(srcdir)/include/include.am \ + $(srcdir)/libevent.pc.in $(srcdir)/libevent_openssl.pc.in \ $(srcdir)/libevent_pthreads.pc.in $(srcdir)/sample/include.am \ $(srcdir)/test/include.am $(top_srcdir)/configure ChangeLog \ build-aux/compile build-aux/config.guess build-aux/config.sub \ @@ -86,33 +85,33 @@ DIST_COMMON = README $(am__configure_deps) \ @OPENSSL_TRUE@ sample/hostcheck.h \ @OPENSSL_TRUE@ sample/openssl_hostname_validation.h -@BUILD_REGRESS_TRUE@am__append_8 = $(TESTPROGRAMS) -@BUILD_REGRESS_TRUE@am__append_9 = test/regress -@BUILD_REGRESS_TRUE@am__append_10 = test/regress.gen.c test/regress.gen.h -@PTHREADS_TRUE@am__append_11 = libevent_pthreads.la -@BUILD_WIN32_TRUE@am__append_12 = test/regress_iocp.c -@OPENSSL_TRUE@am__append_13 = test/regress_ssl.c -@OPENSSL_TRUE@am__append_14 = $(OPENSSL_INCS) -@OPENSSL_TRUE@am__append_15 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD} -@STRLCPY_IMPL_TRUE@am__append_16 = strlcpy.c -@SELECT_BACKEND_TRUE@am__append_17 = select.c -@POLL_BACKEND_TRUE@am__append_18 = poll.c -@DEVPOLL_BACKEND_TRUE@am__append_19 = devpoll.c -@KQUEUE_BACKEND_TRUE@am__append_20 = kqueue.c -@EPOLL_BACKEND_TRUE@am__append_21 = epoll.c -@EVPORT_BACKEND_TRUE@am__append_22 = evport.c -@SIGNAL_SUPPORT_TRUE@am__append_23 = signal.c -@INSTALL_LIBEVENT_FALSE@am__append_24 = $(EVENT1_HDRS) +@BUILD_SAMPLES_TRUE@am__append_8 = $(SAMPLES) +@BUILD_REGRESS_TRUE@am__append_9 = $(TESTPROGRAMS) +@BUILD_REGRESS_TRUE@am__append_10 = test/regress +@BUILD_REGRESS_TRUE@am__append_11 = test/regress.gen.c test/regress.gen.h +@PTHREADS_TRUE@am__append_12 = libevent_pthreads.la +@BUILD_WIN32_TRUE@am__append_13 = test/regress_iocp.c +@OPENSSL_TRUE@am__append_14 = test/regress_ssl.c +@OPENSSL_TRUE@am__append_15 = $(OPENSSL_INCS) +@OPENSSL_TRUE@am__append_16 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD} +@STRLCPY_IMPL_TRUE@am__append_17 = strlcpy.c +@SELECT_BACKEND_TRUE@am__append_18 = select.c +@POLL_BACKEND_TRUE@am__append_19 = poll.c +@DEVPOLL_BACKEND_TRUE@am__append_20 = devpoll.c +@KQUEUE_BACKEND_TRUE@am__append_21 = kqueue.c +@EPOLL_BACKEND_TRUE@am__append_22 = epoll.c +@EVPORT_BACKEND_TRUE@am__append_23 = evport.c +@SIGNAL_SUPPORT_TRUE@am__append_24 = signal.c +@INSTALL_LIBEVENT_FALSE@am__append_25 = $(EVENT1_HDRS) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_backport_259_ssizet.m4 \ + $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/libevent_openssl.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/ntp_pkg_config.m4 \ - $(top_srcdir)/m4/openldap-thread-check.m4 \ - $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ntp_pkg_config.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -250,14 +249,15 @@ am__EXEEXT_3 = sample/dns-example$(EXEEXT) \ sample/event-read-fifo$(EXEEXT) sample/hello-world$(EXEEXT) \ sample/http-server$(EXEEXT) sample/signal-test$(EXEEXT) \ sample/time-test$(EXEEXT) $(am__EXEEXT_2) -am__EXEEXT_4 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \ +@BUILD_SAMPLES_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3) +am__EXEEXT_5 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \ test/bench_http$(EXEEXT) test/bench_httpclient$(EXEEXT) \ test/test-changelist$(EXEEXT) test/test-dumpevents$(EXEEXT) \ test/test-eof$(EXEEXT) test/test-closed$(EXEEXT) \ test/test-fdleak$(EXEEXT) test/test-init$(EXEEXT) \ test/test-ratelim$(EXEEXT) test/test-time$(EXEEXT) \ test/test-weof$(EXEEXT) test/regress$(EXEEXT) -@BUILD_REGRESS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_4) +@BUILD_REGRESS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_5) PROGRAMS = $(noinst_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sample_dns_example_OBJECTS = sample/dns-example.$(OBJEXT) @@ -343,7 +343,7 @@ am_test_regress_OBJECTS = test/test_regress-regress.$(OBJEXT) \ test/test_regress-tinytest.$(OBJEXT) $(am__objects_12) \ $(am__objects_13) $(am__objects_14) $(am__objects_15) test_regress_OBJECTS = $(am_test_regress_OBJECTS) -am__DEPENDENCIES_3 = $(am__append_11) +am__DEPENDENCIES_3 = $(am__append_12) @OPENSSL_TRUE@am__DEPENDENCIES_4 = libevent_openssl.la \ @OPENSSL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_regress_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la \ @@ -568,8 +568,9 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_11) +PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_12) RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -584,6 +585,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -663,7 +665,7 @@ RELEASE = -release 2.1 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 3:0:0 +VERSION_INFO = 5:0:0 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -692,6 +694,8 @@ VERSION_INFO = 3:0:0 # 2.1.1-alpha -- 2.1 1:0:0 # 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1) # 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly) +# 2.1.4-alpha -- 2.1 4:0:0 (ABI changed slightly) +# 2.1.5-beta -- 2.1 5:0:0 (ABI changed slightly) # ABI version history for this package effectively restarts every time # we change RELEASE. Version 1.4.x had RELEASE of 1.4. @@ -744,12 +748,12 @@ noinst_HEADERS = $(am__append_5) $(am__append_7) test/regress.h \ iocp-internal.h ipv6-internal.h kqueue-internal.h \ log-internal.h minheap-internal.h mm-internal.h \ ratelim-internal.h ratelim-internal.h strlcpy-internal.h \ - time-internal.h util-internal.h $(am__append_24) + time-internal.h util-internal.h $(am__append_25) CLEANFILES = test/rpcgen-attempted DISTCLEANFILES = test/test-script.sh test/regress.gen.c \ test/regress.gen.h *~ libevent.pc \ ./include/event2/event-config.h -BUILT_SOURCES = $(am__append_10) include/event2/event-config.h +BUILT_SOURCES = $(am__append_11) include/event2/event-config.h include_event2dir = $(includedir)/event2 EVENT2_EXPORT = \ include/event2/buffer.h \ @@ -853,14 +857,14 @@ test_regress_SOURCES = test/regress.c test/regress.gen.c \ test/regress_minheap.c test/regress_rpc.c \ test/regress_testutils.c test/regress_testutils.h \ test/regress_util.c test/tinytest.c $(regress_thread_SOURCES) \ - $(regress_zlib_SOURCES) $(am__append_12) $(am__append_13) + $(regress_zlib_SOURCES) $(am__append_13) $(am__append_14) @BUILD_WIN32_TRUE@regress_thread_SOURCES = test/regress_thread.c @PTHREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c @ZLIB_REGRESS_TRUE@regress_zlib_SOURCES = test/regress_zlib.c test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la \ - $(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_15) + $(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_16) test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) \ - $(ZLIB_CFLAGS) -Itest $(am__append_14) + $(ZLIB_CFLAGS) -Itest $(am__append_15) test_regress_LDFLAGS = $(PTHREAD_CFLAGS) test_bench_SOURCES = test/bench.c test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la @@ -872,17 +876,17 @@ test_bench_httpclient_SOURCES = test/bench_httpclient.c test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la @BUILD_WIN32_FALSE@SYS_LIBS = @BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 -@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_16) $(am__append_17) \ -@BUILD_WIN32_FALSE@ $(am__append_18) $(am__append_19) \ -@BUILD_WIN32_FALSE@ $(am__append_20) $(am__append_21) \ -@BUILD_WIN32_FALSE@ $(am__append_22) $(am__append_23) +@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_17) $(am__append_18) \ +@BUILD_WIN32_FALSE@ $(am__append_19) $(am__append_20) \ +@BUILD_WIN32_FALSE@ $(am__append_21) $(am__append_22) \ +@BUILD_WIN32_FALSE@ $(am__append_23) $(am__append_24) @BUILD_WIN32_TRUE@SYS_SRC = win32select.c evthread_win32.c \ @BUILD_WIN32_TRUE@ buffer_iocp.c event_iocp.c \ -@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_16) \ -@BUILD_WIN32_TRUE@ $(am__append_17) $(am__append_18) \ -@BUILD_WIN32_TRUE@ $(am__append_19) $(am__append_20) \ -@BUILD_WIN32_TRUE@ $(am__append_21) $(am__append_22) \ -@BUILD_WIN32_TRUE@ $(am__append_23) +@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_17) \ +@BUILD_WIN32_TRUE@ $(am__append_18) $(am__append_19) \ +@BUILD_WIN32_TRUE@ $(am__append_20) $(am__append_21) \ +@BUILD_WIN32_TRUE@ $(am__append_22) $(am__append_23) \ +@BUILD_WIN32_TRUE@ $(am__append_24) @BUILD_WIN32_FALSE@SYS_INCLUDES = @BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake CORE_SRC = \ diff --git a/contrib/ntp/sntp/libevent/README b/contrib/ntp/sntp/libevent/README deleted file mode 100644 index 2723a2cac0c38..0000000000000 --- a/contrib/ntp/sntp/libevent/README +++ /dev/null @@ -1,218 +0,0 @@ -0. BUILDING AND INSTALLATION (Briefly) - -$ ./configure -$ make -$ make verify # (optional) -$ sudo make install - -1. BUILDING AND INSTALLATION (In Depth) - -To build libevent, type - -$ ./configure && make - - (If you got libevent from the git repository, you will - first need to run the included "autogen.sh" script in order to - generate the configure script.) - -You can run the regression tests by running - -$ make verify - -Install as root via - -# make install - -Before reporting any problems, please run the regression tests. - -To enable the low-level tracing build the library as: - - CFLAGS=-DUSE_DEBUG ./configure [...] - -Standard configure flags should work. In particular, see: - - --disable-shared Only build static libraries - --prefix Install all files relative to this directory. - - -The configure script also supports the following flags: - - --enable-gcc-warnings Enable extra compiler checking with GCC. - --disable-malloc-replacement - Don't let applications replace our memory - management functions - --disable-openssl Disable support for OpenSSL encryption. - --disable-thread-support Don't support multithreaded environments. - -2. USEFUL LINKS: - -For the latest released version of Libevent, see the official website at -http://libevent.org/ . - -There's a pretty good work-in-progress manual up at - http://www.wangafu.net/~nickm/libevent-book/ . - -For the latest development versions of Libevent, access our Git repository -via - "git clone git://levent.git.sourceforge.net/gitroot/levent/libevent" - -You can browse the git repository online at -http://levent.git.sourceforge.net/git/gitweb-index.cgi . - -To report bugs, request features, or submit patches to Libevent, -use the Sourceforge trackers at -https://sourceforge.net/tracker/?group_id=50884 . - -There's also a libevent-users mailing list for talking about Libevent -use and development: http://archives.seul.org/libevent/users/ - -3. ACKNOWLEDGMENTS - -The following people have helped with suggestions, ideas, code or -fixing bugs: - - Samy Al Bahra - Jacob Appelbaum - Arno Bakker - Weston Andros Adamson - William Ahern - Ivan Andropov - Sergey Avseyev - Avi Bab - Joachim Bauch - Gilad Benjamini - Stas Bekman - Denis Bilenko - Julien Blache - Kevin Bowling - Tomash Brechko - Kelly Brock - Ralph Castain - Adrian Chadd - Lawnstein Chan - Shuo Chen - Ka-Hing Cheung - Andrew Cox - Paul Croome - George Danchev - Andrew Danforth - Ed Day - Christopher Davis - Mike Davis - Antony Dovgal - Mihai Draghicioiu - Alexander Drozdov - Mark Ellzey - Shie Erlich - Leonid Evdokimov - Juan Pablo Fernandez - Christophe Fillot - Mike Frysinger - Remi Gacogne - Artem Germanov - Alexander von Gernler - Artur Grabowski - Diwaker Gupta - Sebastian Hahn - Dave Hart - Greg Hazel - Michael Herf - Sebastian Hahn - Savg He - Mark Heily - Michael Herf - Greg Hewgill - Andrew Hochhaus - Aaron Hopkins - Tani Hosokawa - Jamie Iles - Claudio Jeker - Evan Jones - George Kadianakis - Phua Keat - Azat Khuzhin - Alexander Klauer - Kevin Ko - Brian Koehmstedt - Marko Kreen - Valery Kyholodov - Ross Lagerwall - Scott Lamb - Christopher Layne - Adam Langley - Graham Leggett - Philip Lewis - Zhou Li - David Libenzi - Yan Lin - Moshe Litvin - Simon Liu - Mitchell Livingston - Hagne Mahre - Lubomir Marinov - Abilio Marques - Abel Mathew - Nick Mathewson - James Mansion - Nicholas Marriott - Andrey Matveev - Caitlin Mercer - Dagobert Michelsen - Andrea Montefusco - Mansour Moufid - Mina Naguib - Felix Nawothnig - Trond Norbye - Linus Nordberg - Richard Nyberg - Jon Oberheide - Phil Oleson - Dave Pacheco - Derrick Pallas - Tassilo von Parseval - Catalin Patulea - Patrick Pelletier - Simon Perreault - Pierre Phaneuf - Amarin Phaosawasdi - Ryan Phillips - Dimitre Piskyulev - Pavel Plesov - Jon Poland - Roman Puls - Nate R - Robert Ransom - Bert JW Regeer - Peter Rosin - Maseeb Abdul Qadir - Wang Qin - Alex S - Hanna Schroeter - Ralf Schmitt - Mike Smellie - Kevin Springborn - Nir Soffer - Harlan Stenn - Steve Snyder - Dug Song - Dongsheng Song - Hannes Sowa - Ferenc Szalai - Brodie Thiesfield - Jason Toffaletti - Gisle Vanem - Bas Verhoeven - Constantine Verutin - Colin Watt - Zack Weinberg - Jardel Weyrich - Jay R. Wren - Zack Weinberg - Alejo - Alex - Taral - propanbutan - mmadia - yangacer - -If we have forgotten your name, please contact us. diff --git a/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h b/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h index da550283adf40..8cbf1902891f4 100644 --- a/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h +++ b/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h @@ -274,7 +274,7 @@ /* #undef EVENT__HAVE_WORKING_KQUEUE */ /* Numeric representation of the version */ -#define EVENT__NUMERIC_VERSION 0x02010301 +#define EVENT__NUMERIC_VERSION 0x02010500 /* Name of package */ #define EVENT__PACKAGE "libevent" @@ -331,7 +331,7 @@ #define EVENT__TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define EVENT__VERSION "2.1.3-alpha-dev" +#define EVENT__VERSION "2.1.5-beta" /* Define to appropriate substitue if compiler doesnt have __func__ */ #define EVENT____func__ __FUNCTION__ diff --git a/contrib/ntp/sntp/libevent/WIN32-Code/tree.h b/contrib/ntp/sntp/libevent/WIN32-Code/tree.h index 585618dde0c00..2ccfbf20ac911 100644 --- a/contrib/ntp/sntp/libevent/WIN32-Code/tree.h +++ b/contrib/ntp/sntp/libevent/WIN32-Code/tree.h @@ -675,680 +675,3 @@ name##_RB_MINMAX(struct name *head, int val) \ (x) = name##_RB_NEXT(x)) #endif /* _SYS_TREE_H_ */ -/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ -/* - * Copyright 2002 Niels Provos <provos@citi.umich.edu> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYS_TREE_H_ -#define _SYS_TREE_H_ - -/* - * This file defines data structures for different types of trees: - * splay trees and red-black trees. - * - * A splay tree is a self-organizing data structure. Every operation - * on the tree causes a splay to happen. The splay moves the requested - * node to the root of the tree and partly rebalances it. - * - * This has the benefit that request locality causes faster lookups as - * the requested nodes move to the top of the tree. On the other hand, - * every lookup causes memory writes. - * - * The Balance Theorem bounds the total access time for m operations - * and n inserts on an initially empty tree as O((m + n)lg n). The - * amortized cost for a sequence of m accesses to a splay tree is O(lg n); - * - * A red-black tree is a binary search tree with the node color as an - * extra attribute. It fulfills a set of conditions: - * - every search path from the root to a leaf consists of the - * same number of black nodes, - * - each red node (except for the root) has a black parent, - * - each leaf node is black. - * - * Every operation on a red-black tree is bounded as O(lg n). - * The maximum height of a red-black tree is 2lg (n+1). - */ - -#define SPLAY_HEAD(name, type) \ -struct name { \ - struct type *sph_root; /* root of the tree */ \ -} - -#define SPLAY_INITIALIZER(root) \ - { NULL } - -#define SPLAY_INIT(root) do { \ - (root)->sph_root = NULL; \ -} while (0) - -#define SPLAY_ENTRY(type) \ -struct { \ - struct type *spe_left; /* left element */ \ - struct type *spe_right; /* right element */ \ -} - -#define SPLAY_LEFT(elm, field) (elm)->field.spe_left -#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right -#define SPLAY_ROOT(head) (head)->sph_root -#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) - -/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ -#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ - SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ - SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ - (head)->sph_root = tmp; \ -} while (0) - -#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ - SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ - SPLAY_LEFT(tmp, field) = (head)->sph_root; \ - (head)->sph_root = tmp; \ -} while (0) - -#define SPLAY_LINKLEFT(head, tmp, field) do { \ - SPLAY_LEFT(tmp, field) = (head)->sph_root; \ - tmp = (head)->sph_root; \ - (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ -} while (0) - -#define SPLAY_LINKRIGHT(head, tmp, field) do { \ - SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ - tmp = (head)->sph_root; \ - (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ -} while (0) - -#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ - SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ - SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ - SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ - SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ -} while (0) - -/* Generates prototypes and inline functions */ - -#define SPLAY_PROTOTYPE(name, type, field, cmp) \ -void name##_SPLAY(struct name *, struct type *); \ -void name##_SPLAY_MINMAX(struct name *, int); \ -struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ -struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ - \ -/* Finds the node with the same key as elm */ \ -static __inline struct type * \ -name##_SPLAY_FIND(struct name *head, struct type *elm) \ -{ \ - if (SPLAY_EMPTY(head)) \ - return(NULL); \ - name##_SPLAY(head, elm); \ - if ((cmp)(elm, (head)->sph_root) == 0) \ - return (head->sph_root); \ - return (NULL); \ -} \ - \ -static __inline struct type * \ -name##_SPLAY_NEXT(struct name *head, struct type *elm) \ -{ \ - name##_SPLAY(head, elm); \ - if (SPLAY_RIGHT(elm, field) != NULL) { \ - elm = SPLAY_RIGHT(elm, field); \ - while (SPLAY_LEFT(elm, field) != NULL) { \ - elm = SPLAY_LEFT(elm, field); \ - } \ - } else \ - elm = NULL; \ - return (elm); \ -} \ - \ -static __inline struct type * \ -name##_SPLAY_MIN_MAX(struct name *head, int val) \ -{ \ - name##_SPLAY_MINMAX(head, val); \ - return (SPLAY_ROOT(head)); \ -} - -/* Main splay operation. - * Moves node close to the key of elm to top - */ -#define SPLAY_GENERATE(name, type, field, cmp) \ -struct type * \ -name##_SPLAY_INSERT(struct name *head, struct type *elm) \ -{ \ - if (SPLAY_EMPTY(head)) { \ - SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ - } else { \ - int __comp; \ - name##_SPLAY(head, elm); \ - __comp = (cmp)(elm, (head)->sph_root); \ - if(__comp < 0) { \ - SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\ - SPLAY_RIGHT(elm, field) = (head)->sph_root; \ - SPLAY_LEFT((head)->sph_root, field) = NULL; \ - } else if (__comp > 0) { \ - SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\ - SPLAY_LEFT(elm, field) = (head)->sph_root; \ - SPLAY_RIGHT((head)->sph_root, field) = NULL; \ - } else \ - return ((head)->sph_root); \ - } \ - (head)->sph_root = (elm); \ - return (NULL); \ -} \ - \ -struct type * \ -name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ -{ \ - struct type *__tmp; \ - if (SPLAY_EMPTY(head)) \ - return (NULL); \ - name##_SPLAY(head, elm); \ - if ((cmp)(elm, (head)->sph_root) == 0) { \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ - (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\ - } else { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\ - name##_SPLAY(head, elm); \ - SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ - } \ - return (elm); \ - } \ - return (NULL); \ -} \ - \ -void \ -name##_SPLAY(struct name *head, struct type *elm) \ -{ \ - struct type __node, *__left, *__right, *__tmp; \ - int __comp; \ -\ - SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ - __left = __right = &__node; \ -\ - while ((__comp = (cmp)(elm, (head)->sph_root))) { \ - if (__comp < 0) { \ - __tmp = SPLAY_LEFT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if ((cmp)(elm, __tmp) < 0){ \ - SPLAY_ROTATE_RIGHT(head, __tmp, field); \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ - break; \ - } \ - SPLAY_LINKLEFT(head, __right, field); \ - } else if (__comp > 0) { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if ((cmp)(elm, __tmp) > 0){ \ - SPLAY_ROTATE_LEFT(head, __tmp, field); \ - if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ - break; \ - } \ - SPLAY_LINKRIGHT(head, __left, field); \ - } \ - } \ - SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ -} \ - \ -/* Splay with either the minimum or the maximum element \ - * Used to find minimum or maximum element in tree. \ - */ \ -void name##_SPLAY_MINMAX(struct name *head, int __comp) \ -{ \ - struct type __node, *__left, *__right, *__tmp; \ -\ - SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ - __left = __right = &__node; \ -\ - while (1) { \ - if (__comp < 0) { \ - __tmp = SPLAY_LEFT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if (__comp < 0){ \ - SPLAY_ROTATE_RIGHT(head, __tmp, field); \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ - break; \ - } \ - SPLAY_LINKLEFT(head, __right, field); \ - } else if (__comp > 0) { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if (__comp > 0) { \ - SPLAY_ROTATE_LEFT(head, __tmp, field); \ - if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ - break; \ - } \ - SPLAY_LINKRIGHT(head, __left, field); \ - } \ - } \ - SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ -} - -#define SPLAY_NEGINF -1 -#define SPLAY_INF 1 - -#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) -#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) -#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) -#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) -#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ - : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) -#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ - : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) - -#define SPLAY_FOREACH(x, name, head) \ - for ((x) = SPLAY_MIN(name, head); \ - (x) != NULL; \ - (x) = SPLAY_NEXT(name, head, x)) - -/* Macros that define a red-back tree */ -#define RB_HEAD(name, type) \ -struct name { \ - struct type *rbh_root; /* root of the tree */ \ -} - -#define RB_INITIALIZER(root) \ - { NULL } - -#define RB_INIT(root) do { \ - (root)->rbh_root = NULL; \ -} while (0) - -#define RB_BLACK 0 -#define RB_RED 1 -#define RB_ENTRY(type) \ -struct { \ - struct type *rbe_left; /* left element */ \ - struct type *rbe_right; /* right element */ \ - struct type *rbe_parent; /* parent element */ \ - int rbe_color; /* node color */ \ -} - -#define RB_LEFT(elm, field) (elm)->field.rbe_left -#define RB_RIGHT(elm, field) (elm)->field.rbe_right -#define RB_PARENT(elm, field) (elm)->field.rbe_parent -#define RB_COLOR(elm, field) (elm)->field.rbe_color -#define RB_ROOT(head) (head)->rbh_root -#define RB_EMPTY(head) (RB_ROOT(head) == NULL) - -#define RB_SET(elm, parent, field) do { \ - RB_PARENT(elm, field) = parent; \ - RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ - RB_COLOR(elm, field) = RB_RED; \ -} while (0) - -#define RB_SET_BLACKRED(black, red, field) do { \ - RB_COLOR(black, field) = RB_BLACK; \ - RB_COLOR(red, field) = RB_RED; \ -} while (0) - -#ifndef RB_AUGMENT -#define RB_AUGMENT(x) -#endif - -#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ - (tmp) = RB_RIGHT(elm, field); \ - if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \ - RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ - RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - } else \ - (head)->rbh_root = (tmp); \ - RB_LEFT(tmp, field) = (elm); \ - RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (0) - -#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ - (tmp) = RB_LEFT(elm, field); \ - if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \ - RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ - RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - } else \ - (head)->rbh_root = (tmp); \ - RB_RIGHT(tmp, field) = (elm); \ - RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (0) - -/* Generates prototypes and inline functions */ -#define RB_PROTOTYPE(name, type, field, cmp) \ -void name##_RB_INSERT_COLOR(struct name *, struct type *); \ -void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ -struct type *name##_RB_REMOVE(struct name *, struct type *); \ -struct type *name##_RB_INSERT(struct name *, struct type *); \ -struct type *name##_RB_FIND(struct name *, struct type *); \ -struct type *name##_RB_NEXT(struct type *); \ -struct type *name##_RB_MINMAX(struct name *, int); \ - \ - -/* Main rb operation. - * Moves node close to the key of elm to top - */ -#define RB_GENERATE(name, type, field, cmp) \ -void \ -name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ -{ \ - struct type *parent, *gparent, *tmp; \ - while ((parent = RB_PARENT(elm, field)) && \ - RB_COLOR(parent, field) == RB_RED) { \ - gparent = RB_PARENT(parent, field); \ - if (parent == RB_LEFT(gparent, field)) { \ - tmp = RB_RIGHT(gparent, field); \ - if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ - RB_COLOR(tmp, field) = RB_BLACK; \ - RB_SET_BLACKRED(parent, gparent, field);\ - elm = gparent; \ - continue; \ - } \ - if (RB_RIGHT(parent, field) == elm) { \ - RB_ROTATE_LEFT(head, parent, tmp, field);\ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RB_SET_BLACKRED(parent, gparent, field); \ - RB_ROTATE_RIGHT(head, gparent, tmp, field); \ - } else { \ - tmp = RB_LEFT(gparent, field); \ - if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ - RB_COLOR(tmp, field) = RB_BLACK; \ - RB_SET_BLACKRED(parent, gparent, field);\ - elm = gparent; \ - continue; \ - } \ - if (RB_LEFT(parent, field) == elm) { \ - RB_ROTATE_RIGHT(head, parent, tmp, field);\ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RB_SET_BLACKRED(parent, gparent, field); \ - RB_ROTATE_LEFT(head, gparent, tmp, field); \ - } \ - } \ - RB_COLOR(head->rbh_root, field) = RB_BLACK; \ -} \ - \ -void \ -name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ -{ \ - struct type *tmp; \ - while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ - elm != RB_ROOT(head)) { \ - if (RB_LEFT(parent, field) == elm) { \ - tmp = RB_RIGHT(parent, field); \ - if (RB_COLOR(tmp, field) == RB_RED) { \ - RB_SET_BLACKRED(tmp, parent, field); \ - RB_ROTATE_LEFT(head, parent, tmp, field);\ - tmp = RB_RIGHT(parent, field); \ - } \ - if ((RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ - (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ - RB_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RB_PARENT(elm, field); \ - } else { \ - if (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ - struct type *oleft; \ - if ((oleft = RB_LEFT(tmp, field)))\ - RB_COLOR(oleft, field) = RB_BLACK;\ - RB_COLOR(tmp, field) = RB_RED; \ - RB_ROTATE_RIGHT(head, tmp, oleft, field);\ - tmp = RB_RIGHT(parent, field); \ - } \ - RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ - RB_COLOR(parent, field) = RB_BLACK; \ - if (RB_RIGHT(tmp, field)) \ - RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\ - RB_ROTATE_LEFT(head, parent, tmp, field);\ - elm = RB_ROOT(head); \ - break; \ - } \ - } else { \ - tmp = RB_LEFT(parent, field); \ - if (RB_COLOR(tmp, field) == RB_RED) { \ - RB_SET_BLACKRED(tmp, parent, field); \ - RB_ROTATE_RIGHT(head, parent, tmp, field);\ - tmp = RB_LEFT(parent, field); \ - } \ - if ((RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ - (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ - RB_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RB_PARENT(elm, field); \ - } else { \ - if (RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ - struct type *oright; \ - if ((oright = RB_RIGHT(tmp, field)))\ - RB_COLOR(oright, field) = RB_BLACK;\ - RB_COLOR(tmp, field) = RB_RED; \ - RB_ROTATE_LEFT(head, tmp, oright, field);\ - tmp = RB_LEFT(parent, field); \ - } \ - RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ - RB_COLOR(parent, field) = RB_BLACK; \ - if (RB_LEFT(tmp, field)) \ - RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\ - RB_ROTATE_RIGHT(head, parent, tmp, field);\ - elm = RB_ROOT(head); \ - break; \ - } \ - } \ - } \ - if (elm) \ - RB_COLOR(elm, field) = RB_BLACK; \ -} \ - \ -struct type * \ -name##_RB_REMOVE(struct name *head, struct type *elm) \ -{ \ - struct type *child, *parent, *old = elm; \ - int color; \ - if (RB_LEFT(elm, field) == NULL) \ - child = RB_RIGHT(elm, field); \ - else if (RB_RIGHT(elm, field) == NULL) \ - child = RB_LEFT(elm, field); \ - else { \ - struct type *left; \ - elm = RB_RIGHT(elm, field); \ - while ((left = RB_LEFT(elm, field))) \ - elm = left; \ - child = RB_RIGHT(elm, field); \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child) \ - RB_PARENT(child, field) = parent; \ - if (parent) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ - if (RB_PARENT(elm, field) == old) \ - parent = elm; \ - (elm)->field = (old)->field; \ - if (RB_PARENT(old, field)) { \ - if (RB_LEFT(RB_PARENT(old, field), field) == old)\ - RB_LEFT(RB_PARENT(old, field), field) = elm;\ - else \ - RB_RIGHT(RB_PARENT(old, field), field) = elm;\ - RB_AUGMENT(RB_PARENT(old, field)); \ - } else \ - RB_ROOT(head) = elm; \ - RB_PARENT(RB_LEFT(old, field), field) = elm; \ - if (RB_RIGHT(old, field)) \ - RB_PARENT(RB_RIGHT(old, field), field) = elm; \ - if (parent) { \ - left = parent; \ - do { \ - RB_AUGMENT(left); \ - } while ((left = RB_PARENT(left, field))); \ - } \ - goto color; \ - } \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child) \ - RB_PARENT(child, field) = parent; \ - if (parent) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ -color: \ - if (color == RB_BLACK) \ - name##_RB_REMOVE_COLOR(head, parent, child); \ - return (old); \ -} \ - \ -/* Inserts a node into the RB tree */ \ -struct type * \ -name##_RB_INSERT(struct name *head, struct type *elm) \ -{ \ - struct type *tmp; \ - struct type *parent = NULL; \ - int comp = 0; \ - tmp = RB_ROOT(head); \ - while (tmp) { \ - parent = tmp; \ - comp = (cmp)(elm, parent); \ - if (comp < 0) \ - tmp = RB_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RB_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - RB_SET(elm, parent, field); \ - if (parent != NULL) { \ - if (comp < 0) \ - RB_LEFT(parent, field) = elm; \ - else \ - RB_RIGHT(parent, field) = elm; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = elm; \ - name##_RB_INSERT_COLOR(head, elm); \ - return (NULL); \ -} \ - \ -/* Finds the node with the same key as elm */ \ -struct type * \ -name##_RB_FIND(struct name *head, struct type *elm) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - int comp; \ - while (tmp) { \ - comp = cmp(elm, tmp); \ - if (comp < 0) \ - tmp = RB_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RB_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - return (NULL); \ -} \ - \ -struct type * \ -name##_RB_NEXT(struct type *elm) \ -{ \ - if (RB_RIGHT(elm, field)) { \ - elm = RB_RIGHT(elm, field); \ - while (RB_LEFT(elm, field)) \ - elm = RB_LEFT(elm, field); \ - } else { \ - if (RB_PARENT(elm, field) && \ - (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ - elm = RB_PARENT(elm, field); \ - else { \ - while (RB_PARENT(elm, field) && \ - (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\ - elm = RB_PARENT(elm, field); \ - elm = RB_PARENT(elm, field); \ - } \ - } \ - return (elm); \ -} \ - \ -struct type * \ -name##_RB_MINMAX(struct name *head, int val) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - struct type *parent = NULL; \ - while (tmp) { \ - parent = tmp; \ - if (val < 0) \ - tmp = RB_LEFT(tmp, field); \ - else \ - tmp = RB_RIGHT(tmp, field); \ - } \ - return (parent); \ -} - -#define RB_NEGINF -1 -#define RB_INF 1 - -#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) -#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) -#define RB_FIND(name, x, y) name##_RB_FIND(x, y) -#define RB_NEXT(name, x, y) name##_RB_NEXT(y) -#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) -#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) - -#define RB_FOREACH(x, name, head) \ - for ((x) = RB_MIN(name, head); \ - (x) != NULL; \ - (x) = name##_RB_NEXT(x)) - -#endif /* _SYS_TREE_H_ */ diff --git a/contrib/ntp/sntp/libevent/aclocal.m4 b/contrib/ntp/sntp/libevent/aclocal.m4 index 3bba48699b709..4c1c849347193 100644 --- a/contrib/ntp/sntp/libevent/aclocal.m4 +++ b/contrib/ntp/sntp/libevent/aclocal.m4 @@ -1131,6 +1131,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_backport_259_ssizet.m4]) +m4_include([m4/acx_pthread.m4]) m4_include([m4/libevent_openssl.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) @@ -1138,5 +1139,3 @@ m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/ntp_pkg_config.m4]) -m4_include([m4/openldap-thread-check.m4]) -m4_include([m4/openldap.m4]) diff --git a/contrib/ntp/sntp/libevent/buffer.c b/contrib/ntp/sntp/libevent/buffer.c index e603be863f01f..a1a2b988c13a3 100644 --- a/contrib/ntp/sntp/libevent/buffer.c +++ b/contrib/ntp/sntp/libevent/buffer.c @@ -158,12 +158,20 @@ evbuffer_chain_new(size_t size) struct evbuffer_chain *chain; size_t to_alloc; + if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE) + return (NULL); + size += EVBUFFER_CHAIN_SIZE; /* get the next largest memory that can hold the buffer */ - to_alloc = MIN_BUFFER_SIZE; - while (to_alloc < size) - to_alloc <<= 1; + if (size < EVBUFFER_CHAIN_MAX / 2) { + to_alloc = MIN_BUFFER_SIZE; + while (to_alloc < size) { + to_alloc <<= 1; + } + } else { + to_alloc = size; + } /* we get everything in one chunk */ if ((chain = mm_malloc(to_alloc)) == NULL) @@ -1133,6 +1141,7 @@ evbuffer_drain(struct evbuffer *buf, size_t len) } buf->first = chain; + EVUTIL_ASSERT(chain && remaining <= chain->off); chain->misalign += remaining; chain->off -= remaining; } @@ -1181,6 +1190,10 @@ evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, EVBUFFER_LOCK(buf); if (pos) { + if (datlen > (size_t)(EV_SSIZE_MAX - pos->pos)) { + result = -1; + goto done; + } chain = pos->internal_.chain; pos_in_chain = pos->internal_.pos_in_chain; if (datlen + pos->pos > buf->total_len) @@ -1218,6 +1231,8 @@ evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, if (datlen) { EVUTIL_ASSERT(chain); + EVUTIL_ASSERT(datlen+pos_in_chain <= chain->off); + memcpy(data, chain->buffer + chain->misalign + pos_in_chain, datlen); } @@ -1712,6 +1727,10 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) if (buf->freeze_end) { goto done; } + /* Prevent buf->total_len overflow */ + if (datlen > EV_SIZE_MAX - buf->total_len) { + goto done; + } chain = buf->last; @@ -1725,7 +1744,10 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) } if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) { - remain = (size_t)(chain->buffer_len - chain->misalign - chain->off); + /* Always true for mutable buffers */ + EVUTIL_ASSERT(chain->misalign >= 0 && + (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX); + remain = chain->buffer_len - (size_t)chain->misalign - chain->off; if (remain >= datlen) { /* there's enough space to hold all the data in the * current last chain */ @@ -1796,6 +1818,9 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) if (buf->freeze_start) { goto done; } + if (datlen > EV_SIZE_MAX - buf->total_len) { + goto done; + } chain = buf->first; @@ -1808,6 +1833,10 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) /* we cannot touch immutable buffers */ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) { + /* Always true for mutable buffers */ + EVUTIL_ASSERT(chain->misalign >= 0 && + (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX); + /* If this chain is empty, we can treat it as * 'empty at the beginning' rather than 'empty at the end' */ if (chain->off == 0) @@ -1845,6 +1874,7 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) tmp->next = chain; tmp->off = datlen; + EVUTIL_ASSERT(datlen <= tmp->buffer_len); tmp->misalign = tmp->buffer_len - datlen; memcpy(tmp->buffer + tmp->misalign, data, datlen); @@ -1943,7 +1973,9 @@ evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen) /* Would expanding this chunk be affordable and worthwhile? */ if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 || - chain->off > MAX_TO_COPY_IN_EXPAND) { + chain->off > MAX_TO_COPY_IN_EXPAND || + (datlen < EVBUFFER_CHAIN_MAX && + EVBUFFER_CHAIN_MAX - datlen >= chain->off)) { /* It's not worth resizing this chain. Can the next one be * used? */ if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) { @@ -2071,6 +2103,8 @@ evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) rmv_all = 1; avail = 0; } else { + /* can't overflow, since only mutable chains have + * huge misaligns. */ avail = (size_t) CHAIN_SPACE_LEN(chain); chain = chain->next; } @@ -2081,6 +2115,7 @@ evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) EVUTIL_ASSERT(chain->off == 0); evbuffer_chain_free(chain); } + EVUTIL_ASSERT(datlen >= avail); tmp = evbuffer_chain_new(datlen - avail); if (tmp == NULL) { if (rmv_all) { @@ -2210,6 +2245,7 @@ get_n_bytes_readable_on_socket(evutil_socket_t fd) unsigned long lng = EVBUFFER_MAX_READ; if (ioctlsocket(fd, FIONREAD, &lng) < 0) return -1; + /* Can overflow, but mostly harmlessly. XXXX */ return (int)lng; #elif defined(FIONREAD) int n = EVBUFFER_MAX_READ; @@ -2322,8 +2358,14 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch) #ifdef USE_IOVEC_IMPL remaining = n; for (i=0; i < nvecs; ++i) { - ev_ssize_t space = (ev_ssize_t) CHAIN_SPACE_LEN(*chainp); - if (space < remaining) { + /* can't overflow, since only mutable chains have + * huge misaligns. */ + size_t space = (size_t) CHAIN_SPACE_LEN(*chainp); + /* XXXX This is a kludge that can waste space in perverse + * situations. */ + if (space > EVBUFFER_CHAIN_MAX) + space = EVBUFFER_CHAIN_MAX; + if ((ev_ssize_t)space < remaining) { (*chainp)->off += space; remaining -= (int)space; } else { @@ -2485,9 +2527,11 @@ evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd, /* XXX(nickm) Don't disable this code until we know if * the WSARecv code above works. */ void *p = evbuffer_pullup(buffer, howmuch); + EVUTIL_ASSERT(p || !howmuch); n = send(fd, p, howmuch, 0); #else void *p = evbuffer_pullup(buffer, howmuch); + EVUTIL_ASSERT(p || !howmuch); n = write(fd, p, howmuch); #endif #ifdef USE_SENDFILE @@ -2538,6 +2582,8 @@ static int evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos, size_t howfar) { + if (pos->pos < 0) + return -1; if (howfar > (size_t)pos->pos) return -1; if (pos->internal_.chain && howfar <= pos->internal_.pos_in_chain) { @@ -2571,12 +2617,17 @@ evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos, case EVBUFFER_PTR_ADD: /* this avoids iterating over all previous chains if we just want to advance the position */ + if (pos->pos < 0 || EV_SIZE_MAX - position < (size_t)pos->pos) { + EVBUFFER_UNLOCK(buf); + return -1; + } chain = pos->internal_.chain; pos->pos += position; position = pos->internal_.pos_in_chain; break; } + EVUTIL_ASSERT(EV_SIZE_MAX - left >= position); while (chain && position + left >= chain->off) { left -= chain->off - position; chain = chain->next; @@ -2613,7 +2664,9 @@ evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos, ASSERT_EVBUFFER_LOCKED(buf); - if (pos->pos + len > buf->total_len) + if (pos->pos < 0 || + EV_SIZE_MAX - len < (size_t)pos->pos || + pos->pos + len > buf->total_len) return -1; chain = pos->internal_.chain; @@ -2740,7 +2793,10 @@ evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len, if (n_vec == 0 && len < 0) { /* If no vectors are provided and they asked for "everything", * pretend they asked for the actual available amount. */ - len = buffer->total_len - len_so_far; + len = buffer->total_len; + if (start_at) { + len -= start_at->pos; + } } while (chain) { @@ -2804,6 +2860,9 @@ evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap) if (sz < 0) goto done; + if (INT_MAX >= EVBUFFER_CHAIN_MAX && + (size_t)sz >= EVBUFFER_CHAIN_MAX) + goto done; if ((size_t)sz < space) { chain->off += sz; buf->total_len += sz; @@ -2913,6 +2972,11 @@ evbuffer_file_segment_new( } seg->length = length; + if (offset < 0 || length < 0 || + ((ev_uint64_t)length > EVBUFFER_CHAIN_MAX) || + (ev_uint64_t)offset > (ev_uint64_t)(EVBUFFER_CHAIN_MAX - length)) + goto err; + #if defined(USE_SENDFILE) if (!(flags & EVBUF_FS_DISABLE_SENDFILE)) { seg->can_sendfile = 1; @@ -3201,7 +3265,7 @@ evbuffer_add_file_segment(struct evbuffer *buf, return 0; err: EVBUFFER_UNLOCK(buf); - evbuffer_file_segment_free(seg); + evbuffer_file_segment_free(seg); /* Lowers the refcount */ return -1; } diff --git a/contrib/ntp/sntp/libevent/bufferevent.c b/contrib/ntp/sntp/libevent/bufferevent.c index 588461a33e1ac..d298d0b3f0138 100644 --- a/contrib/ntp/sntp/libevent/bufferevent.c +++ b/contrib/ntp/sntp/libevent/bufferevent.c @@ -599,7 +599,7 @@ bufferevent_setwatermark(struct bufferevent *bufev, short events, bufev_private->read_watermarks_cb, EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER); - if (evbuffer_get_length(bufev->input) > highmark) + if (evbuffer_get_length(bufev->input) >= highmark) bufferevent_wm_suspend_read(bufev); else if (evbuffer_get_length(bufev->input) < highmark) bufferevent_wm_unsuspend_read(bufev); @@ -615,25 +615,30 @@ bufferevent_setwatermark(struct bufferevent *bufev, short events, BEV_UNLOCK(bufev); } -void +int bufferevent_getwatermark(struct bufferevent *bufev, short events, size_t *lowmark, size_t *highmark) { - BEV_LOCK(bufev); if (events == EV_WRITE) { + BEV_LOCK(bufev); if (lowmark) *lowmark = bufev->wm_write.low; if (highmark) *highmark = bufev->wm_write.high; + BEV_UNLOCK(bufev); + return 0; } if (events == EV_READ) { + BEV_LOCK(bufev); if (lowmark) *lowmark = bufev->wm_read.low; if (highmark) *highmark = bufev->wm_read.high; + BEV_UNLOCK(bufev); + return 0; } - BEV_UNLOCK(bufev); + return -1; } int diff --git a/contrib/ntp/sntp/libevent/bufferevent_async.c b/contrib/ntp/sntp/libevent/bufferevent_async.c index 137ad24797fed..6395e57a9f0c6 100644 --- a/contrib/ntp/sntp/libevent/bufferevent_async.c +++ b/contrib/ntp/sntp/libevent/bufferevent_async.c @@ -381,9 +381,10 @@ be_async_destruct(struct bufferevent *bev) bev_async_del_write(bev_async); fd = evbuffer_overlapped_get_fd_(bev->input); - if (bev_p->options & BEV_OPT_CLOSE_ON_FREE) { - /* XXXX possible double-close */ + if (fd != (evutil_socket_t)INVALID_SOCKET && + (bev_p->options & BEV_OPT_CLOSE_ON_FREE)) { evutil_closesocket(fd); + evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET); } } @@ -564,9 +565,9 @@ bufferevent_async_new_(struct event_base *base, event_overlapped_init_(&bev_a->read_overlapped, read_complete); event_overlapped_init_(&bev_a->write_overlapped, write_complete); + bufferevent_init_generic_timeout_cbs_(bev); + bev_a->ok = fd >= 0; - if (bev_a->ok) - bufferevent_init_generic_timeout_cbs_(bev); return bev; err: @@ -671,6 +672,7 @@ be_async_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op, if (fd != (evutil_socket_t)INVALID_SOCKET && (bev_a->bev.options & BEV_OPT_CLOSE_ON_FREE)) { closesocket(fd); + evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET); } bev_a->ok = 0; return 0; diff --git a/contrib/ntp/sntp/libevent/bufferevent_filter.c b/contrib/ntp/sntp/libevent/bufferevent_filter.c index af71ebeeae912..4d9be43e25db8 100644 --- a/contrib/ntp/sntp/libevent/bufferevent_filter.c +++ b/contrib/ntp/sntp/libevent/bufferevent_filter.c @@ -425,26 +425,34 @@ be_filter_readcb(struct bufferevent *underlying, void *me_) enum bufferevent_filter_result res; enum bufferevent_flush_mode state; struct bufferevent *bufev = downcast(bevf); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); int processed_any = 0; - bufferevent_incref_and_lock_(bufev); + BEV_LOCK(bufev); - if (bevf->got_eof) - state = BEV_FINISHED; - else - state = BEV_NORMAL; + // It's possible our refcount is 0 at this point if another thread free'd our filterevent + EVUTIL_ASSERT(bufev_private->refcnt >= 0); - /* XXXX use return value */ - res = be_filter_process_input(bevf, state, &processed_any); - (void)res; + // If our refcount is > 0 + if (bufev_private->refcnt > 0) { - /* XXX This should be in process_input, not here. There are - * other places that can call process-input, and they should - * force readcb calls as needed. */ - if (processed_any) - bufferevent_trigger_nolock_(bufev, EV_READ, 0); + if (bevf->got_eof) + state = BEV_FINISHED; + else + state = BEV_NORMAL; - bufferevent_decref_and_unlock_(bufev); + /* XXXX use return value */ + res = be_filter_process_input(bevf, state, &processed_any); + (void)res; + + /* XXX This should be in process_input, not here. There are + * other places that can call process-input, and they should + * force readcb calls as needed. */ + if (processed_any) + bufferevent_trigger_nolock_(bufev, EV_READ, 0); + } + + BEV_UNLOCK(bufev); } /* Called when the underlying socket has drained enough that we can write to @@ -454,11 +462,20 @@ be_filter_writecb(struct bufferevent *underlying, void *me_) { struct bufferevent_filtered *bevf = me_; struct bufferevent *bev = downcast(bevf); + struct bufferevent_private *bufev_private = BEV_UPCAST(bev); int processed_any = 0; - bufferevent_incref_and_lock_(bev); - be_filter_process_output(bevf, BEV_NORMAL, &processed_any); - bufferevent_decref_and_unlock_(bev); + BEV_LOCK(bev); + + // It's possible our refcount is 0 at this point if another thread free'd our filterevent + EVUTIL_ASSERT(bufev_private->refcnt >= 0); + + // If our refcount is > 0 + if (bufev_private->refcnt > 0) { + be_filter_process_output(bevf, BEV_NORMAL, &processed_any); + } + + BEV_UNLOCK(bev); } /* Called when the underlying socket has given us an error */ @@ -467,11 +484,21 @@ be_filter_eventcb(struct bufferevent *underlying, short what, void *me_) { struct bufferevent_filtered *bevf = me_; struct bufferevent *bev = downcast(bevf); + struct bufferevent_private *bufev_private = BEV_UPCAST(bev); + + BEV_LOCK(bev); + + // It's possible our refcount is 0 at this point if another thread free'd our filterevent + EVUTIL_ASSERT(bufev_private->refcnt >= 0); + + // If our refcount is > 0 + if (bufev_private->refcnt > 0) { + + /* All we can really to is tell our own eventcb. */ + bufferevent_run_eventcb_(bev, what, 0); + } - bufferevent_incref_and_lock_(bev); - /* All we can really to is tell our own eventcb. */ - bufferevent_run_eventcb_(bev, what, 0); - bufferevent_decref_and_unlock_(bev); + BEV_UNLOCK(bev); } static int diff --git a/contrib/ntp/sntp/libevent/bufferevent_openssl.c b/contrib/ntp/sntp/libevent/bufferevent_openssl.c index 423b34f10097e..b30f90ff2e946 100644 --- a/contrib/ntp/sntp/libevent/bufferevent_openssl.c +++ b/contrib/ntp/sntp/libevent/bufferevent_openssl.c @@ -1276,6 +1276,8 @@ be_openssl_ctrl(struct bufferevent *bev, SSL_set_bio(bev_ssl->ssl, bio, bio); bev_ssl->fd_is_set = 1; } + if (data->fd == -1) + bev_ssl->fd_is_set = 0; if (bev_ssl->state == BUFFEREVENT_SSL_OPEN) return set_open_callbacks(bev_ssl, data->fd); else { diff --git a/contrib/ntp/sntp/libevent/bufferevent_pair.c b/contrib/ntp/sntp/libevent/bufferevent_pair.c index 4340f23723c0b..8154e17be732d 100644 --- a/contrib/ntp/sntp/libevent/bufferevent_pair.c +++ b/contrib/ntp/sntp/libevent/bufferevent_pair.c @@ -45,6 +45,8 @@ struct bufferevent_pair { struct bufferevent_private bev; struct bufferevent_pair *partner; + /* For ->destruct() lock checking */ + struct bufferevent_pair *unlinked_partner; }; @@ -265,11 +267,40 @@ be_pair_unlink(struct bufferevent *bev) struct bufferevent_pair *bev_p = upcast(bev); if (bev_p->partner) { + bev_p->unlinked_partner = bev_p->partner; bev_p->partner->partner = NULL; bev_p->partner = NULL; } } +/* Free *shared* lock in the latest be (since we share it between two of them). */ +static void +be_pair_destruct(struct bufferevent *bev) +{ + struct bufferevent_pair *bev_p = upcast(bev); + + /* Transfer ownership of the lock into partner, otherwise we will use + * already free'd lock during freeing second bev, see next example: + * + * bev1->own_lock = 1 + * bev2->own_lock = 0 + * bev2->lock = bev1->lock + * + * bufferevent_free(bev1) # refcnt == 0 -> unlink + * bufferevent_free(bev2) # refcnt == 0 -> unlink + * + * event_base_free() -> finilizers -> EVTHREAD_FREE_LOCK(bev1->lock) + * -> BEV_LOCK(bev2->lock) <-- already freed + * + * Where bev1 == pair[0], bev2 == pair[1]. + */ + if (bev_p->unlinked_partner && bev_p->bev.own_lock) { + bev_p->unlinked_partner->bev.own_lock = 1; + bev_p->bev.own_lock = 0; + } + bev_p->unlinked_partner = NULL; +} + static int be_pair_flush(struct bufferevent *bev, short iotype, enum bufferevent_flush_mode mode) @@ -320,7 +351,7 @@ const struct bufferevent_ops bufferevent_ops_pair = { be_pair_enable, be_pair_disable, be_pair_unlink, - NULL, /* be_pair_destruct, */ + be_pair_destruct, bufferevent_generic_adj_timeouts_, be_pair_flush, NULL, /* ctrl */ diff --git a/contrib/ntp/sntp/libevent/config.h.in b/contrib/ntp/sntp/libevent/config.h.in index 74466761e9f42..946b11a118b49 100644 --- a/contrib/ntp/sntp/libevent/config.h.in +++ b/contrib/ntp/sntp/libevent/config.h.in @@ -24,9 +24,6 @@ /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME -/* Define to 1 if you have the <cthreads.h> header file. */ -#undef HAVE_CTHREADS_H - /* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you don't. */ #undef HAVE_DECL_CTL_KERN @@ -109,9 +106,6 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* if you have GNU Pth */ -#undef HAVE_GNU_PTH - /* Define to 1 if you have the <ifaddrs.h> header file. */ #undef HAVE_IFADDRS_H @@ -133,24 +127,9 @@ /* Define if the system has zlib */ #undef HAVE_LIBZ -/* if you have LinuxThreads */ -#undef HAVE_LINUX_THREADS - -/* if you have SunOS LWP package */ -#undef HAVE_LWP - -/* Define to 1 if you have the <lwp/lwp.h> header file. */ -#undef HAVE_LWP_LWP_H - /* Define to 1 if you have the `mach_absolute_time' function. */ #undef HAVE_MACH_ABSOLUTE_TIME -/* define if you have Mach Cthreads */ -#undef HAVE_MACH_CTHREADS - -/* Define to 1 if you have the <mach/cthreads.h> header file. */ -#undef HAVE_MACH_CTHREADS_H - /* Define to 1 if you have the <mach/mach_time.h> header file. */ #undef HAVE_MACH_MACH_TIME_H @@ -175,15 +154,6 @@ /* Define to 1 if you have the <netinet/tcp.h> header file. */ #undef HAVE_NETINET_TCP_H -/* if you have NT Event Log */ -#undef HAVE_NT_EVENT_LOG - -/* if you have NT Service Manager */ -#undef HAVE_NT_SERVICE_MANAGER - -/* if you have NT Threads */ -#undef HAVE_NT_THREADS - /* Define if the system has openssl */ #undef HAVE_OPENSSL @@ -208,48 +178,15 @@ /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD -/* define to pthreads API spec revision */ +/* Define if we have pthreads on this system */ #undef HAVE_PTHREADS -/* define if you have pthread_detach function */ -#undef HAVE_PTHREAD_DETACH - -/* Define to 1 if you have the `pthread_getconcurrency' function. */ -#undef HAVE_PTHREAD_GETCONCURRENCY - -/* Define to 1 if you have the <pthread.h> header file. */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if you have the `pthread_kill' function. */ -#undef HAVE_PTHREAD_KILL - -/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */ -#undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP - -/* define if you have pthread_rwlock_destroy function */ -#undef HAVE_PTHREAD_RWLOCK_DESTROY - -/* Define to 1 if you have the `pthread_setconcurrency' function. */ -#undef HAVE_PTHREAD_SETCONCURRENCY - -/* Define to 1 if you have the `pthread_yield' function. */ -#undef HAVE_PTHREAD_YIELD - -/* Define to 1 if you have the <pth.h> header file. */ -#undef HAVE_PTH_H - /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if the system has the type `sa_family_t'. */ #undef HAVE_SA_FAMILY_T -/* Define to 1 if you have the <sched.h> header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `sched_yield' function. */ -#undef HAVE_SCHED_YIELD - /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT @@ -337,9 +274,6 @@ /* Define to 1 if the system has the type `struct so_linger'. */ #undef HAVE_STRUCT_SO_LINGER -/* Define to 1 if you have the <synch.h> header file. */ -#undef HAVE_SYNCH_H - /* Define to 1 if you have the `sysctl' function. */ #undef HAVE_SYSCTL @@ -403,21 +337,6 @@ /* Define if TAILQ_FOREACH is defined in <sys/queue.h> */ #undef HAVE_TAILQFOREACH -/* if you have Solaris LWP (thr) package */ -#undef HAVE_THR - -/* Define to 1 if you have the <thread.h> header file. */ -#undef HAVE_THREAD_H - -/* Define to 1 if you have the `thr_getconcurrency' function. */ -#undef HAVE_THR_GETCONCURRENCY - -/* Define to 1 if you have the `thr_setconcurrency' function. */ -#undef HAVE_THR_SETCONCURRENCY - -/* Define to 1 if you have the `thr_yield' function. */ -#undef HAVE_THR_YIELD - /* Define if timeradd is defined in <sys/time.h> */ #undef HAVE_TIMERADD @@ -466,15 +385,9 @@ /* Define if kqueue works correctly with pipes */ #undef HAVE_WORKING_KQUEUE -/* define if select implicitly yields */ -#undef HAVE_YIELDING_SELECT - /* Define to 1 if you have the <zlib.h> header file. */ #undef HAVE_ZLIB_H -/* define to 1 if library is thread safe */ -#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR @@ -482,9 +395,6 @@ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* define if you have (or want) no threads */ -#undef NO_THREADS - /* Numeric representation of the version */ #undef NUMERIC_VERSION @@ -509,11 +419,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* enable thread safety */ -#undef REENTRANT - -/* define if sched_yield yields the entire process */ -#undef REPLACE_BROKEN_YIELD +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT @@ -542,12 +450,6 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* enable thread safety */ -#undef THREADSAFE - -/* enable thread safety */ -#undef THREAD_SAFE - /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME @@ -570,18 +472,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* enable thread safety */ -#undef _REENTRANT - -/* enable thread safety */ -#undef _SGI_MP_SOURCE - -/* enable thread safety */ -#undef _THREADSAFE - -/* enable thread safety */ -#undef _THREAD_SAFE - /* Define to 500 only on HP-UX. */ #undef _XOPEN_SOURCE diff --git a/contrib/ntp/sntp/libevent/configure b/contrib/ntp/sntp/libevent/configure index 09d6eedb5cd0d..d2c07801dfe77 100755 --- a/contrib/ntp/sntp/libevent/configure +++ b/contrib/ntp/sntp/libevent/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libevent 2.1.3-alpha-dev. +# Generated by GNU Autoconf 2.68 for libevent 2.1.5-beta. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libevent' PACKAGE_TARNAME='libevent' -PACKAGE_VERSION='2.1.3-alpha-dev' -PACKAGE_STRING='libevent 2.1.3-alpha-dev' +PACKAGE_VERSION='2.1.5-beta' +PACKAGE_STRING='libevent 2.1.5-beta' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -619,6 +619,8 @@ PTHREADS_FALSE PTHREADS_TRUE PTHREAD_CFLAGS PTHREAD_LIBS +PTHREAD_CC +acx_pthread_config SIGNAL_SUPPORT_FALSE SIGNAL_SUPPORT_TRUE EVPORT_BACKEND_FALSE @@ -655,6 +657,8 @@ ZLIB_REGRESS_TRUE ZLIB_LIBS BUILD_REGRESS_FALSE BUILD_REGRESS_TRUE +BUILD_SAMPLES_FALSE +BUILD_SAMPLES_TRUE LIBTOOL_DEPS OTOOL64 OTOOL @@ -778,6 +782,7 @@ enable_openssl enable_debug_mode enable_libevent_install enable_libevent_regress +enable_samples enable_function_sections enable_verbose_debug enable_shared @@ -788,8 +793,6 @@ with_gnu_ld with_sysroot enable_libtool_lock enable_largefile -with_threads -with_yielding_select ' ac_precious_vars='build_alias host_alias @@ -1342,7 +1345,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libevent 2.1.3-alpha-dev to adapt to many kinds of systems. +\`configure' configures libevent 2.1.5-beta to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libevent 2.1.3-alpha-dev:";; + short | recursive ) echo "Configuration of libevent 2.1.5-beta:";; esac cat <<\_ACEOF @@ -1437,6 +1440,8 @@ Optional Features: --disable-libevent-regress, skip regress in make check + --disable-samples, skip building of sample programs + --enable-function-sections, make static library allow smaller binaries with --gc-sections --enable-verbose-debug, verbose debug logging @@ -1456,8 +1461,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-threads with threads [auto] - --with-yielding-select with yielding select [auto] Some influential environment variables: CC C compiler command @@ -1535,7 +1538,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libevent configure 2.1.3-alpha-dev +libevent configure 2.1.5-beta generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2235,7 +2238,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libevent $as_me 2.1.3-alpha-dev, which was +It was created by libevent $as_me 2.1.5-beta, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2616,7 +2619,6 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - am__api_version='1.11' # Find a good install program. We prefer a C program (faster), @@ -3055,7 +3057,7 @@ fi # Define the identity of the package. PACKAGE='libevent' - VERSION='2.1.3-alpha-dev' + VERSION='2.1.5-beta' cat >>confdefs.h <<_ACEOF @@ -3110,7 +3112,7 @@ AM_BACKSLASH='\' ac_config_headers="$ac_config_headers config.h evconfig-private.h:evconfig-private.h.in" -$as_echo "#define NUMERIC_VERSION 0x02010301" >>confdefs.h +$as_echo "#define NUMERIC_VERSION 0x02010500" >>confdefs.h if test "$prefix" = "NONE"; then @@ -5004,6 +5006,13 @@ else enable_libevent_regress=yes fi +# Check whether --enable-samples was given. +if test "${enable_samples+set}" = set; then : + enableval=$enable_samples; +else + enable_samples=yes +fi + # Check whether --enable-function-sections was given. if test "${enable_function_sections+set}" = set; then : enableval=$enable_function_sections; @@ -12071,6 +12080,14 @@ CC="$lt_save_CC" + if test "$enable_samples" = "yes"; then + BUILD_SAMPLES_TRUE= + BUILD_SAMPLES_FALSE='#' +else + BUILD_SAMPLES_TRUE='#' + BUILD_SAMPLES_FALSE= +fi + if test "$enable_libevent_regress" = "yes"; then BUILD_REGRESS_TRUE= BUILD_REGRESS_FALSE='#' @@ -14825,3443 +14842,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -# OpenLDAP --with-threads - -# Check whether --with-threads was given. -if test "${with_threads+set}" = set; then : - withval=$with_threads; - ol_arg=invalid - for ol_val in auto nt posix mach pth lwp yes no manual ; do - if test "$withval" = "$ol_val" ; then - ol_arg="$ol_val" - fi - done - if test "$ol_arg" = "invalid" ; then - as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5 - fi - ol_with_threads="$ol_arg" - -else - ol_with_threads="auto" -fi -# end --with-threads - - -case "$ol_with_threads$host" in - auto*-*-solaris2.[0-6]) - ol_with_threads=no - ;; -esac - - -ol_aix_threads=no -case "$host" in -*-*-aix*) if test -z "$CC" ; then - case "$ol_with_threads" in - auto | yes | posix) ol_aix_threads=yes ;; - esac - fi -;; -esac - -if test $ol_aix_threads = yes ; then - if test -z "${CC}" ; then - for ac_prog in cc_r xlc_r cc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break -done - - - if test "$CC" = cc ; then - if test $ol_with_threads != auto ; then - as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5 -$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;} - fi - ol_with_threads=no - fi - fi - - case ${CC} in cc_r | xlc_r) - ol_with_threads=posix - ol_cv_pthread_create=yes - ;; - esac -fi - -ol_link_threads=no -# OpenLDAP --with-yielding_select - -# Check whether --with-yielding_select was given. -if test "${with_yielding_select+set}" = set; then : - withval=$with_yielding_select; - ol_arg=invalid - for ol_val in auto yes no manual ; do - if test "$withval" = "$ol_val" ; then - ol_arg="$ol_val" - fi - done - if test "$ol_arg" = "invalid" ; then - as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5 - fi - ol_with_yielding_select="$ol_arg" - -else - ol_with_yielding_select="auto" -fi -# end --with-yielding_select - - -case $ol_with_threads in auto | yes | nt) - - - ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread" -if test "x$ac_cv_func__beginthread" = xyes; then : - -fi - - - if test $ac_cv_func__beginthread = yes ; then - -$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h - - ol_cv_nt_threads=yes - fi - - - if test "$ol_cv_nt_threads" = yes ; then - ol_link_threads=nt - ol_with_threads=found - ol_with_yielding_select=yes - - -$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h - - -$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h - - fi - - if test $ol_with_threads = nt ; then - as_fn_error $? "could not locate NT Threads" "$LINENO" 5 - fi - ;; -esac - -case $ol_with_threads in auto | yes | posix) - - for ac_header in pthread.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF - -fi - -done - - - if test $ac_cv_header_pthread_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5 -$as_echo_n "checking POSIX thread version... " >&6; } -if ${ol_cv_pthread_version+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <pthread.h> - -int -main () -{ - - int i = PTHREAD_CREATE_JOINABLE; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_detach" >/dev/null 2>&1; then : - ol_cv_pthread_version=10 -else - ol_cv_pthread_version=8 -fi -rm -f conftest* - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <pthread.h> -# ifdef PTHREAD_CREATE_UNDETACHED - draft7 -# endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "draft7" >/dev/null 2>&1; then : - ol_cv_pthread_version=7 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_attr_init" >/dev/null 2>&1; then : - ol_cv_pthread_version=6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <pthread.h> -#ifdef PTHREAD_MUTEX_INITIALIZER - draft5 -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "draft5" >/dev/null 2>&1; then : - ol_cv_pthread_version=5 -else - ol_cv_pthread_version=4 -fi -rm -f conftest* - -fi -rm -f conftest* - -fi -rm -f conftest* - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5 -$as_echo "$ol_cv_pthread_version" >&6; } - - - if test $ol_cv_pthread_version != 0 ; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREADS $ol_cv_pthread_version -_ACEOF - - else - as_fn_error $? "unknown pthread version" "$LINENO" 5 - fi - - # consider threads found - ol_with_threads=found - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 -$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } -if ${ol_cv_header_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : - ol_cv_header_linux_threads=yes -else - ol_cv_header_linux_threads=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 -$as_echo "$ol_cv_header_linux_threads" >&6; } - if test $ol_cv_header_linux_threads = yes; then - -$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5 -$as_echo_n "checking for GNU Pth pthread.h... " >&6; } -if ${ol_cv_header_gnu_pth_pthread_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> -#ifdef _POSIX_THREAD_IS_GNU_PTH - __gnu_pth__; -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "__gnu_pth__" >/dev/null 2>&1; then : - ol_cv_header_gnu_pth_pthread_h=yes -else - ol_cv_header_gnu_pth_pthread_h=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5 -$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; } - - - if test $ol_cv_header_gnu_pth_pthread_h = no ; then - for ac_header in sched.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_H 1 -_ACEOF - -fi - -done - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5 -$as_echo_n "checking for pthread_create in default libraries... " >&6; } -if ${ol_cv_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_create=yes -else - ol_cv_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_create=yes -else - ol_cv_pthread_create=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5 -$as_echo "$ol_cv_pthread_create" >&6; } - - if test $ol_cv_pthread_create != no ; then - ol_link_threads=posix - ol_link_pthreads="" - fi - - # Pthread try link: -kthread (ol_cv_pthread_kthread) -if test "$ol_link_threads" = no ; then - # try -kthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5 -$as_echo_n "checking for pthread link with -kthread... " >&6; } -if ${ol_cv_pthread_kthread+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-kthread $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_kthread=yes -else - ol_cv_pthread_kthread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_kthread=yes -else - ol_cv_pthread_kthread=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5 -$as_echo "$ol_cv_pthread_kthread" >&6; } - - if test $ol_cv_pthread_kthread = yes ; then - ol_link_pthreads="-kthread" - ol_link_threads=posix - fi -fi - - # Pthread try link: -pthread (ol_cv_pthread_pthread) -if test "$ol_link_threads" = no ; then - # try -pthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5 -$as_echo_n "checking for pthread link with -pthread... " >&6; } -if ${ol_cv_pthread_pthread+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-pthread $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_pthread=yes -else - ol_cv_pthread_pthread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_pthread=yes -else - ol_cv_pthread_pthread=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5 -$as_echo "$ol_cv_pthread_pthread" >&6; } - - if test $ol_cv_pthread_pthread = yes ; then - ol_link_pthreads="-pthread" - ol_link_threads=posix - fi -fi - - # Pthread try link: -pthreads (ol_cv_pthread_pthreads) -if test "$ol_link_threads" = no ; then - # try -pthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5 -$as_echo_n "checking for pthread link with -pthreads... " >&6; } -if ${ol_cv_pthread_pthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-pthreads $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_pthreads=yes -else - ol_cv_pthread_pthreads=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_pthreads=yes -else - ol_cv_pthread_pthreads=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5 -$as_echo "$ol_cv_pthread_pthreads" >&6; } - - if test $ol_cv_pthread_pthreads = yes ; then - ol_link_pthreads="-pthreads" - ol_link_threads=posix - fi -fi - - # Pthread try link: -mthreads (ol_cv_pthread_mthreads) -if test "$ol_link_threads" = no ; then - # try -mthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5 -$as_echo_n "checking for pthread link with -mthreads... " >&6; } -if ${ol_cv_pthread_mthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-mthreads $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_mthreads=yes -else - ol_cv_pthread_mthreads=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_mthreads=yes -else - ol_cv_pthread_mthreads=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5 -$as_echo "$ol_cv_pthread_mthreads" >&6; } - - if test $ol_cv_pthread_mthreads = yes ; then - ol_link_pthreads="-mthreads" - ol_link_threads=posix - fi -fi - - # Pthread try link: -thread (ol_cv_pthread_thread) -if test "$ol_link_threads" = no ; then - # try -thread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5 -$as_echo_n "checking for pthread link with -thread... " >&6; } -if ${ol_cv_pthread_thread+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-thread $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_thread=yes -else - ol_cv_pthread_thread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_thread=yes -else - ol_cv_pthread_thread=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5 -$as_echo "$ol_cv_pthread_thread" >&6; } - - if test $ol_cv_pthread_thread = yes ; then - ol_link_pthreads="-thread" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r) -if test "$ol_link_threads" = no ; then - # try -lpthread -lmach -lexc -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 -$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; } -if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthread -lmach -lexc -lc_r $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes -else - ol_cv_pthread_lpthread_lmach_lexc_lc_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes -else - ol_cv_pthread_lpthread_lmach_lexc_lc_r=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5 -$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; } - - if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then - ol_link_pthreads="-lpthread -lmach -lexc -lc_r" - ol_link_threads=posix - fi -fi - - # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc) -if test "$ol_link_threads" = no ; then - # try -lpthread -lmach -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; } -if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthread -lmach -lexc $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthread_lmach_lexc=yes -else - ol_cv_pthread_lpthread_lmach_lexc=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthread_lmach_lexc=yes -else - ol_cv_pthread_lpthread_lmach_lexc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; } - - if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then - ol_link_pthreads="-lpthread -lmach -lexc" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff) -if test "$ol_link_threads" = no ; then - # try -lpthread -Wl,-woff,85 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5 -$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; } -if ${ol_cv_pthread_lib_lpthread_woff+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthread -Wl,-woff,85 $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lib_lpthread_woff=yes -else - ol_cv_pthread_lib_lpthread_woff=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lib_lpthread_woff=yes -else - ol_cv_pthread_lib_lpthread_woff=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5 -$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; } - - if test $ol_cv_pthread_lib_lpthread_woff = yes ; then - ol_link_pthreads="-lpthread -Wl,-woff,85" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -lpthread (ol_cv_pthread_lpthread) -if test "$ol_link_threads" = no ; then - # try -lpthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5 -$as_echo_n "checking for pthread link with -lpthread... " >&6; } -if ${ol_cv_pthread_lpthread+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthread $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthread=yes -else - ol_cv_pthread_lpthread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthread=yes -else - ol_cv_pthread_lpthread=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5 -$as_echo "$ol_cv_pthread_lpthread" >&6; } - - if test $ol_cv_pthread_lpthread = yes ; then - ol_link_pthreads="-lpthread" - ol_link_threads=posix - fi -fi - - # Pthread try link: -lc_r (ol_cv_pthread_lc_r) -if test "$ol_link_threads" = no ; then - # try -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5 -$as_echo_n "checking for pthread link with -lc_r... " >&6; } -if ${ol_cv_pthread_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lc_r $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lc_r=yes -else - ol_cv_pthread_lc_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lc_r=yes -else - ol_cv_pthread_lc_r=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5 -$as_echo "$ol_cv_pthread_lc_r" >&6; } - - if test $ol_cv_pthread_lc_r = yes ; then - ol_link_pthreads="-lc_r" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -threads (ol_cv_pthread_threads) -if test "$ol_link_threads" = no ; then - # try -threads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5 -$as_echo_n "checking for pthread link with -threads... " >&6; } -if ${ol_cv_pthread_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-threads $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_threads=yes -else - ol_cv_pthread_threads=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +acx_pthread_ok=no -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_threads=yes -else - ol_cv_pthread_threads=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5 -$as_echo "$ol_cv_pthread_threads" >&6; } - - if test $ol_cv_pthread_threads = yes ; then - ol_link_pthreads="-threads" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r) -if test "$ol_link_threads" = no ; then - # try -lpthreads -lmach -lexc -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; } -if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthreads -lmach -lexc -lc_r $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes -else - ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes -else - ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; } - - if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then - ol_link_pthreads="-lpthreads -lmach -lexc -lc_r" - ol_link_threads=posix - fi -fi - - # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc) -if test "$ol_link_threads" = no ; then - # try -lpthreads -lmach -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; } -if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthreads -lmach -lexc $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthreads_lmach_lexc=yes -else - ol_cv_pthread_lpthreads_lmach_lexc=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthreads_lmach_lexc=yes -else - ol_cv_pthread_lpthreads_lmach_lexc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; } - - if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then - ol_link_pthreads="-lpthreads -lmach -lexc" - ol_link_threads=posix - fi -fi - - # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc) -if test "$ol_link_threads" = no ; then - # try -lpthreads -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; } -if ${ol_cv_pthread_lpthreads_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthreads -lexc $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lpthreads_lexc=yes -else - ol_cv_pthread_lpthreads_lexc=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lpthreads_lexc=yes -else - ol_cv_pthread_lpthreads_lexc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; } - - if test $ol_cv_pthread_lpthreads_lexc = yes ; then - ol_link_pthreads="-lpthreads -lexc" - ol_link_threads=posix - fi -fi - - - # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads) -if test "$ol_link_threads" = no ; then - # try -lpthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5 -$as_echo_n "checking for pthread link with -lpthreads... " >&6; } -if ${ol_cv_pthread_lib_lpthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # save the flags - ol_LIBS="$LIBS" - LIBS="-lpthreads $LIBS" - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - -int -main () -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_pthread_lib_lpthreads=yes -else - ol_cv_pthread_lib_lpthreads=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_lib_lpthreads=yes -else - ol_cv_pthread_lib_lpthreads=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - # restore the LIBS - LIBS="$ol_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5 -$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; } - - if test $ol_cv_pthread_lib_lpthreads = yes ; then - ol_link_pthreads="-lpthreads" - ol_link_threads=posix - fi -fi - - - if test $ol_link_threads != no ; then - LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" - - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - LIBS="$LTHREAD_LIBS $LIBS" - - for ac_func in sched_yield pthread_yield thr_yield -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - if test $ac_cv_func_sched_yield = no && - test $ac_cv_func_pthread_yield = no && - test $ac_cv_func_thr_yield = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 -$as_echo_n "checking for sched_yield in -lrt... " >&6; } -if ${ac_cv_lib_rt_sched_yield+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -18270,1001 +14867,322 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char sched_yield (); +char pthread_join (); int main () { -return sched_yield (); +return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rt_sched_yield=yes -else - ac_cv_lib_rt_sched_yield=no + acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 -$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } -if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : - LTHREAD_LIBS="$LTHREAD_LIBS -lrt" - -$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h - - ac_cv_func_sched_yield=yes -else - ac_cv_func_sched_yield=no -fi - - fi - if test $ac_cv_func_sched_yield = no && - test $ac_cv_func_pthread_yield = no && - test "$ac_cv_func_thr_yield" = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5 -$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;} - fi - - for ac_func in pthread_kill -do : - ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" -if test "x$ac_cv_func_pthread_kill" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_KILL 1 -_ACEOF - -fi -done - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5 -$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; } -if ${ol_cv_func_pthread_rwlock_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <pthread.h> -pthread_rwlock_t rwlock; - -int -main () -{ -pthread_rwlock_destroy(&rwlock); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_func_pthread_rwlock_destroy=yes -else - ol_cv_func_pthread_rwlock_destroy=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5 -$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; } - if test $ol_cv_func_pthread_rwlock_destroy = yes ; then - -$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5 -$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; } -if ${ol_cv_func_pthread_detach+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <pthread.h> -#ifndef NULL -#define NULL (void*)0 -#endif - -int -main () -{ -pthread_detach(NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_func_pthread_detach=yes -else - ol_cv_func_pthread_detach=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5 -$as_echo "$ol_cv_func_pthread_detach" >&6; } - - if test $ol_cv_func_pthread_detach = no ; then - as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5 - fi - - -$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h - - - for ac_func in \ - pthread_setconcurrency \ - pthread_getconcurrency \ - thr_setconcurrency \ - thr_getconcurrency \ - -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - for ac_func in pthread_kill_other_threads_np -do : - ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np" -if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1 -_ACEOF - -fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5 -$as_echo_n "checking for LinuxThreads implementation... " >&6; } -if ${ol_cv_sys_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else - ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5 -$as_echo "$ol_cv_sys_linux_threads" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5 -$as_echo_n "checking for LinuxThreads consistency... " >&6; } -if ${ol_cv_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test $ol_cv_header_linux_threads = yes && - test $ol_cv_sys_linux_threads = yes; then - ol_cv_linux_threads=yes - elif test $ol_cv_header_linux_threads = no && - test $ol_cv_sys_linux_threads = no; then - ol_cv_linux_threads=no - else - ol_cv_linux_threads=error - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5 -$as_echo "$ol_cv_linux_threads" >&6; } - - - if test $ol_cv_linux_threads = error; then - as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5; - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5 -$as_echo_n "checking if pthread_create() works... " >&6; } -if ${ol_cv_pthread_create_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - ol_cv_pthread_create_works=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -/* pthread test headers */ -#include <pthread.h> -#if HAVE_PTHREADS < 7 -#include <errno.h> -#endif -#ifndef NULL -#define NULL (void*)0 -#endif - -static void *task(p) - void *p; -{ - return (void *) (p == NULL); -} - - -int main(argc, argv) - int argc; - char **argv; -{ - - /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - pthread_t t; - int status; - int detach = PTHREAD_CREATE_DETACHED; - -#if HAVE_PTHREADS > 4 - /* Final pthreads */ - pthread_attr_t attr; - - status = pthread_attr_init(&attr); - if( status ) return status; - -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; -#else - status = pthread_attr_setdetachstate(&attr, detach); -#endif - if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif - if( status ) return status; -#else - /* Draft 4 pthreads */ - status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; - - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); - - status = pthread_detach( &t ); - if( status ) return errno; -#endif - -#ifdef HAVE_LINUX_THREADS - pthread_kill_other_threads_np(); -#endif - - return 0; - -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_create_works=yes -else - ol_cv_pthread_create_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 +$as_echo "$acx_pthread_ok" >&6; } + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5 -$as_echo "$ol_cv_pthread_create_works" >&6; } - - if test $ol_cv_pthread_create_works = no ; then - as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5 - fi - - ol_replace_broken_yield=no - - if test $ol_replace_broken_yield = yes ; then - -$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h - - fi - - if test x$ol_with_yielding_select = xauto ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5 -$as_echo_n "checking if select yields when using pthreads... " >&6; } -if ${ol_cv_pthread_select_yields+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - ol_cv_pthread_select_yields=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <sys/types.h> -#include <sys/time.h> -#include <unistd.h> -#include <pthread.h> -#ifndef NULL -#define NULL (void*) 0 -#endif -static int fildes[2]; +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). -static void *task(p) - void *p; -{ - int i; - struct timeval tv; - - fd_set rfds; +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. - tv.tv_sec=10; - tv.tv_usec=0; +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - FD_ZERO(&rfds); - FD_SET(fildes[0], &rfds); +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: - /* we're not interested in any fds */ - i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv); +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) - if(i < 0) { - perror("select"); - exit(10); - } +case "${host_cpu}-${host_os}" in + *solaris*) - exit(0); /* if we exit here, the select blocked the whole process */ -} + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: -int main(argc, argv) - int argc; - char **argv; -{ - pthread_t t; - - /* create a pipe to select */ - if(pipe(&fildes[0])) { - perror("select"); - exit(1); - } - -#ifdef HAVE_PTHREAD_SETCONCURRENCY - (void) pthread_setconcurrency(2); -#else -#ifdef HAVE_THR_SETCONCURRENCY - /* Set Solaris LWP concurrency to 2 */ - thr_setconcurrency(2); -#endif -#endif - -#if HAVE_PTHREADS < 6 - pthread_create(&t, pthread_attr_default, task, NULL); -#else - pthread_create(&t, NULL, task, NULL); -#endif - - /* make sure task runs first */ -#ifdef HAVE_THR_YIELD - thr_yield(); -#elif defined( HAVE_SCHED_YIELD ) - sched_yield(); -#elif defined( HAVE_PTHREAD_YIELD ) - pthread_yield(); -#endif - - exit(2); -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ol_cv_pthread_select_yields=no -else - ol_cv_pthread_select_yields=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5 -$as_echo "$ol_cv_pthread_select_yields" >&6; } - - if test $ol_cv_pthread_select_yields = cross ; then - as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5 - fi - - if test $ol_cv_pthread_select_yields = yes ; then - ol_with_yielding_select=yes - fi - fi - - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - else - as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5 - fi - fi - - if test $ol_with_threads = posix ; then - as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5 - fi - ;; + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; esac -case $ol_with_threads in auto | yes | mach) +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do - for ac_header in mach/cthreads.h cthreads.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; - if test $ac_cv_header_mach_cthreads_h = yes ; then - ol_with_threads=found + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; - ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" -if test "x$ac_cv_func_cthread_fork" = xyes; then : - ol_link_threads=yes -fi - - - if test $ol_link_threads = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5 -$as_echo_n "checking for cthread_fork with -all_load... " >&6; } -if ${ol_cv_cthread_all_load+:} false; then : + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_acx_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else - - save_LIBS="$LIBS" - LIBS="-all_load $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <mach/cthreads.h> -int -main () -{ - - cthread_fork((void *)0, (void *)0); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_cthread_all_load=yes + if test -n "$acx_pthread_config"; then + ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. else - ol_cv_cthread_all_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5 -$as_echo "$ol_cv_cthread_all_load" >&6; } - - if test $ol_cv_cthread_all_load = yes ; then - LTHREAD_LIBS="$LTHREAD_LIBS -all_load" - ol_link_threads=mach - ol_with_threads=found - fi - fi - - elif test $ac_cv_header_cthreads_h = yes ; then - - ol_with_threads=found - - save_LIBS="$LIBS" - LIBS="$LIBS -lthreads" - ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" -if test "x$ac_cv_func_cthread_fork" = xyes; then : - ol_link_threads=yes -fi - - LIBS="$save_LIBS" - - if test $ol_link_threads = yes ; then - LTHREAD_LIBS="-lthreads" - ol_link_threads=mach - ol_with_threads=found - else - as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5 - fi - - elif test $ol_with_threads = mach ; then - as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5 - fi - - if test $ol_link_threads = mach ; then - -$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h - - elif test $ol_with_threads = found ; then - as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5 - fi - ;; -esac - -case $ol_with_threads in auto | yes | pth) - - for ac_header in pth.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default" -if test "x$ac_cv_header_pth_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTH_H 1 -_ACEOF - -fi - +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_acx_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS - - if test $ac_cv_header_pth_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5 -$as_echo_n "checking for pth_version in -lpth... " >&6; } -if ${ac_cv_lib_pth_pth_version+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpth $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pth_version (); -int -main () -{ -return pth_version (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pth_pth_version=yes -else - ac_cv_lib_pth_pth_version=no + test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5 -$as_echo "$ac_cv_lib_pth_pth_version" >&6; } -if test "x$ac_cv_lib_pth_pth_version" = xyes; then : - have_pth=yes +acx_pthread_config=$ac_cv_prog_acx_pthread_config +if test -n "$acx_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 +$as_echo "$acx_pthread_config" >&6; } else - have_pth=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test $have_pth = yes ; then - -$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h - - LTHREAD_LIBS="$LTHREAD_LIBS -lpth" - ol_link_threads=pth - ol_with_threads=found - - if test x$ol_with_yielding_select = xauto ; then - ol_with_yielding_select=yes - fi - fi - fi - ;; -esac - -case $ol_with_threads in auto | yes | lwp) - - for ac_header in thread.h synch.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; -fi + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac -done + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - if test $ac_cv_header_thread_h = yes && - test $ac_cv_header_synch_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5 -$as_echo_n "checking for thr_create in -lthread... " >&6; } -if ${ac_cv_lib_thread_thr_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char thr_create (); +#include <pthread.h> int main () { -return thr_create (); +pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_thread_thr_create=yes -else - ac_cv_lib_thread_thr_create=no + acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5 -$as_echo "$ac_cv_lib_thread_thr_create" >&6; } -if test "x$ac_cv_lib_thread_thr_create" = xyes; then : - have_thr=yes -else - have_thr=no -fi - - - if test $have_thr = yes ; then - -$as_echo "#define HAVE_THR 1" >>confdefs.h - LTHREAD_LIBS="$LTHREAD_LIBS -lthread" - ol_link_threads=thr + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" - if test x$ol_with_yielding_select = xauto ; then - ol_with_yielding_select=yes - fi - - for ac_func in \ - thr_setconcurrency \ - thr_getconcurrency \ - -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 +$as_echo "$acx_pthread_ok" >&6; } + if test "x$acx_pthread_ok" = xyes; then + break; + fi -fi + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" done - - fi - fi - - for ac_header in lwp/lwp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LWP_LWP_H 1 -_ACEOF - fi -done +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - if test $ac_cv_header_lwp_lwp_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5 -$as_echo_n "checking for lwp_create in -llwp... " >&6; } -if ${ac_cv_lib_lwp_lwp_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llwp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lwp_create (); +#include <pthread.h> int main () { -return lwp_create (); +int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lwp_lwp_create=yes -else - ac_cv_lib_lwp_lwp_create=no + attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5 -$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; } -if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then : - have_lwp=yes -else - have_lwp=no -fi - - - if test $have_lwp = yes ; then - -$as_echo "#define HAVE_LWP 1" >>confdefs.h - - LTHREAD_LIBS="$LTHREAD_LIBS -llwp" - ol_link_threads=lwp - - if test x$ol_with_yielding_select = xauto ; then - ol_with_yielding_select=no - fi - fi - fi - ;; -esac - -if test $ol_with_yielding_select = yes ; then - -$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h - -fi - -if test $ol_with_threads = manual ; then - ol_link_threads=yes - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5 -$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;} + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - for ac_header in pthread.h sched.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF -fi - -done - - for ac_func in sched_yield pthread_yield -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + fi -fi -done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +$as_echo "${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 -$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } -if ${ol_cv_header_linux_threads+:} false; then : + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : - ol_cv_header_linux_threads=yes + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else - ol_cv_header_linux_threads=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 -$as_echo "$ol_cv_header_linux_threads" >&6; } - if test $ol_cv_header_linux_threads = yes; then - -$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h - - fi - - - for ac_header in mach/cthreads.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_cthreads_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MACH_CTHREADS_H 1 -_ACEOF - -fi - -done - - for ac_header in lwp/lwp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LWP_LWP_H 1 -_ACEOF - -fi - +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done - - for ac_header in thread.h synch.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + done +IFS=$as_save_IFS fi - -done - fi - -if test $ol_link_threads != no && test $ol_link_threads != nt ; then - -$as_echo "#define REENTRANT 1" >>confdefs.h - - -$as_echo "#define _REENTRANT 1" >>confdefs.h - - -$as_echo "#define THREAD_SAFE 1" >>confdefs.h - - -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h - - -$as_echo "#define THREADSAFE 1" >>confdefs.h - - -$as_echo "#define _THREADSAFE 1" >>confdefs.h - - -$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5 -$as_echo_n "checking for thread specific errno... " >&6; } -if ${ol_cv_errno_thread_specific+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <errno.h> -int -main () -{ -errno = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_errno_thread_specific=yes +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } else - ol_cv_errno_thread_specific=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5 -$as_echo "$ol_cv_errno_thread_specific" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5 -$as_echo_n "checking for thread specific h_errno... " >&6; } -if ${ol_cv_h_errno_thread_specific+:} false; then : - $as_echo_n "(cached) " >&6 -else + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <netdb.h> -int -main () -{ -h_errno = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ol_cv_h_errno_thread_specific=yes + else + PTHREAD_CC=$CC + fi else - ol_cv_h_errno_thread_specific=no + PTHREAD_CC="$CC" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5 -$as_echo "$ol_cv_h_errno_thread_specific" >&6; } - if test $ol_cv_errno_thread_specific != yes || - test $ol_cv_h_errno_thread_specific != yes ; then - LIBS="$LTHREAD_LIBS $LIBS" - LTHREAD_LIBS="" - fi -fi -if test $ol_link_threads = no ; then - if test $ol_with_threads = yes ; then - as_fn_error $? "no suitable thread support" "$LINENO" 5 - fi - if test $ol_with_threads = auto ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5 -$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;} - ol_with_threads=no - fi +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then -$as_echo "#define NO_THREADS 1" >>confdefs.h +$as_echo "#define HAVE_PTHREADS 1" >>confdefs.h - LTHREAD_LIBS="" - BUILD_THREAD=no + have_pthreads=yes + : else - BUILD_THREAD=yes -fi - -if test $ol_link_threads != no ; then - -$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h + acx_pthread_ok=no fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -case "$ol_with_threads" in - no) - ol_pthread_ok=no - - ;; - *) - have_pthreads=yes - PTHREAD_LIBS="$LTHREAD_LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - # The cast to long int works around a bug in the HP C Compiler + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -19273,10 +15191,8 @@ $as_echo_n "checking size of pthread_t... " >&6; } if ${ac_cv_sizeof_pthread_t+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " - $ac_includes_default - #include <pthread.h> - + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "$ac_includes_default + #include <pthread.h> "; then : @@ -19302,20 +15218,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF - - ;; -esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi - - if test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"; then PTHREADS_TRUE= PTHREADS_FALSE='#' @@ -19712,6 +15615,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILD_SAMPLES_TRUE}" && test -z "${BUILD_SAMPLES_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SAMPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_REGRESS_TRUE}" && test -z "${BUILD_REGRESS_FALSE}"; then as_fn_error $? "conditional \"BUILD_REGRESS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20189,7 +16096,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libevent $as_me 2.1.3-alpha-dev, which was +This file was extended by libevent $as_me 2.1.5-beta, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20255,7 +16162,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libevent config.status 2.1.3-alpha-dev +libevent config.status 2.1.5-beta configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/contrib/ntp/sntp/libevent/configure.ac b/contrib/ntp/sntp/libevent/configure.ac index c60c7ace87f6e..2cdc74f16d823 100644 --- a/contrib/ntp/sntp/libevent/configure.ac +++ b/contrib/ntp/sntp/libevent/configure.ac @@ -5,18 +5,17 @@ dnl See LICENSE for copying information. dnl dnl Original version Dug Song <dugsong@monkey.org> -AC_INIT(libevent,2.1.3-alpha-dev) +AC_INIT(libevent,2.1.5-beta) AC_PREREQ(2.59) AC_CONFIG_SRCDIR(event.c) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) - AM_INIT_AUTOMAKE dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_HEADERS(config.h evconfig-private.h:evconfig-private.h.in) -AC_DEFINE(NUMERIC_VERSION, 0x02010301, [Numeric representation of the version]) +AC_DEFINE(NUMERIC_VERSION, 0x02010500, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then @@ -113,6 +112,9 @@ AC_ARG_ENABLE([libevent-install], AC_ARG_ENABLE([libevent-regress], AS_HELP_STRING([--disable-libevent-regress, skip regress in make check]), [], [enable_libevent_regress=yes]) +AC_ARG_ENABLE([samples], + AS_HELP_STRING([--disable-samples, skip building of sample programs]), + [], [enable_samples=yes]) AC_ARG_ENABLE([function-sections], AS_HELP_STRING([--enable-function-sections, make static library allow smaller binaries with --gc-sections]), [], [enable_function_sections=no]) @@ -129,6 +131,7 @@ dnl the command line with --enable-shared and --disable-shared. dnl AC_DISABLE_SHARED AC_SUBST(LIBTOOL_DEPS) +AM_CONDITIONAL([BUILD_SAMPLES], [test "$enable_samples" = "yes"]) AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"]) dnl Checks for libraries. @@ -724,22 +727,16 @@ AC_TRY_COMPILE([], # check if we can compile with pthreads have_pthreads=no if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then - OL_THREAD_CHECK([ - have_pthreads=yes - PTHREAD_LIBS="$LTHREAD_LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - AC_CHECK_SIZEOF( - [pthread_t], - [], - [ - AC_INCLUDES_DEFAULT() - #include <pthread.h> - ] - ) - ]) + ACX_PTHREAD([ + AC_DEFINE(HAVE_PTHREADS, 1, + [Define if we have pthreads on this system]) + have_pthreads=yes]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + AC_CHECK_SIZEOF(pthread_t, , + [AC_INCLUDES_DEFAULT() + #include <pthread.h> ] + ) fi -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) AM_CONDITIONAL([PTHREADS], [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"]) # check if we should compile locking into the library diff --git a/contrib/ntp/sntp/libevent/evbuffer-internal.h b/contrib/ntp/sntp/libevent/evbuffer-internal.h index fb67ec0957257..cf4bddc80ea86 100644 --- a/contrib/ntp/sntp/libevent/evbuffer-internal.h +++ b/contrib/ntp/sntp/libevent/evbuffer-internal.h @@ -155,6 +155,18 @@ struct evbuffer { struct bufferevent *parent; }; +#if EVENT__SIZEOF_OFF_T < EVENT__SIZEOF_SIZE_T +typedef ev_ssize_t ev_misalign_t; +#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX) +#else +typedef ev_off_t ev_misalign_t; +#if EVENT__SIZEOF_OFF_T > EVENT__SIZEOF_SIZE_T +#define EVBUFFER_CHAIN_MAX EV_SIZE_MAX +#else +#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX) +#endif +#endif + /** A single item in an evbuffer. */ struct evbuffer_chain { /** points to next buffer in the chain */ @@ -165,7 +177,7 @@ struct evbuffer_chain { /** unused space at the beginning of buffer or an offset into a * file for sendfile buffers. */ - ev_off_t misalign; + ev_misalign_t misalign; /** Offset into buffer + misalign at which to start writing. * In other words, the total number of bytes actually stored diff --git a/contrib/ntp/sntp/libevent/evdns.c b/contrib/ntp/sntp/libevent/evdns.c index 59c3abe18655d..60f4db5c5fba1 100644 --- a/contrib/ntp/sntp/libevent/evdns.c +++ b/contrib/ntp/sntp/libevent/evdns.c @@ -541,6 +541,17 @@ nameserver_probe_failed(struct nameserver *const ns) { } } +static void +request_swap_ns(struct request *req, struct nameserver *ns) { + if (ns && req->ns != ns) { + EVUTIL_ASSERT(req->ns->requests_inflight > 0); + req->ns->requests_inflight--; + ns->requests_inflight++; + + req->ns = ns; + } +} + /* called when a nameserver has been deemed to have failed. For example, too */ /* many packets have timed out etc */ static void @@ -595,7 +606,7 @@ nameserver_failed(struct nameserver *const ns, const char *msg) { if (req->tx_count == 0 && req->ns == ns) { /* still waiting to go out, can be moved */ /* to another server */ - req->ns = nameserver_pick(base); + request_swap_ns(req, nameserver_pick(base)); } req = req->next; } while (req != started_at); @@ -659,6 +670,7 @@ request_finished(struct request *const req, struct request **head, int free_hand req->ns->requests_inflight == 0 && req->base->disable_when_inactive) { event_del(&req->ns->event); + evtimer_del(&req->ns->timeout_event); } if (!req->request_appended) { @@ -707,7 +719,7 @@ request_reissue(struct request *req) { /* the last nameserver should have been marked as failing */ /* by the caller of this function, therefore pick will try */ /* not to return it */ - req->ns = nameserver_pick(req->base); + request_swap_ns(req, nameserver_pick(req->base)); if (req->ns == last_ns) { /* ... but pick did return it */ /* not a lot of point in trying again with the */ @@ -2158,29 +2170,30 @@ evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) { log(EVDNS_LOG_DEBUG, "Request %p timed out", arg); EVDNS_LOCK(base); - req->ns->timedout++; - if (req->ns->timedout > req->base->global_max_nameserver_timeout) { - req->ns->timedout = 0; - nameserver_failed(req->ns, "request timed out."); - } - if (req->tx_count >= req->base->global_max_retransmits) { + struct nameserver *ns = req->ns; /* this request has failed */ log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d", arg, req->tx_count); reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL); + request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1); + nameserver_failed(ns, "request timed out."); } else { /* retransmit it */ - struct nameserver *new_ns; log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d", arg, req->tx_count); (void) evtimer_del(&req->timeout_event); - new_ns = nameserver_pick(base); - if (new_ns) - req->ns = new_ns; + request_swap_ns(req, nameserver_pick(base)); evdns_request_transmit(req); + + req->ns->timedout++; + if (req->ns->timedout > req->base->global_max_nameserver_timeout) { + req->ns->timedout = 0; + nameserver_failed(req->ns, "request timed out."); + } } + EVDNS_UNLOCK(base); } @@ -2639,6 +2652,34 @@ evdns_base_nameserver_sockaddr_add(struct evdns_base *base, return res; } +int +evdns_base_get_nameserver_addr(struct evdns_base *base, int idx, + struct sockaddr *sa, ev_socklen_t len) +{ + int result = -1; + int i; + struct nameserver *server; + EVDNS_LOCK(base); + server = base->server_head; + for (i = 0; i < idx && server; ++i, server = server->next) { + if (server->next == base->server_head) + goto done; + } + if (! server) + goto done; + + if (server->addrlen > len) { + result = (int) server->addrlen; + goto done; + } + + memcpy(sa, &server->address, server->addrlen); + result = (int) server->addrlen; +done: + EVDNS_UNLOCK(base); + return result; +} + /* remove from the queue */ static void evdns_request_remove(struct request *req, struct request **head) @@ -3311,7 +3352,7 @@ strtoint(const char *const str) /* Parse a number of seconds into a timeval; return -1 on error. */ static int -strtotimeval(const char *const str, struct timeval *out) +evdns_strtotimeval(const char *const str, struct timeval *out) { double d; char *endptr; @@ -3414,13 +3455,13 @@ evdns_base_set_option_impl(struct evdns_base *base, base->global_search_state->ndots = ndots; } else if (str_matches_option(option, "timeout:")) { struct timeval tv; - if (strtotimeval(val, &tv) == -1) return -1; + if (evdns_strtotimeval(val, &tv) == -1) return -1; if (!(flags & DNS_OPTION_MISC)) return 0; log(EVDNS_LOG_DEBUG, "Setting timeout to %s", val); memcpy(&base->global_timeout, &tv, sizeof(struct timeval)); } else if (str_matches_option(option, "getaddrinfo-allow-skew:")) { struct timeval tv; - if (strtotimeval(val, &tv) == -1) return -1; + if (evdns_strtotimeval(val, &tv) == -1) return -1; if (!(flags & DNS_OPTION_MISC)) return 0; log(EVDNS_LOG_DEBUG, "Setting getaddrinfo-allow-skew to %s", val); @@ -3462,7 +3503,7 @@ evdns_base_set_option_impl(struct evdns_base *base, base->global_outgoing_addrlen = len; } else if (str_matches_option(option, "initial-probe-timeout:")) { struct timeval tv; - if (strtotimeval(val, &tv) == -1) return -1; + if (evdns_strtotimeval(val, &tv) == -1) return -1; if (tv.tv_sec > 3600) tv.tv_sec = 3600; if (!(flags & DNS_OPTION_MISC)) return 0; @@ -3555,8 +3596,8 @@ evdns_get_default_hosts_filename(void) if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0)) return NULL; - len_out = strlen(path)+strlen(hostfile); - path_out = mm_malloc(len_out+1); + len_out = strlen(path)+strlen(hostfile)+1; + path_out = mm_malloc(len_out); evutil_snprintf(path_out, len_out, "%s%s", path, hostfile); return path_out; #else @@ -3826,17 +3867,18 @@ evdns_base_config_windows_nameservers(struct evdns_base *base) if (base == NULL) return -1; EVDNS_LOCK(base); + fname = evdns_get_default_hosts_filename(); + log(EVDNS_LOG_DEBUG, "Loading hosts entries from %s", fname); + evdns_base_load_hosts(base, fname); + if (fname) + mm_free(fname); + if (load_nameservers_with_getnetworkparams(base) == 0) { EVDNS_UNLOCK(base); return 0; } r = load_nameservers_from_registry(base); - fname = evdns_get_default_hosts_filename(); - evdns_base_load_hosts(base, fname); - if (fname) - mm_free(fname); - EVDNS_UNLOCK(base); return r; } @@ -3973,6 +4015,10 @@ evdns_nameserver_free(struct nameserver *server) event_debug_unassign(&server->event); if (server->state == 0) (void) event_del(&server->timeout_event); + if (server->probe_request) { + evdns_cancel_request(server->base, server->probe_request); + server->probe_request = NULL; + } event_debug_unassign(&server->timeout_event); mm_free(server); } @@ -3988,6 +4034,15 @@ evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests) /* TODO(nickm) we might need to refcount here. */ + for (server = base->server_head; server; server = server_next) { + server_next = server->next; + evdns_nameserver_free(server); + if (server_next == base->server_head) + break; + } + base->server_head = NULL; + base->global_good_nameservers = 0; + for (i = 0; i < base->n_req_heads; ++i) { while (base->req_heads[i]) { if (fail_requests) @@ -4002,14 +4057,6 @@ evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests) } base->global_requests_inflight = base->global_requests_waiting = 0; - for (server = base->server_head; server; server = server_next) { - server_next = server->next; - evdns_nameserver_free(server); - if (server_next == base->server_head) - break; - } - base->server_head = NULL; - base->global_good_nameservers = 0; if (base->global_search_state) { for (dom = base->global_search_state->head; dom; dom = dom_next) { @@ -4663,7 +4710,7 @@ evdns_getaddrinfo(struct evdns_base *dns_base, data->ipv4_request.r = evdns_base_resolve_ipv4(dns_base, nodename, 0, evdns_getaddrinfo_gotresolve, &data->ipv4_request); - if (want_cname) + if (want_cname && data->ipv4_request.r) data->ipv4_request.r->current_req->put_cname_in_ptr = &data->cname_result; } @@ -4674,7 +4721,7 @@ evdns_getaddrinfo(struct evdns_base *dns_base, data->ipv6_request.r = evdns_base_resolve_ipv6(dns_base, nodename, 0, evdns_getaddrinfo_gotresolve, &data->ipv6_request); - if (want_cname) + if (want_cname && data->ipv6_request.r) data->ipv6_request.r->current_req->put_cname_in_ptr = &data->cname_result; } diff --git a/contrib/ntp/sntp/libevent/event.c b/contrib/ntp/sntp/libevent/event.c index 01f0e14226c9e..af4a6e05e6774 100644 --- a/contrib/ntp/sntp/libevent/event.c +++ b/contrib/ntp/sntp/libevent/event.c @@ -526,22 +526,24 @@ event_enable_debug_mode(void) #endif } -#if 0 void event_disable_debug_mode(void) { +#ifndef EVENT__DISABLE_DEBUG_MODE struct event_debug_entry **ent, *victim; EVLOCK_LOCK(event_debug_map_lock_, 0); for (ent = HT_START(event_debug_map, &global_debug_map); ent; ) { victim = *ent; - ent = HT_NEXT_RMV(event_debug_map,&global_debug_map, ent); + ent = HT_NEXT_RMV(event_debug_map, &global_debug_map, ent); mm_free(victim); } HT_CLEAR(event_debug_map, &global_debug_map); EVLOCK_UNLOCK(event_debug_map_lock_ , 0); -} + + event_debug_mode_on_ = 0; #endif +} struct event_base * event_base_new_with_config(const struct event_config *cfg) @@ -993,6 +995,21 @@ done: return (res); } +/* Get the monotonic time for this event_base' timer */ +int +event_gettime_monotonic(struct event_base *base, struct timeval *tv) +{ + int rv = -1; + + if (base && tv) { + EVBASE_ACQUIRE_LOCK(base, th_base_lock); + rv = evutil_gettime_monotonic_(&(base->monotonic_timer), tv); + EVBASE_RELEASE_LOCK(base, th_base_lock); + } + + return rv; +} + const char ** event_get_supported_methods(void) { @@ -1454,10 +1471,13 @@ done: static inline void event_persist_closure(struct event_base *base, struct event *ev) { - - // Define our callback, we use this to store our callback before it's executed void (*evcb_callback)(evutil_socket_t, short, void *); + // Other fields of *ev that must be stored before executing + evutil_socket_t evcb_fd; + short evcb_res; + void *evcb_arg; + /* reschedule the persistent event if we have a timeout. */ if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) { /* If there was a timeout, we want it to run at an interval of @@ -1501,13 +1521,16 @@ event_persist_closure(struct event_base *base, struct event *ev) } // Save our callback before we release the lock - evcb_callback = *ev->ev_callback; + evcb_callback = ev->ev_callback; + evcb_fd = ev->ev_fd; + evcb_res = ev->ev_res; + evcb_arg = ev->ev_arg; // Release the lock EVBASE_RELEASE_LOCK(base, th_base_lock); // Execute the callback - (evcb_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg); + (evcb_callback)(evcb_fd, evcb_res, evcb_arg); } /* @@ -1569,8 +1592,9 @@ event_process_active_single_queue(struct event_base *base, event_persist_closure(base, ev); break; case EV_CLOSURE_EVENT: { + void (*evcb_callback)(evutil_socket_t, short, void *); EVUTIL_ASSERT(ev != NULL); - void (*evcb_callback)(evutil_socket_t, short, void *) = *ev->ev_callback; + evcb_callback = *ev->ev_callback; EVBASE_RELEASE_LOCK(base, th_base_lock); evcb_callback(ev->ev_fd, ev->ev_res, ev->ev_arg); } @@ -1583,14 +1607,16 @@ event_process_active_single_queue(struct event_base *base, break; case EV_CLOSURE_EVENT_FINALIZE: case EV_CLOSURE_EVENT_FINALIZE_FREE: { + void (*evcb_evfinalize)(struct event *, void *); + int evcb_closure = evcb->evcb_closure; EVUTIL_ASSERT(ev != NULL); - void (*evcb_evfinalize)(struct event *, void *) = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize; base->current_event = NULL; + evcb_evfinalize = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize; EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING)); EVBASE_RELEASE_LOCK(base, th_base_lock); evcb_evfinalize(ev, ev->ev_arg); event_debug_note_teardown_(ev); - if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE) + if (evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE) mm_free(ev); } break; @@ -3739,6 +3765,7 @@ event_free_debug_globals_locks(void) if (event_debug_map_lock_ != NULL) { EVTHREAD_FREE_LOCK(event_debug_map_lock_, 0); event_debug_map_lock_ = NULL; + evthreadimpl_disable_lock_debugging_(); } #endif /* EVENT__DISABLE_DEBUG_MODE */ #endif /* EVENT__DISABLE_THREAD_SUPPORT */ @@ -3774,6 +3801,7 @@ event_free_globals(void) void libevent_global_shutdown(void) { + event_disable_debug_mode(); event_free_globals(); } diff --git a/contrib/ntp/sntp/libevent/event_tagging.c b/contrib/ntp/sntp/libevent/event_tagging.c index 7edd3da5d9561..64b100b82510a 100644 --- a/contrib/ntp/sntp/libevent/event_tagging.c +++ b/contrib/ntp/sntp/libevent/event_tagging.c @@ -207,10 +207,19 @@ decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain) */ data = evbuffer_pullup( evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1); + if (!data) + return (-1); while (count++ < len) { ev_uint8_t lower = *data++; - number |= (lower & 0x7f) << shift; + if (shift >= 28) { + /* Make sure it fits into 32 bits */ + if (shift > 28) + return (-1); + if ((lower & 0x7f) > 15) + return (-1); + } + number |= (lower & (unsigned)0x7f) << shift; shift += 7; if (!(lower & 0x80)) { @@ -313,6 +322,8 @@ do { \ \ /* XXX(niels): faster? */ \ data = evbuffer_pullup(evbuf, offset + 1) + offset; \ + if (!data) \ + return (-1); \ \ nibbles = ((data[0] & 0xf0) >> 4) + 1; \ if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len) \ @@ -320,6 +331,8 @@ do { \ len = (nibbles >> 1) + 1; \ \ data = evbuffer_pullup(evbuf, offset + len) + offset; \ + if (!data) \ + return (-1); \ \ while (nibbles > 0) { \ number <<= 4; \ diff --git a/contrib/ntp/sntp/libevent/evrpc-internal.h b/contrib/ntp/sntp/libevent/evrpc-internal.h index e53d06e0f40cc..9eb376386de4d 100644 --- a/contrib/ntp/sntp/libevent/evrpc-internal.h +++ b/contrib/ntp/sntp/libevent/evrpc-internal.h @@ -27,6 +27,7 @@ #ifndef EVRPC_INTERNAL_H_INCLUDED_ #define EVRPC_INTERNAL_H_INCLUDED_ +#include "event2/http.h" #include "http-internal.h" struct evrpc; diff --git a/contrib/ntp/sntp/libevent/evthread-internal.h b/contrib/ntp/sntp/libevent/evthread-internal.h index 346b2bb927747..efdecf81e7cd5 100644 --- a/contrib/ntp/sntp/libevent/evthread-internal.h +++ b/contrib/ntp/sntp/libevent/evthread-internal.h @@ -376,6 +376,13 @@ int evsig_global_setup_locks_(const int enable_locks); int evutil_global_setup_locks_(const int enable_locks); int evutil_secure_rng_global_setup_locks_(const int enable_locks); +/** Return current evthread_lock_callbacks */ +struct evthread_lock_callbacks *evthread_get_lock_callbacks(void); +/** Return current evthread_condition_callbacks */ +struct evthread_condition_callbacks *evthread_get_condition_callbacks(void); +/** Disable locking for internal usage (like global shutdown) */ +void evthreadimpl_disable_lock_debugging_(void); + #endif #ifdef __cplusplus diff --git a/contrib/ntp/sntp/libevent/evthread.c b/contrib/ntp/sntp/libevent/evthread.c index 4da5d24e80408..02dab7a8057e5 100644 --- a/contrib/ntp/sntp/libevent/evthread.c +++ b/contrib/ntp/sntp/libevent/evthread.c @@ -69,12 +69,25 @@ evthread_set_id_callback(unsigned long (*id_fn)(void)) evthread_id_fn_ = id_fn; } +struct evthread_lock_callbacks *evthread_get_lock_callbacks() +{ + return evthread_lock_debugging_enabled_ + ? &original_lock_fns_ : &evthread_lock_fns_; +} +struct evthread_condition_callbacks *evthread_get_condition_callbacks() +{ + return evthread_lock_debugging_enabled_ + ? &original_cond_fns_ : &evthread_cond_fns_; +} +void evthreadimpl_disable_lock_debugging_(void) +{ + evthread_lock_debugging_enabled_ = 0; +} + int evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs) { - struct evthread_lock_callbacks *target = - evthread_lock_debugging_enabled_ - ? &original_lock_fns_ : &evthread_lock_fns_; + struct evthread_lock_callbacks *target = evthread_get_lock_callbacks(); if (!cbs) { if (target->alloc) @@ -109,9 +122,7 @@ evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs) int evthread_set_condition_callbacks(const struct evthread_condition_callbacks *cbs) { - struct evthread_condition_callbacks *target = - evthread_lock_debugging_enabled_ - ? &original_cond_fns_ : &evthread_cond_fns_; + struct evthread_condition_callbacks *target = evthread_get_condition_callbacks(); if (!cbs) { if (target->alloc_condition) diff --git a/contrib/ntp/sntp/libevent/evutil.c b/contrib/ntp/sntp/libevent/evutil.c index c28caded59cad..3d72e4032450d 100644 --- a/contrib/ntp/sntp/libevent/evutil.c +++ b/contrib/ntp/sntp/libevent/evutil.c @@ -368,6 +368,20 @@ evutil_make_listen_socket_reuseable(evutil_socket_t sock) } int +evutil_make_listen_socket_reuseable_port(evutil_socket_t sock) +{ +#if defined __linux__ && defined(SO_REUSEPORT) + int one = 1; + /* REUSEPORT on Linux 3.9+ means, "Multiple servers (processes or + * threads) can bind to the same port if they each set the option. */ + return setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (void*) &one, + (ev_socklen_t)sizeof(one)); +#else + return 0; +#endif +} + +int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock) { #if defined(EVENT__HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT) @@ -652,7 +666,7 @@ evutil_check_ifaddrs(void) "GetAdaptersInfo", but that's deprecated; let's just try GetAdaptersAddresses and fall back to connect+getsockname. */ - HANDLE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll")); + HMODULE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll")); GetAdaptersAddresses_fn_t fn; ULONG size, res; IP_ADAPTER_ADDRESSES *addresses = NULL, *address; @@ -1918,15 +1932,15 @@ evutil_inet_pton(int af, const char *src, void *dst) return inet_pton(af, src, dst); #else if (af == AF_INET) { - int a,b,c,d; + unsigned a,b,c,d; char more; struct in_addr *addr = dst; - if (sscanf(src, "%d.%d.%d.%d%c", &a,&b,&c,&d,&more) != 4) + if (sscanf(src, "%u.%u.%u.%u%c", &a,&b,&c,&d,&more) != 4) return 0; - if (a < 0 || a > 255) return 0; - if (b < 0 || b > 255) return 0; - if (c < 0 || c > 255) return 0; - if (d < 0 || d > 255) return 0; + if (a > 255) return 0; + if (b > 255) return 0; + if (c > 255) return 0; + if (d > 255) return 0; addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d); return 1; #ifdef AF_INET6 @@ -1941,7 +1955,7 @@ evutil_inet_pton(int af, const char *src, void *dst) else if (!dot) eow = src+strlen(src); else { - int byte1,byte2,byte3,byte4; + unsigned byte1,byte2,byte3,byte4; char more; for (eow = dot-1; eow >= src && EVUTIL_ISDIGIT_(*eow); --eow) ; @@ -1949,14 +1963,14 @@ evutil_inet_pton(int af, const char *src, void *dst) /* We use "scanf" because some platform inet_aton()s are too lax * about IPv4 addresses of the form "1.2.3" */ - if (sscanf(eow, "%d.%d.%d.%d%c", + if (sscanf(eow, "%u.%u.%u.%u%c", &byte1,&byte2,&byte3,&byte4,&more) != 4) return 0; - if (byte1 > 255 || byte1 < 0 || - byte2 > 255 || byte2 < 0 || - byte3 > 255 || byte3 < 0 || - byte4 > 255 || byte4 < 0) + if (byte1 > 255 || + byte2 > 255 || + byte3 > 255 || + byte4 > 255) return 0; words[6] = (byte1<<8) | byte2; @@ -2453,7 +2467,7 @@ evutil_hex_char_to_int_(char c) } #ifdef _WIN32 -HANDLE +HMODULE evutil_load_windows_system_library_(const TCHAR *library_name) { TCHAR path[MAX_PATH]; diff --git a/contrib/ntp/sntp/libevent/evutil_time.c b/contrib/ntp/sntp/libevent/evutil_time.c index e433043e4d2bd..8f53c66b68c0e 100644 --- a/contrib/ntp/sntp/libevent/evutil_time.c +++ b/contrib/ntp/sntp/libevent/evutil_time.c @@ -54,6 +54,7 @@ #include "event2/util.h" #include "util-internal.h" #include "log-internal.h" +#include "mm-internal.h" #ifndef EVENT__HAVE_GETTIMEOFDAY /* No gettimeofday; this must be windows. */ @@ -160,6 +161,55 @@ adjust_monotonic_time(struct evutil_monotonic_timer *base, base->last_time = *tv; } +/* + Allocate a new struct evutil_monotonic_timer + */ +struct evutil_monotonic_timer * +evutil_monotonic_timer_new(void) +{ + struct evutil_monotonic_timer *p = NULL; + + p = mm_malloc(sizeof(*p)); + if (!p) goto done; + + memset(p, 0, sizeof(*p)); + + done: + return p; +} + +/* + Free a struct evutil_monotonic_timer + */ +void +evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer) +{ + if (timer) { + mm_free(timer); + } +} + +/* + Set up a struct evutil_monotonic_timer for initial use + */ +int +evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer, + int flags) +{ + return evutil_configure_monotonic_time_(timer, flags); +} + +/* + Query the current monotonic time + */ +int +evutil_gettime_monotonic(struct evutil_monotonic_timer *timer, + struct timeval *tp) +{ + return evutil_gettime_monotonic_(timer, tp); +} + + #if defined(HAVE_POSIX_MONOTONIC) /* ===== The POSIX clock_gettime() interface provides a few ways to get at a diff --git a/contrib/ntp/sntp/libevent/ht-internal.h b/contrib/ntp/sntp/libevent/ht-internal.h index 8842f4cd75b24..50375bbaa94c0 100644 --- a/contrib/ntp/sntp/libevent/ht-internal.h +++ b/contrib/ntp/sntp/libevent/ht-internal.h @@ -380,7 +380,6 @@ ht_string_hash_(const char *s) { \ if (head->hth_table) \ freefn(head->hth_table); \ - head->hth_table_length = 0; \ name##_HT_INIT(head); \ } \ /* Debugging helper: return false iff the representation of 'head' is \ diff --git a/contrib/ntp/sntp/libevent/http-internal.h b/contrib/ntp/sntp/libevent/http-internal.h index 82dd402a06264..a83160c8341b8 100644 --- a/contrib/ntp/sntp/libevent/http-internal.h +++ b/contrib/ntp/sntp/libevent/http-internal.h @@ -74,6 +74,7 @@ struct evhttp_connection { #define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */ #define EVHTTP_CON_OUTGOING 0x0002 /* multiple requests possible */ #define EVHTTP_CON_CLOSEDETECT 0x0004 /* detecting if persistent close */ +#define EVHTTP_CON_AUTOFREE 0x0008 /* set when we want to auto free the connection */ struct timeval timeout; /* timeout for events */ int retry_cnt; /* retry count */ @@ -99,6 +100,7 @@ struct evhttp_connection { struct event_base *base; struct evdns_base *dns_base; + int ai_family; /* Saved conn_addr, to extract IP address from it. * diff --git a/contrib/ntp/sntp/libevent/http.c b/contrib/ntp/sntp/libevent/http.c index 51470225e9bb5..dd8c9cffddfc7 100644 --- a/contrib/ntp/sntp/libevent/http.c +++ b/contrib/ntp/sntp/libevent/http.c @@ -769,6 +769,7 @@ evhttp_connection_done(struct evhttp_connection *evcon) { struct evhttp_request *req = TAILQ_FIRST(&evcon->requests); int con_outgoing = evcon->flags & EVHTTP_CON_OUTGOING; + int free_evcon = 0; if (con_outgoing) { /* idle or close the connection */ @@ -801,6 +802,12 @@ evhttp_connection_done(struct evhttp_connection *evcon) * need to detect if the other side closes it. */ evhttp_connection_start_detectclose(evcon); + } else if ((evcon->flags & EVHTTP_CON_AUTOFREE)) { + /* + * If we have no more requests that need completion + * and we're not waiting for the connection to close + */ + free_evcon = 1; } } else { /* @@ -819,6 +826,16 @@ evhttp_connection_done(struct evhttp_connection *evcon) if (con_outgoing && ((req->flags & EVHTTP_USER_OWNED) == 0)) { evhttp_request_free(req); } + + /* If this was the last request of an outgoing connection and we're + * not waiting to receive a connection close event and we want to + * automatically free the connection. We check to ensure our request + * list is empty one last time just in case our callback added a + * new request. + */ + if (free_evcon && TAILQ_FIRST(&evcon->requests) == NULL) { + evhttp_connection_free(evcon); + } } /* @@ -1175,6 +1192,11 @@ evhttp_connection_free(struct evhttp_connection *evcon) } void +evhttp_connection_free_on_completion(struct evhttp_connection *evcon) { + evcon->flags |= EVHTTP_CON_AUTOFREE; +} + +void evhttp_connection_set_local_address(struct evhttp_connection *evcon, const char *address) { @@ -1243,6 +1265,7 @@ evhttp_connection_reset_(struct evhttp_connection *evcon) shutdown(evcon->fd, EVUTIL_SHUT_WR); evutil_closesocket(evcon->fd); + bufferevent_setfd(evcon->bufev, -1); evcon->fd = -1; } @@ -1285,6 +1308,7 @@ evhttp_connection_cb_cleanup(struct evhttp_connection *evcon) { struct evcon_requestq requests; + evhttp_connection_reset_(evcon); if (evcon->retry_max < 0 || evcon->retry_cnt < evcon->retry_max) { struct timeval tv_retry = evcon->initial_retry_timeout; int i; @@ -1306,7 +1330,6 @@ evhttp_connection_cb_cleanup(struct evhttp_connection *evcon) evcon->retry_cnt++; return; } - evhttp_connection_reset_(evcon); /* * User callback can do evhttp_make_request() on the same @@ -1385,6 +1408,17 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg) */ EVUTIL_ASSERT(evcon->state == EVCON_IDLE); evhttp_connection_reset_(evcon); + + /* + * If we have no more requests that need completion + * and we want to auto-free the connection when all + * requests have been completed. + */ + if (TAILQ_FIRST(&evcon->requests) == NULL + && (evcon->flags & EVHTTP_CON_OUTGOING) + && (evcon->flags & EVHTTP_CON_AUTOFREE)) { + evhttp_connection_free(evcon); + } return; } @@ -2267,6 +2301,7 @@ evhttp_connection_base_bufferevent_new(struct event_base *base, struct evdns_bas evhttp_deferred_read_cb, evcon); evcon->dns_base = dnsbase; + evcon->ai_family = AF_UNSPEC; return (evcon); @@ -2294,6 +2329,12 @@ evhttp_connection_base_new(struct event_base *base, struct evdns_base *dnsbase, return evhttp_connection_base_bufferevent_new(base, dnsbase, NULL, address, port); } +void evhttp_connection_set_family(struct evhttp_connection *evcon, + int family) +{ + evcon->ai_family = family; +} + void evhttp_connection_set_base(struct evhttp_connection *evcon, struct event_base *base) @@ -2419,7 +2460,7 @@ evhttp_connection_connect_(struct evhttp_connection *evcon) evcon->state = EVCON_CONNECTING; if (bufferevent_socket_connect_hostname(evcon->bufev, evcon->dns_base, - AF_UNSPEC, evcon->address, evcon->port) < 0) { + evcon->ai_family, evcon->address, evcon->port) < 0) { evcon->state = old_state; event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed", __func__, evcon->address); @@ -4289,6 +4330,8 @@ parse_port(const char *s, const char *eos) portnum = (portnum * 10) + (*s - '0'); if (portnum < 0) return -1; + if (portnum > 65535) + return -1; ++s; } return portnum; diff --git a/contrib/ntp/sntp/libevent/include/event2/buffer.h b/contrib/ntp/sntp/libevent/include/event2/buffer.h index 839d6e7ca4c54..468588b9f141c 100644 --- a/contrib/ntp/sntp/libevent/include/event2/buffer.h +++ b/contrib/ntp/sntp/libevent/include/event2/buffer.h @@ -105,13 +105,8 @@ struct evbuffer Used when repeatedly searching through a buffer. Calling any function that modifies or re-packs the buffer contents may invalidate all - evbuffer_ptrs for that buffer. Do not modify these values except with - evbuffer_ptr_set. - - Used when repeatedly searching through a buffer. Calls to any function - that modifies or re-packs the buffer contents may invalidate all - evbuffer_ptrs for that buffer. Do not modify these values except with - evbuffer_ptr_set. + evbuffer_ptrs for that buffer. Do not modify or contruct these values + except with evbuffer_ptr_set. An evbuffer_ptr can represent any position from the start of a buffer up to a position immediately after the end of a buffer. @@ -787,7 +782,7 @@ enum evbuffer_ptr_how { There are two ways to use this function: you can call evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET) to move 'pos' to a position 'N' bytes after the start of the buffer, or - evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET) + evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_ADD) to move 'pos' forward by 'N' bytes. If evbuffer_ptr is not initialized, this function can only be called diff --git a/contrib/ntp/sntp/libevent/include/event2/bufferevent.h b/contrib/ntp/sntp/libevent/include/event2/bufferevent.h index 46203b04f5960..fe8a74d348c63 100644 --- a/contrib/ntp/sntp/libevent/include/event2/bufferevent.h +++ b/contrib/ntp/sntp/libevent/include/event2/bufferevent.h @@ -535,8 +535,9 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events, size_t lowmark, size_t highmark); /** - Retrieves the watermarks for read or write events. Result is undefined if - events contains both EV_READ and EV_WRITE. + Retrieves the watermarks for read or write events. + Returns non-zero if events contains not only EV_READ or EV_WRITE. + Returns zero if events equal EV_READ or EV_WRITE @param bufev the bufferevent to be examined @param events EV_READ or EV_WRITE @@ -544,7 +545,7 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events, @param highmark receives the high watermark if not NULL */ EVENT2_EXPORT_SYMBOL -void bufferevent_getwatermark(struct bufferevent *bufev, short events, +int bufferevent_getwatermark(struct bufferevent *bufev, short events, size_t *lowmark, size_t *highmark); /** @@ -598,7 +599,7 @@ enum bufferevent_trigger_options { BEV_TRIG_IGNORE_WATERMARKS = (1<<16), /** defer even if the callbacks are not */ - BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS, + BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS /* (Note: for internal reasons, these need to be disjoint from * bufferevent_options, except when they mean the same thing. */ diff --git a/contrib/ntp/sntp/libevent/include/event2/dns.h b/contrib/ntp/sntp/libevent/include/event2/dns.h index a00c83e6a3731..17cd86a2ec2df 100644 --- a/contrib/ntp/sntp/libevent/include/event2/dns.h +++ b/contrib/ntp/sntp/libevent/include/event2/dns.h @@ -453,7 +453,7 @@ int evdns_base_set_option(struct evdns_base *base, const char *option, const cha @param base the evdns_base to which to apply this operation @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC| - DNS_OPTIONS_HOSTSFILE|DNS_OPTIONS_ALL + DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL @param filename the path to the resolv.conf file @return 0 if successful, or various positive error codes if an error occurred (see above) @@ -694,6 +694,22 @@ struct evdns_getaddrinfo_request *evdns_getaddrinfo( EVENT2_EXPORT_SYMBOL void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req); +/** + Retrieve the address of the 'idx'th configured nameserver. + + @param base The evdns_base to examine. + @param idx The index of the nameserver to get the address of. + @param sa A location to receive the server's address. + @param len The number of bytes available at sa. + + @return the number of bytes written into sa on success. On failure, returns + -1 if idx is greater than the number of configured nameservers, or a + value greater than 'len' if len was not high enough. + */ +EVENT2_EXPORT_SYMBOL +int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx, + struct sockaddr *sa, ev_socklen_t len); + #ifdef __cplusplus } #endif diff --git a/contrib/ntp/sntp/libevent/include/event2/event.h b/contrib/ntp/sntp/libevent/include/event2/event.h index 6e2b884d440d5..570031f264b0b 100644 --- a/contrib/ntp/sntp/libevent/include/event2/event.h +++ b/contrib/ntp/sntp/libevent/include/event2/event.h @@ -396,6 +396,12 @@ const char *event_base_get_method(const struct event_base *); EVENT2_EXPORT_SYMBOL const char **event_get_supported_methods(void); +/** Query the current monotonic time from a the timer for a struct + * event_base. + */ +EVENT2_EXPORT_SYMBOL +int event_gettime_monotonic(struct event_base *base, struct timeval *tp); + /** @name event type flag @@ -771,6 +777,10 @@ void event_set_fatal_callback(event_fatal_cb cb); EVENT2_EXPORT_SYMBOL void event_enable_debug_logging(ev_uint32_t which); +EVENT2_EXPORT_SYMBOL +void +event_disable_debug_mode(void); + /** Associate a different event base with an event. diff --git a/contrib/ntp/sntp/libevent/include/event2/http.h b/contrib/ntp/sntp/libevent/include/event2/http.h index 81f44b8552315..4284d5fc32bc2 100644 --- a/contrib/ntp/sntp/libevent/include/event2/http.h +++ b/contrib/ntp/sntp/libevent/include/event2/http.h @@ -630,6 +630,12 @@ struct evhttp_connection *evhttp_connection_base_new( struct event_base *base, struct evdns_base *dnsbase, const char *address, unsigned short port); +/** + * Set family hint for DNS requests. + */ +void evhttp_connection_set_family(struct evhttp_connection *evcon, + int family); + /** Takes ownership of the request object * * Can be used in a request callback to keep onto the request until @@ -669,6 +675,14 @@ void evhttp_connection_set_max_body_size(struct evhttp_connection* evcon, EVENT2_EXPORT_SYMBOL void evhttp_connection_free(struct evhttp_connection *evcon); +/** Disowns a given connection object + * + * Can be used to tell libevent to free the connection object after + * the last request has completed or failed. + */ +EVENT2_EXPORT_SYMBOL +void evhttp_connection_free_on_completion(struct evhttp_connection *evcon); + /** sets the ip address from which http connections are made */ EVENT2_EXPORT_SYMBOL void evhttp_connection_set_local_address(struct evhttp_connection *evcon, diff --git a/contrib/ntp/sntp/libevent/include/event2/listener.h b/contrib/ntp/sntp/libevent/include/event2/listener.h index 8c77803d6d84c..84b4da055d8d2 100644 --- a/contrib/ntp/sntp/libevent/include/event2/listener.h +++ b/contrib/ntp/sntp/libevent/include/event2/listener.h @@ -88,6 +88,15 @@ typedef void (*evconnlistener_errorcb)(struct evconnlistener *, void *); * to use the option before it is actually bound. */ #define LEV_OPT_DEFERRED_ACCEPT (1u<<6) +/** Flag: Indicates that we ask to allow multiple servers (processes or + * threads) to bind to the same port if they each set the option. + * + * SO_REUSEPORT is what most people would expect SO_REUSEADDR to be, however + * SO_REUSEPORT does not imply SO_REUSEADDR. + * + * This is only available on Linux and kernel 3.9+ + */ +#define LEV_OPT_REUSEABLE_PORT (1u<<7) /** Allocate a new evconnlistener object to listen for incoming TCP connections diff --git a/contrib/ntp/sntp/libevent/include/event2/util.h b/contrib/ntp/sntp/libevent/include/event2/util.h index 14c6a25d7a86d..b152a4b40b514 100644 --- a/contrib/ntp/sntp/libevent/include/event2/util.h +++ b/contrib/ntp/sntp/libevent/include/event2/util.h @@ -292,6 +292,62 @@ extern "C" { #define evutil_socket_t int #endif +/** + * Structure to hold information about a monotonic timer + * + * Use this with evutil_configure_monotonic_time() and + * evutil_gettime_monotonic(). + * + * This is an opaque structure; you can allocate one using + * evutil_monotonic_timer_new(). + * + * @see evutil_monotonic_timer_new(), evutil_monotonic_timer_free(), + * evutil_configure_monotonic_time(), evutil_gettime_monotonic() + */ +struct evutil_monotonic_timer +#ifdef EVENT_IN_DOXYGEN_ +{/*Empty body so that doxygen will generate documentation here.*/} +#endif +; + +#define EV_MONOT_PRECISE 1 +#define EV_MONOT_FALLBACK 2 + +/** Allocate a new struct evutil_monotonic_timer for use with the + * evutil_configure_monotonic_time() and evutil_gettime_monotonic() + * functions. You must configure the timer with + * evutil_configure_monotonic_time() before using it. + */ +EVENT2_EXPORT_SYMBOL +struct evutil_monotonic_timer * evutil_monotonic_timer_new(void); + +/** Free a struct evutil_monotonic_timer that was allocated using + * evutil_monotonic_timer_new(). + */ +EVENT2_EXPORT_SYMBOL +void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer); + +/** Set up a struct evutil_monotonic_timer; flags can include + * EV_MONOT_PRECISE and EV_MONOT_FALLBACK. + */ +EVENT2_EXPORT_SYMBOL +int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer, + int flags); + +/** Query the current monotonic time from a struct evutil_monotonic_timer + * previously configured with evutil_configure_monotonic_time(). Monotonic + * time is guaranteed never to run in reverse, but is not necessarily epoch- + * based, or relative to any other definite point. Use it to make reliable + * measurements of elapsed time between events even when the system time + * may be changed. + * + * It is not safe to use this funtion on the same timer from multiple + * threads. + */ +EVENT2_EXPORT_SYMBOL +int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer, + struct timeval *tp); + /** Create two new sockets that are connected to each other. On Unix, this simply calls socketpair(). On Windows, it uses the @@ -327,6 +383,19 @@ int evutil_make_socket_nonblocking(evutil_socket_t sock); EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_reuseable(evutil_socket_t sock); +/** Do platform-specific operations to make a listener port reusable. + + Specifically, we want to make sure that multiple programs which also + set the same socket option will be able to bind, listen at the same time. + + This is a feature available only to Linux 3.9+ + + @param sock The socket to make reusable + @return 0 on success, -1 on failure + */ +EVENT2_EXPORT_SYMBOL +int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock); + /** Do platform-specific operations as needed to close a socket upon a successful execution of one of the exec*() functions. diff --git a/contrib/ntp/sntp/libevent/kqueue.c b/contrib/ntp/sntp/libevent/kqueue.c index 39334674244bb..a6578dfe1a57e 100644 --- a/contrib/ntp/sntp/libevent/kqueue.c +++ b/contrib/ntp/sntp/libevent/kqueue.c @@ -332,6 +332,23 @@ kq_dispatch(struct event_base *base, struct timeval *tv) * on FreeBSD. */ case EINVAL: continue; +#if defined(__FreeBSD__) && defined(ENOTCAPABLE) + /* + * This currently occurs if an FD is closed + * before the EV_DELETE makes it out via kevent(). + * The FreeBSD capabilities code sees the blank + * capability set and rejects the request to + * modify an event. + * + * To be strictly correct - when an FD is closed, + * all the registered events are also removed. + * Queuing EV_DELETE to a closed FD is wrong. + * The event(s) should just be deleted from + * the pending changelist. + */ + case ENOTCAPABLE: + continue; +#endif /* Can occur on a delete if the fd is closed. */ case EBADF: diff --git a/contrib/ntp/sntp/libevent/listener.c b/contrib/ntp/sntp/libevent/listener.c index 3272c405ce6ee..172d2927c0c3c 100644 --- a/contrib/ntp/sntp/libevent/listener.c +++ b/contrib/ntp/sntp/libevent/listener.c @@ -235,6 +235,11 @@ evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb, goto err; } + if (flags & LEV_OPT_REUSEABLE_PORT) { + if (evutil_make_listen_socket_reuseable_port(fd) < 0) + goto err; + } + if (flags & LEV_OPT_DEFERRED_ACCEPT) { if (evutil_make_tcp_listen_socket_deferred(fd) < 0) goto err; diff --git a/contrib/ntp/sntp/libevent/m4/acx_pthread.m4 b/contrib/ntp/sntp/libevent/m4/acx_pthread.m4 new file mode 100644 index 0000000000000..d2b116945f9f7 --- /dev/null +++ b/contrib/ntp/sntp/libevent/m4/acx_pthread.m4 @@ -0,0 +1,279 @@ +##### http://autoconf-archive.cryp.to/acx_pthread.html +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. +# It sets the PTHREAD_LIBS output variable to the threads library and +# linker flags, and the PTHREAD_CFLAGS output variable to any special +# C compiler flags that are needed. (The user can also force certain +# compiler flags/libs to be tested by setting these environment +# variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). +# (This is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these +# flags, but also link it with them as well. e.g. you should link +# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS +# $LIBS +# +# If you are only building threads programs, you may wish to use +# these variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads +# library is found, and ACTION-IF-NOT-FOUND is a list of commands to +# run it if it is not found. If ACTION-IF-FOUND is not specified, the +# default action will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or +# if you have any other suggestions or comments. This macro was based +# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) +# (with help from M. Frigo), as well as ac_pthread and hb_pthread +# macros posted by Alejandro Forero Cuervo to the autoconf macro +# repository. We are also grateful for the helpful feedback of +# numerous users. +# +# LAST MODIFICATION +# +# 2007-07-29 +# +# COPYLEFT +# +# Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu> +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include <pthread.h>], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff --git a/contrib/ntp/sntp/libevent/sample/http-server.c b/contrib/ntp/sntp/libevent/sample/http-server.c index 1cb89bc91b04e..cbb9c914dd8fd 100644 --- a/contrib/ntp/sntp/libevent/sample/http-server.c +++ b/contrib/ntp/sntp/libevent/sample/http-server.c @@ -246,7 +246,10 @@ send_document_cb(struct evhttp_request *req, void *arg) goto err; #endif - evbuffer_add_printf(evb, "<html>\n <head>\n" + evbuffer_add_printf(evb, + "<!DOCTYPE html>\n" + "<html>\n <head>\n" + " <meta charset='utf-8'>\n" " <title>%s</title>\n" " <base href='%s%s'>\n" " </head>\n" @@ -274,7 +277,7 @@ send_document_cb(struct evhttp_request *req, void *arg) #endif evbuffer_add_printf(evb, "</ul></body></html>\n"); #ifdef _WIN32 - CloseHandle(d); + FindClose(d); #else closedir(d); #endif diff --git a/contrib/ntp/sntp/libevent/sample/https-client.c b/contrib/ntp/sntp/libevent/sample/https-client.c index e13ac4bd342f5..fbd5de8c59c2a 100644 --- a/contrib/ntp/sntp/libevent/sample/https-client.c +++ b/contrib/ntp/sntp/libevent/sample/https-client.c @@ -96,7 +96,7 @@ static void syntax(void) { fputs("Syntax:\n", stderr); - fputs(" https-client -url <https-url> [-data data-file.bin] [-ignore-cert]\n", stderr); + fputs(" https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num]\n", stderr); fputs("Example:\n", stderr); fputs(" https-client -url https://ip.appspot.com/\n", stderr); @@ -195,6 +195,7 @@ main(int argc, char **argv) const char *scheme, *host, *path, *query; char uri[256]; int port; + int retries = 0; SSL_CTX *ssl_ctx; SSL *ssl; @@ -221,6 +222,12 @@ main(int argc, char **argv) } else { syntax(); } + } else if (!strcmp("-retries", argv[i])) { + if (i < argc - 1) { + retries = atoi(argv[i + 1]); + } else { + syntax(); + } } else if (!strcmp("-help", argv[i])) { syntax(); } @@ -346,8 +353,10 @@ main(int argc, char **argv) die_openssl("SSL_new()"); } + #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME // Set hostname for SNI extension SSL_set_tlsext_host_name(ssl, host); + #endif if (strcasecmp(scheme, "http") == 0) { bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE); @@ -373,6 +382,10 @@ main(int argc, char **argv) return 1; } + if (retries > 0) { + evhttp_connection_set_retries(evcon, retries); + } + // Fire off the request req = evhttp_request_new(http_request_done, bev); if (req == NULL) { @@ -402,7 +415,7 @@ main(int argc, char **argv) evbuffer_add(output_buffer, buf, s); bytes += s; } - evutil_snprintf(buf, sizeof(buf)-1, "%lu", bytes); + evutil_snprintf(buf, sizeof(buf)-1, "%lu", (unsigned long)bytes); evhttp_add_header(output_headers, "Content-Length", buf); fclose(f); } diff --git a/contrib/ntp/sntp/libevent/sample/include.am b/contrib/ntp/sntp/libevent/sample/include.am index 81980ac51e1d8..75f87c70d961c 100644 --- a/contrib/ntp/sntp/libevent/sample/include.am +++ b/contrib/ntp/sntp/libevent/sample/include.am @@ -30,7 +30,9 @@ noinst_HEADERS += \ sample/openssl_hostname_validation.h endif +if BUILD_SAMPLES noinst_PROGRAMS += $(SAMPLES) +endif $(SAMPLES) : libevent.la diff --git a/contrib/ntp/sntp/libevent/test/include.am b/contrib/ntp/sntp/libevent/test/include.am index ca36da46e271a..4cd49ef6306f8 100644 --- a/contrib/ntp/sntp/libevent/test/include.am +++ b/contrib/ntp/sntp/libevent/test/include.am @@ -49,7 +49,8 @@ TESTS = test/test-script.sh test/test-script.sh: test/test.sh cp $(top_srcdir)/test/test.sh $@ -DISTCLEANFILES += test/test-script.sh test/regress.gen.c test/regress.gen.h +DISTCLEANFILES += test/test-script.sh +DISTCLEANFILES += test/regress.gen.c test/regress.gen.h if BUILD_REGRESS BUILT_SOURCES += test/regress.gen.c test/regress.gen.h diff --git a/contrib/ntp/sntp/libevent/test/regress.c b/contrib/ntp/sntp/libevent/test/regress.c index 4d17b6780b043..399ba2fbd8d79 100644 --- a/contrib/ntp/sntp/libevent/test/regress.c +++ b/contrib/ntp/sntp/libevent/test/regress.c @@ -944,17 +944,18 @@ signal_cb(evutil_socket_t fd, short event, void *arg) } static void -test_simplesignal(void) +test_simplesignal_impl(int find_reorder) { struct event ev; struct itimerval itv; - setup_test("Simple signal: "); evsignal_set(&ev, SIGALRM, signal_cb, &ev); evsignal_add(&ev, NULL); /* find bugs in which operations are re-ordered */ - evsignal_del(&ev); - evsignal_add(&ev, NULL); + if (find_reorder) { + evsignal_del(&ev); + evsignal_add(&ev, NULL); + } memset(&itv, 0, sizeof(itv)); itv.it_value.tv_sec = 0; @@ -971,6 +972,20 @@ test_simplesignal(void) } static void +test_simplestsignal(void) +{ + setup_test("Simplest one signal: "); + test_simplesignal_impl(0); +} + +static void +test_simplesignal(void) +{ + setup_test("Simple signal: "); + test_simplesignal_impl(1); +} + +static void test_multiplesignal(void) { struct event ev_one, ev_two; @@ -1658,7 +1673,7 @@ static void test_active_later(void *ptr) { struct basic_test_data *data = ptr; - struct event *ev1, *ev2; + struct event *ev1 = NULL, *ev2 = NULL; struct event ev3, ev4; struct timeval qsec = {0, 100000}; ev1 = event_new(data->base, data->pair[0], EV_READ|EV_PERSIST, read_and_drain_cb, NULL); @@ -1693,10 +1708,15 @@ test_active_later(void *ptr) * it. */ event_active_later_(&ev3, EV_READ); event_base_assert_ok_(data->base); + +end: + if (ev1) + event_free(ev1); + if (ev2) + event_free(ev2); + event_base_free(data->base); data->base = NULL; -end: - ; } @@ -2281,7 +2301,7 @@ evtag_fuzz(void *ptr) for (j = 0; j < 100; j++) { for (i = 0; i < (int)sizeof(buffer); i++) - buffer[i] = rand(); + buffer[i] = test_weakrand(); evbuffer_drain(tmp, -1); evbuffer_add(tmp, buffer, sizeof(buffer)); @@ -3294,6 +3314,7 @@ struct testcase_t evtag_testcases[] = { struct testcase_t signal_testcases[] = { #ifndef _WIN32 + LEGACY(simplestsignal, TT_ISOLATED), LEGACY(simplesignal, TT_ISOLATED), LEGACY(multiplesignal, TT_ISOLATED), LEGACY(immediatesignal, TT_ISOLATED), diff --git a/contrib/ntp/sntp/libevent/test/regress.h b/contrib/ntp/sntp/libevent/test/regress.h index a9892b0ef7c8b..bbfefe6739e44 100644 --- a/contrib/ntp/sntp/libevent/test/regress.h +++ b/contrib/ntp/sntp/libevent/test/regress.h @@ -53,6 +53,10 @@ extern struct testcase_t listener_testcases[]; extern struct testcase_t listener_iocp_testcases[]; extern struct testcase_t thread_testcases[]; +extern struct evutil_weakrand_state test_weakrand_state; + +#define test_weakrand() (evutil_weakrand_(&test_weakrand_state)) + void regress_threads(void *); void test_bufferevent_zlib(void *); @@ -114,7 +118,7 @@ int test_ai_eq_(const struct evutil_addrinfo *ai, const char *sockaddr_port, } while (0) #define test_timeval_diff_leq(tv1, tv2, diff, tolerance) \ - tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance) + tt_int_op(labs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance) #define test_timeval_diff_eq(tv1, tv2, diff) \ test_timeval_diff_leq((tv1), (tv2), (diff), 50) diff --git a/contrib/ntp/sntp/libevent/test/regress_buffer.c b/contrib/ntp/sntp/libevent/test/regress_buffer.c index ccb14870a5be8..4d6a5de20b33a 100644 --- a/contrib/ntp/sntp/libevent/test/regress_buffer.c +++ b/contrib/ntp/sntp/libevent/test/regress_buffer.c @@ -246,7 +246,7 @@ test_evbuffer(void *ptr) if (memcmp(evbuffer_pullup( evb, -1), buffer, sizeof(buffer) / 2) != 0 || memcmp(evbuffer_pullup( - evb_two, -1), buffer, sizeof(buffer) != 0)) + evb_two, -1), buffer, sizeof(buffer)) != 0) tt_abort_msg("Pullup did not preserve content"); evbuffer_validate(evb); @@ -863,6 +863,10 @@ test_evbuffer_add_file(void *ptr) evutil_closesocket(pair[0]); if (pair[1] >= 0) evutil_closesocket(pair[1]); + if (wev) + event_free(wev); + if (rev) + event_free(rev); if (tmpfilename) { unlink(tmpfilename); free(tmpfilename); @@ -1534,9 +1538,9 @@ test_evbuffer_callbacks(void *ptr) tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2)); evbuffer_validate(buf); - tt_str_op(evbuffer_pullup(buf_out1, -1), ==, + tt_str_op((const char *) evbuffer_pullup(buf_out1, -1), ==, "0->36; 36->26; 26->31; 31->38; "); - tt_str_op(evbuffer_pullup(buf_out2, -1), ==, + tt_str_op((const char *) evbuffer_pullup(buf_out2, -1), ==, "0->36; 31->38; 38->0; 0->1; "); evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1)); evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2)); @@ -1552,7 +1556,7 @@ test_evbuffer_callbacks(void *ptr) tt_uint_op(evbuffer_get_length(buf_out2), ==, 0); evbuffer_setcb(buf, NULL, NULL); evbuffer_add_printf(buf, "This will not."); - tt_str_op(evbuffer_pullup(buf, -1), ==, "This will not."); + tt_str_op((const char *) evbuffer_pullup(buf, -1), ==, "This will not."); evbuffer_validate(buf); evbuffer_drain(buf, evbuffer_get_length(buf)); evbuffer_validate(buf); @@ -1660,7 +1664,7 @@ test_evbuffer_add_reference(void *ptr) evbuffer_add(buf1, "You shake and shake the ", 24); evbuffer_add_reference(buf1, "ketchup bottle", 14, ref_done_cb, (void*)3333); - evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 42); + evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 35); evbuffer_free(buf1); buf1 = NULL; tt_int_op(ref_done_cb_called_count, ==, 3); @@ -1840,6 +1844,42 @@ end: } static void +test_evbuffer_peek_first_gt(void *info) +{ + struct evbuffer *buf = NULL, *tmp_buf = NULL; + struct evbuffer_ptr ptr; + struct evbuffer_iovec v[2]; + + buf = evbuffer_new(); + tmp_buf = evbuffer_new(); + evbuffer_add_printf(tmp_buf, "Contents of chunk 100\n"); + evbuffer_add_buffer(buf, tmp_buf); + evbuffer_add_printf(tmp_buf, "Contents of chunk 1\n"); + evbuffer_add_buffer(buf, tmp_buf); + + evbuffer_ptr_set(buf, &ptr, 0, EVBUFFER_PTR_SET); + + /** The only case that matters*/ + tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2); + /** Just in case */ + tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2); + + evbuffer_ptr_set(buf, &ptr, 20, EVBUFFER_PTR_ADD); + tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2); + tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2); + tt_int_op(evbuffer_peek(buf, 2, &ptr, NULL, 0), ==, 1); + tt_int_op(evbuffer_peek(buf, 2, &ptr, v, 2), ==, 1); + tt_int_op(evbuffer_peek(buf, 3, &ptr, NULL, 0), ==, 2); + tt_int_op(evbuffer_peek(buf, 3, &ptr, v, 2), ==, 2); + +end: + if (buf) + evbuffer_free(buf); + if (tmp_buf) + evbuffer_free(tmp_buf); +} + +static void test_evbuffer_peek(void *info) { struct evbuffer *buf = NULL, *tmp_buf = NULL; @@ -2096,7 +2136,7 @@ test_evbuffer_copyout(void *dummy) "When the rich Allobrogenses never kept amanuenses, " "And our only plots were piled in lakes at Berne."; /* -- Kipling, "In The Neolithic Age" */ - char tmp[256]; + char tmp[1024]; struct evbuffer_ptr ptr; struct evbuffer *buf; @@ -2206,6 +2246,7 @@ struct testcase_t evbuffer_testcases[] = { { "multicast_drain", test_evbuffer_multicast_drain, 0, NULL, NULL }, { "prepend", test_evbuffer_prepend, TT_FORK, NULL, NULL }, { "peek", test_evbuffer_peek, 0, NULL, NULL }, + { "peek_first_gt", test_evbuffer_peek_first_gt, 0, NULL, NULL }, { "freeze_start", test_evbuffer_freeze, 0, &nil_setup, (void*)"start" }, { "freeze_end", test_evbuffer_freeze, 0, &nil_setup, (void*)"end" }, { "add_iovec", test_evbuffer_add_iovec, 0, NULL, NULL}, diff --git a/contrib/ntp/sntp/libevent/test/regress_bufferevent.c b/contrib/ntp/sntp/libevent/test/regress_bufferevent.c index 4ec2dccf43e9c..a1998ba62cd1d 100644 --- a/contrib/ntp/sntp/libevent/test/regress_bufferevent.c +++ b/contrib/ntp/sntp/libevent/test/regress_bufferevent.c @@ -75,6 +75,7 @@ #include "event2/util.h" #include "bufferevent-internal.h" +#include "evthread-internal.h" #include "util-internal.h" #ifdef _WIN32 #include "iocp-internal.h" @@ -173,9 +174,9 @@ test_bufferevent_impl(int use_pair) event_dispatch(); - bufferevent_free(bev1); - tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, NULL); bufferevent_free(bev2); + tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, NULL); + bufferevent_free(bev1); if (test_ok != 2) test_ok = 0; @@ -195,6 +196,143 @@ test_bufferevent_pair(void) test_bufferevent_impl(1); } +#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) +/** + * Trace lock/unlock/alloc/free for locks. + * (More heavier then evthread_debug*) + */ +typedef struct +{ + void *lock; + enum { + ALLOC, FREE, + } status; + size_t locked /** allow recursive locking */; +} lock_wrapper; +struct lock_unlock_base +{ + /* Original callbacks */ + struct evthread_lock_callbacks cbs; + /* Map of locks */ + lock_wrapper *locks; + size_t nr_locks; +} lu_base = { + .locks = NULL, +}; + +static lock_wrapper *lu_find(void *lock_) +{ + size_t i; + for (i = 0; i < lu_base.nr_locks; ++i) { + lock_wrapper *lock = &lu_base.locks[i]; + if (lock->lock == lock_) + return lock; + } + return NULL; +} + +static void *trace_lock_alloc(unsigned locktype) +{ + ++lu_base.nr_locks; + lu_base.locks = realloc(lu_base.locks, + sizeof(lock_wrapper) * lu_base.nr_locks); + void *lock = lu_base.cbs.alloc(locktype); + lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 }; + return lock; +} +static void trace_lock_free(void *lock_, unsigned locktype) +{ + lock_wrapper *lock = lu_find(lock_); + if (!lock || lock->status == FREE || lock->locked) { + __asm__("int3"); + TT_FAIL(("lock: free error")); + } else { + lock->status = FREE; + lu_base.cbs.free(lock_, locktype); + } +} +static int trace_lock_lock(unsigned mode, void *lock_) +{ + lock_wrapper *lock = lu_find(lock_); + if (!lock || lock->status == FREE) { + TT_FAIL(("lock: lock error")); + return -1; + } else { + ++lock->locked; + return lu_base.cbs.lock(mode, lock_); + } +} +static int trace_lock_unlock(unsigned mode, void *lock_) +{ + lock_wrapper *lock = lu_find(lock_); + if (!lock || lock->status == FREE || !lock->locked) { + TT_FAIL(("lock: unlock error")); + return -1; + } else { + --lock->locked; + return lu_base.cbs.unlock(mode, lock_); + } +} +static void lock_unlock_free_thread_cbs() +{ + event_base_free(NULL); + + /** drop immutable flag */ + evthread_set_lock_callbacks(NULL); + /** avoid calling of event_global_setup_locks_() for new cbs */ + libevent_global_shutdown(); + /** drop immutable flag for non-debug ops (since called after shutdown) */ + evthread_set_lock_callbacks(NULL); +} + +static int use_lock_unlock_profiler(void) +{ + struct evthread_lock_callbacks cbs = { + EVTHREAD_LOCK_API_VERSION, + EVTHREAD_LOCKTYPE_RECURSIVE, + trace_lock_alloc, + trace_lock_free, + trace_lock_lock, + trace_lock_unlock, + }; + memcpy(&lu_base.cbs, evthread_get_lock_callbacks(), + sizeof(lu_base.cbs)); + { + lock_unlock_free_thread_cbs(); + + evthread_set_lock_callbacks(&cbs); + /** re-create debug locks correctly */ + evthread_enable_lock_debugging(); + + event_init(); + } + return 0; +} +static void free_lock_unlock_profiler(struct basic_test_data *data) +{ + lock_unlock_free_thread_cbs(); + free(lu_base.locks); + data->base = NULL; +} + +static void test_bufferevent_pair_release_lock(void *arg) +{ + struct basic_test_data *data = arg; + use_lock_unlock_profiler(); + { + struct bufferevent *pair[2]; + if (!bufferevent_pair_new(NULL, BEV_OPT_THREADSAFE, pair)) { + bufferevent_free(pair[0]); + bufferevent_free(pair[1]); + } else + tt_abort_perror("bufferevent_pair_new"); + } + free_lock_unlock_profiler(data); +end: + ; +} +#endif + /* * test watermarks and bufferevent */ @@ -287,6 +425,11 @@ test_bufferevent_watermarks_impl(int use_pair) tt_int_op(low, ==, 100); tt_int_op(high, ==, 2000); + { + int r = bufferevent_getwatermark(bev1, EV_WRITE | EV_READ, &low, &high); + tt_int_op(r, !=, 0); + } + bufferevent_write(bev1, buffer, sizeof(buffer)); event_dispatch(); @@ -944,6 +1087,11 @@ struct testcase_t bufferevent_testcases[] = { LEGACY(bufferevent, TT_ISOLATED), LEGACY(bufferevent_pair, TT_ISOLATED), +#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) + { "bufferevent_pair_release_lock", test_bufferevent_pair_release_lock, + TT_FORK|TT_ISOLATED|TT_NEED_THREADS|TT_NEED_BASE|TT_LEGACY, + &basic_setup, NULL }, +#endif LEGACY(bufferevent_watermarks, TT_ISOLATED), LEGACY(bufferevent_pair_watermarks, TT_ISOLATED), LEGACY(bufferevent_filters, TT_ISOLATED), diff --git a/contrib/ntp/sntp/libevent/test/regress_dns.c b/contrib/ntp/sntp/libevent/test/regress_dns.c index 338c4ee8fd548..6d6b48443df59 100644 --- a/contrib/ntp/sntp/libevent/test/regress_dns.c +++ b/contrib/ntp/sntp/libevent/test/regress_dns.c @@ -406,6 +406,22 @@ dns_server(void) * the only nameserver. */ evdns_base_nameserver_sockaddr_add(base, (struct sockaddr*)&ss, slen, 0); tt_int_op(evdns_base_count_nameservers(base), ==, 1); + { + struct sockaddr_storage ss2; + int slen2; + + memset(&ss2, 0, sizeof(ss2)); + + slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, 3); + tt_int_op(slen2, ==, slen); + tt_int_op(ss2.ss_family, ==, 0); + slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, sizeof(ss2)); + tt_int_op(slen2, ==, slen); + tt_mem_op(&ss2, ==, &ss, slen); + + slen2 = evdns_base_get_nameserver_addr(base, 1, (struct sockaddr *)&ss2, sizeof(ss2)); + tt_int_op(-1, ==, slen2); + } /* Send some queries. */ evdns_base_resolve_ipv4(base, "zz.example.com", DNS_QUERY_NO_SEARCH, @@ -443,6 +459,7 @@ end: static int n_replies_left; static struct event_base *exit_base; +static struct evdns_server_port *exit_port; struct generic_dns_callback_result { int result; @@ -483,8 +500,14 @@ generic_dns_callback(int result, char type, int count, int ttl, void *addresses, res->addrs = res->addrs_buf; } - if (--n_replies_left == 0) - event_base_loopexit(exit_base, NULL); + --n_replies_left; + if (n_replies_left == 0) { + if (exit_port) { + evdns_close_server_port(exit_port); + exit_port = NULL; + } else + event_base_loopexit(exit_base, NULL); + } } static struct regress_dns_server_table search_table[] = { @@ -664,7 +687,7 @@ end: } static void -dns_retry_test(void *arg) +dns_retry_test_impl(void *arg, int flags) { struct basic_test_data *data = arg; struct event_base *base = data->base; @@ -681,7 +704,7 @@ dns_retry_test(void *arg) tt_assert(port); evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum); - dns = evdns_base_new(base, 0); + dns = evdns_base_new(base, flags); tt_assert(!evdns_base_nameserver_ip_add(dns, buf)); tt_assert(! evdns_base_set_option(dns, "timeout", "0.2")); tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "10")); @@ -736,6 +759,16 @@ end: if (port) evdns_close_server_port(port); } +static void +dns_retry_test(void *arg) +{ + dns_retry_test_impl(arg, 0); +} +static void +dns_retry_disable_when_inactive_test(void *arg) +{ + dns_retry_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE); +} static struct regress_dns_server_table internal_error_table[] = { /* Error 4 (NOTIMPL) makes us reissue the request to another server @@ -753,7 +786,7 @@ static struct regress_dns_server_table reissue_table[] = { }; static void -dns_reissue_test(void *arg) +dns_reissue_test_impl(void *arg, int flags) { struct basic_test_data *data = arg; struct event_base *base = data->base; @@ -772,7 +805,7 @@ dns_reissue_test(void *arg) evutil_snprintf(buf1, sizeof(buf1), "127.0.0.1:%d", (int)portnum1); evutil_snprintf(buf2, sizeof(buf2), "127.0.0.1:%d", (int)portnum2); - dns = evdns_base_new(base, 0); + dns = evdns_base_new(base, flags); tt_assert(!evdns_base_nameserver_ip_add(dns, buf1)); tt_assert(! evdns_base_set_option(dns, "timeout:", "0.3")); tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2")); @@ -805,6 +838,16 @@ end: if (port2) evdns_close_server_port(port2); } +static void +dns_reissue_test(void *arg) +{ + dns_reissue_test_impl(arg, 0); +} +static void +dns_reissue_disable_when_inactive_test(void *arg) +{ + dns_reissue_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE); +} #if 0 static void @@ -819,21 +862,29 @@ dumb_bytes_fn(char *p, size_t n) #endif static void -dns_inflight_test(void *arg) +dns_inflight_test_impl(void *arg, int flags) { struct basic_test_data *data = arg; struct event_base *base = data->base; struct evdns_base *dns = NULL; + struct evdns_server_port *dns_port = NULL; ev_uint16_t portnum = 0; char buf[64]; + int disable_when_inactive = flags & EVDNS_BASE_DISABLE_WHEN_INACTIVE; struct generic_dns_callback_result r[20]; int i; - tt_assert(regress_dnsserver(base, &portnum, reissue_table)); + dns_port = regress_get_dnsserver(base, &portnum, NULL, + regress_dns_server_cb, reissue_table); + tt_assert(dns_port); + if (disable_when_inactive) { + exit_port = dns_port; + } + evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum); - dns = evdns_base_new(base, 0); + dns = evdns_base_new(base, flags); tt_assert(!evdns_base_nameserver_ip_add(dns, buf)); tt_assert(! evdns_base_set_option(dns, "max-inflight:", "3")); tt_assert(! evdns_base_set_option(dns, "randomize-case:", "0")); @@ -855,7 +906,65 @@ dns_inflight_test(void *arg) end: if (dns) evdns_base_free(dns, 0); + if (exit_port) { + evdns_close_server_port(exit_port); + exit_port = NULL; + } else if (! disable_when_inactive) { + evdns_close_server_port(dns_port); + } +} + +static void +dns_inflight_test(void *arg) +{ + dns_inflight_test_impl(arg, 0); +} + +static void +dns_disable_when_inactive_test(void *arg) +{ + dns_inflight_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE); +} + +static void +dns_disable_when_inactive_no_ns_test(void *arg) +{ + struct basic_test_data *data = arg; + struct event_base *base = data->base, *inactive_base; + struct evdns_base *dns = NULL; + ev_uint16_t portnum = 0; + char buf[64]; + struct generic_dns_callback_result r; + + inactive_base = event_base_new(); + tt_assert(inactive_base); + + /** Create dns server with inactive base, to avoid replying to clients */ + tt_assert(regress_dnsserver(inactive_base, &portnum, search_table)); + evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum); + + dns = evdns_base_new(base, EVDNS_BASE_DISABLE_WHEN_INACTIVE); + tt_assert(!evdns_base_nameserver_ip_add(dns, buf)); + tt_assert(! evdns_base_set_option(dns, "timeout:", "0.1")); + + evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r); + n_replies_left = 1; + exit_base = base; + + event_base_dispatch(base); + + tt_int_op(n_replies_left, ==, 0); + + tt_int_op(r.result, ==, DNS_ERR_TIMEOUT); + tt_int_op(r.count, ==, 0); + tt_ptr_op(r.addrs, ==, NULL); + +end: + if (dns) + evdns_base_free(dns, 0); regress_clean_dnsserver(); + if (inactive_base) + event_base_free(inactive_base); } /* === Test for bufferevent_socket_connect_hostname */ @@ -1563,7 +1672,8 @@ test_getaddrinfo_async(void *arg) end: if (local_outcome.ai) evutil_freeaddrinfo(local_outcome.ai); - for (i=0;i<10;++i) { +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + for (i=0;i<(int)ARRAY_SIZE(a_out);++i) { if (a_out[i].ai) evutil_freeaddrinfo(a_out[i].ai); } @@ -1694,9 +1804,15 @@ testleak_setup(const struct testcase_t *testcase) struct testleak_env_t *env; allocated_chunks = 0; + + /* Reset allocation counter, to start allocations from the very beginning. + * (this will avoid false-positive negative numbers for allocated_chunks) + */ + libevent_global_shutdown(); + event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free); - if (!libevent_tests_running_in_debug_mode) - event_enable_debug_mode(); + + event_enable_debug_mode(); /* not mm_calloc: we don't want to mess with the count. */ env = calloc(1, sizeof(struct testleak_env_t)); @@ -1717,8 +1833,8 @@ testleak_cleanup(const struct testcase_t *testcase, void *env_) #ifdef EVENT__DISABLE_DEBUG_MODE tt_int_op(allocated_chunks, ==, 0); #else - /* FIXME: that's `1' because of event_debug_map_HT_GROW */ - tt_int_op(allocated_chunks, ==, 1); + libevent_global_shutdown(); + tt_int_op(allocated_chunks, ==, 0); #endif ok = 1; end: @@ -1791,6 +1907,7 @@ dbg_leak_resume(void *env_, int cancel, int send_err_shutdown) end: evdns_base_free(env->dns_base, send_err_shutdown); env->dns_base = 0; + event_base_free(env->base); env->base = 0; } @@ -1875,6 +1992,8 @@ end: evdns_base_free(dns_base, 1); if (server) evdns_close_server_port(server); + if (base) + event_base_free(base); if (fd >= 0) evutil_closesocket(fd); } @@ -1894,10 +2013,18 @@ struct testcase_t dns_testcases[] = { { "search_cancel", dns_search_cancel_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, { "retry", dns_retry_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL }, + { "retry_disable_when_inactive", dns_retry_disable_when_inactive_test, + TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL }, { "reissue", dns_reissue_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL }, + { "reissue_disable_when_inactive", dns_reissue_disable_when_inactive_test, + TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL }, { "inflight", dns_inflight_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, { "bufferevent_connect_hostname", test_bufferevent_connect_hostname, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, + { "disable_when_inactive", dns_disable_when_inactive_test, + TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, + { "disable_when_inactive_no_ns", dns_disable_when_inactive_no_ns_test, + TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, { "getaddrinfo_async", test_getaddrinfo_async, TT_FORK|TT_NEED_BASE, &basic_setup, (char*)"" }, diff --git a/contrib/ntp/sntp/libevent/test/regress_finalize.c b/contrib/ntp/sntp/libevent/test/regress_finalize.c index 61a6313f1b3bf..552210fe9d01c 100644 --- a/contrib/ntp/sntp/libevent/test/regress_finalize.c +++ b/contrib/ntp/sntp/libevent/test/regress_finalize.c @@ -25,6 +25,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #include "tinytest.h" #include "tinytest_macros.h" #include <stdlib.h> diff --git a/contrib/ntp/sntp/libevent/test/regress_http.c b/contrib/ntp/sntp/libevent/test/regress_http.c index ca7d5155bf140..35f6dd768961c 100644 --- a/contrib/ntp/sntp/libevent/test/regress_http.c +++ b/contrib/ntp/sntp/libevent/test/regress_http.c @@ -105,8 +105,12 @@ http_bind(struct evhttp *myhttp, ev_uint16_t *pport, int ipv6) else sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", *pport); - if (sock == NULL) - event_errx(1, "Could not start web server"); + if (sock == NULL) { + if (ipv6) + return -1; + else + event_errx(1, "Could not start web server"); + } port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock)); if (port < 0) @@ -395,7 +399,7 @@ http_basic_test(void *arg) { struct basic_test_data *data = arg; struct timeval tv; - struct bufferevent *bev; + struct bufferevent *bev = NULL; evutil_socket_t fd; const char *http_request; ev_uint16_t port = 0, port2 = 0; @@ -480,7 +484,8 @@ http_basic_test(void *arg) evhttp_free(http); end: - ; + if (bev) + bufferevent_free(bev); } @@ -714,6 +719,7 @@ http_delete_test(void *arg) http = http_setup(&port, data->base, 0); + tt_assert(http); fd = http_connect("127.0.0.1", port); tt_int_op(fd, >=, 0); @@ -734,6 +740,7 @@ http_delete_test(void *arg) bufferevent_free(bev); evutil_closesocket(fd); + fd = -1; evhttp_free(http); @@ -953,7 +960,8 @@ static void http_request_done(struct evhttp_request *, void *); static void http_request_empty_done(struct evhttp_request *, void *); static void -http_connection_test_(struct basic_test_data *data, int persistent, const char *address, struct evdns_base *dnsbase, int ipv6) +http_connection_test_(struct basic_test_data *data, int persistent, + const char *address, struct evdns_base *dnsbase, int ipv6, int family) { ev_uint16_t port = 0; struct evhttp_connection *evcon = NULL; @@ -962,9 +970,14 @@ http_connection_test_(struct basic_test_data *data, int persistent, const char * test_ok = 0; http = http_setup(&port, data->base, ipv6); + if (!http && ipv6) { + tt_skip(); + } + tt_assert(http); evcon = evhttp_connection_base_new(data->base, dnsbase, address, port); tt_assert(evcon); + evhttp_connection_set_family(evcon, family); tt_assert(evhttp_connection_get_base(evcon) == data->base); @@ -1038,12 +1051,12 @@ http_connection_test_(struct basic_test_data *data, int persistent, const char * static void http_connection_test(void *arg) { - http_connection_test_(arg, 0, "127.0.0.1", NULL, 0); + http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC); } static void http_persist_connection_test(void *arg) { - http_connection_test_(arg, 1, "127.0.0.1", NULL, 0); + http_connection_test_(arg, 1, "127.0.0.1", NULL, 0, AF_UNSPEC); } static struct regress_dns_server_table search_table[] = { @@ -1147,6 +1160,63 @@ http_connection_async_test(void *arg) } static void +http_autofree_connection_test(void *arg) +{ + struct basic_test_data *data = arg; + ev_uint16_t port = 0; + struct evhttp_connection *evcon = NULL; + struct evhttp_request *req[2] = { NULL }; + + test_ok = 0; + http = http_setup(&port, data->base, 0); + + evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); + tt_assert(evcon); + + /* + * At this point, we want to schedule two request to the HTTP + * server using our make request method. + */ + req[0] = evhttp_request_new(http_request_empty_done, data->base); + req[1] = evhttp_request_new(http_request_empty_done, data->base); + + /* Add the information that we care about */ + evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Host", "somehost"); + evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Connection", "close"); + evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Empty", "itis"); + evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Host", "somehost"); + evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Connection", "close"); + evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Empty", "itis"); + + /* We give ownership of the request to the connection */ + if (evhttp_make_request(evcon, req[0], EVHTTP_REQ_GET, "/test") == -1) { + tt_abort_msg("couldn't make request"); + } + if (evhttp_make_request(evcon, req[1], EVHTTP_REQ_GET, "/test") == -1) { + tt_abort_msg("couldn't make request"); + } + + /* + * Tell libevent to free the connection when the request completes + * We then set the evcon pointer to NULL since we don't want to free it + * when this function ends. + */ + evhttp_connection_free_on_completion(evcon); + evcon = NULL; + + event_base_dispatch(data->base); + + /* at this point, the http server should have no connection */ + tt_assert(TAILQ_FIRST(&http->connections) == NULL); + + end: + if (evcon) + evhttp_connection_free(evcon); + if (http) + evhttp_free(http); +} + +static void http_request_never_call(struct evhttp_request *req, void *arg) { fprintf(stdout, "FAILED\n"); @@ -2743,6 +2813,7 @@ http_incomplete_test_(struct basic_test_data *data, int use_timeout) bufferevent_free(bev); if (use_timeout) { evutil_closesocket(fd); + fd = -1; } evhttp_free(http); @@ -3748,7 +3819,7 @@ static struct regress_dns_server_table ipv6_search_table[] = { }; static void -http_ipv6_for_domain_test(void *arg) +http_ipv6_for_domain_test_impl(void *arg, int family) { struct basic_test_data *data = arg; struct evdns_base *dns_base = NULL; @@ -3765,13 +3836,19 @@ http_ipv6_for_domain_test(void *arg) evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum); evdns_base_nameserver_ip_add(dns_base, address); - http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base, 1 /* ipv6 */); + http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base, + 1 /* ipv6 */, family); end: if (dns_base) evdns_base_free(dns_base, 0); regress_clean_dnsserver(); } +static void +http_ipv6_for_domain_test(void *arg) +{ + http_ipv6_for_domain_test_impl(arg, AF_UNSPEC); +} static void http_request_get_addr_on_close(struct evhttp_connection *evcon, void *arg) @@ -3836,6 +3913,22 @@ http_get_addr_test(void *arg) evhttp_free(http); } +static void +http_set_family_test(void *arg) +{ + http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC); +} +static void +http_set_family_ipv4_test(void *arg) +{ + http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_INET); +} +static void +http_set_family_ipv6_test(void *arg) +{ + http_ipv6_for_domain_test_impl(arg, AF_INET6); +} + #define HTTP_LEGACY(name) \ { #name, run_legacy_test_fn, TT_ISOLATED|TT_LEGACY, &legacy_setup, \ http_##name##_test } @@ -3861,6 +3954,7 @@ struct testcase_t http_testcases[] = { HTTP(failure), HTTP(connection), HTTP(persist_connection), + HTTP(autofree_connection), HTTP(connection_async), HTTP(close_detection), HTTP(close_detection_delay), @@ -3888,6 +3982,10 @@ struct testcase_t http_testcases[] = { HTTP(ipv6_for_domain), HTTP(get_addr), + HTTP(set_family), + HTTP(set_family_ipv4), + HTTP(set_family_ipv6), + END_OF_TESTCASES }; diff --git a/contrib/ntp/sntp/libevent/test/regress_main.c b/contrib/ntp/sntp/libevent/test/regress_main.c index 58cbe5fe2741f..3198ced1da355 100644 --- a/contrib/ntp/sntp/libevent/test/regress_main.c +++ b/contrib/ntp/sntp/libevent/test/regress_main.c @@ -90,6 +90,8 @@ #include "../iocp-internal.h" #include "../event-internal.h" +struct evutil_weakrand_state test_weakrand_state; + long timeval_msec_diff(const struct timeval *start, const struct timeval *end) { @@ -452,6 +454,8 @@ main(int argc, const char **argv) tinytest_set_aliases(testaliases); + evutil_weakrand_seed_(&test_weakrand_state, 0); + if (tinytest_main(argc,argv,testgroups)) return 1; diff --git a/contrib/ntp/sntp/libevent/test/regress_minheap.c b/contrib/ntp/sntp/libevent/test/regress_minheap.c index a1f554ebbe8ff..05db32e26f4de 100644 --- a/contrib/ntp/sntp/libevent/test/regress_minheap.c +++ b/contrib/ntp/sntp/libevent/test/regress_minheap.c @@ -30,12 +30,13 @@ #include "tinytest.h" #include "tinytest_macros.h" +#include "regress.h" static void set_random_timeout(struct event *ev) { - ev->ev_timeout.tv_sec = rand(); - ev->ev_timeout.tv_usec = rand() & 0xfffff; + ev->ev_timeout.tv_sec = test_weakrand(); + ev->ev_timeout.tv_usec = test_weakrand() & 0xfffff; ev->ev_timeout_pos.min_heap_idx = -1; } diff --git a/contrib/ntp/sntp/libevent/test/regress_ssl.c b/contrib/ntp/sntp/libevent/test/regress_ssl.c index c2113414cc639..bf9b46b1ef88e 100644 --- a/contrib/ntp/sntp/libevent/test/regress_ssl.c +++ b/contrib/ntp/sntp/libevent/test/regress_ssl.c @@ -194,6 +194,7 @@ respond_to_number(struct bufferevent *bev, void *ctx) n = atoi(line); if (n <= 0) TT_FAIL(("Bad number: %s", line)); + free(line); TT_BLATHER(("The number was %d", n)); if (n == 1001) { ++test_is_done; diff --git a/contrib/ntp/sntp/libevent/test/regress_thread.c b/contrib/ntp/sntp/libevent/test/regress_thread.c index 612bf1d6111fa..c42668ea8839c 100644 --- a/contrib/ntp/sntp/libevent/test/regress_thread.c +++ b/contrib/ntp/sntp/libevent/test/regress_thread.c @@ -361,7 +361,7 @@ thread_conditions_simple(void *arg) &tv_signal); diff2 = timeval_msec_diff(&actual_delay, &tv_broadcast); - if (abs(diff1) < abs(diff2)) { + if (labs(diff1) < labs(diff2)) { TT_BLATHER(("%d looks like a signal\n", i)); target_delay = &tv_signal; ++n_signal; @@ -382,7 +382,8 @@ thread_conditions_simple(void *arg) tt_int_op(n_signal, ==, 1); end: - ; + EVTHREAD_FREE_LOCK(cond.lock, EVTHREAD_LOCKTYPE_RECURSIVE); + EVTHREAD_FREE_COND(cond.cond); } #define CB_COUNT 128 diff --git a/contrib/ntp/sntp/libevent/test/regress_util.c b/contrib/ntp/sntp/libevent/test/regress_util.c index d64d002495ab4..60f085bf1db3f 100644 --- a/contrib/ntp/sntp/libevent/test/regress_util.c +++ b/contrib/ntp/sntp/libevent/test/regress_util.c @@ -179,10 +179,10 @@ regress_ipv6_parse(void *ptr) for (j = 0; j < 4; ++j) { /* Can't use s6_addr32 here; some don't have it. */ ev_uint32_t u = - (in6.s6_addr[j*4 ] << 24) | - (in6.s6_addr[j*4+1] << 16) | - (in6.s6_addr[j*4+2] << 8) | - (in6.s6_addr[j*4+3]); + ((ev_uint32_t)in6.s6_addr[j*4 ] << 24) | + ((ev_uint32_t)in6.s6_addr[j*4+1] << 16) | + ((ev_uint32_t)in6.s6_addr[j*4+2] << 8) | + ((ev_uint32_t)in6.s6_addr[j*4+3]); if (u != ent->res[j]) { TT_FAIL(("%s did not parse as expected.", ent->addr)); continue; @@ -726,46 +726,48 @@ test_evutil_integers(void *arg) tt_assert(u64 > 0); tt_assert(i64 > 0); u64++; - i64++; +/* i64++; */ tt_assert(u64 == 0); - tt_assert(i64 == EV_INT64_MIN); - tt_assert(i64 < 0); +/* tt_assert(i64 == EV_INT64_MIN); */ +/* tt_assert(i64 < 0); */ u32 = EV_UINT32_MAX; i32 = EV_INT32_MAX; tt_assert(u32 > 0); tt_assert(i32 > 0); u32++; - i32++; +/* i32++; */ tt_assert(u32 == 0); - tt_assert(i32 == EV_INT32_MIN); - tt_assert(i32 < 0); +/* tt_assert(i32 == EV_INT32_MIN); */ +/* tt_assert(i32 < 0); */ u16 = EV_UINT16_MAX; i16 = EV_INT16_MAX; tt_assert(u16 > 0); tt_assert(i16 > 0); u16++; - i16++; +/* i16++; */ tt_assert(u16 == 0); - tt_assert(i16 == EV_INT16_MIN); - tt_assert(i16 < 0); +/* tt_assert(i16 == EV_INT16_MIN); */ +/* tt_assert(i16 < 0); */ u8 = EV_UINT8_MAX; i8 = EV_INT8_MAX; tt_assert(u8 > 0); tt_assert(i8 > 0); u8++; - i8++; +/* i8++;*/ tt_assert(u8 == 0); - tt_assert(i8 == EV_INT8_MIN); - tt_assert(i8 < 0); +/* tt_assert(i8 == EV_INT8_MIN); */ +/* tt_assert(i8 < 0); */ +/* ssize = EV_SSIZE_MAX; tt_assert(ssize > 0); ssize++; tt_assert(ssize < 0); tt_assert(ssize == EV_SSIZE_MIN); +*/ ptr = &ssize; iptr = (ev_intptr_t)ptr; @@ -1119,7 +1121,7 @@ end: static void test_evutil_loadsyslib(void *arg) { - HANDLE h=NULL; + HMODULE h=NULL; h = evutil_load_windows_system_library_(TEXT("kernel32.dll")); tt_assert(h); diff --git a/contrib/ntp/sntp/libevent/test/regress_zlib.c b/contrib/ntp/sntp/libevent/test/regress_zlib.c index 9339397c93b6b..8406676932ed3 100644 --- a/contrib/ntp/sntp/libevent/test/regress_zlib.c +++ b/contrib/ntp/sntp/libevent/test/regress_zlib.c @@ -56,6 +56,7 @@ #include "event2/bufferevent.h" #include "regress.h" +#include "mm-internal.h" /* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory @@ -95,6 +96,7 @@ zlib_deflate_free(void *ctx) z_streamp p = ctx; assert(deflateEnd(p) == Z_OK); + mm_free(p); } static void @@ -103,6 +105,7 @@ zlib_inflate_free(void *ctx) z_streamp p = ctx; assert(inflateEnd(p) == Z_OK); + mm_free(p); } static int @@ -275,7 +278,7 @@ test_bufferevent_zlib(void *arg) { struct bufferevent *bev1=NULL, *bev2=NULL; char buffer[8333]; - z_stream z_input, z_output; + z_stream *z_input, *z_output; int i, r; evutil_socket_t pair[2] = {-1, -1}; (void)arg; @@ -293,18 +296,18 @@ test_bufferevent_zlib(void *arg) bev1 = bufferevent_socket_new(NULL, pair[0], 0); bev2 = bufferevent_socket_new(NULL, pair[1], 0); - memset(&z_output, 0, sizeof(z_output)); - r = deflateInit(&z_output, Z_DEFAULT_COMPRESSION); + z_output = mm_calloc(sizeof(*z_output), 1); + r = deflateInit(z_output, Z_DEFAULT_COMPRESSION); tt_int_op(r, ==, Z_OK); - memset(&z_input, 0, sizeof(z_input)); - r = inflateInit(&z_input); + z_input = mm_calloc(sizeof(*z_input), 1); + r = inflateInit(z_input); tt_int_op(r, ==, Z_OK); /* initialize filters */ bev1 = bufferevent_filter_new(bev1, NULL, zlib_output_filter, - BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, &z_output); + BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, z_output); bev2 = bufferevent_filter_new(bev2, zlib_input_filter, - NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, &z_input); + NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, z_input); bufferevent_setcb(bev1, readcb, writecb, errorcb, NULL); bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL); diff --git a/contrib/ntp/sntp/libevent/test/test-fdleak.c b/contrib/ntp/sntp/libevent/test/test-fdleak.c index ee2432b713176..4c4eba25e70e5 100644 --- a/contrib/ntp/sntp/libevent/test/test-fdleak.c +++ b/contrib/ntp/sntp/libevent/test/test-fdleak.c @@ -57,7 +57,7 @@ #endif /* Provide storage for the address, both for the server & the clients */ -static struct sockaddr_in sin; +static struct sockaddr_in saddr; /* Number of sucessful requests so far */ static int num_requests; @@ -131,7 +131,7 @@ start_loop(void) listener = evconnlistener_new_bind(base, listener_accept_cb, NULL, LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE, - -1, (struct sockaddr *)&sin, sizeof(sin)); + -1, (struct sockaddr *)&saddr, sizeof(saddr)); if (listener == NULL) { my_perror("Could not create listener!"); exit(1); @@ -145,8 +145,8 @@ start_loop(void) my_perror("getsockname()"); exit(1); } - memcpy(&sin, &ss, sizeof(sin)); - if (sin.sin_family != AF_INET) { + memcpy(&saddr, &ss, sizeof(saddr)); + if (saddr.sin_family != AF_INET) { puts("AF mismatch from getsockname()."); exit(1); } @@ -208,8 +208,8 @@ start_client(struct event_base *base) BEV_OPT_CLOSE_ON_FREE); bufferevent_setcb(bev, client_read_cb, NULL, client_event_cb, NULL); - if (bufferevent_socket_connect(bev, (struct sockaddr *)&sin, - sizeof(sin)) < 0) { + if (bufferevent_socket_connect(bev, (struct sockaddr *)&saddr, + sizeof(saddr)) < 0) { my_perror("Could not connect!"); bufferevent_free(bev); exit(2); @@ -236,10 +236,10 @@ main(int argc, char **argv) #endif /* Set up an address, used by both client & server. */ - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(0x7f000001); - sin.sin_port = 0; /* Tell the implementation to pick a port. */ + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = htonl(0x7f000001); + saddr.sin_port = 0; /* Tell the implementation to pick a port. */ start_loop(); diff --git a/contrib/ntp/sntp/libevent/test/test-ratelim.c b/contrib/ntp/sntp/libevent/test/test-ratelim.c index 27649b8490e0b..17babfdcbcf58 100644 --- a/contrib/ntp/sntp/libevent/test/test-ratelim.c +++ b/contrib/ntp/sntp/libevent/test/test-ratelim.c @@ -50,6 +50,7 @@ #include "event2/listener.h" #include "event2/thread.h" +static struct evutil_weakrand_state weakrand_state; static int cfg_verbose = 0; static int cfg_help = 0; @@ -113,11 +114,7 @@ loud_writecb(struct bufferevent *bev, void *ctx) struct client_state *cs = ctx; struct evbuffer *output = bufferevent_get_output(bev); char buf[1024]; -#ifdef _WIN32 - int r = rand() % 256; -#else - int r = random() % 256; -#endif + int r = evutil_weakrand_(&weakrand_state); memset(buf, r, sizeof(buf)); while (evbuffer_get_length(output) < 8192) { evbuffer_add(output, buf, sizeof(buf)); @@ -223,7 +220,7 @@ check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg) #undef B total_n_bev_checks++; - if (total_n_bev_checks >= .8 * (cfg_duration / cfg_tick_msec) * cfg_n_connections) { + if (total_n_bev_checks >= .8 * ((double)cfg_duration / cfg_tick_msec) * cfg_n_connections) { event_free(event_base_get_running_event(bufferevent_get_base(bev))); } } @@ -553,6 +550,8 @@ main(int argc, char **argv) (void) WSAStartup(wVersionRequested, &wsaData); #endif + evutil_weakrand_seed_(&weakrand_state, 0); + #ifndef _WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) return 1; diff --git a/contrib/ntp/sntp/libevent/test/test-time.c b/contrib/ntp/sntp/libevent/test/test-time.c index dcd6639a56fb8..bcc7086df7eda 100644 --- a/contrib/ntp/sntp/libevent/test/test-time.c +++ b/contrib/ntp/sntp/libevent/test/test-time.c @@ -41,6 +41,7 @@ #include "event2/event.h" #include "event2/event_compat.h" #include "event2/event_struct.h" +#include "util-internal.h" int called = 0; @@ -48,14 +49,12 @@ int called = 0; struct event *ev[NEVENT]; +struct evutil_weakrand_state weakrand_state; + static int rand_int(int n) { -#ifdef _WIN32 - return (int)(rand() % n); -#else - return (int)(random() % n); -#endif + return evutil_weakrand_(&weakrand_state) % n; } static void @@ -71,7 +70,7 @@ time_cb(evutil_socket_t fd, short event, void *arg) j = rand_int(NEVENT); tv.tv_sec = 0; tv.tv_usec = rand_int(50000); - if (tv.tv_usec % 2) + if (tv.tv_usec % 2 || called < NEVENT) evtimer_add(ev[j], &tv); else evtimer_del(ev[j]); @@ -93,6 +92,8 @@ main(int argc, char **argv) (void) WSAStartup(wVersionRequested, &wsaData); #endif + evutil_weakrand_seed_(&weakrand_state, 0); + /* Initalize the event library */ event_init(); @@ -108,6 +109,8 @@ main(int argc, char **argv) event_dispatch(); + + printf("%d, %d\n", called, NEVENT); return (called < NEVENT); } diff --git a/contrib/ntp/sntp/libevent/test/tinytest.c b/contrib/ntp/sntp/libevent/test/tinytest.c index 36b3a627c48bf..3a8e331055015 100644 --- a/contrib/ntp/sntp/libevent/test/tinytest.c +++ b/contrib/ntp/sntp/libevent/test/tinytest.c @@ -31,6 +31,8 @@ #include <string.h> #include <assert.h> +#ifndef NO_FORKING + #ifdef _WIN32 #include <windows.h> #else @@ -48,6 +50,8 @@ #endif #endif +#endif /* !NO_FORKING */ + #ifndef __GNUC__ #define __attribute__(x) #endif @@ -111,6 +115,8 @@ testcase_run_bare_(const struct testcase_t *testcase) #define MAGIC_EXITCODE 42 +#ifndef NO_FORKING + static enum outcome testcase_run_forked_(const struct testgroup_t *group, const struct testcase_t *testcase) @@ -211,6 +217,8 @@ testcase_run_forked_(const struct testgroup_t *group, #endif } +#endif /* !NO_FORKING */ + int testcase_run_one(const struct testgroup_t *group, const struct testcase_t *testcase) @@ -234,9 +242,13 @@ testcase_run_one(const struct testgroup_t *group, cur_test_name = testcase->name; } +#ifndef NO_FORKING if ((testcase->flags & TT_FORK) && !(opt_forked||opt_nofork)) { outcome = testcase_run_forked_(group, testcase); } else { +#else + { +#endif outcome = testcase_run_bare_(testcase); } @@ -411,7 +423,9 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) if (!n) tinytest_set_flag_(groups, "..", 1, TT_ENABLED_); +#ifdef _IONBF setvbuf(stdout, NULL, _IONBF, 0); +#endif ++in_tinytest_main; for (i=0; groups[i].prefix; ++i) @@ -458,3 +472,22 @@ tinytest_set_test_skipped_(void) cur_test_outcome = SKIP; } +char * +tinytest_format_hex_(const void *val_, unsigned long len) +{ + const unsigned char *val = val_; + char *result, *cp; + size_t i; + + if (!val) + return strdup("null"); + if (!(result = malloc(len*2+1))) + return strdup("<allocation failure>"); + cp = result; + for (i=0;i<len;++i) { + *cp++ = "0123456789ABCDEF"[val[i] >> 4]; + *cp++ = "0123456789ABCDEF"[val[i] & 0x0f]; + } + *cp = 0; + return result; +} diff --git a/contrib/ntp/sntp/libevent/test/tinytest.h b/contrib/ntp/sntp/libevent/test/tinytest.h index dff440e3190ed..ed07b26bc006b 100644 --- a/contrib/ntp/sntp/libevent/test/tinytest.h +++ b/contrib/ntp/sntp/libevent/test/tinytest.h @@ -81,6 +81,8 @@ int tinytest_get_verbosity_(void); /** Implementation: Set a flag on tests matching a name; returns number * of tests that matched. */ int tinytest_set_flag_(struct testgroup_t *, const char *, int set, unsigned long); +/** Implementation: Put a chunk of memory into hex. */ +char *tinytest_format_hex_(const void *, unsigned long); /** Set all tests in 'groups' matching the name 'named' to be skipped. */ #define tinytest_skip(groups, named) \ diff --git a/contrib/ntp/sntp/libevent/test/tinytest_macros.h b/contrib/ntp/sntp/libevent/test/tinytest_macros.h index 9ff69b1d506da..c3728d1fdd61d 100644 --- a/contrib/ntp/sntp/libevent/test/tinytest_macros.h +++ b/contrib/ntp/sntp/libevent/test/tinytest_macros.h @@ -113,8 +113,8 @@ #define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \ setup_block,cleanup_block,die_on_fail) \ TT_STMT_BEGIN \ - type val1_ = (type)(a); \ - type val2_ = (type)(b); \ + type val1_ = (a); \ + type val2_ = (b); \ int tt_status_ = (test); \ if (!tt_status_ || tinytest_get_verbosity_()>1) { \ printf_type print_; \ @@ -144,6 +144,10 @@ tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt, \ {print_=value_;},{},die_on_fail) +#define tt_assert_test_type_opt(a,b,str_test,type,test,fmt,die_on_fail) \ + tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt, \ + {print_=value_?value_:"<NULL>";},{},die_on_fail) + /* Helper: assert that a op b, when cast to type. Format the values with * printf format fmt on failure. */ #define tt_assert_op_type(a,op,b,type,fmt) \ @@ -159,12 +163,23 @@ (val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION) #define tt_ptr_op(a,op,b) \ - tt_assert_test_type(a,b,#a" "#op" "#b,void*, \ + tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \ (val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION) #define tt_str_op(a,op,b) \ - tt_assert_test_type(a,b,#a" "#op" "#b,const char *, \ - (strcmp(val1_,val2_) op 0),"<%s>",TT_EXIT_TEST_FUNCTION) + tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *, \ + (val1_ && val2_ && strcmp(val1_,val2_) op 0),"<%s>", \ + TT_EXIT_TEST_FUNCTION) + +#define tt_mem_op(expr1, op, expr2, len) \ + tt_assert_test_fmt_type(expr1,expr2,#expr1" "#op" "#expr2, \ + const void *, \ + (val1_ && val2_ && memcmp(val1_, val2_, len) op 0), \ + char *, "%s", \ + { print_ = tinytest_format_hex_(value_, (len)); }, \ + { if (print_) free(print_); }, \ + TT_EXIT_TEST_FUNCTION \ + ); #define tt_want_int_op(a,op,b) \ tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_),"%ld",(void)0) @@ -174,7 +189,7 @@ (val1_ op val2_),"%lu",(void)0) #define tt_want_ptr_op(a,op,b) \ - tt_assert_test_type(a,b,#a" "#op" "#b,void*, \ + tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \ (val1_ op val2_),"%p",(void)0) #define tt_want_str_op(a,op,b) \ diff --git a/contrib/ntp/sntp/libevent/time-internal.h b/contrib/ntp/sntp/libevent/time-internal.h index daf20f47a30eb..2c584fa752636 100644 --- a/contrib/ntp/sntp/libevent/time-internal.h +++ b/contrib/ntp/sntp/libevent/time-internal.h @@ -86,9 +86,6 @@ struct evutil_monotonic_timer { struct timeval last_time; }; -#define EV_MONOT_PRECISE 1 -#define EV_MONOT_FALLBACK 2 - int evutil_configure_monotonic_time_(struct evutil_monotonic_timer *mt, int flags); int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv); diff --git a/contrib/ntp/sntp/libevent/util-internal.h b/contrib/ntp/sntp/libevent/util-internal.h index 5866dbc518bdf..4fdedeaf93c57 100644 --- a/contrib/ntp/sntp/libevent/util-internal.h +++ b/contrib/ntp/sntp/libevent/util-internal.h @@ -392,7 +392,7 @@ void evutil_free_secure_rng_globals_(void); void evutil_free_globals_(void); #ifdef _WIN32 -HANDLE evutil_load_windows_system_library_(const TCHAR *library_name); +HMODULE evutil_load_windows_system_library_(const TCHAR *library_name); #endif #ifndef EV_SIZE_FMT diff --git a/contrib/ntp/sntp/libevent/whatsnew-2.1.txt b/contrib/ntp/sntp/libevent/whatsnew-2.1.txt index c0ee7cf7dc028..0be54ae11b50d 100644 --- a/contrib/ntp/sntp/libevent/whatsnew-2.1.txt +++ b/contrib/ntp/sntp/libevent/whatsnew-2.1.txt @@ -41,7 +41,7 @@ We don't try to do binary compatibility except within stable release series, so binaries linked against any version of Libevent 2.0 will - probably need to be recompiled against Libevent 2.1.3-alpha if you + probably need to be recompiled against Libevent 2.1.4-alpha if you want to use it. It is probable that we'll break binary compatibility again before Libevent 2.1 is stable. @@ -63,6 +63,9 @@ surrounded with appropriate #ifdef lines to keep your IDE from getting upset. + There is now an alternative cmake-based build process; cmake users + should see the relevant sections in the README. + 1.2. New functions for events and the event loop @@ -146,6 +149,19 @@ that's a no-op in past versions of Libevent, and we don't want to break compatibility.) + You can use the new event_base_get_num_events() function to find the + number of events active or pending on an event_base. To find the + largest number of events that there have been since the last call, use + event_base_get_max_events(). + + You can now activate all the events waiting for a given fd or signal + using the event_base_active_by_fd() and event_base_active_by_signal() + APIs. + + On backends that support it (currently epoll), there is now an + EV_CLOSED flag that programs can use to detect when a socket has + closed without having to read all the bytes until receiving an EOF. + 1.3. Event finalization [NOTE: This is an experimental feature in Libevent 2.1.3-alpha. Though @@ -325,6 +341,13 @@ You can find the priority at which a bufferevent runs with bufferevent_get_priority(). + The function bufferevent_get_token_bucket_cfg() can retrieve the + rate-limit settings for a bufferevent; bufferevent_getwatermark() can + return a bufferevent's current watermark settings. + + You can manually trigger a bufferevent's callbacks via + bufferevent_trigger() and bufferevent_trigger_event(). + 1.7. New functions and features: evdns The previous evdns interface used an "open a test UDP socket" trick in @@ -340,6 +363,9 @@ flag, which tells the evdns_base that it should not prevent Libevent from exiting while it has no DNS requests in progress. + There is a new evdns_base_clear_host_addresses() function to remove + all the /etc/hosts addresses registered with an evdns instance. + 1.8. New functions and features: evconnlistener Libevent 2.1 adds the following evconnlistener flags: @@ -392,6 +418,31 @@ and actually reports the error code and lets you figure out which request failed. + You can navigate from an evhttp_connection back to its evhttp with the + new evhttp_connection_get_server() function. + + You can override the default HTTP Content-Type with the new + evhttp_set_default_content_type() function + + There's a new evhttp_connection_get_addr() API to return the peer + address of an evhttp_connection. + + The new evhttp_send_reply_chunk_with_cb() is a variant of + evhttp_send_reply_chunk() with a callback to be invoked when the + chunk is sent. + + The evhttp_request_set_header_cb() facility adds a callback to be + invoked while parsing headers. + + The evhttp_request_set_on_complete_cb() facility adds a callback to be + invoked on request completion. + +1.10. New functions and features: evutil + + There's a function "evutil_secure_rng_set_urandom_device_file()" that + you can use to override the default file that Libevent uses to seed + its (sort-of) secure RNG. + 2. Cross-platform performance improvements 2.1. Better data structures diff --git a/contrib/ntp/sntp/libopts/Makefile.in b/contrib/ntp/sntp/libopts/Makefile.in index 3b107c7a73e3c..feb2e0f5c8229 100644 --- a/contrib/ntp/sntp/libopts/Makefile.in +++ b/contrib/ntp/sntp/libopts/Makefile.in @@ -39,8 +39,6 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/libevent/m4/openldap.m4 \ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -60,8 +58,10 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \ - $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/openldap-thread-check.m4 \ + $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -303,6 +303,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ abs_builddir = @abs_builddir@ diff --git a/contrib/ntp/sntp/libopts/m4/libopts.m4 b/contrib/ntp/sntp/libopts/m4/libopts.m4 index 4a4ca181bcce5..352098b808c6b 100644 --- a/contrib/ntp/sntp/libopts/m4/libopts.m4 +++ b/contrib/ntp/sntp/libopts/m4/libopts.m4 @@ -216,7 +216,7 @@ AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[ LIBREGEX_LIBS="" AC_MSG_CHECKING([whether libregex functions properly]) AC_CACHE_VAL([libopts_cv_with_libregex],[ - AC_RUN_IFELSE([@%:@include <stdio.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h> @%:@include <stdlib.h> @%:@include <sys/types.h> @%:@include REGEX_HEADER @@ -235,7 +235,7 @@ int main() { fputs( "error: regex -->.<-- did not match\n", stderr ); return 1; } - return 0; }], + return 0; }])], [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no], [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex @@ -260,12 +260,12 @@ libopts_cv_with_libregex=no AC_DEFUN([LIBOPTS_RUN_PATHFIND],[ AC_MSG_CHECKING([whether pathfind(3) works]) AC_CACHE_VAL([libopts_cv_run_pathfind],[ - AC_RUN_IFELSE([@%:@include <string.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <string.h> @%:@include <stdlib.h> int main (int argc, char** argv) { char* pz = pathfind( getenv( "PATH" ), "sh", "x" ); return (pz == 0) ? 1 : 0; -}], +}])], [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind @@ -303,7 +303,7 @@ echo ${dzero}` AC_DEFUN([LIBOPTS_RUN_REALPATH],[ AC_MSG_CHECKING([whether we have a functional realpath(3C)]) AC_CACHE_VAL([libopts_cv_run_realpath],[ - AC_RUN_IFELSE([@%:@include <limits.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <limits.h> @%:@include <stdlib.h> int main (int argc, char** argv) { @%:@ifndef PATH_MAX @@ -313,7 +313,7 @@ choke me!! @%:@endif char *pz = realpath(argv@<:@0@:>@, zPath); return (pz == zPath) ? 0 : 1; -}], +}])], [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath @@ -330,7 +330,7 @@ choke me!! AC_DEFUN([LIBOPTS_RUN_STRFTIME],[ AC_MSG_CHECKING([whether strftime() works]) AC_CACHE_VAL([libopts_cv_run_strftime],[ - AC_RUN_IFELSE([@%:@include <time.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <time.h> @%:@include <string.h> char t_buf@<:@ 64 @:>@; int main() { @@ -346,7 +346,7 @@ int main() { tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */ tm.tm_isdst = 1; /* flag for daylight savings time */ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm ); - return (strcmp( t_buf, z ) != 0); }], + return (strcmp( t_buf, z ) != 0); }])], [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime @@ -363,10 +363,10 @@ int main() { AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[ AC_MSG_CHECKING([whether fopen accepts "b" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_binary],[ - AC_RUN_IFELSE([@%:@include <stdio.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h> int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rb"); -return (fp == NULL) ? 1 : fclose(fp); }], +return (fp == NULL) ? 1 : fclose(fp); }])], [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary @@ -386,10 +386,10 @@ return (fp == NULL) ? 1 : fclose(fp); }], AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[ AC_MSG_CHECKING([whether fopen accepts "t" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_text],[ - AC_RUN_IFELSE([@%:@include <stdio.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h> int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rt"); -return (fp == NULL) ? 1 : fclose(fp); }], +return (fp == NULL) ? 1 : fclose(fp); }])], [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text diff --git a/contrib/ntp/sntp/loc/darwin b/contrib/ntp/sntp/loc/darwin index c902860b6a075..37d2dcac7a9b7 100644 --- a/contrib/ntp/sntp/loc/darwin +++ b/contrib/ntp/sntp/loc/darwin @@ -12,3 +12,4 @@ ntpsweep,noinst,8 ntptime,sbin,8 ntptrace,sbin,8 sntp,bin,8 +update-leap,sbin,8 diff --git a/contrib/ntp/sntp/loc/debian b/contrib/ntp/sntp/loc/debian index 7bc895ae010b6..1242fdf973110 100644 --- a/contrib/ntp/sntp/loc/debian +++ b/contrib/ntp/sntp/loc/debian @@ -15,3 +15,4 @@ ntptrace,bin,1 sntp,bin,1 tickadj,sbin,8 timetrim,sbin,8 +update-leap,sbin,8 diff --git a/contrib/ntp/sntp/loc/freebsd b/contrib/ntp/sntp/loc/freebsd index 7759e315693a2..587f998c153b6 100644 --- a/contrib/ntp/sntp/loc/freebsd +++ b/contrib/ntp/sntp/loc/freebsd @@ -12,3 +12,4 @@ ntptime,sbin,8 ntpsweep,noinst,8 ntptrace,sbin,8 sntp,sbin,8 +update-leap,sbin,8 diff --git a/contrib/ntp/sntp/loc/legacy b/contrib/ntp/sntp/loc/legacy index 46c63a2831a62..5412971b265ae 100644 --- a/contrib/ntp/sntp/loc/legacy +++ b/contrib/ntp/sntp/loc/legacy @@ -15,3 +15,4 @@ ntptrace,bin,1 sntp,bin,1 tickadj,bin,1 timetrim,bin,1 +update-leap,bin,1 diff --git a/contrib/ntp/sntp/loc/netbsd b/contrib/ntp/sntp/loc/netbsd index fa79340db23eb..200de2b596201 100644 --- a/contrib/ntp/sntp/loc/netbsd +++ b/contrib/ntp/sntp/loc/netbsd @@ -12,3 +12,4 @@ ntpsweep,noinst,8 ntptime,sbin,8 ntptrace,sbin,8 sntp,sbin,1 +update-leap,sbin,8 diff --git a/contrib/ntp/sntp/loc/solaris b/contrib/ntp/sntp/loc/solaris index eca143843c4d9..a9b3853018bca 100644 --- a/contrib/ntp/sntp/loc/solaris +++ b/contrib/ntp/sntp/loc/solaris @@ -14,3 +14,4 @@ ntptime,sbin,1m ntptrace,sbin,1m sntp,sbin,1m tickadj,sbin,1m +update-leap,sbin,1m diff --git a/contrib/ntp/sntp/m4/ax_c99_struct_init.m4 b/contrib/ntp/sntp/m4/ax_c99_struct_init.m4 new file mode 100644 index 0000000000000..44a2db3cf8ba9 --- /dev/null +++ b/contrib/ntp/sntp/m4/ax_c99_struct_init.m4 @@ -0,0 +1,59 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_c99_struct_init.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_C99_STRUCT_INIT +# +# DESCRIPTION +# +# This macro defines MISSING_C99_STRUCT_INIT if the C compiler does not +# supports the C99 tagged structure initialization. +# +# Given: struct foo_s {int i1; int i2; int i3;}; +# one can write: +# #if !define(MISSING_C99_STRUCT_INIT) +# # define FOO_INIT(a, b, c) { .i1 = a, .i2 = b, .i3 = c } +# #else +# # define FOO_INIT(a, b, c) { a, b, c } +# +# static struct foo_s foo[] = { +# FOO_INIT(1, 1, 1), +# FOO_INIT(2, 2, 2), +# FOO_INIT(0, 0, 0) +# }; +# +# LICENSE +# +# Copyright (c) 2015 Network Time Foundation +# +# Author: Harlan Stenn <stenn@nwtime.org> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([AX_C99_STRUCT_INIT], [ + AC_MSG_CHECKING([whether the compiler supports C99 structure initialization]) + AC_REQUIRE([AC_PROG_CC_C99]) + + AC_LANG_PUSH([C]) + + dnl AC_LINK_IFELSE? + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + struct foo_s {int i1; int i2;}; + int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; } + ]])], + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + AC_DEFINE([MISSING_C99_STRUCT_INIT], [1], + [Define to 1 if the compiler does not support C99's structure initialization.]), + ) + + AC_LANG_POP([C]) + ]); diff --git a/contrib/ntp/sntp/m4/ntp_libntp.m4 b/contrib/ntp/sntp/m4/ntp_libntp.m4 index 8842c4a81125c..3aa3dff563a47 100644 --- a/contrib/ntp/sntp/m4/ntp_libntp.m4 +++ b/contrib/ntp/sntp/m4/ntp_libntp.m4 @@ -878,13 +878,13 @@ AC_CACHE_CHECK( [for SIGIO], [ntp_cv_hdr_def_sigio], [AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <signal.h> #ifndef SIGIO # error #endif - ], + ])], [ntp_cv_hdr_def_sigio=yes], [ntp_cv_hdr_def_sigio=no] )] @@ -947,13 +947,13 @@ AC_CACHE_CHECK( [for SIGPOLL], [ntp_cv_hdr_def_sigpoll], [AC_PREPROC_IFELSE( - [ + [AC_LANG_SOURCE([ #include <signal.h> #ifndef SIGPOLL # error #endif - ], + ])], [ntp_cv_hdr_def_sigpoll=yes], [ntp_cv_hdr_def_sigpoll=no] )] diff --git a/contrib/ntp/sntp/m4/ntp_locinfo.m4 b/contrib/ntp/sntp/m4/ntp_locinfo.m4 index f045ac2609d56..6701ba028b60f 100644 --- a/contrib/ntp/sntp/m4/ntp_locinfo.m4 +++ b/contrib/ntp/sntp/m4/ntp_locinfo.m4 @@ -124,6 +124,12 @@ AC_SUBST([TIMETRIM_DL]) AC_SUBST([TIMETRIM_DS]) AC_SUBST([TIMETRIM_MS]) AC_SUBST([TIMETRIM_NI]) +AC_SUBST([UPDATE_LEAP_DB]) +AC_SUBST([UPDATE_LEAP_DL]) +AC_SUBST([UPDATE_LEAP_DS]) +AC_SUBST([UPDATE_LEAP_MS]) +AC_SUBST([UPDATE_LEAP_NI]) +AM_CONDITIONAL([INSTALL_UPDATE_LEAP], [test -z "$UPDATE_LEAP_NI" ]) ])dnl dnl ====================================================================== diff --git a/contrib/ntp/sntp/libevent/m4/openldap-thread-check.m4 b/contrib/ntp/sntp/m4/openldap-thread-check.m4 index 33f9199ff300e..33f9199ff300e 100644 --- a/contrib/ntp/sntp/libevent/m4/openldap-thread-check.m4 +++ b/contrib/ntp/sntp/m4/openldap-thread-check.m4 diff --git a/contrib/ntp/sntp/libevent/m4/openldap.m4 b/contrib/ntp/sntp/m4/openldap.m4 index 49ffb87058ac4..49ffb87058ac4 100644 --- a/contrib/ntp/sntp/libevent/m4/openldap.m4 +++ b/contrib/ntp/sntp/m4/openldap.m4 diff --git a/contrib/ntp/sntp/m4/version.m4 b/contrib/ntp/sntp/m4/version.m4 index 06f9676920618..945d9cb0cad42 100644 --- a/contrib/ntp/sntp/m4/version.m4 +++ b/contrib/ntp/sntp/m4/version.m4 @@ -1 +1 @@ -m4_define([VERSION_NUMBER],[4.2.8p1]) +m4_define([VERSION_NUMBER],[4.2.8p2]) diff --git a/contrib/ntp/sntp/main.c b/contrib/ntp/sntp/main.c index c271c8c457f58..20e27f0fec300 100644 --- a/contrib/ntp/sntp/main.c +++ b/contrib/ntp/sntp/main.c @@ -1161,6 +1161,7 @@ handle_pkt( int stratum; char * ref; char * ts_str; + char * leaptxt; double offset; double precision; double synch_distance; @@ -1256,9 +1257,28 @@ handle_pkt( disptxt[0] = '\0'; } - msyslog(LOG_INFO, "%s %+.*f%s %s s%d%s", ts_str, + switch (PKT_LEAP(rpkt->li_vn_mode)) { + case LEAP_NOWARNING: + leaptxt = "no-leap"; + break; + case LEAP_ADDSECOND: + leaptxt = "add-leap"; + break; + case LEAP_DELSECOND: + leaptxt = "del-leap"; + break; + case LEAP_NOTINSYNC: + leaptxt = "unsync"; + break; + default: + leaptxt = "LEAP-ERROR"; + break; + } + + msyslog(LOG_INFO, "%s %+.*f%s %s s%d %s%s", ts_str, digits, offset, disptxt, hostnameaddr(hostname, host), stratum, + leaptxt, (time_adjusted) ? " [excess]" : ""); diff --git a/contrib/ntp/sntp/scripts/Makefile.in b/contrib/ntp/sntp/scripts/Makefile.in index 26c3591bfa334..73025d0bb8ba5 100644 --- a/contrib/ntp/sntp/scripts/Makefile.in +++ b/contrib/ntp/sntp/scripts/Makefile.in @@ -38,8 +38,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/libevent/m4/openldap.m4 \ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -59,8 +57,10 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \ - $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/openldap-thread-check.m4 \ + $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -246,6 +246,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ abs_builddir = @abs_builddir@ diff --git a/contrib/ntp/sntp/sntp-opts.c b/contrib/ntp/sntp/sntp-opts.c index a9e36457ad134..ce28d653d71c3 100644 --- a/contrib/ntp/sntp/sntp-opts.c +++ b/contrib/ntp/sntp/sntp-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:33:35 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:17:23 AM by AutoGen 5.18.5pre4 * From the definitions sntp-opts.def * and the template file options * @@ -70,7 +70,7 @@ extern FILE * option_usage_fp; * static const strings for sntp options */ static char const sntp_opt_strs[2549] = -/* 0 */ "sntp 4.2.8p1\n" +/* 0 */ "sntp 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -155,7 +155,7 @@ static char const sntp_opt_strs[2549] = /* 2298 */ "LOAD_OPTS\0" /* 2308 */ "no-load-opts\0" /* 2321 */ "SNTP\0" -/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1\n" +/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" "\t\t[ hostname-or-IP ...]\n\0" /* 2485 */ "$HOME\0" @@ -163,7 +163,7 @@ static char const sntp_opt_strs[2549] = /* 2493 */ ".ntprc\0" /* 2500 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 2534 */ "\n\0" -/* 2536 */ "sntp 4.2.8p1"; +/* 2536 */ "sntp 4.2.8p2"; /** * ipv4 option description with @@ -1173,7 +1173,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via sntpOptions.pzCopyright */ - puts(_("sntp 4.2.8p1\n\ + puts(_("sntp 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -1263,7 +1263,7 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via sntpOptions.pzUsageTitle */ - puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1\n\ + puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ \t\t[ hostname-or-IP ...]\n")); @@ -1271,7 +1271,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ puts(_("\n")); /* referenced via sntpOptions.pzFullVersion */ - puts(_("sntp 4.2.8p1")); + puts(_("sntp 4.2.8p2")); /* referenced via sntpOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/sntp/sntp-opts.def b/contrib/ntp/sntp/sntp-opts.def index c94d5e96e55bd..fcfeaaf6c6b74 100644 --- a/contrib/ntp/sntp/sntp-opts.def +++ b/contrib/ntp/sntp/sntp-opts.def @@ -281,7 +281,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. _END_PROG_MDOC_DESCRIP; }; diff --git a/contrib/ntp/sntp/sntp-opts.h b/contrib/ntp/sntp/sntp-opts.h index d0407aa8d3d76..8f1a5df5675af 100644 --- a/contrib/ntp/sntp/sntp-opts.h +++ b/contrib/ntp/sntp/sntp-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:33:34 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:17:22 AM by AutoGen 5.18.5pre4 * From the definitions sntp-opts.def * and the template file options * @@ -91,9 +91,9 @@ typedef enum { /** count of all options for sntp */ #define OPTION_CT 23 /** sntp version */ -#define SNTP_VERSION "4.2.8p1" +#define SNTP_VERSION "4.2.8p2" /** Full sntp version text */ -#define SNTP_FULL_VERSION "sntp 4.2.8p1" +#define SNTP_FULL_VERSION "sntp 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/sntp/sntp.1sntpman b/contrib/ntp/sntp/sntp.1sntpman index 36bdfbd42c9f3..1b636e9843b00 100644 --- a/contrib/ntp/sntp/sntp.1sntpman +++ b/contrib/ntp/sntp/sntp.1sntpman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH sntp 1sntpman "04 Feb 2015" "4.2.8p1" "User Commands" +.TH sntp 1sntpman "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-apayaT/ag-zpaq_S) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E6aqmA/ag-76ailA) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:34:13 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:18:00 AM by AutoGen 5.18.5pre4 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -72,7 +72,8 @@ Otherwise, only the is displayed. Finally, the \fIstratum\f[] -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .SH "OPTIONS" .TP .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] diff --git a/contrib/ntp/sntp/sntp.1sntpmdoc b/contrib/ntp/sntp/sntp.1sntpmdoc index 26444f5aff2e5..5a84a80ff4ce3 100644 --- a/contrib/ntp/sntp/sntp.1sntpmdoc +++ b/contrib/ntp/sntp/sntp.1sntpmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt SNTP 1sntpmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:18:06 AM by AutoGen 5.18.5pre4 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -57,7 +57,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .Sh "OPTIONS" .Bl -tag .It Fl 4 , Fl \-ipv4 diff --git a/contrib/ntp/sntp/sntp.html b/contrib/ntp/sntp/sntp.html index cac641afb391f..5b41a7f4d2a28 100644 --- a/contrib/ntp/sntp/sntp.html +++ b/contrib/ntp/sntp/sntp.html @@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server clock. Run as root, it can correct the system clock to this offset as well. It can be run as an interactive command or from a cron job. - <p>This document applies to version 4.2.8p1 of <code>sntp</code>. + <p>This document applies to version 4.2.8p2 of <code>sntp</code>. <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. @@ -127,7 +127,8 @@ Otherwise, only the is displayed. Finally, the <em>stratum</em> -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. <p>This section was generated by <strong>AutoGen</strong>, using the <code>agtexi-cmd</code> template and the option descriptions for the <code>sntp</code> program. @@ -175,7 +176,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1 +<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2 Usage: sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \ [ hostname-or-IP ...] Flg Arg Option-Name Description diff --git a/contrib/ntp/sntp/sntp.man.in b/contrib/ntp/sntp/sntp.man.in index 3a6f9c5e95391..a1a3e0719fa39 100644 --- a/contrib/ntp/sntp/sntp.man.in +++ b/contrib/ntp/sntp/sntp.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH sntp @SNTP_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.TH sntp @SNTP_MS@ "07 Apr 2015" "4.2.8p2" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-apayaT/ag-zpaq_S) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E6aqmA/ag-76ailA) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:34:13 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:18:00 AM by AutoGen 5.18.5pre4 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -72,7 +72,8 @@ Otherwise, only the is displayed. Finally, the \fIstratum\f[] -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .SH "OPTIONS" .TP .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] diff --git a/contrib/ntp/sntp/sntp.mdoc.in b/contrib/ntp/sntp/sntp.mdoc.in index 9b66208f171bf..31a42685c0be6 100644 --- a/contrib/ntp/sntp/sntp.mdoc.in +++ b/contrib/ntp/sntp/sntp.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt SNTP @SNTP_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:18:06 AM by AutoGen 5.18.5pre4 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -57,7 +57,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .Sh "OPTIONS" .Bl -tag .It Fl 4 , Fl \-ipv4 diff --git a/contrib/ntp/sntp/tests/Makefile.in b/contrib/ntp/sntp/tests/Makefile.in index 73b78daf6bb93..194af0f7754c9 100644 --- a/contrib/ntp/sntp/tests/Makefile.in +++ b/contrib/ntp/sntp/tests/Makefile.in @@ -44,8 +44,6 @@ subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/libevent/m4/openldap.m4 \ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -65,8 +63,10 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \ - $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/openldap-thread-check.m4 \ + $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -295,6 +295,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ abs_builddir = @abs_builddir@ diff --git a/contrib/ntp/tests/Makefile.in b/contrib/ntp/tests/Makefile.in index 664785610be92..0b88e406c5e28 100644 --- a/contrib/ntp/tests/Makefile.in +++ b/contrib/ntp/tests/Makefile.in @@ -42,8 +42,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -72,6 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -328,6 +329,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/tests/libntp/Makefile.in b/contrib/ntp/tests/libntp/Makefile.in index b5b667b61fb12..233c3ef193535 100644 --- a/contrib/ntp/tests/libntp/Makefile.in +++ b/contrib/ntp/tests/libntp/Makefile.in @@ -44,8 +44,7 @@ subdir = tests/libntp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -74,6 +73,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -342,6 +343,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/tests/ntpd/Makefile.in b/contrib/ntp/tests/ntpd/Makefile.in index a9975b4977772..bb51457a5c6ce 100644 --- a/contrib/ntp/tests/ntpd/Makefile.in +++ b/contrib/ntp/tests/ntpd/Makefile.in @@ -44,8 +44,7 @@ subdir = tests/ntpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -74,6 +73,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -345,6 +346,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ diff --git a/contrib/ntp/util/Makefile.am b/contrib/ntp/util/Makefile.am index 88bf7cb022be1..8a47a3c554a3d 100644 --- a/contrib/ntp/util/Makefile.am +++ b/contrib/ntp/util/Makefile.am @@ -112,7 +112,7 @@ $(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true ) -jitter_SOURCES= jitter.c jitter.h +jitter_SOURCES= jitter.c jitter_LDADD= kern.o: kern.c diff --git a/contrib/ntp/util/Makefile.in b/contrib/ntp/util/Makefile.in index 0325e445d648c..f4fc7124331a2 100644 --- a/contrib/ntp/util/Makefile.in +++ b/contrib/ntp/util/Makefile.in @@ -52,8 +52,7 @@ subdir = util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ - $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ $(top_srcdir)/sntp/m4/define_dir.m4 \ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ $(top_srcdir)/sntp/m4/libtool.m4 \ @@ -82,6 +81,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac @@ -436,6 +437,11 @@ TIMETRIM_DL = @TIMETRIM_DL@ TIMETRIM_DS = @TIMETRIM_DS@ TIMETRIM_MS = @TIMETRIM_MS@ TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ VER_SUFFIX = @VER_SUFFIX@ YACC = @YACC@ @@ -554,7 +560,7 @@ std_def_list = \ $(top_srcdir)/sntp/include/version.def \ $(NULL) -jitter_SOURCES = jitter.c jitter.h +jitter_SOURCES = jitter.c jitter_LDADD = NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ diff --git a/contrib/ntp/util/invoke-ntp-keygen.texi b/contrib/ntp/util/invoke-ntp-keygen.texi index 808757dc94c23..0412485d48837 100644 --- a/contrib/ntp/util/invoke-ntp-keygen.texi +++ b/contrib/ntp/util/invoke-ntp-keygen.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi) # -# It has been AutoGen-ed February 4, 2015 at 02:43:59 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 7, 2015 at 04:27:46 AM by AutoGen 5.18.5pre4 # From the definitions ntp-keygen-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -886,7 +886,7 @@ with a status code of 0. @exampleindent 0 @example -ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p1 +ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2 Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... Flg Arg Option-Name Description -b Num imbits identity modulus bits diff --git a/contrib/ntp/util/jitter.c b/contrib/ntp/util/jitter.c index 62a84ade3d59f..c0050fca262ae 100644 --- a/contrib/ntp/util/jitter.c +++ b/contrib/ntp/util/jitter.c @@ -14,10 +14,9 @@ #include <stdio.h> #include <sys/time.h> #include <stdlib.h> -#include "jitter.h" +#include "ntp_fp.h" #define NBUF 800002 -#define FRAC 4294967296. /* a bbbbillion */ #define JAN_1970 2208988800UL /* Unix base epoch */ #define CLOCK_GETTIME /* Solaris hires clock */ diff --git a/contrib/ntp/util/jitter.h b/contrib/ntp/util/jitter.h deleted file mode 100644 index 14314063b59ae..0000000000000 --- a/contrib/ntp/util/jitter.h +++ /dev/null @@ -1,401 +0,0 @@ -/* - * ntp_types.h - defines how int32 and u_int32 are treated. - * For 64 bit systems like the DEC Alpha, they have to be defined - * as int and u_int. - * For 32 bit systems, define them as long and u_long - */ -#define SIZEOF_INT 4 - -/* - * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H, - * and u_int isn't defined anywhere - */ -#if defined(VMS) -#include <socket.h> -typedef unsigned int u_int; -/* - * Note: VMS DECC has long == int (even on __alpha), - * so the distinction below doesn't matter - */ -#endif /* VMS */ - -#if (SIZEOF_INT == 4) -# ifndef int32 -# define int32 int -# endif -# ifndef u_int32 -# define u_int32 unsigned int -# endif -#else /* not sizeof(int) == 4 */ -# if (SIZEOF_LONG == 4) -# else /* not sizeof(long) == 4 */ -# ifndef int32 -# define int32 long -# endif -# ifndef u_int32 -# define u_int32 unsigned long -# endif -# endif /* not sizeof(long) == 4 */ -# include "Bletch: what's 32 bits on this machine?" -#endif /* not sizeof(int) == 4 */ - -typedef unsigned short associd_t; /* association ID */ -typedef u_int32 keyid_t; /* cryptographic key ID */ -typedef u_int32 tstamp_t; /* NTP seconds timestamp */ - -/* - * NTP uses two fixed point formats. The first (l_fp) is the "long" - * format and is 64 bits long with the decimal between bits 31 and 32. - * This is used for time stamps in the NTP packet header (in network - * byte order) and for internal computations of offsets (in local host - * byte order). We use the same structure for both signed and unsigned - * values, which is a big hack but saves rewriting all the operators - * twice. Just to confuse this, we also sometimes just carry the - * fractional part in calculations, in both signed and unsigned forms. - * Anyway, an l_fp looks like: - * - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Integral Part | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Fractional Part | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * - */ -typedef struct { - union { - u_int32 Xl_ui; - int32 Xl_i; - } Ul_i; - union { - u_int32 Xl_uf; - int32 Xl_f; - } Ul_f; -} l_fp; - -#define l_ui Ul_i.Xl_ui /* unsigned integral part */ -#define l_i Ul_i.Xl_i /* signed integral part */ -#define l_uf Ul_f.Xl_uf /* unsigned fractional part */ -#define l_f Ul_f.Xl_f /* signed fractional part */ - -/* - * Fractional precision (of an l_fp) is actually the number of - * bits in a long. - */ -#define FRACTION_PREC (32) - - -/* - * The second fixed point format is 32 bits, with the decimal between - * bits 15 and 16. There is a signed version (s_fp) and an unsigned - * version (u_fp). This is used to represent synchronizing distance - * and synchronizing dispersion in the NTP packet header (again, in - * network byte order) and internally to hold both distance and - * dispersion values (in local byte order). In network byte order - * it looks like: - * - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Integer Part | Fraction Part | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * - */ -typedef int32 s_fp; -typedef u_int32 u_fp; - -/* - * A unit second in fp format. Actually 2**(half_the_bits_in_a_long) - */ -#define FP_SECOND (0x10000) - -/* - * Byte order conversions - */ -#define HTONS_FP(x) (htonl(x)) -#define HTONL_FP(h, n) do { (n)->l_ui = htonl((h)->l_ui); \ - (n)->l_uf = htonl((h)->l_uf); } while (0) -#define NTOHS_FP(x) (ntohl(x)) -#define NTOHL_FP(n, h) do { (h)->l_ui = ntohl((n)->l_ui); \ - (h)->l_uf = ntohl((n)->l_uf); } while (0) -#define NTOHL_MFP(ni, nf, hi, hf) \ - do { (hi) = ntohl(ni); (hf) = ntohl(nf); } while (0) -#define HTONL_MFP(hi, hf, ni, nf) \ - do { (ni) = ntohl(hi); (nf) = ntohl(hf); } while (0) - -/* funny ones. Converts ts fractions to net order ts */ -#define HTONL_UF(uf, nts) \ - do { (nts)->l_ui = 0; (nts)->l_uf = htonl(uf); } while (0) -#define HTONL_F(f, nts) do { (nts)->l_uf = htonl(f); \ - if ((f) & 0x80000000) \ - (nts)->l_i = -1; \ - else \ - (nts)->l_i = 0; \ - } while (0) - -/* - * Conversions between the two fixed point types - */ -#define MFPTOFP(x_i, x_f) (((int)(x_i) >= 0x00010000) ? 0x7fffffff : \ - (((int)(x_i) <= -0x00010000) ? 0x80000000 : \ - (u_int)(((x_i)<<16) | (((x_f)>>16)&0xffff)))) -#define LFPTOFP(v) MFPTOFP((v)->l_i, (v)->l_f) - -#define UFPTOLFP(x, v) ((v)->l_ui = (u_fp)(x)>>16, (v)->l_uf = (x)<<16) -#define FPTOLFP(x, v) (UFPTOLFP((x), (v)), (x) < 0 ? (v)->l_ui -= 0x10000 : 0) - -#define MAXLFP(v) ((v)->l_ui = 0x7fffffff, (v)->l_uf = 0xffffffff) -#define MINLFP(v) ((v)->l_ui = 0x80000000, (v)->l_uf = 0) - -/* - * Primitive operations on long fixed point values. If these are - * reminiscent of assembler op codes it's only because some may - * be replaced by inline assembler for particular machines someday. - * These are the (kind of inefficient) run-anywhere versions. - */ -#define M_NEG(v_i, v_f) /* v = -v */ \ - do { \ - if ((v_f) == 0) \ - (v_i) = -((s_fp)(v_i)); \ - else { \ - (v_f) = -((s_fp)(v_f)); \ - (v_i) = ~(v_i); \ - } \ - } while(0) - -#define M_NEGM(r_i, r_f, a_i, a_f) /* r = -a */ \ - do { \ - if ((a_f) == 0) { \ - (r_f) = 0; \ - (r_i) = -(a_i); \ - } else { \ - (r_f) = -(a_f); \ - (r_i) = ~(a_i); \ - } \ - } while(0) - -#define M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \ - do { \ - register u_int32 lo_tmp; \ - register u_int32 hi_tmp; \ - \ - lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \ - hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \ - if (lo_tmp & 0x10000) \ - hi_tmp++; \ - (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \ - \ - (r_i) += (a_i); \ - if (hi_tmp & 0x10000) \ - (r_i)++; \ - } while (0) - -#define M_ADD3(r_ovr, r_i, r_f, a_ovr, a_i, a_f) /* r += a, three word */ \ - do { \ - register u_int32 lo_tmp; \ - register u_int32 hi_tmp; \ - \ - lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \ - hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \ - if (lo_tmp & 0x10000) \ - hi_tmp++; \ - (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \ - \ - lo_tmp = ((r_i) & 0xffff) + ((a_i) & 0xffff); \ - if (hi_tmp & 0x10000) \ - lo_tmp++; \ - hi_tmp = (((r_i) >> 16) & 0xffff) + (((a_i) >> 16) & 0xffff); \ - if (lo_tmp & 0x10000) \ - hi_tmp++; \ - (r_i) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \ - \ - (r_ovr) += (a_ovr); \ - if (hi_tmp & 0x10000) \ - (r_ovr)++; \ - } while (0) - -#define M_SUB(r_i, r_f, a_i, a_f) /* r -= a */ \ - do { \ - register u_int32 lo_tmp; \ - register u_int32 hi_tmp; \ - \ - if ((a_f) == 0) { \ - (r_i) -= (a_i); \ - } else { \ - lo_tmp = ((r_f) & 0xffff) + ((-((s_fp)(a_f))) & 0xffff); \ - hi_tmp = (((r_f) >> 16) & 0xffff) \ - + (((-((s_fp)(a_f))) >> 16) & 0xffff); \ - if (lo_tmp & 0x10000) \ - hi_tmp++; \ - (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \ - \ - (r_i) += ~(a_i); \ - if (hi_tmp & 0x10000) \ - (r_i)++; \ - } \ - } while (0) - -#define M_RSHIFTU(v_i, v_f) /* v >>= 1, v is unsigned */ \ - do { \ - (v_f) = (u_int32)(v_f) >> 1; \ - if ((v_i) & 01) \ - (v_f) |= 0x80000000; \ - (v_i) = (u_int32)(v_i) >> 1; \ - } while (0) - -#define M_RSHIFT(v_i, v_f) /* v >>= 1, v is signed */ \ - do { \ - (v_f) = (u_int32)(v_f) >> 1; \ - if ((v_i) & 01) \ - (v_f) |= 0x80000000; \ - if ((v_i) & 0x80000000) \ - (v_i) = ((v_i) >> 1) | 0x80000000; \ - else \ - (v_i) = (v_i) >> 1; \ - } while (0) - -#define M_LSHIFT(v_i, v_f) /* v <<= 1 */ \ - do { \ - (v_i) <<= 1; \ - if ((v_f) & 0x80000000) \ - (v_i) |= 0x1; \ - (v_f) <<= 1; \ - } while (0) - -#define M_LSHIFT3(v_ovr, v_i, v_f) /* v <<= 1, with overflow */ \ - do { \ - (v_ovr) <<= 1; \ - if ((v_i) & 0x80000000) \ - (v_ovr) |= 0x1; \ - (v_i) <<= 1; \ - if ((v_f) & 0x80000000) \ - (v_i) |= 0x1; \ - (v_f) <<= 1; \ - } while (0) - -#define M_ADDUF(r_i, r_f, uf) /* r += uf, uf is u_int32 fraction */ \ - M_ADD((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */ - -#define M_SUBUF(r_i, r_f, uf) /* r -= uf, uf is u_int32 fraction */ \ - M_SUB((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */ - -#define M_ADDF(r_i, r_f, f) /* r += f, f is a int32 fraction */ \ - do { \ - if ((f) > 0) \ - M_ADD((r_i), (r_f), 0, (f)); \ - else if ((f) < 0) \ - M_ADD((r_i), (r_f), (-1), (f));\ - } while(0) - -#define M_ISNEG(v_i, v_f) /* v < 0 */ \ - (((v_i) & 0x80000000) != 0) - -#define M_ISHIS(a_i, a_f, b_i, b_f) /* a >= b unsigned */ \ - (((u_int32)(a_i)) > ((u_int32)(b_i)) || \ - ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f)))) - -#define M_ISGEQ(a_i, a_f, b_i, b_f) /* a >= b signed */ \ - (((int32)(a_i)) > ((int32)(b_i)) || \ - ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f)))) - -#define M_ISEQU(a_i, a_f, b_i, b_f) /* a == b unsigned */ \ - ((a_i) == (b_i) && (a_f) == (b_f)) - -/* - * Operations on the long fp format - */ -#define L_ADD(r, a) M_ADD((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf) -#define L_SUB(r, a) M_SUB((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf) -#define L_NEG(v) M_NEG((v)->l_ui, (v)->l_uf) -#define L_ADDUF(r, uf) M_ADDUF((r)->l_ui, (r)->l_uf, (uf)) -#define L_SUBUF(r, uf) M_SUBUF((r)->l_ui, (r)->l_uf, (uf)) -#define L_ADDF(r, f) M_ADDF((r)->l_ui, (r)->l_uf, (f)) -#define L_RSHIFT(v) M_RSHIFT((v)->l_i, (v)->l_uf) -#define L_RSHIFTU(v) M_RSHIFT((v)->l_ui, (v)->l_uf) -#define L_LSHIFT(v) M_LSHIFT((v)->l_ui, (v)->l_uf) -#define L_CLR(v) ((v)->l_ui = (v)->l_uf = 0) - -#define L_ISNEG(v) (((v)->l_ui & 0x80000000) != 0) -#define L_ISZERO(v) ((v)->l_ui == 0 && (v)->l_uf == 0) -#define L_ISHIS(a, b) ((a)->l_ui > (b)->l_ui || \ - ((a)->l_ui == (b)->l_ui && (a)->l_uf >= (b)->l_uf)) -#define L_ISGEQ(a, b) ((a)->l_i > (b)->l_i || \ - ((a)->l_i == (b)->l_i && (a)->l_uf >= (b)->l_uf)) -#define L_ISEQU(a, b) M_ISEQU((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf) - -/* - * s_fp/double and u_fp/double conversions - */ -#define FRIC 65536. /* 2^16 as a double */ -#define DTOFP(r) ((s_fp)((r) * FRIC)) -#define DTOUFP(r) ((u_fp)((r) * FRIC)) -#define FPTOD(r) ((double)(r) / FRIC) - -/* - * l_fp/double conversions - */ -#define FRAC 4294967296. /* 2^32 as a double */ -#define M_DTOLFP(d, r_i, r_uf) /* double to l_fp */ \ - do { \ - register double d_tmp; \ - \ - d_tmp = (d); \ - if (d_tmp < 0) { \ - d_tmp = -d_tmp; \ - (r_i) = (int32)(d_tmp); \ - (r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \ - M_NEG((r_i), (r_uf)); \ - } else { \ - (r_i) = (int32)(d_tmp); \ - (r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \ - } \ - } while (0) -#define M_LFPTOD(r_i, r_uf, d) /* l_fp to double */ \ - do { \ - register l_fp l_tmp; \ - \ - l_tmp.l_i = (r_i); \ - l_tmp.l_f = (r_uf); \ - if (l_tmp.l_i < 0) { \ - M_NEG(l_tmp.l_i, l_tmp.l_uf); \ - (d) = -((double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC); \ - } else { \ - (d) = (double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC; \ - } \ - } while (0) -#define DTOLFP(d, v) M_DTOLFP((d), (v)->l_ui, (v)->l_uf) -#define LFPTOD(v, d) M_LFPTOD((v)->l_ui, (v)->l_uf, (d)) - -/* - * Prototypes - */ -#if 0 -extern char * dofptoa (u_fp, int, short, int); -extern char * dolfptoa (u_long, u_long, int, short, int); -#endif - -extern int atolfp (const char *, l_fp *); -extern int buftvtots (const char *, l_fp *); -extern char * fptoa (s_fp, short); -extern char * fptoms (s_fp, short); -extern int hextolfp (const char *, l_fp *); -extern void gpstolfp (int, int, unsigned long, l_fp *); -extern int mstolfp (const char *, l_fp *); -extern char * prettydate (l_fp *); -extern char * gmprettydate (l_fp *); -extern char * uglydate (l_fp *); -extern void mfp_mul (int32 *, u_int32 *, int32, u_int32, int32, u_int32); - -extern void get_systime (l_fp *); -extern int step_systime (double); -extern int adj_systime (double); - -#define lfptoa(_fpv, _ndec) mfptoa((_fpv)->l_ui, (_fpv)->l_uf, (_ndec)) -#define lfptoms(_fpv, _ndec) mfptoms((_fpv)->l_ui, (_fpv)->l_uf, (_ndec)) - -#define ufptoa(_fpv, _ndec) dofptoa((_fpv), 0, (_ndec), 0) -#define ufptoms(_fpv, _ndec) dofptoa((_fpv), 0, (_ndec), 1) -#define ulfptoa(_fpv, _ndec) dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 0) -#define ulfptoms(_fpv, _ndec) dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 1) -#define umfptoa(_fpi, _fpf, _ndec) dolfptoa((_fpi), (_fpf), 0, (_ndec), 0) diff --git a/contrib/ntp/util/ntp-keygen-opts.c b/contrib/ntp/util/ntp-keygen-opts.c index aff2d01de3ab1..8521861ebbbb7 100644 --- a/contrib/ntp/util/ntp-keygen-opts.c +++ b/contrib/ntp/util/ntp-keygen-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) * - * It has been AutoGen-ed February 4, 2015 at 02:43:42 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:27:30 AM by AutoGen 5.18.5pre4 * From the definitions ntp-keygen-opts.def * and the template file options * @@ -72,7 +72,7 @@ extern FILE * option_usage_fp; * static const strings for ntp-keygen options */ static char const ntp_keygen_opt_strs[2419] = -/* 0 */ "ntp-keygen (ntp) 4.2.8p1\n" +/* 0 */ "ntp-keygen (ntp) 4.2.8p2\n" "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" @@ -164,14 +164,14 @@ static char const ntp_keygen_opt_strs[2419] = /* 2202 */ "no-load-opts\0" /* 2215 */ "no\0" /* 2218 */ "NTP_KEYGEN\0" -/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p1\n" +/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" /* 2343 */ "$HOME\0" /* 2349 */ ".\0" /* 2351 */ ".ntprc\0" /* 2358 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 2392 */ "\n\0" -/* 2394 */ "ntp-keygen (ntp) 4.2.8p1"; +/* 2394 */ "ntp-keygen (ntp) 4.2.8p2"; /** * imbits option description: @@ -1309,7 +1309,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntp_keygenOptions.pzCopyright */ - puts(_("ntp-keygen (ntp) 4.2.8p1\n\ + puts(_("ntp-keygen (ntp) 4.2.8p2\n\ Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ @@ -1408,14 +1408,14 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntp_keygenOptions.pzUsageTitle */ - puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p1\n\ + puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); /* referenced via ntp_keygenOptions.pzExplain */ puts(_("\n")); /* referenced via ntp_keygenOptions.pzFullVersion */ - puts(_("ntp-keygen (ntp) 4.2.8p1")); + puts(_("ntp-keygen (ntp) 4.2.8p2")); /* referenced via ntp_keygenOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/util/ntp-keygen-opts.h b/contrib/ntp/util/ntp-keygen-opts.h index 48489999dda5a..54f1ac400794b 100644 --- a/contrib/ntp/util/ntp-keygen-opts.h +++ b/contrib/ntp/util/ntp-keygen-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) * - * It has been AutoGen-ed February 4, 2015 at 02:43:41 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 7, 2015 at 04:27:29 AM by AutoGen 5.18.5pre4 * From the definitions ntp-keygen-opts.def * and the template file options * @@ -94,9 +94,9 @@ typedef enum { /** count of all options for ntp-keygen */ #define OPTION_CT 26 /** ntp-keygen version */ -#define NTP_KEYGEN_VERSION "4.2.8p1" +#define NTP_KEYGEN_VERSION "4.2.8p2" /** Full ntp-keygen version text */ -#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p1" +#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p2" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenman b/contrib/ntp/util/ntp-keygen.1ntp-keygenman index 46bbad8294f6d..b600ed4b830f6 100644 --- a/contrib/ntp/util/ntp-keygen.1ntp-keygenman +++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp-keygen 1ntp-keygenman "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntp-keygen 1ntp-keygenman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Xkaqsu/ag-9kairu) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Kfaqzc/ag-Wfaiyc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:55 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:42 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc index d70ca2c4e5e5d..ad8a96d786ea9 100644 --- a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc +++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:44:02 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:49 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-keygen-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/util/ntp-keygen.c b/contrib/ntp/util/ntp-keygen.c index c16902161297e..494bedb19d247 100644 --- a/contrib/ntp/util/ntp-keygen.c +++ b/contrib/ntp/util/ntp-keygen.c @@ -827,24 +827,24 @@ gen_md5( str = fheader("MD5key", id, groupname); for (i = 1; i <= MD5KEYS; i++) { for (j = 0; j < MD5SIZE; j++) { - int temp; + u_char temp; while (1) { int rc; - rc = ntp_crypto_random_buf(&temp, 1); + rc = ntp_crypto_random_buf( + &temp, sizeof(temp)); if (-1 == rc) { fprintf(stderr, "ntp_crypto_random_buf() failed.\n"); exit (-1); } - temp &= 0xff; if (temp == '#') continue; if (temp > 0x20 && temp < 0x7f) break; } - md5key[j] = (u_char)temp; + md5key[j] = temp; } md5key[j] = '\0'; fprintf(str, "%2d MD5 %s # MD5 key\n", i, @@ -2170,15 +2170,29 @@ fheader ( FILE *str; /* file handle */ char linkname[MAXFILENAME]; /* link name */ int temp; - +#ifdef HAVE_UMASK + mode_t orig_umask; +#endif + snprintf(filename, sizeof(filename), "ntpkey_%s_%s.%u", file, owner, fstamp); - if ((str = fopen(filename, "w")) == NULL) { +#ifdef HAVE_UMASK + orig_umask = umask( S_IWGRP | S_IRWXO ); + str = fopen(filename, "w"); + (void) umask(orig_umask); +#else + str = fopen(filename, "w"); +#endif + if (str == NULL) { perror("Write"); exit (-1); } - snprintf(linkname, sizeof(linkname), "ntpkey_%s_%s", ulink, - hostname); + if (strcmp(ulink, "md5") == 0) { + strcpy(linkname,"ntp.keys"); + } else { + snprintf(linkname, sizeof(linkname), "ntpkey_%s_%s", ulink, + hostname); + } (void)remove(linkname); /* The symlink() line below matters */ temp = symlink(filename, linkname); if (temp < 0) diff --git a/contrib/ntp/util/ntp-keygen.html b/contrib/ntp/util/ntp-keygen.html index 3b950ec843ebc..1aad39b3d3963 100644 --- a/contrib/ntp/util/ntp-keygen.html +++ b/contrib/ntp/util/ntp-keygen.html @@ -70,7 +70,7 @@ All other files are in PEM-encoded printable ASCII format so they can be embedded as MIME attachments in mail to other sites. - <p>This document applies to version 4.2.8p1 of <code>ntp-keygen</code>. + <p>This document applies to version 4.2.8p2 of <code>ntp-keygen</code>. <div class="node"> <p><hr> @@ -1085,7 +1085,7 @@ the usage text by passing it through a pager program. used to select the program, defaulting to <span class="file">more</span>. Both will exit with a status code of 0. -<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p1-RC2 +<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2-RC3 Usage: ntp-keygen [ -<flag> [<val>] | --<name>[{=| }<val>] ]... Flg Arg Option-Name Description -b Num imbits identity modulus bits diff --git a/contrib/ntp/util/ntp-keygen.man.in b/contrib/ntp/util/ntp-keygen.man.in index 6242382b020cf..b47691b9eabcd 100644 --- a/contrib/ntp/util/ntp-keygen.man.in +++ b/contrib/ntp/util/ntp-keygen.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp-keygen @NTP_KEYGEN_MS@ "04 Feb 2015" "ntp (4.2.8p1)" "User Commands" +.TH ntp-keygen @NTP_KEYGEN_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Xkaqsu/ag-9kairu) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Kfaqzc/ag-Wfaiyc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:43:55 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:42 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/util/ntp-keygen.mdoc.in b/contrib/ntp/util/ntp-keygen.mdoc.in index da99a8deb64f5..540ff4f36b7f7 100644 --- a/contrib/ntp/util/ntp-keygen.mdoc.in +++ b/contrib/ntp/util/ntp-keygen.mdoc.in @@ -1,9 +1,9 @@ -.Dd February 4 2015 +.Dd April 7 2015 .Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc) .\" -.\" It has been AutoGen-ed February 4, 2015 at 02:44:02 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 7, 2015 at 04:27:49 AM by AutoGen 5.18.5pre4 .\" From the definitions ntp-keygen-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/openresolv/GNUmakefile b/contrib/openresolv/GNUmakefile new file mode 100644 index 0000000000000..4bc845ab3c890 --- /dev/null +++ b/contrib/openresolv/GNUmakefile @@ -0,0 +1,4 @@ +# Nasty hack so that make clean works without configure being run +CONFIG_MK?=$(shell test -e config.mk && echo config.mk || echo config-null.mk) + +include Makefile diff --git a/contrib/openresolv/Makefile b/contrib/openresolv/Makefile index e4e3498ac9f4c..aca2cb531769d 100644 --- a/contrib/openresolv/Makefile +++ b/contrib/openresolv/Makefile @@ -1,8 +1,19 @@ -include config.mk +PKG= openresolv +VERSION= 3.7.0 -NAME= openresolv -VERSION= 3.4.1 -PKG= ${NAME}-${VERSION} +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf +RCDIR?= /etc/rc.d +RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ + ${RCDIR}/\1 restart; \ + fi INSTALL?= install SED?= sed @@ -17,31 +28,36 @@ TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake -SED_PREFIX= -e 's:@PREFIX@:${PREFIX}:g' +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +DISTPREFIX?= ${PKG}-${VERSION} +DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.bz2 +FOSSILID?= current + .SUFFIXES: .in all: ${TARGET} .in: - ${SED} ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ $< > $@ clean: - rm -f ${TARGET} openresolv-${VERSION}.tar.bz2 + rm -f ${TARGET} distclean: clean - rm -f config.mk + rm -f config.mk ${DISTFILE} installdirs: -install: ${TARGET} +proginstall: ${TARGET} ${INSTALL} -d ${DESTDIR}${SBINDIR} ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} @@ -49,18 +65,21 @@ install: ${TARGET} ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} + +maninstall: ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 +install: proginstall maninstall + import: - rm -rf /tmp/${PKG} - ${INSTALL} -d /tmp/${PKG} - cp README ${SRCS} /tmp/${PKG} + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp README ${SRCS} /tmp/${DISPREFIX} -dist: import - cp configure Makefile resolvconf.conf /tmp/${PKG} - tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} - rm -rf /tmp/${PKG} - ls -l ${PKG}.tar.bz2 +dist: + fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} + gunzip -c ${DISTFILEGZ} | bzip2 >${DISTFILE} + rm ${DISTFILEGZ} diff --git a/contrib/openresolv/config-null.mk b/contrib/openresolv/config-null.mk new file mode 100644 index 0000000000000..6bf701d5aa6be --- /dev/null +++ b/contrib/openresolv/config-null.mk @@ -0,0 +1 @@ +# This space left intentionally blank diff --git a/contrib/openresolv/configure b/contrib/openresolv/configure index 39bdddb65412d..190ee71a9f926 100644 --- a/contrib/openresolv/configure +++ b/contrib/openresolv/configure @@ -9,7 +9,7 @@ TARGET= RESTARTCMD= RCDIR= -for x; do +for x do opt=${x%%=*} var=${x#*=} case "$opt" in @@ -18,7 +18,7 @@ for x; do --debug) DEBUG=$var;; --disable-debug) DEBUG=no;; --enable-debug) DEBUG=yes;; - --prefix) prefix=$var;; + --prefix) PREFIX=$var;; --sysconfdir) SYSCONFDIR=$var;; --bindir|--sbindir) SBINDIR=$var;; --libexecdir) LIBEXECDIR=$var;; @@ -41,68 +41,76 @@ for x; do esac done +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + : ${SED:=sed} -: ${PREFIX:=$prefix} : ${SYSCONFDIR:=$PREFIX/etc} : ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} : ${STATEDIR:=/var} : ${RUNDIR:=$STATEDIR/run} : ${MANDIR:=${PREFIX:-/usr}/share/man} eval SYSCONFDIR="$SYSCONFDIR" eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR/resolvconf" +eval LIBEXECDIR="$LIBEXECDIR" eval VARDIR="$RUNDIR/resolvconf" eval MANDIR="$MANDIR" CONFIG_MK=config.mk if [ -z "$BUILD" ]; then - BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'` -fi -if [ -z "$HOST" ]; then - [ -z "$TARGET" ] && TARGET=$BUILD - HOST=$TARGET -fi -if [ -z "$TARGET" ]; then - [ -z "$HOST" ] && HOST=$BUILD - TARGET=$HOST -fi - -# Debian and Slackware have linux in different places when dealing with -# autoconf, so we deal with that here. -if [ -z "$OS" ]; then - case "$TARGET" in - *-linux-*|linux-*|*-linux|linux) OS=linux;; - esac + # autoconf target triplet: cpu-vendor-os + BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]') fi +: ${HOST:=$BUILD} if [ -z "$OS" ]; then - # Derive OS from cpu-manufacturer-os-kernel - CPU=${TARGET%%-*} - REST=${TARGET#*-} + echo "Deriving operating system from ... $HOST" + # Derive OS from cpu-vendor-[kernel-]os + CPU=${HOST%%-*} + REST=${HOST#*-} if [ "$CPU" != "$REST" ]; then - MANU=${REST%%-*} + VENDOR=${REST%%-*} REST=${REST#*-} - if [ "$MANU" != "$REST" ]; then + if [ "$VENDOR" != "$REST" ]; then + # Use kernel if given, otherwise os OS=${REST%%-*} - REST=${REST#*-} - if [ "$OS" != "$REST" ]; then - KERNEL=${REST%%-*} - else - # 3 tupple - KERNEL=$OS - OS=$MANU - MANU= - fi else # 2 tupple - OS=$MANU - MANU= + OS=$VENDOR + VENDOR= fi fi + + # Work with cpu-kernel-os, ie Debian + case "$VENDOR" in + linux*|kfreebsd*) OS=$VENDOR; VENDOR= ;; + esac + # Special case + case "$OS" in + gnu*) OS=hurd;; # No HURD support as yet + esac fi echo "Configuring openresolv for ... $OS" @@ -118,17 +126,36 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR; do echo "$x=$t $v" >>$CONFIG_MK done -if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - echo "Overriding service status check for Arch Linux" - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" +if [ -z "$RESTARTCMD" ]; then + printf "Checking for systemd ... " + if [ -x /bin/systemctl ]; then + RESTARTCMD="/bin/systemctl try-restart \1" + echo "yes" + elif [ -x /usr/bin/systemctl ]; then + RESTARTCMD="/usr/bin/systemctl try-restart \1" + echo "yes" + else + echo "no" + fi +fi + +# Arch upgraded to systemd, so this check has to be just after systemd +# but higher than the others +if [ -z "$RESTARTCMD" ]; then + printf "Checking for Arch ... " + if [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" + echo "yes" + else + echo "no" + fi fi if [ -z "$RESTARTCMD" ]; then printf "Checking for OpenRC ... " if [ -x /sbin/rc-service ]; then - RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart" + RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" echo "yes" else echo "no" @@ -138,7 +165,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for invoke-rc.d ... " if [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart" + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" echo "yes" else echo "no" @@ -148,7 +175,19 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for service ... " if [ -x /sbin/service ]; then RCDIR=/etc/init.d - RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart" + RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" + echo "yes" + else + echo "no" + fi +fi +if [ -z "$RESTARTCMD" ]; then + printf "Checking for runit... " + if [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \1" + echo "yes" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \1" echo "yes" else echo "no" @@ -159,7 +198,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for $x ... " if [ -d $x ]; then RCDIR=$x - RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart" + RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" echo "yes" break else @@ -169,7 +208,7 @@ if [ -z "$RESTARTCMD" ]; then fi if [ -z "$RESTARTCMD" ]; then - echo "WARNING! No means of interacting with system services detected!" + echo "$0: WARNING: No means of interacting with system services detected!" exit 1 fi diff --git a/contrib/openresolv/dnsmasq.in b/contrib/openresolv/dnsmasq.in index 178f4dd486153..1b6ad16640c75 100644 --- a/contrib/openresolv/dnsmasq.in +++ b/contrib/openresolv/dnsmasq.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -29,12 +29,13 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " : ${dnsmasq_pid:=/var/run/dnsmasq.pid} [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid +[ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" @@ -46,21 +47,18 @@ newresolv="$newconf" # so we need to validate a few things first. # Check for DBus support in the binary dbus=false -: ${dbus_pid:=/var/run/dbus/dbus.pid} -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid -if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then - if dnsmasq --version 2>/dev/null | \ - grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" +dbus_ex=false +dbus_introspect=$(dbus-send --print-reply --system \ + --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + org.freedesktop.DBus.Introspectable.Introspect \ + 2>/dev/null) +if [ $? = 0 ]; then + dbus=true + if printf %s "$dbus_introspect" | \ + grep -q '<method name="SetDomainServers">' then - # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "$dbus_pid") 2>/dev/null && \ - kill -0 $(cat "$dnsmasq_pid") 2>/dev/null - then - dbus=true - newconf="$newconf$NL# Domain specific servers will" - newconf="$newconf be sent over dbus${NL}enable-dbus$NL" - fi + dbus_ex=true fi fi @@ -69,30 +67,97 @@ for n in $NAMESERVERS; do done dbusdest= +dbusdest_ex= +conf= for d in $DOMAINS; do dn="${d%%:*}" ns="${d#*:}" while [ -n "$ns" ]; do - if $dbus; then - SIFS=${IFS-y} OIFS=$IFS - IFS=. - set -- ${ns%%,*} - num="0x$(printf %02x $1 $2 $3 $4)" - if [ "$SIFS" = yi ]; then - unset IFS - else - IFS=$OIFS - fi - dbusdest="$dbusdest uint32:$(printf %u $num)" - dbusdest="$dbusdest string:$dn" - else - newconf="${newconf}server=/$dn/${ns%%,*}$NL" + n="${ns%%,*}" + if $dbus && ! $dbus_ex; then + case "$n" in + *.*.*.*) + SIFS=${IFS-y} OIFS=$IFS + IFS=. + set -- $n + num="0x$(printf %02x $1 $2 $3 $4)" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="$dbusdest uint32:$(printf %u $num)" + dbusdest="$dbusdest string:$dn" + ;; + *:*%*) + # This version of dnsmasq won't accept + # scoped IPv6 addresses + dbus=false + ;; + *:*) + SIFS=${IFS-y} OIFS=$IFS bytes= front= back= + empty=false i=0 + IFS=: + set -- $n + while [ -n "$1" -o -n "$2" ]; do + addr="$1" + shift + if [ -z "$addr" ]; then + empty=true + continue + fi + i=$(($i + 1)) + while [ ${#addr} -lt 4 ]; do + addr="0${addr}" + done + byte1="$(printf %d 0x${addr%??})" + byte2="$(printf %d 0x${addr#??})" + if $empty; then + back="$back byte:$byte1 byte:$byte2" + else + front="$front byte:$byte1 byte:$byte2" + fi + done + while [ $i != 8 ]; do + i=$(($i + 1)) + front="$front byte:0 byte:0" + done + front="${front}$back" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="${dbusdest}$front string:$dn" + ;; + *) + if ! $dbus_ex; then + dbus=false + fi + ;; + esac fi + dbusdest_ex="$dbusdest_ex${dbusdest_ex:+,}/$dn/$n" + conf="${conf}server=/$dn/$n$NL" [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" done done +if $dbus; then + newconf="$newconf$NL# Domain specific servers will" + newconf="$newconf be sent over dbus${NL}" +else + newconf="$newconf$conf" +fi + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv" +else + @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" +fi + changed=false if [ -n "$dnsmasq_conf" ]; then if [ ! -f "$dnsmasq_conf" ] || \ @@ -103,14 +168,13 @@ if [ -n "$dnsmasq_conf" ]; then fi fi if [ -n "$dnsmasq_resolv" ]; then + # dnsmasq polls this file so no need to set changed=true if [ -f "$dnsmasq_resolv" ]; then if [ "$(cat "$dnsmasq_resolv")" != "$(printf %s "$newresolv")" ] then - changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi else - # dnsmasq polls this file so no need to set changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi fi @@ -119,9 +183,20 @@ if $changed; then eval $dnsmasq_restart fi if $dbus; then - $changed || kill -HUP $(cat "$dnsmasq_pid") + if [ -s "$dnsmasq_pid" ]; then + $changed || kill -HUP $(cat "$dnsmasq_pid") + fi # Send even if empty so old servers are cleared + if $dbus_ex; then + method=SetDomainServers + if [ -n "$dbusdest_ex" ]; then + dbusdest_ex="array:string:$dbusdest_ex" + fi + dbusdest="$dbusdest_ex" + else + method=SetServers + fi dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ - /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \ + /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest fi diff --git a/contrib/openresolv/libc.in b/contrib/openresolv/libc.in index cf0323e86a866..d4f6cc9a4a387 100644 --- a/contrib/openresolv/libc.in +++ b/contrib/openresolv/libc.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2014 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,18 +36,18 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - local key="$1" value= x= line= + local key="$1" x= line= shift if [ $# -eq 0 ]; then - while read line; do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac done else - for x; do - while read line; do + for x do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac @@ -56,6 +56,24 @@ key_get_value() fi } +keys_remove() +{ + local key x line found + + while read -r line; do + found=false + for key do + case "$line" in + "$key"*|"#"*|" "*|" "*|"") found=true;; + esac + $found && break + done + $found || echo "$line" + done +} + +local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -64,12 +82,11 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; then SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then - name_servers="$(key_get_value "nameserver " "$base")" - search_domains="$(key_get_value "search " "$base")" - if [ -z "$search_domains" ]; then - search_domains="$(key_get_value "domain " "$base")" - fi + prepend_nameservers="$(key_get_value "nameserver " "$base")" + domain="$(key_get_value "domain " "$base")" + prepend_search="$(key_get_value "search " "$base")" resolv_conf_options="$(key_get_value "options " "$base")" + resolv_conf_sortlist="$(key_get_value "sortlist " "$base")" fi if [ -f "$SYSCONFDIR"/resolv.conf.d/head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)" @@ -81,7 +98,7 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${libc_restart:=@RESTARTCMD ${libc_service}@} -: ${list_resolv:=@PREFIX@/sbin/resolvconf -l} +: ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi @@ -89,6 +106,9 @@ if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi +backup=true +signature="# Generated by resolvconf" + uniqify() { local result= @@ -104,6 +124,7 @@ uniqify() case "${resolv_conf_passthrough:-NO}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + backup=false newest= for conf in "$IFACEDIR"/*; do if [ -z "$newest" -o "$conf" -nt "$newest" ]; then @@ -113,31 +134,70 @@ case "${resolv_conf_passthrough:-NO}" in [ -z "$newest" ] && exit 0 newconf="$(cat "$newest")$NL" ;; +/dev/null|[Nn][Uu][Ll][Ll]) + : ${resolv_conf_local_only:=NO} + if [ "$local_nameservers" = "127.* 0.0.0.0 255.255.255.255 ::1" ]; then + local_nameservers= + fi + # Need to overwrite our variables. + eval "$(@SBINDIR@/resolvconf -V)" + ;; + +*) + [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" + ;; +esac +case "${resolv_conf_passthrough:-NO}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; *) - [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" - newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)" + : ${domain:=$DOMAIN} + newsearch="$(uniqify $prepend_search $SEARCH $append_search)" NS="$LOCALNAMESERVERS $NAMESERVERS" - newns="$(uniqify $name_servers $NS $name_servers_append)" + newns= + gotlocal=false + for n in $(uniqify $prepend_nameservers $NS $append_nameservers); do + add=true + islocal=false + for l in $local_nameservers; do + case "$n" in + $l) islocal=true; gotlocal=true; break;; + esac + done + if ! $islocal; then + case "${resolv_conf_local_only:-YES}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + $gotlocal && add=false;; + esac + fi + $add && newns="$newns $n" + done # Hold our new resolv.conf in a variable to save on temporary files - newconf="# Generated by resolvconf$NL" + newconf="$signature$NL" if [ -n "$resolv_conf_head" ]; then newconf="$newconf$resolv_conf_head$NL" fi - [ -n "$newsearch" ] && newconf="${newconf}search $newsearch$NL" + + [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" + if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then + newconf="${newconf}search $newsearch$NL" + fi for n in $newns; do newconf="${newconf}nameserver $n$NL" done - # Now get any configured options - opts="$resolv_conf_options${resolv_conf_options:+ }" - opts="$opts$($list_resolv | key_get_value "options ")" - if [ -n "$opts" ]; then - newconf="${newconf}options" - for opt in $(uniqify $opts); do - newconf="${newconf} $opt" - done - newconf="$newconf$NL" + # Now add anything we don't care about such as sortlist and options + stuff="$($list_resolv | keys_remove nameserver domain search)" + if [ -n "$stuff" ]; then + newconf="$newconf$stuff$NL" + fi + + # Append any user defined ones + if [ -n "$resolv_conf_options" ]; then + newconf="${newconf}options $resolv_conf_options$NL" + fi + if [ -n "$resolv_conf_sortlist" ]; then + newconf="${newconf}sortlist $resolv_conf_sortlist$NL" fi if [ -n "$resolv_conf_tail" ]; then @@ -151,6 +211,22 @@ if [ -e "$resolv_conf" ]; then [ "$(cat "$resolv_conf")" = "$(printf %s "$newconf")" ] && exit 0 fi +# Change is good. +# If the old file does not have our signature, back it up. +# If the new file just has our signature, restore the backup. +if $backup; then + if [ "$newconf" = "$signature$NL" ]; then + if [ -e "$resolv_conf.bak" ]; then + newconf="$(cat "$resolv_conf.bak")" + fi + elif [ -e "$resolv_conf" ]; then + read line <"$resolv_conf" + if [ "$line" != "$signature" ]; then + cp "$resolv_conf" "$resolv_conf.bak" + fi + fi +fi + # Create our resolv.conf now (umask 022; echo "$newconf" >"$resolv_conf") eval $libc_restart @@ -162,7 +238,7 @@ for script in "$LIBEXECDIR"/libc.d/*; do if [ -x "$script" ]; then "$script" "$@" else - (. "$script" "$@") + (. "$script") fi retval=$(($retval + $?)) fi diff --git a/contrib/openresolv/named.in b/contrib/openresolv/named.in index 47b10e0ceed59..43ceabb5e972c 100644 --- a/contrib/openresolv/named.in +++ b/contrib/openresolv/named.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$named_zones" -a -z "$named_options" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -40,6 +40,9 @@ then if [ -x "@RCDIR@"/bind9 ]; then # Debian and derivatives named_service=bind9 + elif [ -x "@RCDIR@"/rc.bind ]; then + # Slackware + named_service=rc.bind fi fi : ${named_service:=named} @@ -71,6 +74,13 @@ for d in $DOMAINS; do newzones="$newzones };$NL};$NL" done +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$named_options" "$named_zones" +else + @SBINDIR@/resolvconf -D "$named_options" "$named_zones" +fi + # No point in changing files or reloading bind if the end result has not # changed changed=false diff --git a/contrib/openresolv/pdns_recursor.in b/contrib/openresolv/pdns_recursor.in new file mode 100644 index 0000000000000..2919e7d0ff378 --- /dev/null +++ b/contrib/openresolv/pdns_recursor.in @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright (c) 2009-2011 Roy Marples +# All rights reserved + +# PowerDNS Recursor subscriber for resolvconf + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 +. "@SYSCONFDIR@/resolvconf.conf" || exit 1 +[ -z "$pdns_zones" ] && exit 0 +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" + +: ${pdns_service:=pdns_recursor} +: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} + +newzones= + +# pds_recursor does not present support global forward servers, which +# does limit it's usefulness somewhat. +# If it did, the below code can be enabled, or something like it. +#for n in $NAMESERVERS; do +# newzones="$newzones${newzones:+,}$n" +#done +#[ -n "$newzones" ] && newzones=".=$newzones$NL" + +for d in $DOMAINS; do + newns= + ns="${d#*:}" + while [ -n "$ns" ]; do + newns="$newns${newns:+,}${ns%%,*}" + [ "$ns" = "${ns#*,}" ] && break + ns="${ns#*,}" + done + [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" +done + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_zones" +else + @SBINDIR@/resolvconf -D "$pdnsd_zones" +fi + +if [ ! -f "$pdns_zones" ] || \ + [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] +then + printf %s "$newzones" >"$pdns_zones" + eval $pdns_restart +fi diff --git a/contrib/openresolv/pdnsd.in b/contrib/openresolv/pdnsd.in index 61dc5e1394b58..59a4755aff16b 100644 --- a/contrib/openresolv/pdnsd.in +++ b/contrib/openresolv/pdnsd.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -29,7 +29,9 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" : ${pdnsd_restart:=pdnsd-ctl config $pdnsd_conf} signature="# Generated by resolvconf" @@ -46,7 +48,7 @@ remove_markers() sed "/^$m1/,/^$m2/d" $@ else for x; do - while read line; do + while read -r line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; @@ -80,24 +82,32 @@ change_file() return 0 } -newresolv="# Generated by resolvconf\n" +newresolv="# Generated by resolvconf$NL" changed=false +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_resolv" "$pdnsd_conf" +else + @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" +fi + if [ -n "$pdnsd_resolv" ]; then for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done fi -if [ -n "$pdnsd_conf" ]; then +# Only modify the configuration if it exists and we can write to it +if [ -w "$pdnsd_conf" ]; then cf="$pdnsd_conf.new" newconf= if [ -z "$pdnsd_resolv" ]; then - newconf="${newconf}server {\n" - newconf="${newconf}\tlabel=resolvconf;\n" + newconf="${newconf}server {$NL" + newconf="${newconf} label=resolvconf;$NL" if [ -n "$NAMESERVERS" ]; then - newconf="${newconf}\tip=" + newconf="${newconf} ip=" first=true for n in $NAMESERVERS; do if $first; then @@ -107,16 +117,16 @@ if [ -n "$pdnsd_conf" ]; then fi newconf="$newconf$n" done - newconf="${newconf};\n" + newconf="${newconf};$NL" fi - newconf="${newconf}}\n" + newconf="${newconf}}$NL" fi for d in $DOMAINS; do - newconf="${newconf}server {\n" - newconf="${newconf}\tinclude=.${d%%:*}.;\n" - newconf="${newconf}\tpolicy=excluded;\n" - newconf="${newconf}\tip=" + newconf="${newconf}server {$NL" + newconf="${newconf} include=.${d%%:*}.;$NL" + newconf="${newconf} policy=excluded;$NL" + newconf="${newconf} ip=" ns="${d#*:}" while [ -n "$ns" ]; do newconf="${newconf}${ns%%,*}" @@ -124,7 +134,7 @@ if [ -n "$pdnsd_conf" ]; then ns="${ns#*,}" newconf="${newconf}," done - newconf="${newconf};\n}\n" + newconf="${newconf};$NL}$NL" done rm -f "$cf" @@ -136,7 +146,7 @@ if [ -n "$pdnsd_conf" ]; then fi if change_file "$pdnsd_conf" "$cf"; then changed=true - fi + fi fi if [ -n "$pdnsd_resolv" ]; then diff --git a/contrib/openresolv/resolvconf.8.in b/contrib/openresolv/resolvconf.8.in index 4e6f59a0449e0..10dcf5dd73992 100644 --- a/contrib/openresolv/resolvconf.8.in +++ b/contrib/openresolv/resolvconf.8.in @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2009 Roy Marples +.\" Copyright (c) 2007-2015 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 3, 2009 -.Dt RESOLVCONF 8 SMM +.Dd April 27, 2014 +.Dt RESOLVCONF 8 .Os .Sh NAME .Nm resolvconf @@ -34,11 +34,14 @@ .Nm .Op Fl m Ar metric .Op Fl p -.Fl a Ar interface No < Ns Pa file +.Op Fl x +.Fl a Ar interface Ns Op Ar .protocol +.No < Ns Pa file .Nm .Op Fl f -.Fl d Ar interface +.Fl d Ar interface Ns Op Ar .protocol .Nm +.Op Fl x .Fl il Ar pattern .Nm .Fl u @@ -63,7 +66,7 @@ file to via .Xr stdin 3 with the argument -.Fl a Ar interface +.Fl a Ar interface Ns Op Ar .protocol instead of the filesystem. .Nm then updates @@ -78,6 +81,20 @@ then will supply files that the resolver should be configured to include. .Pp .Nm +assumes it has a job to do. +In some situations +.Nm +needs to act as a deterrent to writing to +.Pa /etc/resolv.conf . +Where this file cannot be made immutable or you just need to toggle this +behaviour, +.Nm +can be disabled by adding +.Sy resolvconf Ns = Ns NO +to +.Xr resolvconf.conf 5 . +.Pp +.Nm can mark an interfaces .Pa resolv.conf as private. @@ -91,13 +108,21 @@ for how to configure .Nm to use a local name server. .Pp +.Nm +can mark an interfaces +.Pa resolv.conf +as exclusive. +Only the latest exclusive interface is used for processing, otherwise all are. +.Pp When an interface goes down, it should then call .Nm with -.Fl d Ar interface +.Fl d Ar interface.* arguments to delete the .Pa resolv.conf -file for the +file(s) for all the +.Ar protocols +on the .Ar interface . .Pp Here are some more options that @@ -119,7 +144,7 @@ is used to add interfaces. Ignore non existant interfaces. Only really useful for deleting interfaces. .It Fl i Ar pattern -List the interfaces, optionally matching +List the interfaces and protocols, optionally matching .Ar pattern , we have .Pa resolv.conf @@ -130,7 +155,8 @@ List the files we have. If .Ar pattern -is specified then we list the files for the interfaces that match it. +is specified then we list the files for the interfaces and protocols +that match it. .It Fl m Ar metric Set the metric of the interface when adding it, default of 0. Lower metrics take precedence. @@ -142,18 +168,28 @@ as private. .It Fl u Force .Nm -to update all it's subscribers. +to update all its subscribers. .Nm does not update the subscribers when adding a resolv.conf that matches what it already has for that interface. +.It Fl x +Mark the interface +.Pa resolv.conf +as exclusive when adding, otherwise only use the latest exclusive interface. .El .Pp .Nm -also has some options designed to be used by it's subscribers:- +also has some options designed to be used by its subscribers:- .Bl -tag -width indent .It Fl v Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can configure the resolver easily. +.It Fl V +Same as +.Fl v +except that only the information configured in +.Xr resolvconf.conf 5 +is set. .El .Sh INTERFACE ORDERING For @@ -170,6 +206,29 @@ the operating systems lexical order. See .Xr resolvconf.conf 5 for details on these lists. +.Sh PROTOCOLS +Here are some suggested protocol tags to use for each +.Pa resolv.conf +file registered on an +.Ar interface Ns No :- +.Bl -tag -width indent +.It dhcp +Dynamic Host Configuration Protocol. +Initial versions of +.Nm +did not recommend a +.Ar protocol +tag be appended to the +.Ar interface +name. +When the protocol is absent, it is assumed to be the DHCP protocol. +.It ppp +Point-to-Point Protocol. +.It ra +IPv6 Router Advertisement. +.It dhcp6 +Dynamic Host Configuration Protocol, version 6. +.El .Sh IMPLEMENTATION NOTES If a subscriber has the executable bit then it is executed otherwise it is assumed to be a shell script and sourced into the current environment in a @@ -197,9 +256,15 @@ for the metric. Marks the interface .Pa resolv.conf as private. +.It Va IF_EXCLUSIVE +Marks the interface +.Pa resolv.conf +as exclusive. .El .Sh FILES .Bl -ohang +.It Pa /etc/resolv.conf.bak +Backup file of the original resolv.conf. .It Pa @SYSCONFDIR@/resolvconf.conf Configuration file for .Nm . @@ -218,7 +283,17 @@ This implementation of .Nm is called openresolv and is fully command line compatible with Debian's resolvconf, as written by Thomas Hood. +.Sh SEE ALSO +.Xr resolv.conf 5 , +.Xr resolvconf.conf 5 , +.Xr resolver 3 , +.Xr stdin 3 +.Sh AUTHORS +.An Roy Marples Aq Mt roy@marples.name .Sh BUGS +Please report them to +.Lk http://roy.marples.name/projects/openresolv +.Pp .Nm does not validate any of the files given to it. .Pp @@ -229,12 +304,3 @@ will generate. You should consult .Xr resolvconf.conf 5 for instructions on how to configure your resolver. -.Sh SEE ALSO -.Xr resolv.conf 5 , -.Xr resolvconf.conf 5 , -.Xr resolver 3 , -.Xr stdin 3 -.Sh AUTHORS -.An Roy Marples Aq roy@marples.name -.Sh BUGS -Please report them to http://roy.marples.name/projects/openresolv diff --git a/contrib/openresolv/resolvconf.conf.5.in b/contrib/openresolv/resolvconf.conf.5.in index 454aac5380d08..d4f654308e9ef 100644 --- a/contrib/openresolv/resolvconf.conf.5.in +++ b/contrib/openresolv/resolvconf.conf.5.in @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2010 Roy Marples +.\" Copyright (c) 2009-2015 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 29, 2010 -.Dt RESOLVCONF.CONF 5 SMM +.Dd March 20, 2015 +.Dt RESOLVCONF.CONF 5 .Os .Sh NAME .Nm resolvconf.conf @@ -42,12 +42,22 @@ must contain valid shell commands. Listed below are the standard .Nm variables that may be set. +If the values contain white space for special shell characters, +ensure they are quoted and escaped correctly. .Pp After updating this file, you may wish to run .Nm resolvconf -u to apply the new configuration. +.Pp +When a dynamically generated list is appended or prepended to, the whole +is made unique where left-most wins. .Sh RESOLVCONF OPTIONS .Bl -tag -width indent +.It Sy resolvconf +Set to NO to disable +.Nm resolvconf +from running any subscribers. +Defaults to YES. .It Sy interface_order These interfaces will always be processed first. If unset, defaults to the following:- @@ -56,16 +66,27 @@ If unset, defaults to the following:- These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:- .D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* +.It Sy local_nameservers +If unset, defaults to the following:- +.D1 127.* 0.0.0.0 255.255.255.255 ::1 .It Sy search_domains Prepend search domains to the dynamically generated list. .It Sy search_domains_append Append search domains to the dynamically generated list. +.It Sy domain_blacklist +A list of domains to be removed from consideration. +To remove a domain, you can use foo.* +To remove a sub domain, you can use *.bar .It Sy name_servers Prepend name servers to the dynamically generated list. You should set this to 127.0.0.1 if you use a local name server other than libc. .It Sy name_servers_append Append name servers to the dynamically generated list. +.It Sy name_server_blacklist +A list of name servers to be removed from consideration. +The default is 0.0.0.0 as some faulty routers send it via DHCP. +To remove a block, you can use 192.168.* .It Sy private_interfaces These interfaces name servers will only be queried for the domains listed in their resolv.conf. @@ -73,6 +94,34 @@ Useful for VPN domains. This is equivalent to the .Nm resolvconf -p option. +.It Sy replace +Is a space separated list of replacement keywords. The syntax is this: +.Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement +.Pp +Example, given this resolv.conf: +.D1 domain foo.org +.D1 search foo.org dead.beef +.D1 nameserver 1.2.3.4 +.D1 nameserver 2.3.4.5 +and this configuaration: +.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/" +you would get this resolv.conf instead: +.D1 domain foo.org +.D1 search bar.com +.D1 nameserver 5.6.7.8 +.It Sy replace_sub +Works the same way as +.Sy replace +except it works on each space separated value rather than the whole line, +so it's useful for the replacing a single domain within the search directive. +Using the same example resolv.conf and changing +.Sy replace +to +.Sy replace_sub , +you would get this resolv.conf instead: +.D1 domain foo.org +.D1 search bar.com dead.beef +.D1 nameserver 5.6.7.8 .It Sy state_dir Override the default state directory of .Pa @VARDIR@ . @@ -96,6 +145,32 @@ A list of libc resolver options, as specified in When set to YES the latest resolv.conf is written to .Sy resolv_conf without any alteration. +When set to /dev/null or NULL, +.Sy resolv_conf_local_only +is defaulted to NO, +.Sy local_nameservers +is unset unless overriden and only the information set in +.Nm +is written to +.Sy resolv_conf . +.It Sy resolv_conf_sortlist +A libc resolver sortlist, as specified in +.Xr resolv.conf 5 . +.It Sy resolv_conf_local_only +If a local name server is configured then the default is just to specify that +and ignore all other entries as they will be configured for the local +name server. +Set this to NO to also list non-local nameservers. +This will give you working DNS even if the local nameserver stops functioning +at the expense of duplicated server queries. +.It Sy append_nameservers +Append name servers to the dynamically generated list. +.It Sy prepend_nameservers +Prepend name servers to the dynamically generated list. +.It Sy append_search +Append search domains to the dynamically generated list. +.It Sy prepend_search +Prepend search domains to the dynamically generated list. .El .Sh SUBSCRIBER OPTIONS openresolv ships with subscribers for the name servers @@ -106,11 +181,15 @@ and .Xr unbound 8 . Each subscriber can create configuration files which should be included in in the subscribers main configuration file. +.Pp +To disable a subscriber, simply set it's name to NO. +For example, to disable the libc subscriber you would set: +.D1 libc=NO .Bl -tag -width indent .It Sy dnsmasq_conf -This file tells dnsmasq which nameservers to use for specific domains. +This file tells dnsmasq which name servers to use for specific domains. .It Sy dnsmasq_resolv -This file tells dnsmasq which nameservers to use for global lookups. +This file tells dnsmasq which name servers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: .D1 name_servers=127.0.0.1 @@ -119,14 +198,17 @@ Example resolvconf.conf for dnsmasq: .Pp Example dnsmasq.conf: .D1 listen-address=127.0.0.1 +.D1 # If dnsmasq is compiled for DBus then we can take +.D1 # advantage of not having to restart dnsmasq. +.D1 enable-dbus .D1 conf-file=/etc/dnsmasq-conf.conf .D1 resolv-file=/etc/dnsmasq-resolv.conf .It Sy named_options Include this file in the named options block. -This file tells named which nameservers to use for global lookups. +This file tells named which name servers to use for global lookups. .It Sy named_zones Include this file in the named global scope, after the options block. -This file tells named which nameservers to use for specific domains. +This file tells named which name servers to use for specific domains. .Pp Example resolvconf.conf for named: .D1 name_servers=127.0.0.1 @@ -147,7 +229,7 @@ setup to read .Pa pdnsd_resolv as documented below. .It Sy pdnsd_resolv -This file tells pdnsd about global nameservers. +This file tells pdnsd about global name servers. If this variable is not set then it's written to .Pa pdnsd_conf . .Pp @@ -168,7 +250,9 @@ Example pdnsd.conf: .D1 # file="/etc/pdnsd-resolv.conf"; .D1 } .It Sy unbound_conf -This file tells unbound about specific and global nameservers. +This file tells unbound about specific and global name servers. +.It Sy unbound_insecure +When set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC. .Pp Example resolvconf.conf for unbound: .D1 name_servers=127.0.0.1 @@ -177,11 +261,53 @@ Example resolvconf.conf for unbound: Example unbound.conf: .D1 include: /etc/unbound-resolvconf.conf .El +.Sh SUBSCRIBER INTEGRATION +Not all distributions store the files the subscribers need in the same +locations. +For example, named service scripts have been called named, bind and rc.bind +and they could be located in a directory called /etc/rc.d, /etc/init.d or +similar. +Each subscriber attempts to automatically configure itself, but not every +distribution has been catered for. +Also, users could equally want to use a different version from the one +installed by default, such as bind8 and bind9. +To accomodate this, the subscribers have these files in configurable +variables, documented below. +.Pp +.Bl -tag -width indent +.It Sy dnsmasq_service +Location of the dnsmasq service. +.It Sy dnsmasq_restart +Command to restart the dnsmasq service. +.It Sy dnsmasq_pid +Location of the dnsmasq pidfile. +.It Sy libc_service +Location of the libc service. +.It Sy libc_restart +Command to restart the libc service. +.It Sy named_service +Location of the named service. +.It Sy named_restart +Command to restart the named service. +.It Sy pdnsd_restart +Command to restart the pdnsd service. +.It Sy unbound_service +Location of the unbound service. +.It Sy unbound_restart +Command to restart the unbound service. +.It Sy unbound_pid +Location of the unbound pidfile. +.El .Sh SEE ALSO -.Xr resolv.conf 5 +.Xr resolv.conf 5 , +.Xr resolvconf 8 and -.Xr resolvconf 8 . +.Xr sh 1 . .Sh AUTHORS -.An Roy Marples Aq roy@marples.name +.An Roy Marples Aq Mt roy@marples.name .Sh BUGS -Please report them to http://roy.marples.name/projects/openresolv +Each distribution is a special snowflake and likes to name the same thing +differently, namely the named service script. +.Pp +Please report them to +.Lk http://roy.marples.name/projects/openresolv diff --git a/contrib/openresolv/resolvconf.in b/contrib/openresolv/resolvconf.in index 8a608d3098b05..3b2b0f53fd835 100644 --- a/contrib/openresolv/resolvconf.in +++ b/contrib/openresolv/resolvconf.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2015 Roy Marples # All rights reserved # Redistribution and use in source and binary forms, with or without @@ -28,6 +28,17 @@ RESOLVCONF="$0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ + +# Disregard dhcpcd setting +unset interface_order state_dir + +# If you change this, change the test in VFLAG and libc.in as well +local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" + +dynamic_order="tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*" +interface_order="lo lo[0-9]*" +name_server_blacklist="0.0.0.0" + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -39,12 +50,17 @@ elif [ -d "$SYSCONFDIR/resolvconf" ]; then interface_order="$(cat "$SYSCONFDIR"/interface-order)" fi fi +TMPDIR="$VARDIR/tmp" IFACEDIR="$VARDIR/interfaces" METRICDIR="$VARDIR/metrics" PRIVATEDIR="$VARDIR/private" +EXCLUSIVEDIR="$VARDIR/exclusive" +LOCKDIR="$VARDIR/lock" -: ${dynamic_order:=tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*} -: ${interface_order:=lo lo[0-9]*} +warn() +{ + echo "$*" >&2 +} error_exit() { @@ -64,6 +80,7 @@ usage() (DNS supplied via stdin in resolv.conf format) -m metric Give the added DNS information a metric -p Mark the interface as private + -x Mark the interface as exclusive -d \$INTERFACE Delete DNS information from the specified interface -f Ignore non existant interfaces -I Init the state dir @@ -84,16 +101,23 @@ usage() echo_resolv() { - local line= - [ -n "$1" -a -e "$IFACEDIR/$1" ] || return 1 + local line= OIFS="$IFS" + + [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 echo "# resolv.conf from $1" # Our variable maker works of the fact each resolv.conf per interface # is separated by blank lines. # So we remove them when echoing them. - while read line; do - [ -n "$line" ] && echo "$line" + while read -r line; do + IFS="$OIFS" + if [ -n "$line" ]; then + # We need to set IFS here to preserve any whitespace + IFS='' + printf "%s\n" "$line" + fi done < "$IFACEDIR/$1" echo + IFS="$OIFS" } # Parse resolv.conf's and make variables @@ -101,22 +125,11 @@ echo_resolv() parse_resolv() { local line= ns= ds= search= d= n= newns= - local new=true iface= private=false p= + local new=true iface= private=false p= domain= l= islocal= - echo "DOMAINS=" - echo "SEARCH=\"$search_domains\"" - # let our subscribers know about global nameservers - for n in $name_servers; do - case "$n" in - 127.*|0.0.0.0|255.255.255.255|::1) :;; - *) newns="$newns${newns:+ }$n";; - esac - done - echo "NAMESERVERS=\"$newns\"" - echo "LOCALNAMESERVERS=" newns= - while read line; do + while read -r line; do case "$line" in "# resolv.conf from "*) if ${new}; then @@ -129,24 +142,34 @@ parse_resolv() cd "$IFACEDIR" private=false for p in $private_interfaces; do - if [ "$p" = "$iface" ]; then - private=true - break - fi + case "$iface" in + "$p"|"$p":*) private=true; break;; + esac done fi fi ;; "nameserver "*) - case "${line#* }" in - 127.*|0.0.0.0|255.255.255.255|::1) - echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\"" - continue - ;; - esac - ns="$ns${line#* } " + islocal=false + for l in $local_nameservers; do + case "${line#* }" in + $l) + islocal=true + echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\"" + break + ;; + esac + done + $islocal || ns="$ns${line#* } " ;; - "domain "*|"search "*) + "domain "*) + if [ -z "$domain" ]; then + domain="${line#* }" + echo "DOMAIN=\"$domain\"" + fi + search="${line#* }" + ;; + "search "*) search="${line#* }" ;; *) @@ -187,70 +210,243 @@ uniqify() echo "${result# *}" } +dirname() +{ + local dir= OIFS="$IFS" + local IFS=/ + set -- $@ + IFS="$OIFS" + if [ -n "$1" ]; then + printf %s . + else + shift + fi + while [ -n "$2" ]; do + printf "/%s" "$1" + shift + done + printf "\n" +} + +config_mkdirs() +{ + local e=0 f d + for f; do + [ -n "$f" ] || continue + d="$(dirname "$f")" + if [ ! -d "$d" ]; then + if type install >/dev/null 2>&1; then + install -d "$d" || e=$? + else + mkdir "$d" || e=$? + fi + fi + done + return $e +} + list_resolv() { [ -d "$IFACEDIR" ] || return 0 - local report=false list= retval=0 cmd="$1" + local report=false list= retval=0 cmd="$1" excl= shift + case "$IF_EXCLUSIVE" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + if [ -d "$EXCLUSIVEDIR" ]; then + cd "$EXCLUSIVEDIR" + for i in *; do + if [ -f "$i" ]; then + list="${i#* }" + break + fi + done + fi + excl=true + ;; + *) + excl=false + ;; + esac + # If we have an interface ordering list, then use that. # It works by just using pathname expansion in the interface directory. if [ -n "$1" ]; then - list="$@" + list="$*" $force || report=true - else + elif ! $excl; then cd "$IFACEDIR" for i in $interface_order; do - [ -e "$i" ] && list="$list $i" + [ -f "$i" ] && list="$list $i" + for ii in "$i":* "$i".*; do + [ -f "$ii" ] && list="$list $ii" + done done for i in $dynamic_order; do if [ -e "$i" -a ! -e "$METRICDIR/"*" $i" ]; then list="$list $i" fi + for ii in "$i":* "$i".*; do + if [ -f "$ii" -a ! -e "$METRICDIR/"*" $ii" ]; then + list="$list $ii" + fi + done done if [ -d "$METRICDIR" ]; then cd "$METRICDIR" for i in *; do - list="$list ${i#* }" + [ -f "$i" ] && list="$list ${i#* }" done fi list="$list *" fi cd "$IFACEDIR" + retval=1 for i in $(uniqify $list); do # Only list interfaces which we really have - if ! [ -e "$i" ]; then + if ! [ -f "$i" ]; then if $report; then echo "No resolv.conf for interface $i" >&2 - retval=$(($retval + 1)) + retval=2 fi continue fi if [ "$cmd" = i -o "$cmd" = "-i" ]; then - printf "$i " + printf %s "$i " else echo_resolv "$i" fi + [ $? = 0 -a "$retval" = 1 ] && retval=0 done [ "$cmd" = i -o "$cmd" = "-i" ] && echo return $retval } +list_remove() { + local list= e= l= result= found= retval=0 + + [ -z "$2" ] && return 0 + eval list=\"\$$1\" + shift + + set -f + for e; do + found=false + for l in $list; do + case "$e" in + $l) found=true;; + esac + $found && break + done + if $found; then + retval=$(($retval + 1)) + else + result="$result $e" + fi + done + set +f + echo "${result# *}" + return $retval +} + +echo_prepend() +{ + echo "# Generated by resolvconf" + if [ -n "$search_domains" ]; then + echo "search $search_domains" + fi + for n in $name_servers; do + echo "nameserver $n" + done + echo +} + +echo_append() +{ + echo "# Generated by resolvconf" + if [ -n "$search_domains_append" ]; then + echo "search $search_domains_append" + fi + for n in $name_servers_append; do + echo "nameserver $n" + done + echo +} + +replace() +{ + local r= k= f= v= val= sub= + + while read -r keyword value; do + for r in $replace; do + k="${r%%/*}" + r="${r#*/}" + f="${r%%/*}" + r="${r#*/}" + v="${r%%/*}" + case "$keyword" in + $k) + case "$value" in + $f) value="$v";; + esac + ;; + esac + done + val= + for sub in $value; do + for r in $replace_sub; do + k="${r%%/*}" + r="${r#*/}" + f="${r%%/*}" + r="${r#*/}" + v="${r%%/*}" + case "$keyword" in + $k) + case "$sub" in + $f) sub="$v";; + esac + ;; + esac + done + val="$val${val:+ }$sub" + done + printf "%s %s\n" "$keyword" "$val" + done +} + make_vars() { - eval "$(list_resolv -l "$@" | parse_resolv)" + local newdomains= d= dn= newns= ns= + + # Clear variables + DOMAIN= + DOMAINS= + SEARCH= + NAMESERVERS= + LOCALNAMESERVERS= + + if [ -n "$name_servers" -o -n "$search_domains" ]; then + eval "$(echo_prepend | parse_resolv)" + fi + if [ -z "$VFLAG" ]; then + IF_EXCLUSIVE=1 + list_resolv -i "$@" >/dev/null || IF_EXCLUSIVE=0 + eval "$(list_resolv -l "$@" | replace | parse_resolv)" + fi + if [ -n "$name_servers_append" -o -n "$search_domains_append" ]; then + eval "$(echo_append | parse_resolv)" + fi # Ensure that we only list each domain once - newdomains= for d in $DOMAINS; do dn="${d%%:*}" + list_remove domain_blacklist "$dn" >/dev/null || continue case " $newdomains" in *" ${dn}:"*) continue;; esac - newdomains="$newdomains${newdomains:+ }$dn:" newns= for nd in $DOMAINS; do if [ "$dn" = "${nd%%:*}" ]; then @@ -258,34 +454,56 @@ make_vars() while [ -n "$ns" ]; do case ",$newns," in *,${ns%%,*},*) ;; - *) newns="$newns${newns:+,}${ns%%,*}";; + *) list_remove name_server_blacklist \ + "${ns%%,*}" >/dev/null \ + && newns="$newns${newns:+,}${ns%%,*}";; esac [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" done fi done - newdomains="$newdomains$newns" + if [ -n "$newns" ]; then + newdomains="$newdomains${newdomains:+ }$dn:$newns" + fi done + DOMAIN="$(list_remove domain_blacklist $DOMAIN)" + SEARCH="$(uniqify $SEARCH)" + SEARCH="$(list_remove domain_blacklist $SEARCH)" + NAMESERVERS="$(uniqify $NAMESERVERS)" + NAMESERVERS="$(list_remove name_server_blacklist $NAMESERVERS)" + LOCALNAMESERVERS="$(uniqify $LOCALNAMESERVERS)" + LOCALNAMESERVERS="$(list_remove name_server_blacklist $LOCALNAMESERVERS)" + echo "DOMAIN='$DOMAIN'" + echo "SEARCH='$SEARCH'" + echo "NAMESERVERS='$NAMESERVERS'" + echo "LOCALNAMESERVERS='$LOCALNAMESERVERS'" echo "DOMAINS='$newdomains'" - echo "SEARCH='$(uniqify $SEARCH)'" - echo "NAMESERVERS='$(uniqify $NAMESERVERS)'" - echo "LOCALNAMESERVERS='$(uniqify $LOCALNAMESERVERS)'" } force=false -while getopts a:d:fhIilm:puv OPT; do +VFLAG= +while getopts a:Dd:fhIilm:puvVx OPT; do case "$OPT" in f) force=true;; h) usage;; m) IF_METRIC="$OPTARG";; p) IF_PRIVATE=1;; + V) + VFLAG=1 + if [ "$local_nameservers" = \ + "127.* 0.0.0.0 255.255.255.255 ::1" ] + then + local_nameservers= + fi + ;; + x) IF_EXCLUSIVE=1;; '?') ;; *) cmd="$OPT"; iface="$OPTARG";; esac done shift $(($OPTIND - 1)) -args="$iface${iface:+ }$@" +args="$iface${iface:+ }$*" # -I inits the state dir if [ "$cmd" = I ]; then @@ -295,6 +513,12 @@ if [ "$cmd" = I ]; then exit $? fi +# -D ensures that the listed config file base dirs exist +if [ "$cmd" = D ]; then + config_mkdirs "$@" + exit $? +fi + # -l lists our resolv files, optionally for a specific interface if [ "$cmd" = l -o "$cmd" = i ]; then list_resolv "$cmd" "$args" @@ -302,7 +526,7 @@ if [ "$cmd" = l -o "$cmd" = i ]; then fi # Not normally needed, but subscribers should be able to run independently -if [ "$cmd" = v ]; then +if [ "$cmd" = v -o -n "$VFLAG" ]; then make_vars "$iface" exit $? fi @@ -316,6 +540,7 @@ elif [ "$cmd" != u ]; then [ -n "$cmd" -a "$cmd" != h ] && usage "Unknown option $cmd" usage fi + if [ "$cmd" = a ]; then for x in '/' \\ ' ' '*'; do case "$iface" in @@ -331,78 +556,198 @@ if [ "$cmd" = a ]; then [ "$cmd" = a -a -t 0 ] && error_exit "No file given via stdin" fi -if [ ! -d "$IFACEDIR" ]; then - if [ ! -d "$VARDIR" ]; then - if [ -L "$VARDIR" ]; then - dir="$(readlink "$VARDIR")" - # link maybe relative - cd "${VARDIR%/*}" - if ! mkdir -m 0755 -p "$dir"; then - error_exit "Failed to create needed" \ - "directory $dir" - fi - else - if ! mkdir -m 0755 -p "$VARDIR"; then - error_exit "Failed to create needed" \ - "directory $VARDIR" - fi +if [ ! -d "$VARDIR" ]; then + if [ -L "$VARDIR" ]; then + dir="$(readlink "$VARDIR")" + # link maybe relative + cd "${VARDIR%/*}" + if ! mkdir -m 0755 -p "$dir"; then + error_exit "Failed to create needed" \ + "directory $dir" + fi + else + if ! mkdir -m 0755 -p "$VARDIR"; then + error_exit "Failed to create needed" \ + "directory $VARDIR" fi fi +fi + +if [ ! -d "$IFACEDIR" ]; then mkdir -m 0755 -p "$IFACEDIR" || \ error_exit "Failed to create needed directory $IFACEDIR" -else - # Delete any existing information about the interface if [ "$cmd" = d ]; then - cd "$IFACEDIR" - for i in $args; do - if [ "$cmd" = d -a ! -e "$i" ]; then - $force && continue - error_exit "No resolv.conf for" \ - "interface $i" - fi - rm -f "$i" "$METRICDIR/"*" $i" \ - "$PRIVATEDIR/$i" || exit $? - done + # Provide the same error messages as below + if ! ${force}; then + cd "$IFACEDIR" + for i in $args; do + warn "No resolv.conf for interface $i" + done + fi + ${force} + exit $? fi fi -if [ "$cmd" = a ]; then +# An interface was added, changed, deleted or a general update was called. +# Due to exclusivity we need to ensure that this is an atomic operation. +# Our subscribers *may* need this as well if the init system is sub par. +# As such we spinlock at this point as best we can. +# We don't use flock(1) because it's not widely available and normally resides +# in /usr which we do our very best to operate without. +[ -w "$VARDIR" ] || error_exit "Cannot write to $LOCKDIR" +: ${lock_timeout:=10} +while true; do + if mkdir "$LOCKDIR" 2>/dev/null; then + trap 'rm -rf "$LOCKDIR";' EXIT + trap 'rm -rf "$LOCKDIR"; exit 1' INT QUIT ABRT SEGV ALRM TERM + echo $$ >"$LOCKDIR/pid" + break + fi + pid=$(cat "$LOCKDIR/pid") + if ! kill -0 "$pid"; then + warn "clearing stale lock pid $pid" + rm -rf "$LOCKDIR" + continue + fi + lock_timeout=$(($lock_timeout - 1)) + if [ "$lock_timeout" -le 0 ]; then + error_exit "timed out waiting for lock from pid $pid" + fi + sleep 1 +done + +case "$cmd" in +a) # Read resolv.conf from stdin resolv="$(cat)" + changed=false + changedfile=false # If what we are given matches what we have, then do nothing if [ -e "$IFACEDIR/$iface" ]; then - if [ "$(echo "$resolv")" = \ + if [ "$(echo "$resolv")" != \ "$(cat "$IFACEDIR/$iface")" ] then - exit 0 + changed=true + changedfile=true fi - rm "$IFACEDIR/$iface" + else + changed=true + changedfile=true fi - echo "$resolv" >"$IFACEDIR/$iface" || exit $? + + # Set metric and private before creating the interface resolv.conf file + # to ensure that it will have the correct flags [ ! -d "$METRICDIR" ] && mkdir "$METRICDIR" - rm -f "$METRICDIR/"*" $iface" + oldmetric="$METRICDIR/"*" $iface" + newmetric= if [ -n "$IF_METRIC" ]; then # Pad metric to 6 characters, so 5 is less than 10 while [ ${#IF_METRIC} -le 6 ]; do IF_METRIC="0$IF_METRIC" done - echo " " >"$METRICDIR/$IF_METRIC $iface" + newmetric="$METRICDIR/$IF_METRIC $iface" fi + rm -f "$METRICDIR/"*" $iface" + [ "$oldmetric" != "$newmetric" -a \ + "$oldmetric" != "$METRICDIR/* $iface" ] && + changed=true + [ -n "$newmetric" ] && echo " " >"$newmetric" + case "$IF_PRIVATE" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) if [ ! -d "$PRIVATEDIR" ]; then [ -e "$PRIVATEDIR" ] && rm "$PRIVATEDIR" mkdir "$PRIVATEDIR" fi + [ -e "$PRIVATEDIR/$iface" ] || changed=true [ -d "$PRIVATEDIR" ] && echo " " >"$PRIVATEDIR/$iface" ;; *) if [ -e "$PRIVATEDIR/$iface" ]; then rm -f "$PRIVATEDIR/$iface" + changed=true fi ;; esac -fi + + oldexcl= + for x in "$EXCLUSIVEDIR/"*" $iface"; do + if [ -f "$x" ]; then + oldexcl="$x" + break + fi + done + case "$IF_EXCLUSIVE" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + if [ ! -d "$EXCLUSIVEDIR" ]; then + [ -e "$EXCLUSIVEDIR" ] && rm "$EXCLUSIVEDIR" + mkdir "$EXCLUSIVEDIR" + fi + cd "$EXCLUSIVEDIR" + for x in *; do + [ -f "$x" ] && break + done + if [ "${x#* }" != "$iface" ]; then + if [ "$x" = "${x% *}" ]; then + x=10000000 + else + x="${x% *}" + fi + if [ "$x" = "0000000" ]; then + warn "exclusive underflow" + else + x=$(($x - 1)) + fi + if [ -d "$EXCLUSIVEDIR" ]; then + echo " " >"$EXCLUSIVEDIR/$x $iface" + fi + changed=true + fi + ;; + *) + if [ -f "$oldexcl" ]; then + rm -f "$oldexcl" + changed=true + fi + ;; + esac + + if $changedfile; then + printf "%s\n" "$resolv" >"$IFACEDIR/$iface" || exit $? + elif ! $changed; then + exit 0 + fi + unset changed changedfile oldmetric newmetric x oldexcl + ;; + +d) + # Delete any existing information about the interface + cd "$IFACEDIR" + changed=false + for i in $args; do + if [ -e "$i" ]; then + changed=true + elif ! ${force}; then + warn "No resolv.conf for interface $i" + fi + rm -f "$i" "$METRICDIR/"*" $i" \ + "$PRIVATEDIR/$i" \ + "$EXCLUSIVEDIR/"*" $i" || exit $? + done + if ! ${changed}; then + # Set the return code based on the forced flag + ${force} + exit $? + fi + unset changed i + ;; +esac + +case "${resolvconf:-YES}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; +*) exit 0;; +esac eval "$(make_vars)" export RESOLVCONF DOMAINS SEARCH NAMESERVERS LOCALNAMESERVERS @@ -410,10 +755,15 @@ export RESOLVCONF DOMAINS SEARCH NAMESERVERS LOCALNAMESERVERS retval=0 for script in "$LIBEXECDIR"/*; do if [ -f "$script" ]; then + eval script_enabled="\$${script##*/}" + case "${script_enabled:-YES}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; + *) continue;; + esac if [ -x "$script" ]; then "$script" "$cmd" "$iface" else - (. "$script" "$cmd" "$iface") + (set -- "$cmd" "$iface"; . "$script") fi retval=$(($retval + $?)) fi diff --git a/contrib/openresolv/unbound.in b/contrib/openresolv/unbound.in index aa04a3191015b..5752e6f2c4123 100644 --- a/contrib/openresolv/unbound.in +++ b/contrib/openresolv/unbound.in @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2009 Roy Marples +# Copyright (c) 2009-2014 Roy Marples # All rights reserved # unbound subscriber for resolvconf @@ -26,10 +26,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +unbound_insecure= + [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$unbound_conf" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -41,6 +43,11 @@ newconf="# Generated by resolvconf$NL" for d in $DOMAINS; do dn="${d%%:*}" ns="${d#*:}" + case "$unbound_insecure" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + newconf="$newconf${NL}domain-insecure: \"$dn\"" + ;; + esac newconf="$newconf${NL}forward-zone:$NL name: \"$dn\"$NL" while [ -n "$ns" ]; do newconf="$newconf forward-addr: ${ns%%,*}$NL" @@ -56,6 +63,13 @@ if [ -n "$NAMESERVERS" ]; then done fi +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$unbound_conf" +else + @SBINDIR@/resolvconf -D "$unbound_conf" +fi + if [ ! -f "$unbound_conf" ] || \ [ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ] then diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c index b1630818f6159..c8ca0bf5a4b37 100644 --- a/contrib/tcpdump/tcpdump.c +++ b/contrib/tcpdump/tcpdump.c @@ -1921,8 +1921,6 @@ main(int argc, char **argv) #endif if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); #endif /* __FreeBSD__ */ do { diff --git a/etc/Makefile b/etc/Makefile index e5ade7f889b16..e8295b72e53c9 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -54,10 +54,6 @@ BIN1= crontab \ syslog.conf \ termcap.small -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -BIN1+= libmap32.conf -.endif - .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) diff --git a/etc/libmap32.conf b/etc/libmap32.conf deleted file mode 100644 index 07fb13803c0c9..0000000000000 --- a/etc/libmap32.conf +++ /dev/null @@ -1,2 +0,0 @@ -# $FreeBSD$ -/usr/lib/private /usr/lib32/private diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index b182894ba78e7..f0d42a2a3bde1 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -8,6 +8,12 @@ bin .. include + private + bsdstat + .. + ucl + .. + .. .. lib aout @@ -32,16 +38,12 @@ .. i18n .. - private - .. .. lib32 dtrace .. i18n .. - private - .. .. libdata gcc diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3 index 1e864f8dcbc54..f0d0f4b97f0db 100644 --- a/lib/libc/gen/directory.3 +++ b/lib/libc/gen/directory.3 @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd May 6, 2015 .Dt DIRECTORY 3 .Os .Sh NAME @@ -263,8 +263,25 @@ function appeared in function appeared in .Fx 10.0 . .Sh BUGS -The invalidation of +The behaviour of .Fn telldir -tokens when calling +and +.Fn seekdir +is likely to be wrong if there are parallel unlinks happening +and the directory is larger than one page. +There is code to ensure that a .Fn seekdir -is non-standard. +to the location given by a +.Fn telldir +immediately before the last +.Fn readdir +will always set the correct location to return the same value as that last +.Fn readdir +performed. +This is enough for some applications which want to "push back the last entry read" E.g. Samba. +Seeks back to any other location, +other than the beginning of the directory, +may result in unexpected behaviour if deletes are present. +It is hoped that this situation will be resolved with changes to +.Fn getdirentries +and the VFS. diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 69f59d16087ac..c6f5d3fd6c9b2 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip) int skip; { struct dirent *dp; + long initial_seek; + long initial_loc = 0; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { if (dirp->dd_flags & __DTF_READALL) return (NULL); + initial_loc = dirp->dd_loc; + dirp->dd_flags &= ~__DTF_SKIPREAD; dirp->dd_loc = 0; } if (dirp->dd_loc == 0 && !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { + initial_seek = dirp->dd_seek; dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); if (dirp->dd_size <= 0) return (NULL); + _fixtelldir(dirp, initial_seek, initial_loc); } dirp->dd_flags &= ~__DTF_SKIPREAD; dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c index 193f4b0570da3..e157cd682e1c5 100644 --- a/lib/libc/gen/rewinddir.c +++ b/lib/libc/gen/rewinddir.c @@ -51,6 +51,7 @@ rewinddir(dirp) if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ if (dirp->dd_flags & __DTF_READALL) _filldir(dirp, false); else { diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c index d72b500b051c1..19cd6ee9fec8c 100644 --- a/lib/libc/gen/telldir.c +++ b/lib/libc/gen/telldir.c @@ -101,9 +101,22 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) return; + + /* If it's within the same chunk of data, don't bother reloading. */ + if (lp->loc_seek == dirp->dd_seek) { + /* + * If we go back to 0 don't make the next readdir + * trigger a call to getdirentries(). + */ + if (lp->loc_loc == 0) + dirp->dd_flags |= __DTF_SKIPREAD; + dirp->dd_loc = lp->loc_loc; + return; + } (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); dirp->dd_seek = lp->loc_seek; dirp->dd_loc = 0; + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ while (dirp->dd_loc < lp->loc_loc) { dp = _readdir_unlocked(dirp, 0); if (dp == NULL) @@ -112,6 +125,30 @@ _seekdir(dirp, loc) } /* + * After readdir returns the last entry in a block, a call to telldir + * returns a location that is after the end of that last entry. + * However, that location doesn't refer to a valid directory entry. + * Ideally, the call to telldir would return a location that refers to + * the first entry in the next block. That location is not known + * until the next block is read, so readdir calls this function after + * fetching a new block to fix any such telldir locations. + */ +void +_fixtelldir(DIR *dirp, long oldseek, long oldloc) +{ + struct ddloc *lp; + + lp = LIST_FIRST(&dirp->dd_td->td_locq); + if (lp != NULL) { + if (lp->loc_loc == oldloc && + lp->loc_seek == oldseek) { + lp->loc_seek = dirp->dd_seek; + lp->loc_loc = dirp->dd_loc; + } + } +} + +/* * Reclaim memory for telldir cookies which weren't used. */ void diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index 04989bb7b5360..bccabb1aea53c 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -64,5 +64,6 @@ bool _filldir(DIR *, bool); struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); +void _fixtelldir(DIR *dirp, long oldseek, long oldloc); #endif diff --git a/lib/libc/stdlib/reallocarray.3 b/lib/libc/stdlib/reallocarray.3 index a85858c244d8b..8e714f4daecc7 100644 --- a/lib/libc/stdlib/reallocarray.3 +++ b/lib/libc/stdlib/reallocarray.3 @@ -1,6 +1,5 @@ -.\" .\" Copyright (c) 1980, 1991, 1993 -.\">----The Regents of the University of California. All rights reserved. +.\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information @@ -44,6 +43,9 @@ .Sh DESCRIPTION The .Fn reallocarray +function is similar to the +.Fn realloc +function except it operates on .Fa nmemb members of size @@ -53,8 +55,9 @@ and checks for integer overflow in the calculation * .Fa size . .Sh RETURN VALUES +The .Fn reallocarray -return a pointer to the allocated space; otherwise, a +function returns a pointer to the allocated space; otherwise, a .Dv NULL pointer is returned and .Va errno @@ -132,6 +135,8 @@ if ((newp = reallocarray(p, num, size)) == NULL) { .Xr realloc 3 .Sh HISTORY The -.Fn reallocf +.Fn reallocarray function first appeared in -.Ox 5.6 . +.Ox 5.6 +and +.Fx 11.0 . diff --git a/lib/libc/sys/socketpair.2 b/lib/libc/sys/socketpair.2 index d3a47ebb23182..b15553afc5837 100644 --- a/lib/libc/sys/socketpair.2 +++ b/lib/libc/sys/socketpair.2 @@ -28,7 +28,7 @@ .\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 11, 2013 +.Dd May 4, 2015 .Dt SOCKETPAIR 2 .Os .Sh NAME @@ -40,13 +40,13 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn socketpair "int fd" "int type" "int protocol" "int *sv" +.Fn socketpair "int domain" "int type" "int protocol" "int *sv" .Sh DESCRIPTION The .Fn socketpair system call creates an unnamed pair of connected sockets in -the specified domain -.Fa fd , +the specified communications +.Fa domain , of the specified .Fa type , and using the optionally specified diff --git a/lib/libc/sys/truncate.2 b/lib/libc/sys/truncate.2 index f06c1ebaae327..0734464c868cc 100644 --- a/lib/libc/sys/truncate.2 +++ b/lib/libc/sys/truncate.2 @@ -28,7 +28,7 @@ .\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd May 4, 2015 .Dt TRUNCATE 2 .Os .Sh NAME @@ -60,9 +60,18 @@ is lost. If the file was smaller than this size, it will be extended as if by writing bytes with the value zero. -With -.Fn ftruncate , -the file must be open for writing. +.Pp +The +.Fn ftruncate +system call causes the file or shared memory object backing the file descriptor +.Fa fd +to be truncated or extended to +.Fa length +bytes in size. +The file descriptor must be a valid file descriptor open for writing. +The file position pointer associated with the file descriptor +.Fa fd +will not be modified. .Sh RETURN VALUES .Rv -std If the file to be modified is not a directory or @@ -129,7 +138,7 @@ is not a valid descriptor. The .Fa fd argument -references a socket, not a file. +references a file descriptor that is not a regular file or shared memory object. .It Bq Er EINVAL The .Fa fd @@ -138,11 +147,14 @@ is not open for writing. .El .Sh SEE ALSO .Xr chflags 2 , -.Xr open 2 +.Xr open 2 , +.Xr shm_open 2 .Sh HISTORY The .Fn truncate -system call appeared in +and +.Fn ftruncate +system calls appeared in .Bx 4.2 . .Sh BUGS These calls should be generalized to allow ranges diff --git a/lib/libevent/Makefile b/lib/libevent/Makefile index d8b1e2032ce34..1d20bcdc94786 100644 --- a/lib/libevent/Makefile +++ b/lib/libevent/Makefile @@ -7,7 +7,6 @@ LIB= event SHLIB_MAJOR= 1 PRIVATELIB= -INTERNALLIB= SRCS= buffer.c evbuffer.c event.c kqueue.c log.c poll.c select.c signal.c HDRS= event.h diff --git a/lib/libucl/Makefile b/lib/libucl/Makefile index b94f3dac40f6b..310e8b70c0717 100644 --- a/lib/libucl/Makefile +++ b/lib/libucl/Makefile @@ -14,8 +14,10 @@ SRCS= ucl_emitter_streamline.c \ ucl_util.c \ xxhash.c -.PATH: ${LIBUCL}/src +.PATH: ${LIBUCL}/src \ + ${LIBUCL}/include +INCS= ucl.h LIBADD= m WARNS= 1 diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 0c158456db4da..1e6e627011b9d 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <machine/specialreg.h> #include <machine/param.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> @@ -958,9 +959,9 @@ vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities) return (error); } -static int -gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, int *fault, uint64_t *gpa) +int +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *fault) { struct vm_gla2gpa gg; int error; @@ -979,29 +980,18 @@ gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, return (error); } -int -vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) -{ - int error, fault; - - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, gpa); - if (fault) - error = fault; - return (error); -} - #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault) { void *va; uint64_t gpa; - int error, fault, i, n, off; + int error, i, n, off; for (i = 0; i < iovcnt; i++) { iov[i].iov_base = 0; @@ -1010,18 +1000,16 @@ vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, while (len) { assert(iovcnt > 0); - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa); - if (error) - return (-1); - if (fault) - return (1); + error = vm_gla2gpa(ctx, vcpu, paging, gla, prot, &gpa, fault); + if (error || *fault) + return (error); off = gpa & PAGE_MASK; n = min(len, PAGE_SIZE - off); va = vm_map_gpa(ctx, gpa, n); if (va == NULL) - return (-1); + return (EFAULT); iov->iov_base = va; iov->iov_len = n; diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index d001cd8ee4230..d3ecdc4f843a3 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -64,7 +64,7 @@ int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *fault); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); void vm_set_memflags(struct vmctx *ctx, int flags); @@ -131,10 +131,15 @@ int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); /* * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. * The 'iovcnt' should be big enough to accomodate all GPA segments. - * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. + * + * retval fault Interpretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Error */ int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault); void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, void *host_dst, size_t len); void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, diff --git a/libexec/rtld-elf/debug.h b/libexec/rtld-elf/debug.h index 98fdfb4929c93..ed65227ee03da 100644 --- a/libexec/rtld-elf/debug.h +++ b/libexec/rtld-elf/debug.h @@ -32,10 +32,6 @@ #ifndef DEBUG_H #define DEBUG_H 1 -#ifndef __GNUC__ -#error "This file must be compiled with GCC" -#endif - #include <sys/cdefs.h> #include <string.h> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 3ac4467619922..1d91460f4c19b 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -34,10 +34,6 @@ * John Polstra <jdp@polstra.com>. */ -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include <sys/param.h> #include <sys/mount.h> #include <sys/mman.h> diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index f74d32027a7da..f7f34a6fab794 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -12,6 +12,15 @@ AMINAMESUFFIX!= date +-%Y-%m-%d PUBLISH= --public .endif +CLEANFILES+= ec2ami + +.if !exists(/usr/local/bin/bsdec2-image-upload) +CW_EC2_PORTINSTALL= cw-ec2-portinstall +CLEANFILES+= ${CW_EC2_PORTINSTALL} +.else +CW_EC2_PORTINSTALL= +.endif + cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean @@ -21,8 +30,9 @@ cw-ec2-portinstall: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/bsdec2-image-upload .endif + @touch ${.TARGET} -ec2ami: cw-ec2 cw-ec2-portinstall +ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" @@ -46,3 +56,4 @@ ec2ami: cw-ec2 cw-ec2-portinstall "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}" \ "${TYPE} ${REVISION}-${BRANCH}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} + @touch ${.TARGET} diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 4efb61d20bec5..72337f831cc3b 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -13,6 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="sysutils/u-boot-beaglebone" # Build chroot configuration load_chroot_env() { diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf new file mode 100644 index 0000000000000..bb8ebe998ca9f --- /dev/null +++ b/release/arm/RPI2.conf @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="sysutils/u-boot-rpi2" + +# Build chroot configuration +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} + +# Build target configuration +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="RPI2" + export CROCHETSRC="https://github.com/freebsd/crochet" + export CROCHETBRANCH="trunk@rHEAD" +} + diff --git a/release/arm/release.sh b/release/arm/release.sh index 104edd8cb32d3..c68f812c70438 100755 --- a/release/arm/release.sh +++ b/release/arm/release.sh @@ -42,11 +42,6 @@ before_build() { KNOWNHASH= UBOOT_VERSION= case ${KERNEL} in - BEAGLEBONE) - WANT_UBOOT=1 - KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" - UBOOT_VERSION="u-boot-2014.04" - ;; PANDABOARD) WANT_UBOOT=1 KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496" diff --git a/release/doc/en_US.ISO8859-1/relnotes/article.xml b/release/doc/en_US.ISO8859-1/relnotes/article.xml index 1528435f1aa50..b6ea140e804a8 100644 --- a/release/doc/en_US.ISO8859-1/relnotes/article.xml +++ b/release/doc/en_US.ISO8859-1/relnotes/article.xml @@ -22,7 +22,7 @@ <pubdate>$FreeBSD$</pubdate> - <!-- Last rev: 282146 --> + <!-- Last rev: 282482 --> <copyright> <year>2015</year> @@ -334,6 +334,17 @@ <literal>ARCHIVE_EXTRACT_SECURE_NODOTDOT</literal> to disallow directory traversal when extracting an archive, similar to &man.tar.1;.</para> + + <para revision="282208" contrib="sponsor" + sponsor="&multiplay;">The &man.chflags.1;, &man.chgrp.1;, + &man.chmod.1;, and &man.chown.8; utilities now affect symbolic + links when the <literal>-R</literal> flag is specified, as + documented in &man.symlink.7;.</para> + + <para revision="281617">A race condition in &man.wc.1; that + would cause final results to be sent to &man.stderr.4; when + receiving the <literal>SIGINFO</literal> signal has been + fixed.</para> </sect2> <sect2 xml:id="userland-contrib"> @@ -423,7 +434,7 @@ updated to version 20150410.</para> <para revision="281806">The &man.wpa.supplicant.8; and - &man.hostapd.8; utilties have been updated to version + &man.hostapd.8; utilities have been updated to version 2.4.</para> <para revision="281812"><application>bmake</application> has @@ -431,6 +442,10 @@ <para revision="282089">The &man.unbound.8; utility has been updated to version 1.5.3.</para> + + <para revision="282434" contrib="sponsor" sponsor="&ff;">The + &man.resolvconf.8; utility has been updated to version + 3.7.0.</para> </sect2> <sect2 xml:id="userland-installer"> @@ -681,6 +696,13 @@ <literal>vfs.devfs.dotimes</literal> has been added, which when set to a non-zero value, enables default precision timestamps for these operations.</para> + + <para revision="282213" contrib="sponsor" sponsor="&ff;">A new + &man.sysctl.8;, <literal>kern.racct.enable</literal>, has been + added, which when set to a non-zero value allows using + &man.rctl.8; with the <literal>GENERIC</literal> kernel. + A new kernel configuration option, + <literal>RACCT_DISABLED</literal> has also been added.</para> </sect2> </sect1> @@ -914,6 +936,30 @@ <para revision="281439" arch="arm">Support for the <application>QEMU</application> <literal>virt</literal> system has been added.</para> + + <para revision="282212" contrib="sponsor" sponsor="&msostc;">The + HyperV™ drivers have been updated with several + enhancements:</para> + + <itemizedlist> + <listitem> + <para>The &man.hv.vmbus.4; driver now has multi-channel + support.</para> + </listitem> + + <listitem> + <para>The &man.hv.storvsc.4; driver now has scatter/gather + support, in addition to performance improvements.</para> + </listitem> + + <listitem> + <para>The &man.hv.kvp.4; driver has received several bug + fixes.</para> + </listitem> + </itemizedlist> + + <para revision="282274">Support for &man.xen.4; para-virtualized + <literal>domU</literal> kernels has been removed.</para> </sect2> <sect2 xml:id="hardware-arm"> @@ -1175,6 +1221,11 @@ been updated to use multi-threaded &man.xz.1;. By default, the number of &man.xz.1; threads is set to the number of cores available.</para> + + <para revision="281802" contrib="sponsor" sponsor="&ff;">The + Release Engineering build tools have been updated to include + support for building &os;/&arch.arm64; virtual machine and + memory stick installation images.</para> </sect2> </sect1> </article> diff --git a/release/doc/share/xml/sponsor.ent b/release/doc/share/xml/sponsor.ent index 91cfe65c1e263..19787a2b32a5a 100644 --- a/release/doc/share/xml/sponsor.ent +++ b/release/doc/share/xml/sponsor.ent @@ -30,7 +30,9 @@ <!ENTITY limelight "Limelight Networks"> <!ENTITY lsi "LSI"> +<!ENTITY msostc "Microsoft Open Source Technology Center"> <!ENTITY mitail "MIT Computer Science & Artificial Intelligence Laboratory"> +<!ENTITY multiplay "Multiplay"> <!ENTITY netflix "Netflix"> <!ENTITY netgate "Netgate"> diff --git a/release/release.sh b/release/release.sh index 6b24b73b80714..158794f0c5154 100755 --- a/release/release.sh +++ b/release/release.sh @@ -238,6 +238,7 @@ fi # Embedded builds do not use the 'make release' target. if [ -n "${EMBEDDEDBUILD}" ]; then + buildenv_setup # If a crochet configuration file exists in *this* checkout of # release/, copy it to the /tmp/external directory within the chroot. # This allows building embedded releases without relying on updated diff --git a/release/tools/arm/crochet-BEAGLEBONE.conf b/release/tools/arm/crochet-BEAGLEBONE.conf index e72814fbdca72..7a32542ed0f95 100644 --- a/release/tools/arm/crochet-BEAGLEBONE.conf +++ b/release/tools/arm/crochet-BEAGLEBONE.conf @@ -27,3 +27,14 @@ FREEBSD_WORLD_EXTRA_ARGS="" FREEBSD_KERNEL_EXTRA_ARGS="" FREEBSD_EXTRA_ARGS="" IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img +BEAGLEBONE_UBOOT=/tmp/external/u-boot-beaglebone + +beaglebone_check_uboot() { + mkdir -p "${BEAGLEBONE_UBOOT}" + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/MLO \ + ${BEAGLEBONE_UBOOT}/MLO + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/u-boot.img \ + ${BEAGLEBONE_UBOOT}/bb-uboot.img + ln -fs ${BOARDDIR}/files/uEnv.txt \ + ${BEAGLEBONE_UBOOT}/bb-uenv.txt +} diff --git a/release/tools/arm/crochet-RPI2.conf b/release/tools/arm/crochet-RPI2.conf new file mode 100644 index 0000000000000..7ecab4ca5b44a --- /dev/null +++ b/release/tools/arm/crochet-RPI2.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD Raspberry Pi 2 images. + +board_setup RaspberryPi2 +option ImageSize 1gb +option Growfs + +export MAKEOBJDIRPREFIX=/usr/obj +FREEBSD_SRC=/usr/src +__MAKE_CONF=/dev/null +SRCCONF=/dev/null +WORKDIR=/usr/obj +_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) +_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) +KERNCONF=RPI2 +TARGET=arm +TARGET_ARCH=armv6 +FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" +FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" +FREEBSD_INSTALLWORLD_EXTRA_ARGS="" +FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" +FREEBSD_WORLD_EXTRA_ARGS="" +FREEBSD_KERNEL_EXTRA_ARGS="" +FREEBSD_EXTRA_ARGS="" +IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8 index 520f0491d5c6e..8e8f858432b86 100644 --- a/sbin/geom/class/part/gpart.8 +++ b/sbin/geom/class/part/gpart.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2015 +.Dd May 5, 2015 .Dt GPART 8 .Os .Sh NAME @@ -668,6 +668,8 @@ for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are +.Qq Li "!175" +for MBR, .Qq Li "!Apple_HFS" for APM and .Qq Li "!48465300-0000-11aa-aa11-00306543ecac" @@ -696,6 +698,8 @@ for GPT. .It Cm apple-ufs An Apple Mac OS X partition that contains a UFS filesystem. The scheme-specific types are +.Qq Li "!168" +for MBR, .Qq Li "!Apple_UNIX_SVR2" for APM and .Qq Li "!55465300-0000-11aa-aa11-00306543ecac" diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 08f47318e678e..594c28d178672 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -715,6 +715,7 @@ table_print_valheader(char *buf, size_t bufsize, uint32_t vmask) return; } + memset(buf, 0, bufsize); print_flags_buffer(buf, bufsize, tablevaltypes, vmask); } diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index f24ecdeea0c9c..23d5696b3ea24 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -737,9 +737,6 @@ main(int argc, char *const *argv) if (cansandbox && cap_enter() < 0 && errno != ENOSYS) err(1, "cap_enter"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); - cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit srecv"); diff --git a/sbin/resolvconf/Makefile b/sbin/resolvconf/Makefile index 18ef240d84658..2d4701eade42b 100644 --- a/sbin/resolvconf/Makefile +++ b/sbin/resolvconf/Makefile @@ -5,7 +5,7 @@ DIST= ${.CURDIR}/../../contrib/openresolv SCRIPTS= resolvconf -FILES= libc dnsmasq named pdnsd unbound +FILES= libc dnsmasq named pdnsd pdns_recursor unbound FILESDIR= /libexec/resolvconf MAN= resolvconf.conf.5 resolvconf.8 diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 index 9352e7660b4f4..d7686fd8cf7ec 100644 --- a/share/man/man4/usb_quirk.4 +++ b/share/man/man4/usb_quirk.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd May 7, 2015 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -170,6 +170,9 @@ ejects after Huawei SCSI command .It UQ_MSC_EJECT_TCT ejects after TCT SCSI command .Dv 0x06f504025270 +.It UQ_MSC_DYMO_EJECT +ejects after HID command +.Dv 0x1b5a01 .El .Pp See diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 7f79156b4a6e6..11dcb01b3a6d5 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1113,7 +1113,6 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ - namei.9 NDHASGIANT.9 \ namei.9 NDINIT.9 MLINKS+=netisr.9 netisr_clearqdrops.9 \ netisr.9 netisr_default_flow2cpu.9 \ diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 0bd827f2cd5e6..305665a22c477 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -33,14 +33,13 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd May 6, 2015 .Dt NAMEI 9 .Os .Sh NAME .Nm namei , .Nm NDINIT , .Nm NDFREE , -.Nm NDHASGIANT .Nd pathname translation and lookup operations .Sh SYNOPSIS .In sys/param.h @@ -55,8 +54,6 @@ .Fc .Ft void .Fn NDFREE "struct nameidata *ndp" "const uint flags" -.Ft int -.Fn NDHASGIANT "struct nameidata *ndp" .Sh DESCRIPTION The .Nm @@ -73,16 +70,6 @@ or depending on whether the .Dv LOCKLEAF flag was specified or not. -If the -.Va Giant -lock is required, -.Nm -will acquire it if the caller indicates it is -.Dv MPSAFE , -in which case the caller must later release -.Va Giant -based on the results of -.Fn NDHASGIANT . .Pp The .Fn NDINIT @@ -362,6 +349,3 @@ In order to solve this for the cases where both and .Dv LOCKLEAF are used, it is necessary to resort to recursive locking. -.Pp -Non-MPSAFE file systems exist, requiring callers to conditionally unlock -.Va Giant . diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 7df15cc83535b..0bf11134b4565 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -321,8 +321,15 @@ FreeBSD 5.2 | | | | | FreeBSD | | | | | 10.1 | | | DragonFly 4.0.1 | | | | | + | | | | DragonFly 4.0.2 | | | | | + | | | | DragonFly 4.0.3 | | | | | + | | | | DragonFly 4.0.4 + | | | | | + | | | | DragonFly 4.0.5 + | | | | | + | | | OpenBSD 5.7 | | | | | | | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current @@ -655,11 +662,16 @@ DragonFly 3.8.1 2014-06-16 [DFB] DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] DragonFly 3.8.2 2014-08-08 [DFB] -NetBSD 6.1.5 2014-09-22 [NDB] +NetBSD 6.1.5 2014-09-22 [NBD] Mac OS X 10.10 2014-10-16 [APL] OpenBSD 5.6 2014-11-01 [OBD] FreeBSD 10.1 2014-11-14 [FBD] DragonFly 4.0.1 2014-11-25 [DFB] +DragonFly 4.0.2 2015-01-07 [DFB] +DragonFly 4.0.3 2015-01-21 [DFB] +DragonFly 4.0.4 2015-03-09 [DFB] +DragonFly 4.0.5 2015-03-23 [DFB] +OpenBSD 5.7 2015-05-01 [OBD] Bibliography ------------------------ @@ -679,6 +691,10 @@ McKusick, Marshall Kirk, George Neville-Neil. The Design and Implementation of the FreeBSD Operating System. Addison-Wesley Professional, Published: Aug 2, 2004. ISBN 0-201-70245-2 +McKusick, Marshall Kirk, George Neville-Neil, Robert Watson. The +Design and Implementation of the FreeBSD Operating System, 2nd Edition. +Pearson Education, Inc., 2014. ISBN 0-321-96897-2 + Doug McIlroy. Research Unix Reader. Michael G. Brown. The Role of BSD in the Development of Unix. diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index 08632037de22e..dffd4665b8473 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -72,11 +72,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.c DPADD.${_T}+= ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c TEST_INTERFACE.${_T}= atf .endfor .endif @@ -90,11 +89,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_CXX} ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_cxx} ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c++ TEST_INTERFACE.${_T}= atf .endfor .endif diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index 1ef072ab3d99f..f0c9c425472e4 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -30,7 +30,7 @@ all: buildincludes ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} -${group}DIR?= ${INCLUDEDIR} +${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} _${group}INCS= .for header in ${${group}} diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index e2a48a8a7b836..f3969ec10ae5b 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -11,6 +11,7 @@ _LD= ${CXX} _LD= ${CC} .endif +LIB_PRIVATE= ${PRIVATELIB:Dprivate} # Set up the variables controlling shared libraries. After this section, # SHLIB_NAME will be defined only if we are to create a shared library. # SHLIB_LINK will be defined only if we are to create a link to it. @@ -23,7 +24,7 @@ _LD= ${CC} SHLIB= ${LIB} .endif .if !defined(SHLIB_NAME) && defined(SHLIB) && defined(SHLIB_MAJOR) -SHLIB_NAME= lib${SHLIB}.so.${SHLIB_MAJOR} +SHLIB_NAME= lib${LIB_PRIVATE}${SHLIB}.so.${SHLIB_MAJOR} .endif .if defined(SHLIB_NAME) && !empty(SHLIB_NAME:M*.so.*) SHLIB_LINK?= ${SHLIB_NAME:R} @@ -139,13 +140,8 @@ PO_FLAG=-pg all: beforebuild .WAIT beforebuild: objwarn -.if defined(PRIVATELIB) -_LIBDIR:=${LIBPRIVATEDIR} -_SHLIBDIR:=${LIBPRIVATEDIR} -.else _LIBDIR:=${LIBDIR} _SHLIBDIR:=${SHLIBDIR} -.endif .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" @@ -173,19 +169,15 @@ ${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) -_LIBS= lib${LIB}.a +_LIBS= lib${LIB_PRIVATE}${LIB}.a -lib${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} @@ -195,11 +187,11 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if !defined(INTERNALLIB) .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) -_LIBS+= lib${LIB}_p.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} NOPATH_FILES+= ${POBJS} -lib${LIB}_p.a: ${POBJS} +lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} @@ -254,9 +246,9 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .endif #defined(SHLIB_NAME) .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" -_LIBS+= lib${LIB}_pic.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a -lib${LIB}_pic.a: ${SOBJS} +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} @@ -316,13 +308,13 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}} realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: -.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" && !defined(PRIVATELIB) +.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR} .endif -.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) && !defined(PRIVATELIB) +.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},profile} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR} .endif .if defined(SHLIB_NAME) ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -336,7 +328,7 @@ _libinstall: ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} .endif -.if defined(SHLIB_LINK) && !defined(PRIVATELIB) +.if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory # prefix where shared objects will be installed by the install target. @@ -386,7 +378,7 @@ _libinstall: .endif # SHLIB_LDSCRIPT .endif # SHLIB_LINK .endif # SHIB_NAME -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" && !defined(PRIVATELIB) +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR} .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 5fa8e81d0d32b..ff8e17a04a4d4 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -58,10 +58,6 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} LDFLAGS+= -static .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR} -.endif - .if ${MK_DEBUG_FILES} != "no" PROG_FULL=${PROG}.full # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 512ad2fdd69c3..192bc001b4d9c 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -15,6 +15,7 @@ _PRIVATELIBS= \ atf_c \ atf_cxx \ bsdstat \ + event \ heimipcc \ heimipcs \ ldns \ @@ -28,7 +29,6 @@ _INTERNALIBS= \ bsnmptools \ cron \ elftc \ - event \ fifolog \ ipf \ lpr \ @@ -233,18 +233,25 @@ _DP_vmmapi= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -LDADD_atf_c= -L${LIBATF_CDIR} -latf-c -LDADD_atf_cxx= -L${LIBATF_CXXDIR} -latf-c++ +LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a +LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a +LDADD_atf_c= -lprivateatf-c +LDADD_atf_cxx= -lprivateatf-c++ + +.for _l in ${_PRIVATELIBS} +LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libprivate${_l}.a +.endfor .for _l in ${_LIBRARIES} -.if ${_PRIVATELIBS:M${_l}} -LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} -.endif .if ${_INTERNALIBS:M${_l}} LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} .endif DPADD_${_l}?= ${LIB${_l:tu}} +.if ${_PRIVATELIBS:M${_l}} +LDADD_${_l}?= -lprivate${_l} +.else LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} +.endif .if defined(_DP_${_l}) && defined(NO_SHARED) .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} @@ -253,12 +260,12 @@ LDADD_${_l}+= ${LDADD_${_d}} .endif .endfor -DPADD_sqlite3+= ${DPADD_pthread} -LDADD_sqlite3+= ${LDADD_pthread} - DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} +DPADD_sqlite3+= ${DPADD_pthread} +LDADD_sqlite3+= ${LDADD_pthread} + DPADD_fifolog+= ${DPADD_z} LDADD_fifolog+= ${LDADD_z} @@ -290,55 +297,15 @@ LDADD+= ${LDADD_${_l}} .error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - -LIBATF_CDIR= ${ROOTOBJDIR}/lib/atf/libatf-c -LDATF_C?= ${LIBATF_CDIR}/libatf-c.so -LIBATF_C?= ${LIBATF_CDIR}/libatf-c.a - -LIBATF_CXXDIR= ${ROOTOBJDIR}/lib/atf/libatf-c++ -LDATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.so -LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a - -LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat -LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a - LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc -LDELFTC?= ${LIBELFTCDIR}/libelftc.a LIBELFTC?= ${LIBELFTCDIR}/libelftc.a -LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent -LIBEVENT?= ${LIBEVENTDIR}/libevent.a - -LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc -LIBHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.a - -LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs -LIBHEIMIPCS?= ${LIBHEIMIPCSDIR}/libheimipcs.a - -LIBLDNSDIR= ${ROOTOBJDIR}/lib/libldns -LIBLDNS?= ${LIBLDNSDIR}/libldns.a - -LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh -LIBSSH?= ${LIBSSHDIR}/libssh.a - -LIBUNBOUNDDIR= ${ROOTOBJDIR}/lib/libunbound -LIBUNBOUND?= ${LIBUNBOUNDDIR}/libunbound.a - -LIBUCLDIR= ${ROOTOBJDIR}/lib/libucl -LIBUCL?= ${LIBUCLDIR}/libucl.a - LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash LIBOHASH?= ${LIBOHASHDIR}/libohash.a -LIBSQLITE3DIR= ${ROOTOBJDIR}/lib/libsqlite3 -LIBSQLITE3?= ${LIBSQLITE3DIR}/libsqlite3.a - LIBMANDOCDIR= ${ROOTOBJDIR}/lib/libmandoc LIBMANDOC?= ${LIBMANDOCDIR}/libmandoc.a diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 7c617bebdf0a9..d3798bcab2e39 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -276,7 +276,13 @@ vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu) static int __inline vcpu_should_yield(struct vm *vm, int vcpu) { - return (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)); + + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) + return (1); + else if (curthread->td_owepreempt) + return (1); + else + return (0); } #endif @@ -345,9 +351,10 @@ struct vm_copyinfo { * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for * a copyin or PROT_WRITE for a copyout. * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Intepretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Unrecoverable error * * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if * the return value is 0. The 'copyinfo[]' resources should be freed by calling @@ -355,7 +362,7 @@ struct vm_copyinfo { */ int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo); + int num_copyinfo, int *is_fault); void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, int num_copyinfo); void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, diff --git a/sys/amd64/include/vmm_instruction_emul.h b/sys/amd64/include/vmm_instruction_emul.h index 651b3b3642cce..5e7127f0129d6 100644 --- a/sys/amd64/include/vmm_instruction_emul.h +++ b/sys/amd64/include/vmm_instruction_emul.h @@ -81,17 +81,19 @@ int vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_reg_name seg, */ int vmm_fetch_instruction(struct vm *vm, int cpuid, struct vm_guest_paging *guest_paging, - uint64_t rip, int inst_length, struct vie *vie); + uint64_t rip, int inst_length, struct vie *vie, + int *is_fault); /* * Translate the guest linear address 'gla' to a guest physical address. * - * Returns 0 on success and '*gpa' contains the result of the translation. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Interpretation + * 0 0 'gpa' contains result of the translation + * 0 1 An exception was injected into the guest + * EFAULT N/A An unrecoverable hypervisor error occurred */ int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *is_fault); void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index 7cc13ca3fcf9c..20e8f765cb9a4 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -564,6 +564,19 @@ svm_vminit(struct vm *vm, pmap_t pmap) return (svm_sc); } +/* + * Collateral for a generic SVM VM-exit. + */ +static void +vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) +{ + + vme->exitcode = VM_EXITCODE_SVM; + vme->u.svm.exitcode = code; + vme->u.svm.exitinfo1 = info1; + vme->u.svm.exitinfo2 = info2; +} + static int svm_cpl(struct vmcb_state *state) { @@ -1080,6 +1093,76 @@ clear_nmi_blocking(struct svm_softc *sc, int vcpu) KASSERT(!error, ("%s: error %d setting intr_shadow", __func__, error)); } +#define EFER_MBZ_BITS 0xFFFFFFFFFFFF0200UL + +static int +svm_write_efer(struct svm_softc *sc, int vcpu, uint64_t newval, bool *retu) +{ + struct vm_exit *vme; + struct vmcb_state *state; + uint64_t changed, lma, oldval; + int error; + + state = svm_get_vmcb_state(sc, vcpu); + + oldval = state->efer; + VCPU_CTR2(sc->vm, vcpu, "wrmsr(efer) %#lx/%#lx", oldval, newval); + + newval &= ~0xFE; /* clear the Read-As-Zero (RAZ) bits */ + changed = oldval ^ newval; + + if (newval & EFER_MBZ_BITS) + goto gpf; + + /* APMv2 Table 14-5 "Long-Mode Consistency Checks" */ + if (changed & EFER_LME) { + if (state->cr0 & CR0_PG) + goto gpf; + } + + /* EFER.LMA = EFER.LME & CR0.PG */ + if ((newval & EFER_LME) != 0 && (state->cr0 & CR0_PG) != 0) + lma = EFER_LMA; + else + lma = 0; + + if ((newval & EFER_LMA) != lma) + goto gpf; + + if (newval & EFER_NXE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_NO_EXECUTE)) + goto gpf; + } + + /* + * XXX bhyve does not enforce segment limits in 64-bit mode. Until + * this is fixed flag guest attempt to set EFER_LMSLE as an error. + */ + if (newval & EFER_LMSLE) { + vme = vm_exitinfo(sc->vm, vcpu); + vm_exit_svm(vme, VMCB_EXIT_MSR, 1, 0); + *retu = true; + return (0); + } + + if (newval & EFER_FFXSR) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_FFXSR)) + goto gpf; + } + + if (newval & EFER_TCE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_TCE)) + goto gpf; + } + + error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, newval); + KASSERT(error == 0, ("%s: error %d updating efer", __func__, error)); + return (0); +gpf: + vm_inject_gp(sc->vm, vcpu); + return (0); +} + static int emulate_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu) @@ -1089,7 +1172,7 @@ emulate_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, if (lapic_msr(num)) error = lapic_wrmsr(sc->vm, vcpu, num, val, retu); else if (num == MSR_EFER) - error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, val); + error = svm_write_efer(sc, vcpu, val, retu); else error = svm_wrmsr(sc, vcpu, num, val, retu); @@ -1189,19 +1272,6 @@ nrip_valid(uint64_t exitcode) } } -/* - * Collateral for a generic SVM VM-exit. - */ -static void -vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) -{ - - vme->exitcode = VM_EXITCODE_SVM; - vme->u.svm.exitcode = code; - vme->u.svm.exitinfo1 = info1; - vme->u.svm.exitinfo2 = info2; -} - static int svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit) { diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index bca9b98adc7ec..51c63f5459f2e 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1256,7 +1256,7 @@ vm_handle_inst_emul(struct vm *vm, int vcpuid, bool *retu) mem_region_read_t mread; mem_region_write_t mwrite; enum vm_cpu_mode cpu_mode; - int cs_d, error, length; + int cs_d, error, fault, length; vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; @@ -1279,19 +1279,15 @@ vm_handle_inst_emul(struct vm *vm, int vcpuid, bool *retu) */ length = vme->inst_length ? vme->inst_length : VIE_INST_SIZE; error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip + - cs_base, length, vie); + cs_base, length, vie, &fault); } else { /* * The instruction bytes have already been copied into 'vie' */ - error = 0; + error = fault = 0; } - if (error == 1) - return (0); /* Resume guest to handle page fault */ - else if (error == -1) - return (EFAULT); - else if (error != 0) - panic("%s: vmm_fetch_instruction error %d", __func__, error); + if (error || fault) + return (error); if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, cs_d, vie) != 0) { VCPU_CTR1(vm, vcpuid, "Error decoding instruction at %#lx", @@ -2323,7 +2319,7 @@ vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo) + int num_copyinfo, int *fault) { int error, idx, nused; size_t n, off, remaining; @@ -2336,8 +2332,8 @@ vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, remaining = len; while (remaining > 0) { KASSERT(nused < num_copyinfo, ("insufficient vm_copyinfo")); - error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa); - if (error) + error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa, fault); + if (error || *fault) return (error); off = gpa & PAGE_MASK; n = min(remaining, PAGE_SIZE - off); @@ -2359,8 +2355,9 @@ vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, if (idx != nused) { vm_copy_teardown(vm, vcpuid, copyinfo, num_copyinfo); - return (-1); + return (EFAULT); } else { + *fault = 0; return (0); } } diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 5be99cbcf4a19..e3e140af5cc17 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -441,19 +441,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, CTASSERT(PROT_EXEC == VM_PROT_EXECUTE); gg = (struct vm_gla2gpa *)data; error = vm_gla2gpa(sc->vm, gg->vcpuid, &gg->paging, gg->gla, - gg->prot, &gg->gpa); - KASSERT(error == 0 || error == 1 || error == -1, + gg->prot, &gg->gpa, &gg->fault); + KASSERT(error == 0 || error == EFAULT, ("%s: vm_gla2gpa unknown error %d", __func__, error)); - if (error >= 0) { - /* - * error = 0: the translation was successful - * error = 1: a fault was injected into the guest - */ - gg->fault = error; - error = 0; - } else { - error = EFAULT; - } break; } case VM_ACTIVATE_CPU: diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 71723654d54f2..9c6158a2f0ac8 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -178,14 +178,20 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x23, .op_type = VIE_OP_TYPE_AND, }, + [0x80] = { + /* Group 1 extended opcode */ + .op_byte = 0x80, + .op_type = VIE_OP_TYPE_GROUP1, + .op_flags = VIE_OP_F_IMM8, + }, [0x81] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x81, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM, }, [0x83] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x83, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM8, @@ -591,13 +597,11 @@ emulate_movx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, /* * Helper function to calculate and validate a linear address. - * - * Returns 0 on success and 1 if an exception was injected into the guest. */ static int get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, int opsize, int addrsize, int prot, enum vm_reg_name seg, - enum vm_reg_name gpr, uint64_t *gla) + enum vm_reg_name gpr, uint64_t *gla, int *fault) { struct seg_desc desc; uint64_t cr0, val, rflags; @@ -623,7 +627,7 @@ get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_canonical_check(paging->cpu_mode, *gla)) { @@ -631,14 +635,19 @@ get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_alignment_check(paging->cpl, opsize, cr0, rflags, *gla)) { vm_inject_ac(vm, vcpuid, 0); - return (1); + goto guest_fault; } + *fault = 0; + return (0); + +guest_fault: + *fault = 1; return (0); } @@ -654,7 +663,7 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, #endif uint64_t dstaddr, srcaddr, dstgpa, srcgpa, val; uint64_t rcx, rdi, rsi, rflags; - int error, opsize, seg, repeat; + int error, fault, opsize, seg, repeat; opsize = (vie->op.op_byte == 0xA4) ? 1 : vie->opsize; val = 0; @@ -677,8 +686,10 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, * The count register is %rcx, %ecx or %cx depending on the * address size of the instruction. */ - if ((rcx & vie_size2mask(vie->addrsize)) == 0) - return (0); + if ((rcx & vie_size2mask(vie->addrsize)) == 0) { + error = 0; + goto done; + } } /* @@ -699,13 +710,16 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, seg = vie->segment_override ? vie->segment_register : VM_REG_GUEST_DS; error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr); - if (error) + PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr, &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, srcaddr, opsize, PROT_READ, - copyinfo, nitems(copyinfo)); + copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (2): read from system memory and write to mmio. */ @@ -714,11 +728,6 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, error = memwrite(vm, vcpuid, gpa, val, opsize, arg); if (error) goto done; - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * 'vm_copy_setup()' is expected to fail for cases (3) and (4) @@ -726,13 +735,17 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, */ error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr); - if (error) + PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr, + &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, dstaddr, opsize, - PROT_WRITE, copyinfo, nitems(copyinfo)); + PROT_WRITE, copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (3): read from MMIO and write to system memory. * @@ -748,27 +761,29 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, vm_copyout(vm, vcpuid, &val, copyinfo, opsize); vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * Case (4): read from and write to mmio. + * + * Commit to the MMIO read/write (with potential + * side-effects) only after we are sure that the + * instruction is not going to be restarted due + * to address translation faults. */ error = vm_gla2gpa(vm, vcpuid, paging, srcaddr, - PROT_READ, &srcgpa); - if (error) - goto done; - error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); - if (error) + PROT_READ, &srcgpa, &fault); + if (error || fault) goto done; error = vm_gla2gpa(vm, vcpuid, paging, dstaddr, - PROT_WRITE, &dstgpa); + PROT_WRITE, &dstgpa, &fault); + if (error || fault) + goto done; + + error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); if (error) goto done; + error = memwrite(vm, vcpuid, dstgpa, val, opsize, arg); if (error) goto done; @@ -813,10 +828,9 @@ emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, vm_restart_instruction(vm, vcpuid); } done: - if (error < 0) - return (EFAULT); - else - return (0); + KASSERT(error == 0 || error == EFAULT, ("%s: unexpected error %d", + __func__, error)); + return (error); } static int @@ -1066,9 +1080,13 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, rflags2 = getcc(size, op1, op2); break; + case 0x80: case 0x81: case 0x83: /* + * 80 /7 cmp r/m8, imm8 + * REX + 80 /7 cmp r/m8, imm8 + * * 81 /7 cmp r/m16, imm16 * 81 /7 cmp r/m32, imm32 * REX.W + 81 /7 cmp r/m64, imm32 sign-extended to 64 @@ -1084,6 +1102,8 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, * the status flags. * */ + if (vie->op.op_byte == 0x80) + size = 1; /* get the first operand */ error = memread(vm, vcpuid, gpa, &op1, size, arg); @@ -1173,7 +1193,7 @@ emulate_stack_op(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie, #endif struct seg_desc ss_desc; uint64_t cr0, rflags, rsp, stack_gla, val; - int error, size, stackaddrsize, pushop; + int error, fault, size, stackaddrsize, pushop; val = 0; size = vie->opsize; @@ -1239,18 +1259,10 @@ emulate_stack_op(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie, } error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, - pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo)); - if (error == -1) { - /* - * XXX cannot return a negative error value here because it - * ends up being the return value of the VM_RUN() ioctl and - * is interpreted as a pseudo-error (for e.g. ERESTART). - */ - return (EFAULT); - } else if (error == 1) { - /* Resume guest execution to handle page fault */ - return (0); - } + pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo), + &fault); + if (error || fault) + return (error); if (pushop) { error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); @@ -1660,7 +1672,7 @@ ptp_hold(struct vm *vm, vm_paddr_t ptpphys, size_t len, void **cookie) int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) { int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; @@ -1668,6 +1680,8 @@ vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint32_t *ptpbase32, pte32; void *cookie; + *guest_fault = 0; + usermode = (paging->cpl == 3 ? 1 : 0); writable = prot & VM_PROT_WRITE; cookie = NULL; @@ -1830,18 +1844,20 @@ restart: *gpa = pte | (gla & (pgsize - 1)); done: ptp_release(&cookie); + KASSERT(retval == 0 || retval == EFAULT, ("%s: unexpected retval %d", + __func__, retval)); return (retval); error: - retval = -1; + retval = EFAULT; goto done; fault: - retval = 1; + *guest_fault = 1; goto done; } int vmm_fetch_instruction(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t rip, int inst_length, struct vie *vie) + uint64_t rip, int inst_length, struct vie *vie, int *faultptr) { struct vm_copyinfo copyinfo[2]; int error, prot; @@ -1851,13 +1867,14 @@ vmm_fetch_instruction(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, prot = PROT_READ | PROT_EXEC; error = vm_copy_setup(vm, vcpuid, paging, rip, inst_length, prot, - copyinfo, nitems(copyinfo)); - if (error == 0) { - vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); - vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - vie->num_valid = inst_length; - } - return (error); + copyinfo, nitems(copyinfo), faultptr); + if (error || *faultptr) + return (error); + + vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + vie->num_valid = inst_length; + return (0); } static int diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index 137c7ee9006bd..525e1d9b912f9 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -488,3 +488,34 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, return (1); } + +bool +vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability cap) +{ + bool rv; + + KASSERT(cap > 0 && cap < VCC_LAST, ("%s: invalid vm_cpu_capability %d", + __func__, cap)); + + /* + * Simply passthrough the capabilities of the host cpu for now. + */ + rv = false; + switch (cap) { + case VCC_NO_EXECUTE: + if (amd_feature & AMDID_NX) + rv = true; + break; + case VCC_FFXSR: + if (amd_feature & AMDID_FFXSR) + rv = true; + break; + case VCC_TCE: + if (amd_feature2 & AMDID2_TCE) + rv = true; + break; + default: + panic("%s: unknown vm_cpu_capability %d", __func__, cap); + } + return (rv); +} diff --git a/sys/amd64/vmm/x86.h b/sys/amd64/vmm/x86.h index 8401c15f989a4..6f99d52931d71 100644 --- a/sys/amd64/vmm/x86.h +++ b/sys/amd64/vmm/x86.h @@ -62,4 +62,17 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); +enum vm_cpuid_capability { + VCC_NONE, + VCC_NO_EXECUTE, + VCC_FFXSR, + VCC_TCE, + VCC_LAST +}; + +/* + * Return 'true' if the capability 'cap' is enabled in this virtual cpu + * and 'false' otherwise. + */ +bool vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability); #endif diff --git a/sys/arm/amlogic/aml8726/aml8726_uart.h b/sys/arm/amlogic/aml8726/aml8726_uart.h index ee633253390e2..fbdd657fb2ca9 100644 --- a/sys/arm/amlogic/aml8726/aml8726_uart.h +++ b/sys/arm/amlogic/aml8726/aml8726_uart.h @@ -94,4 +94,14 @@ #define AML_UART_MISC_RECV_IRQ_CNT_MASK 0xff #define AML_UART_MISC_RECV_IRQ_CNT_SHIFT 0 +/* + * The new baud rate register is available on the + * aml8726-m6 and later. + */ +#define AML_UART_NEW_BAUD_REG 20 +#define AML_UART_NEW_BAUD_USE_XTAL_CLK (1 << 24) +#define AML_UART_NEW_BAUD_RATE_EN (1 << 23) +#define AML_UART_NEW_BAUD_RATE_MASK (0x7fffff << 0) +#define AML_UART_NEW_BAUD_RATE_SHIFT 0 + #endif /* _ARM_AMLOGIC_AML8726_UART_H */ diff --git a/sys/arm/amlogic/aml8726/uart_dev_aml8726.c b/sys/arm/amlogic/aml8726/uart_dev_aml8726.c index 1dda52f42d18a..5d21fb05569b6 100644 --- a/sys/arm/amlogic/aml8726/uart_dev_aml8726.c +++ b/sys/arm/amlogic/aml8726/uart_dev_aml8726.c @@ -31,8 +31,8 @@ * uarts. For example ... though UART A as a 128 byte FIFO, the * others only have a 64 byte FIFO. * - * Also, it's assumed that register 5 (the new baud rate register - * present on the aml8726-m6) has not been activated. + * Also, it's assumed that the USE_XTAL_CLK feature (available on + * the aml8726-m6 and later) has not been activated. */ #include <sys/cdefs.h> @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include <dev/uart/uart_cpu_fdt.h> #include <dev/uart/uart_bus.h> +#include <arm/amlogic/aml8726/aml8726_soc.h> #include <arm/amlogic/aml8726/aml8726_uart.h> #include "uart_if.h" @@ -89,7 +90,7 @@ aml8726_uart_divisor(int rclk, int baudrate) /* integer version of (rclk / baudrate + .5) */ divisor = ((rclk << 1) + baudrate) / (baudrate << 1); - if (divisor == 0 || divisor >= 65536) + if (divisor == 0) return (0); actual_baud = rclk / divisor; @@ -109,6 +110,7 @@ aml8726_uart_param(struct uart_bas *bas, int baudrate, int databits, int stopbit { uint32_t cr; uint32_t mr; + uint32_t nbr; int divisor; cr = uart_getreg(bas, AML_UART_CONTROL_REG); @@ -147,8 +149,29 @@ aml8726_uart_param(struct uart_bas *bas, int baudrate, int databits, int stopbit /* Set baudrate. */ if (baudrate > 0 && bas->rclk != 0) { divisor = aml8726_uart_divisor(bas->rclk / 4, baudrate) - 1; - if (divisor > 0xffff) - return (EINVAL); + + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + if (divisor > (AML_UART_NEW_BAUD_RATE_MASK >> + AML_UART_NEW_BAUD_RATE_SHIFT)) + return (EINVAL); + + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + nbr &= ~(AML_UART_NEW_BAUD_USE_XTAL_CLK | + AML_UART_NEW_BAUD_RATE_MASK); + nbr |= AML_UART_NEW_BAUD_RATE_EN | + (divisor << AML_UART_NEW_BAUD_RATE_SHIFT); + uart_setreg(bas, AML_UART_NEW_BAUD_REG, nbr); + + divisor = 0; + break; + default: + if (divisor > 0xffff) + return (EINVAL); + break; + } cr &= ~AML_UART_CONTROL_BAUD_MASK; cr |= (divisor & AML_UART_CONTROL_BAUD_MASK); @@ -187,7 +210,7 @@ aml8726_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits uint32_t cr; uint32_t mr; - aml8726_uart_param(bas, baudrate, databits, stopbits, parity); + (void)aml8726_uart_param(bas, baudrate, databits, stopbits, parity); cr = uart_getreg(bas, AML_UART_CONTROL_REG); /* Disable all interrupt sources. */ @@ -466,7 +489,7 @@ aml8726_uart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { struct uart_bas *bas; int baudrate, divisor, error; - uint32_t cr, mr; + uint32_t cr, mr, nbr; bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); @@ -483,6 +506,20 @@ aml8726_uart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) divisor = ((mr >> AML_UART_MISC_BAUD_EXT_SHIFT) << AML_UART_CONTROL_BAUD_WIDTH) | cr; + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + if ((nbr & AML_UART_NEW_BAUD_RATE_EN) != 0) { + divisor = (nbr & AML_UART_NEW_BAUD_RATE_MASK) >> + AML_UART_NEW_BAUD_RATE_SHIFT; + } + break; + default: + break; + } + baudrate = bas->rclk / 4 / (divisor + 1); if (baudrate > 0) *(int*)data = baudrate; diff --git a/sys/arm/arm/cpufunc_asm_armv7.S b/sys/arm/arm/cpufunc_asm_armv7.S index 25f052fd5553e..7016d7eeffb0a 100644 --- a/sys/arm/arm/cpufunc_asm_armv7.S +++ b/sys/arm/arm/cpufunc_asm_armv7.S @@ -266,6 +266,9 @@ END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] + sub r3, ip, #1 /* Address need not be aligned, but */ + and r2, r0, r3 /* round length up if op spans line */ + add r1, r1, r2 /* boundary: len += addr & linemask; */ .Larmv7_sync_next: mcr CP15_DCCMVAC(r0) mcr CP15_ICIMVAU(r0) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index d246a87328086..56db9cadfe2ea 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -31,7 +31,7 @@ */ /** - * Cortex-A15 (and probably A7) Generic Timer + * Cortex-A7, Cortex-A15, ARMv8 and later Generic Timer */ #include <sys/cdefs.h> diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index a76e18a45c400..3ef156b7c082e 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -114,7 +114,57 @@ __FBSDID("$FreeBSD$"); #ifdef DDB #include <ddb/ddb.h> -#endif + +#if __ARM_ARCH >= 6 +#include <machine/cpu-v6.h> + +DB_SHOW_COMMAND(cp15, db_show_cp15) +{ + u_int reg; + + reg = cp15_midr_get(); + db_printf("Cpu ID: 0x%08x\n", reg); + reg = cp15_ctr_get(); + db_printf("Current Cache Lvl ID: 0x%08x\n",reg); + + reg = cp15_sctlr_get(); + db_printf("Ctrl: 0x%08x\n",reg); + reg = cp15_actlr_get(); + db_printf("Aux Ctrl: 0x%08x\n",reg); + + reg = cp15_id_pfr0_get(); + db_printf("Processor Feat 0: 0x%08x\n", reg); + reg = cp15_id_pfr1_get(); + db_printf("Processor Feat 1: 0x%08x\n", reg); + reg = cp15_id_dfr0_get(); + db_printf("Debug Feat 0: 0x%08x\n", reg); + reg = cp15_id_afr0_get(); + db_printf("Auxiliary Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr0_get(); + db_printf("Memory Model Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr1_get(); + db_printf("Memory Model Feat 1: 0x%08x\n", reg); + reg = cp15_id_mmfr2_get(); + db_printf("Memory Model Feat 2: 0x%08x\n", reg); + reg = cp15_id_mmfr3_get(); + db_printf("Memory Model Feat 3: 0x%08x\n", reg); + reg = cp15_ttbr_get(); + db_printf("TTB0: 0x%08x\n", reg); +} + +DB_SHOW_COMMAND(vtop, db_show_vtop) +{ + u_int reg; + + if (have_addr) { + cp15_ats1cpr_set(addr); + reg = cp15_par_get(); + db_printf("Physical address reg: 0x%08x\n",reg); + } else + db_printf("show vtop <virt_addr>\n"); +} +#endif /* __ARM_ARCH >= 6 */ +#endif /* DDB */ #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c index 2ea5b495c5c60..1466313a9526c 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2013-2014 Daisuke Aoyama <aoyama@peach.ne.jp> + * Copyright (C) 2013-2015 Daisuke Aoyama <aoyama@peach.ne.jp> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,21 +60,28 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(fmt, ...) #endif -#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) -#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) -#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) -#define MVOLT2OFFSET(val) (((val) - 1200) / 25) +#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) +#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) -#define DEFAULT_ARM_FREQUENCY 700 -#define DEFAULT_CORE_FREQUENCY 250 -#define DEFAULT_SDRAM_FREQUENCY 400 -#define DEFAULT_LOWEST_FREQ 300 -#define TRANSITION_LATENCY 1000 -#define MIN_OVER_VOLTAGE -16 -#define MAX_OVER_VOLTAGE 6 -#define MSG_ERROR -999999999 -#define MHZSTEP 100 -#define HZSTEP (MHZ2HZ(MHZSTEP)) +#ifdef SOC_BCM2836 +#define OFFSET2MVOLT(val) (((val) / 1000)) +#define MVOLT2OFFSET(val) (((val) * 1000)) +#define DEFAULT_ARM_FREQUENCY 600 +#define DEFAULT_LOWEST_FREQ 600 +#else +#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) +#define MVOLT2OFFSET(val) (((val) - 1200) / 25) +#define DEFAULT_ARM_FREQUENCY 700 +#define DEFAULT_LOWEST_FREQ 300 +#endif +#define DEFAULT_CORE_FREQUENCY 250 +#define DEFAULT_SDRAM_FREQUENCY 400 +#define TRANSITION_LATENCY 1000 +#define MIN_OVER_VOLTAGE -16 +#define MAX_OVER_VOLTAGE 6 +#define MSG_ERROR -999999999 +#define MHZSTEP 100 +#define HZSTEP (MHZ2HZ(MHZSTEP)) #define TZ_ZEROC 2732 #define VC_LOCK(sc) do { \ @@ -1418,7 +1425,10 @@ static int bcm2835_cpufreq_probe(device_t dev) { + if (device_get_unit(dev) != 0) + return (ENXIO); device_set_desc(dev, "CPU Frequency Control"); + return (0); } @@ -1740,6 +1750,23 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf_setting *sets, if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; +#ifdef SOC_BCM2836 + /* XXX RPi2 have only 900/600MHz */ + idx = 0; + volts = sc->min_voltage_core; + sets[idx].freq = freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + if (freq != min_freq) { + sets[idx].freq = min_freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + } +#else /* from freq to min_freq */ for (idx = 0; idx < *count && freq >= min_freq; idx++) { if (freq > sc->arm_min_freq) @@ -1752,7 +1779,8 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf_setting *sets, sets[idx].dev = dev; freq -= MHZSTEP; } - *count = ++idx; +#endif + *count = idx; return (0); } diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c index 1024a48e7fa28..e950ec6913b39 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -68,15 +68,8 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -/* DMA doesn't yet work with the bcm3826 */ -#ifdef SOC_BCM2836 -#define PIO_MODE 1 -#else -#define PIO_MODE 0 -#endif - static int bcm2835_sdhci_hs = 1; -static int bcm2835_sdhci_pio_mode = PIO_MODE; +static int bcm2835_sdhci_pio_mode = 0; TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h index cb871f23bf9e2..7b79b1ab5ea41 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h +++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h @@ -37,14 +37,20 @@ #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 +#ifdef SOC_BCM2836 +#define BCM2835_ARM_IO_BASE 0x3f000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED +#else #define BCM2835_ARM_IO_BASE 0x20000000 -#define BCM2835_ARM_IO_SIZE 0x02000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED +#endif +#define BCM2835_ARM_IO_SIZE 0x01000000 /* * Convert physical address to VC bus address. Should be used * when submitting address over mailbox interface */ -#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_CACHED) +#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_BASE) /* Check whether pa bellong top IO window */ #define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ @@ -61,6 +67,6 @@ * when address is returned by VC over mailbox interface. e.g. * framebuffer base */ -#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_CACHED) +#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_BASE) #endif /* _BCM2835_VCBUS_H_ */ diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index 3e89eae1b53b2..58ad8e4f921d9 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -52,7 +52,9 @@ __FBSDID("$FreeBSD$"); #define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4) #define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4) #define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4) -#define INT_PENDING_MASK 0x0f +#define INT_PENDING_MASK 0x01f +#define MAILBOX0_IRQ 4 +#define MAILBOX0_IRQEN (1 << 0) /* * A driver for features of the bcm2836. @@ -141,12 +143,27 @@ void bcm2836_mask_irq(uintptr_t irq) { uint32_t reg; +#ifdef SMP + int cpu; +#endif int i; - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); - reg &= ~(1 << irq); - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + if (irq < MAILBOX0_IRQ) { + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i)); + reg &= ~(1 << irq); + bus_write_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i), reg); + } +#ifdef SMP + } else if (irq == MAILBOX0_IRQ) { + /* Mailbox 0 for IPI */ + cpu = PCPU_GET(cpuid); + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); + reg &= ~MAILBOX0_IRQEN; + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); +#endif } } @@ -154,12 +171,27 @@ void bcm2836_unmask_irq(uintptr_t irq) { uint32_t reg; +#ifdef SMP + int cpu; +#endif int i; - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); - reg |= (1 << irq); - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + if (irq < MAILBOX0_IRQ) { + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i)); + reg |= (1 << irq); + bus_write_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i), reg); + } +#ifdef SMP + } else if (irq == MAILBOX0_IRQ) { + /* Mailbox 0 for IPI */ + cpu = PCPU_GET(cpuid); + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); + reg |= MAILBOX0_IRQEN; + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); +#endif } } diff --git a/sys/arm/broadcom/bcm2835/bcm2836_mp.c b/sys/arm/broadcom/bcm2835/bcm2836_mp.c new file mode 100644 index 0000000000000..177f41ec6ed9f --- /dev/null +++ b/sys/arm/broadcom/bcm2835/bcm2836_mp.c @@ -0,0 +1,207 @@ +/*- + * Copyright (C) 2015 Daisuke Aoyama <aoyama@peach.ne.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/smp.h> + +#include <vm/vm.h> +#include <vm/pmap.h> + +#include <machine/smp.h> +#include <machine/bus.h> +#include <machine/fdt.h> +#include <machine/intr.h> + +#ifdef DEBUG +#define DPRINTF(fmt, ...) do { \ + printf("%s:%u: ", __func__, __LINE__); \ + printf(fmt, ##__VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(fmt, ...) +#endif + +#define ARM_LOCAL_BASE 0x40000000 +#define ARM_LOCAL_SIZE 0x00001000 + +/* mailbox registers */ +#define MBOXINTRCTRL_CORE(n) (0x00000050 + (0x04 * (n))) +#define MBOX0SET_CORE(n) (0x00000080 + (0x10 * (n))) +#define MBOX1SET_CORE(n) (0x00000084 + (0x10 * (n))) +#define MBOX2SET_CORE(n) (0x00000088 + (0x10 * (n))) +#define MBOX3SET_CORE(n) (0x0000008C + (0x10 * (n))) +#define MBOX0CLR_CORE(n) (0x000000C0 + (0x10 * (n))) +#define MBOX1CLR_CORE(n) (0x000000C4 + (0x10 * (n))) +#define MBOX2CLR_CORE(n) (0x000000C8 + (0x10 * (n))) +#define MBOX3CLR_CORE(n) (0x000000CC + (0x10 * (n))) + +static bus_space_handle_t bs_periph; + +#define BSRD4(addr) \ + bus_space_read_4(fdtbus_bs_tag, bs_periph, (addr)) +#define BSWR4(addr, val) \ + bus_space_write_4(fdtbus_bs_tag, bs_periph, (addr), (val)) + +void +platform_mp_init_secondary(void) +{ + +} + +void +platform_mp_setmaxid(void) +{ + + DPRINTF("platform_mp_setmaxid\n"); + if (mp_ncpus != 0) + return; + + mp_ncpus = 4; + mp_maxid = mp_ncpus - 1; + DPRINTF("mp_maxid=%d\n", mp_maxid); +} + +int +platform_mp_probe(void) +{ + + DPRINTF("platform_mp_probe\n"); + CPU_SETOF(0, &all_cpus); + if (mp_ncpus == 0) + platform_mp_setmaxid(); + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + uint32_t val; + int i, retry; + + DPRINTF("platform_mp_start_ap\n"); + + /* initialize */ + if (bus_space_map(fdtbus_bs_tag, ARM_LOCAL_BASE, ARM_LOCAL_SIZE, + 0, &bs_periph) != 0) + panic("can't map local peripheral\n"); + for (i = 0; i < mp_ncpus; i++) { + /* clear mailbox 0/3 */ + BSWR4(MBOX0CLR_CORE(i), 0xffffffff); + BSWR4(MBOX3CLR_CORE(i), 0xffffffff); + } + wmb(); + + /* boot secondary CPUs */ + for (i = 1; i < mp_ncpus; i++) { + /* set entry point to mailbox 3 */ + BSWR4(MBOX3SET_CORE(i), + (uint32_t)pmap_kextract((vm_offset_t)mpentry)); + wmb(); + + /* wait for bootup */ + retry = 1000; + do { + /* check entry point */ + val = BSRD4(MBOX3CLR_CORE(i)); + if (val == 0) + break; + DELAY(100); + retry--; + if (retry <= 0) { + printf("can't start for CPU%d\n", i); + break; + } + } while (1); + + /* dsb and sev */ + armv7_sev(); + + /* recode AP in CPU map */ + CPU_SET(i, &all_cpus); + } + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); +} + +void +pic_ipi_send(cpuset_t cpus, u_int ipi) +{ + int i; + + dsb(); + for (i = 0; i < mp_ncpus; i++) { + if (CPU_ISSET(i, &cpus)) + BSWR4(MBOX0SET_CORE(i), 1 << ipi); + } + wmb(); +} + +int +pic_ipi_read(int i) +{ + uint32_t val; + int cpu, ipi; + + cpu = PCPU_GET(cpuid); + dsb(); + if (i != -1) { + val = BSRD4(MBOX0CLR_CORE(cpu)); + if (val == 0) + return (0); + ipi = ffs(val) - 1; + return (ipi); + } + return (0x3ff); +} + +void +pic_ipi_clear(int ipi) +{ + int cpu; + + cpu = PCPU_GET(cpuid); + dsb(); + BSWR4(MBOX0CLR_CORE(cpu), 1 << ipi); + wmb(); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} diff --git a/sys/arm/broadcom/bcm2835/files.bcm2836 b/sys/arm/broadcom/bcm2835/files.bcm2836 index f797cf73bdc7c..36f4d2499665a 100644 --- a/sys/arm/broadcom/bcm2835/files.bcm2836 +++ b/sys/arm/broadcom/bcm2835/files.bcm2836 @@ -3,3 +3,4 @@ arm/arm/generic_timer.c standard arm/broadcom/bcm2835/bcm2836.c standard +arm/broadcom/bcm2835/bcm2836_mp.c optional smp diff --git a/sys/arm/broadcom/bcm2835/std.bcm2836 b/sys/arm/broadcom/bcm2835/std.bcm2836 index bb112bec424d5..862be752338a9 100644 --- a/sys/arm/broadcom/bcm2835/std.bcm2836 +++ b/sys/arm/broadcom/bcm2835/std.bcm2836 @@ -6,6 +6,7 @@ makeoptions CONF_CFLAGS="-march=armv7a" options SOC_BCM2836 options ARM_L2_PIPT +options IPI_IRQ_START=76 files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" diff --git a/sys/arm/conf/AML8726 b/sys/arm/conf/AML8726 index 7272db4b08a29..125a53dba7084 100644 --- a/sys/arm/conf/AML8726 +++ b/sys/arm/conf/AML8726 @@ -19,43 +19,14 @@ # $FreeBSD$ ident AML8726 + +include "std.armv6" include "../amlogic/aml8726/std.aml8726" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging diff --git a/sys/arm/conf/APALIS-IMX6 b/sys/arm/conf/APALIS-IMX6 index ceb21c7f4ab85..ce8a0d5221a1f 100644 --- a/sys/arm/conf/APALIS-IMX6 +++ b/sys/arm/conf/APALIS-IMX6 @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident APALIS-IMX6 makeoptions MODULES_OVERRIDE="" diff --git a/sys/arm/conf/ARMADAXP b/sys/arm/conf/ARMADAXP index f611e09da8827..6d51c16ca7124 100644 --- a/sys/arm/conf/ARMADAXP +++ b/sys/arm/conf/ARMADAXP @@ -19,43 +19,16 @@ # $FreeBSD$ ident MV-88F78XX0 -include "../mv/armadaxp/std.mv78x60" + +include "std.armv6" +include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP makeoptions WERROR="-Werror" options HZ=1000 -#options SCHED_ULE # ULE scheduler options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/ARNDALE b/sys/arm/conf/ARNDALE index 964f9e40041cd..1c16d131cfca2 100644 --- a/sys/arm/conf/ARNDALE +++ b/sys/arm/conf/ARNDALE @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5250" +include "EXYNOS5250" ident ARNDALE #FDT diff --git a/sys/arm/conf/ARNDALE-OCTA b/sys/arm/conf/ARNDALE-OCTA index ad937ee5a6627..a4faaa0387c89 100644 --- a/sys/arm/conf/ARNDALE-OCTA +++ b/sys/arm/conf/ARNDALE-OCTA @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5420" +include "EXYNOS5420" ident ARNDALE-OCTA #FDT diff --git a/sys/arm/conf/ATMEL b/sys/arm/conf/ATMEL index 572cf4a1ce5ef..c3b6035b4286a 100644 --- a/sys/arm/conf/ATMEL +++ b/sys/arm/conf/ATMEL @@ -6,7 +6,8 @@ ident ATMEL -include "../at91/std.atmel" +include "std.arm" +include "../at91/std.atmel" # Typical values for most SoCs and board configurations. Will not work for # at91sam9g45 or on some boards with non u-boot boot loaders. @@ -77,10 +78,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +options DDB # Enable the kernel debugger +options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp options BOOTP -options BOOTP_COMPAT options BOOTP_NFSROOT +options BOOTP_COMPAT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 @@ -94,20 +109,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -options DDB # Support DDB. -options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. @@ -115,7 +116,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device ate # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface diff --git a/sys/arm/conf/AVILA b/sys/arm/conf/AVILA index cbf27a2b63342..fd4d62a6de0a6 100644 --- a/sys/arm/conf/AVILA +++ b/sys/arm/conf/AVILA @@ -20,9 +20,10 @@ ident AVILA -include "../xscale/ixp425/std.ixp425" +include "std.arm" +include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" # Default places to look for devices. diff --git a/sys/arm/conf/BEAGLEBONE b/sys/arm/conf/BEAGLEBONE index 8234533b87ef6..97e2d3d2c1f79 100644 --- a/sys/arm/conf/BEAGLEBONE +++ b/sys/arm/conf/BEAGLEBONE @@ -23,7 +23,8 @@ ident BEAGLEBONE -include "../ti/am335x/std.am335x" +include "std.armv6" +include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x" @@ -35,38 +36,7 @@ makeoptions MODULES_EXTRA+="opensolaris dtrace dtrace/lockstat dtrace/profile dt options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT index a9e0e784361ea..a6f8e4991ae5f 100644 --- a/sys/arm/conf/BWCT +++ b/sys/arm/conf/BWCT @@ -21,9 +21,10 @@ ident BWCT +include "std.arm" options VERBOSE_INIT_ARM -include "../at91/std.bwct" +include "../at91/std.bwct" #To statically compile in device wiring instead of /boot/device.hints hints "BWCT.hints" diff --git a/sys/arm/conf/CAMBRIA b/sys/arm/conf/CAMBRIA index af29b23064252..c25521ba59007 100644 --- a/sys/arm/conf/CAMBRIA +++ b/sys/arm/conf/CAMBRIA @@ -20,9 +20,10 @@ ident CAMBRIA -include "../xscale/ixp425/std.ixp435" +include "std.arm" +include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. diff --git a/sys/arm/conf/CHROMEBOOK b/sys/arm/conf/CHROMEBOOK index 94591517cce4b..059f24344f4be 100644 --- a/sys/arm/conf/CHROMEBOOK +++ b/sys/arm/conf/CHROMEBOOK @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "EXYNOS5250" +include "EXYNOS5250" ident CHROMEBOOK hints "CHROMEBOOK.hints" diff --git a/sys/arm/conf/CHROMEBOOK-PEACH-PIT b/sys/arm/conf/CHROMEBOOK-PEACH-PIT index e01128c997782..87284c2eff90c 100644 --- a/sys/arm/conf/CHROMEBOOK-PEACH-PIT +++ b/sys/arm/conf/CHROMEBOOK-PEACH-PIT @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5420" +include "EXYNOS5420" ident CHROMEBOOK-PEACH-PIT hints "CHROMEBOOK-PEACH-PIT.hints" diff --git a/sys/arm/conf/CHROMEBOOK-SNOW b/sys/arm/conf/CHROMEBOOK-SNOW index e9242d1b47e1a..aee3dc07b5d92 100644 --- a/sys/arm/conf/CHROMEBOOK-SNOW +++ b/sys/arm/conf/CHROMEBOOK-SNOW @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "CHROMEBOOK" +include "CHROMEBOOK" ident CHROMEBOOK-SNOW #FDT diff --git a/sys/arm/conf/CHROMEBOOK-SPRING b/sys/arm/conf/CHROMEBOOK-SPRING index 1b791ac652bcd..9714d3402ca44 100644 --- a/sys/arm/conf/CHROMEBOOK-SPRING +++ b/sys/arm/conf/CHROMEBOOK-SPRING @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "CHROMEBOOK" +include "CHROMEBOOK" ident CHROMEBOOK-SPRING #FDT diff --git a/sys/arm/conf/CNS11XXNAS b/sys/arm/conf/CNS11XXNAS index 5ba221700c010..710a4715576e8 100644 --- a/sys/arm/conf/CNS11XXNAS +++ b/sys/arm/conf/CNS11XXNAS @@ -20,13 +20,14 @@ ident CNS11XXNAS +include "std.arm" #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../cavium/cns11xx/std.econa" +include "../cavium/cns11xx/std.econa" makeoptions MODULES_OVERRIDE="" diff --git a/sys/arm/conf/COLIBRI-VF50 b/sys/arm/conf/COLIBRI-VF50 index 9f73f6987f2f1..81581f6bf8427 100644 --- a/sys/arm/conf/COLIBRI-VF50 +++ b/sys/arm/conf/COLIBRI-VF50 @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident COLIBRI-VF50 #FDT diff --git a/sys/arm/conf/COSMIC b/sys/arm/conf/COSMIC index 72ae5c20b07b5..61b99a743d336 100644 --- a/sys/arm/conf/COSMIC +++ b/sys/arm/conf/COSMIC @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident COSMIC #FDT diff --git a/sys/arm/conf/CRB b/sys/arm/conf/CRB index 641ba9f3f0f3c..69b0ebd1696e6 100644 --- a/sys/arm/conf/CRB +++ b/sys/arm/conf/CRB @@ -19,12 +19,13 @@ ident CRB +include "std.arm" options PHYSADDR=0x00000000 options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options COUNTS_PER_SEC=400000000 -include "../xscale/i8134x/std.crb" +include "../xscale/i8134x/std.crb" makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/CUBIEBOARD b/sys/arm/conf/CUBIEBOARD index 945f0ae6fbcf8..26283d4381b69 100644 --- a/sys/arm/conf/CUBIEBOARD +++ b/sys/arm/conf/CUBIEBOARD @@ -21,41 +21,11 @@ ident CUBIEBOARD -include "../allwinner/std.a10" +include "std.armv6" +include "../allwinner/std.a10" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/CUBIEBOARD2 b/sys/arm/conf/CUBIEBOARD2 index d370dda954faa..45311c39930ea 100644 --- a/sys/arm/conf/CUBIEBOARD2 +++ b/sys/arm/conf/CUBIEBOARD2 @@ -21,41 +21,11 @@ ident CUBIEBOARD2 -include "../allwinner/a20/std.a20" +include "std.armv6" +include "../allwinner/a20/std.a20" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/DB-78XXX b/sys/arm/conf/DB-78XXX index 4fee206e8ff56..e59e4264721e4 100644 --- a/sys/arm/conf/DB-78XXX +++ b/sys/arm/conf/DB-78XXX @@ -5,7 +5,8 @@ # ident DB-88F78XX -include "../mv/discovery/std.db78xxx" +include "std.arm" +include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY diff --git a/sys/arm/conf/DB-88F5XXX b/sys/arm/conf/DB-88F5XXX index 6ccb360bd4d97..f1729f060a1b8 100644 --- a/sys/arm/conf/DB-88F5XXX +++ b/sys/arm/conf/DB-88F5XXX @@ -5,7 +5,8 @@ # ident DB-88F5XXX -include "../mv/orion/std.db88f5xxx" +include "std.arm" +include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION diff --git a/sys/arm/conf/DB-88F6XXX b/sys/arm/conf/DB-88F6XXX index c59f1c1130da6..4018bcddc8b85 100644 --- a/sys/arm/conf/DB-88F6XXX +++ b/sys/arm/conf/DB-88F6XXX @@ -5,7 +5,8 @@ # ident DB-88F6XXX -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD diff --git a/sys/arm/conf/DIGI-CCWMX53 b/sys/arm/conf/DIGI-CCWMX53 index 20dec9c0f5337..65239c141eb5d 100644 --- a/sys/arm/conf/DIGI-CCWMX53 +++ b/sys/arm/conf/DIGI-CCWMX53 @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX53" +include "IMX53" ident DIGI-CCWMX53 makeoptions WITHOUT_MODULES="ahc" diff --git a/sys/arm/conf/DOCKSTAR b/sys/arm/conf/DOCKSTAR index aea158ca8911e..9e739805b16a4 100644 --- a/sys/arm/conf/DOCKSTAR +++ b/sys/arm/conf/DOCKSTAR @@ -21,7 +21,8 @@ ident DOCKSTAR -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts diff --git a/sys/arm/conf/DREAMPLUG-1001 b/sys/arm/conf/DREAMPLUG-1001 index 0448d4f956464..f44599e2712c6 100644 --- a/sys/arm/conf/DREAMPLUG-1001 +++ b/sys/arm/conf/DREAMPLUG-1001 @@ -24,7 +24,8 @@ ident DREAMPLUG-1001 -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts diff --git a/sys/arm/conf/EA3250 b/sys/arm/conf/EA3250 index d2d691b32129c..8f135051b96fb 100644 --- a/sys/arm/conf/EA3250 +++ b/sys/arm/conf/EA3250 @@ -5,7 +5,8 @@ # ident EA3250 -include "../lpc/std.lpc" +include "std.arm" +include "../lpc/std.lpc" hints "EA3250.hints" makeoptions MODULES_OVERRIDE="" diff --git a/sys/arm/conf/EB9200 b/sys/arm/conf/EB9200 index a5ec5eb52f1db..afcc530cd5ec2 100644 --- a/sys/arm/conf/EB9200 +++ b/sys/arm/conf/EB9200 @@ -16,7 +16,8 @@ ident EB9200 -include "../at91/std.eb9200" +include "std.arm" +include "../at91/std.eb9200" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "EB9200.hints" diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX index a4690f6964fc7..dc22943ffc3a1 100644 --- a/sys/arm/conf/EFIKA_MX +++ b/sys/arm/conf/EFIKA_MX @@ -20,6 +20,7 @@ ident EFIKA_MX +include "std.armv6" include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" @@ -27,43 +28,13 @@ makeoptions WITHOUT_MODULES="ahc" options SOC_IMX51 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS #options MD_ROOT # MD is a potential root device -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/EP80219 b/sys/arm/conf/EP80219 index 35bcb17641f19..301849c302b8d 100644 --- a/sys/arm/conf/EP80219 +++ b/sys/arm/conf/EP80219 @@ -19,12 +19,13 @@ ident EP80219 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options ARM32_NEW_VM_LAYOUT -include "../xscale/i80321/std.ep80219" +include "../xscale/i80321/std.ep80219" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/ETHERNUT5 b/sys/arm/conf/ETHERNUT5 index 376336a233290..c91869ad7e2fa 100644 --- a/sys/arm/conf/ETHERNUT5 +++ b/sys/arm/conf/ETHERNUT5 @@ -21,7 +21,8 @@ ident ETHERNUT5 -include "../at91/std.ethernut5" +include "std.arm" +include "../at91/std.ethernut5" # To statically compile in device wiring instead of /boot/device.hints hints "ETHERNUT5.hints" diff --git a/sys/arm/conf/EXYNOS5.common b/sys/arm/conf/EXYNOS5.common index cd6e76fb2b390..0bd6ad66cb971 100644 --- a/sys/arm/conf/EXYNOS5.common +++ b/sys/arm/conf/EXYNOS5.common @@ -20,6 +20,7 @@ makeoptions WERROR="-Werror" +include "std.armv6" options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption diff --git a/sys/arm/conf/EXYNOS5250 b/sys/arm/conf/EXYNOS5250 index 156d8564eba1a..e22239f41fcff 100644 --- a/sys/arm/conf/EXYNOS5250 +++ b/sys/arm/conf/EXYNOS5250 @@ -18,8 +18,8 @@ # $FreeBSD$ ident EXYNOS5250 -include "EXYNOS5.common" -include "../samsung/exynos/std.exynos5250" +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5250" #FDT options FDT diff --git a/sys/arm/conf/EXYNOS5420 b/sys/arm/conf/EXYNOS5420 index 0f2c2c780a8a7..b55151a7c9497 100644 --- a/sys/arm/conf/EXYNOS5420 +++ b/sys/arm/conf/EXYNOS5420 @@ -18,8 +18,8 @@ # $FreeBSD$ ident EXYNOS5420 -include "EXYNOS5.common" -include "../samsung/exynos/std.exynos5420" +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5420" #FDT options FDT diff --git a/sys/arm/conf/GUMSTIX b/sys/arm/conf/GUMSTIX index 97d0ac7468d3e..048bd3c680cbb 100644 --- a/sys/arm/conf/GUMSTIX +++ b/sys/arm/conf/GUMSTIX @@ -19,6 +19,7 @@ # $FreeBSD$ ident GUMSTIX +include "std.arm" cpu CPU_XSCALE_PXA2X0 # This probably wants to move somewhere else. Maybe we can create a basic @@ -30,7 +31,7 @@ options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -include "../xscale/pxa/std.pxa" +include "../xscale/pxa/std.pxa" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200 index 3c0f4e880ce86..43a8148abe722 100644 --- a/sys/arm/conf/HL200 +++ b/sys/arm/conf/HL200 @@ -21,7 +21,8 @@ ident HL200 -include "../at91/std.hl200" +include "std.arm" +include "../at91/std.hl200" #To statically compile in device wiring instead of /boot/device.hints hints "KB920X.hints" diff --git a/sys/arm/conf/HL201 b/sys/arm/conf/HL201 index 6a477af809826..2eed9d562c5e8 100644 --- a/sys/arm/conf/HL201 +++ b/sys/arm/conf/HL201 @@ -21,7 +21,8 @@ ident HL201 -include "../at91/std.hl201" +include "std.arm" +include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" diff --git a/sys/arm/conf/IMX53 b/sys/arm/conf/IMX53 index 9f78f303d76a5..d07d6ad0edf4d 100644 --- a/sys/arm/conf/IMX53 +++ b/sys/arm/conf/IMX53 @@ -20,47 +20,18 @@ ident IMX53 +include "std.armv6" include "../freescale/imx/std.imx53" options SOC_IMX53 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/IMX53-QSB b/sys/arm/conf/IMX53-QSB index fdde591b13b05..5fa907c01b4cb 100644 --- a/sys/arm/conf/IMX53-QSB +++ b/sys/arm/conf/IMX53-QSB @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX53" +include "IMX53" ident IMX53-QSB options HZ=250 # 4ms scheduling quantum diff --git a/sys/arm/conf/IMX6 b/sys/arm/conf/IMX6 index f1baf296667b3..332681ab4c3ec 100644 --- a/sys/arm/conf/IMX6 +++ b/sys/arm/conf/IMX6 @@ -19,45 +19,16 @@ # $FreeBSD$ ident IMX6 +include "std.armv6" include "../freescale/imx/std.imx6" options SOC_IMX6 options HZ=500 # Scheduling quantum is 2 milliseconds. options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options INCLUDE_CONFIG_FILE # Include this file in kernel options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/IQ31244 b/sys/arm/conf/IQ31244 index 2066fb85c6959..ae8eae8bf9e22 100644 --- a/sys/arm/conf/IQ31244 +++ b/sys/arm/conf/IQ31244 @@ -19,13 +19,14 @@ ident IQ31244 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options FLASHADDR=0xf0000000 options LOADERRAMADDR=0x00000000 -include "../xscale/i80321/std.iq31244" +include "../xscale/i80321/std.iq31244" makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/KB920X b/sys/arm/conf/KB920X index 1fc23be2b45c4..79be31ab61513 100644 --- a/sys/arm/conf/KB920X +++ b/sys/arm/conf/KB920X @@ -22,7 +22,8 @@ ident KB920X -include "../at91/std.kb920x" +include "std.arm" +include "../at91/std.kb920x" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "KB920X.hints" diff --git a/sys/arm/conf/LN2410SBC b/sys/arm/conf/LN2410SBC index b2f64a0a77178..a154c325e6cea 100644 --- a/sys/arm/conf/LN2410SBC +++ b/sys/arm/conf/LN2410SBC @@ -19,6 +19,7 @@ ident LN2410SBC +include "std.arm" include "../samsung/s3c2xx0/std.ln2410sbc" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. diff --git a/sys/arm/conf/NSLU b/sys/arm/conf/NSLU index e12c5a583846c..665910a07e5cd 100644 --- a/sys/arm/conf/NSLU +++ b/sys/arm/conf/NSLU @@ -21,6 +21,7 @@ ident NSLU +include "std.arm" # XXX What is defined in std.avila does not exactly match the following: #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 @@ -28,9 +29,9 @@ ident NSLU #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../xscale/ixp425/std.ixp425" +include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila (see also comment above) -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "NSLU.hints" # Default places to look for devices. diff --git a/sys/arm/conf/PANDABOARD b/sys/arm/conf/PANDABOARD index e0b5d149d3184..41e2900671b8f 100644 --- a/sys/arm/conf/PANDABOARD +++ b/sys/arm/conf/PANDABOARD @@ -27,42 +27,12 @@ ident PANDABOARD hints "PANDABOARD.hints" +include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/QILA9G20 b/sys/arm/conf/QILA9G20 index 7559c31079f0f..1d6bff91c2970 100644 --- a/sys/arm/conf/QILA9G20 +++ b/sys/arm/conf/QILA9G20 @@ -22,7 +22,8 @@ ident QILA9G20 -include "../at91/std.qila9g20" +include "std.arm" +include "../at91/std.qila9g20" #To statically compile in device wiring instead of /boot/device.hints hints "QILA9G20.hints" diff --git a/sys/arm/conf/QUARTZ b/sys/arm/conf/QUARTZ index 04f1b5c94749a..9c981850b4c07 100644 --- a/sys/arm/conf/QUARTZ +++ b/sys/arm/conf/QUARTZ @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident QUARTZ #FDT diff --git a/sys/arm/conf/RADXA b/sys/arm/conf/RADXA index ad5eadfae41fc..8801f6728e919 100644 --- a/sys/arm/conf/RADXA +++ b/sys/arm/conf/RADXA @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "RK3188" +include "RK3188" ident RADXA # Flattened Device Tree diff --git a/sys/arm/conf/RADXA-LITE b/sys/arm/conf/RADXA-LITE index c07462d9b58b8..72529411a6ba3 100644 --- a/sys/arm/conf/RADXA-LITE +++ b/sys/arm/conf/RADXA-LITE @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "RK3188" +include "RK3188" ident RADXA-LITE # Flattened Device Tree diff --git a/sys/arm/conf/RK3188 b/sys/arm/conf/RK3188 index 64065d30d70a5..9afa7ab7ac59e 100644 --- a/sys/arm/conf/RK3188 +++ b/sys/arm/conf/RK3188 @@ -20,41 +20,11 @@ ident RK3188 -include "../rockchip/std.rk30xx" +include "std.armv6" +include "../rockchip/std.rk30xx" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index 0604a975d2974..9193bcae037fc 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -20,43 +20,13 @@ ident RPI-B -include "../broadcom/bcm2835/std.rpi" -include "../broadcom/bcm2835/std.bcm2835" +include "std.armv6" +include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2835" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/RPI2 b/sys/arm/conf/RPI2 index 5383601caa4d0..27caac997d092 100644 --- a/sys/arm/conf/RPI2 +++ b/sys/arm/conf/RPI2 @@ -20,43 +20,14 @@ ident RPI2 -include "../broadcom/bcm2835/std.rpi" -include "../broadcom/bcm2835/std.bcm2836" +include "std.armv6" +include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2836" options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options SCHED_ULE # ULE scheduler +options SMP # Enable multiple cores options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols @@ -130,8 +101,8 @@ device smsc device spibus device bcm2835_spi -#device vchiq -#device sound +device vchiq +device sound # Flattened Device Tree options FDT # Configure using FDT/DTB data diff --git a/sys/arm/conf/SAM9260EK b/sys/arm/conf/SAM9260EK index 7e88ee1fb8be4..a3c77598752fd 100644 --- a/sys/arm/conf/SAM9260EK +++ b/sys/arm/conf/SAM9260EK @@ -21,7 +21,8 @@ ident SAM9260EK -include "../at91/std.sam9260ek" +include "std.arm" +include "../at91/std.sam9260ek" # To statically compile in device wiring instead of /boot/device.hints hints "SAM9260EK.hints" @@ -72,10 +73,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +#options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +#options DDB # Enable the kernel debugger +#options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp #options BOOTP -#options BOOTP_COMPAT #options BOOTP_NFSROOT +#options BOOTP_COMPAT #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 @@ -92,20 +107,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -#options DDB # Support DDB. -#options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. diff --git a/sys/arm/conf/SAM9G20EK b/sys/arm/conf/SAM9G20EK index 7f3d15c153842..e12a143272e24 100644 --- a/sys/arm/conf/SAM9G20EK +++ b/sys/arm/conf/SAM9G20EK @@ -19,21 +19,18 @@ ident SAM9G20EK -include "../at91/std.sam9g20ek" +include "std.arm" +include "../at91/std.sam9g20ek" #To statically compile in device wiring instead of /boot/device.hints hints "SAM9G20EK.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support @@ -46,77 +43,80 @@ options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager #options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" - -options ALT_BREAK_TO_DEBUGGER - #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -# Debugging for use in -current +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device random -device loop -device bpf -device ether -device md +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 + +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -device uart # Serial Ports +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter # Ethernet -device ate # Ethernet Driver -device mii +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver option AT91_ATE_USE_RMII -device at91_twi # TWI: Two Wire Interface (EEPROM) -device at91_wdt # WDT: Watchdog timer +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device icee -# NAND Flash - Reference design has Samsung 256MB but others possible -device nand # NAND interface on CS3 +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +options AT91_MCI_SLOT_B +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +# DataFlash # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware # confilict on this card. Use one or the other. # see board_sam9g20ek.c - -# SPI: Data Flash -#device at91_spi # SPI: -#device spibus +#device at91_spi # Atmel AT91 Serial Peripheral Interface +#device spibus # SPI bus #device at45d # at45db642 and maybe others -# MMC/SD -device at91_mci -device mmc -device mmcsd -option AT91_MCI_SLOT_B -option AT91_MCI_HAS_4WIRE - -# iic -device iic -device iicbus -device icee +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" # SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) @@ -124,8 +124,12 @@ device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + # USB support -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" @@ -154,3 +158,9 @@ device uhid # "Human Interface Devices" #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm + +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer + +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 diff --git a/sys/arm/conf/SAM9X25EK b/sys/arm/conf/SAM9X25EK index 419e45631abe3..08dc1f59a0fd2 100644 --- a/sys/arm/conf/SAM9X25EK +++ b/sys/arm/conf/SAM9X25EK @@ -21,7 +21,8 @@ ident SAM9X25EK -include "../at91/std.sam9x25ek" +include "std.arm" +include "../at91/std.sam9x25ek" #To statically compile in device wiring instead of /boot/device.hints hints "SAM9G20EK.hints" diff --git a/sys/arm/conf/SHEEVAPLUG b/sys/arm/conf/SHEEVAPLUG index 9d8ea269892e9..9797cc061be20 100644 --- a/sys/arm/conf/SHEEVAPLUG +++ b/sys/arm/conf/SHEEVAPLUG @@ -6,7 +6,8 @@ #NO_UNIVERSE ident SHEEVAPLUG -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD diff --git a/sys/arm/conf/SN9G45 b/sys/arm/conf/SN9G45 index dec6681986d4e..e85d613400f35 100644 --- a/sys/arm/conf/SN9G45 +++ b/sys/arm/conf/SN9G45 @@ -21,7 +21,8 @@ ident SN9G45 -include "../at91/std.sn9g45" +include "std.arm" +include "../at91/std.sn9g45" #To statically compile in device wiring instead of /boot/device.hints #hints "SN9G45.hints" diff --git a/sys/arm/conf/SOCKIT.common b/sys/arm/conf/SOCKIT.common index ac71169d343c2..ff817f89554fe 100644 --- a/sys/arm/conf/SOCKIT.common +++ b/sys/arm/conf/SOCKIT.common @@ -18,6 +18,7 @@ # # $FreeBSD$ +include "std.armv6" include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" @@ -26,37 +27,6 @@ makeoptions WERROR="-Werror" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/TS7800 b/sys/arm/conf/TS7800 index 87a40d588f8f1..1a565c43fb6fe 100644 --- a/sys/arm/conf/TS7800 +++ b/sys/arm/conf/TS7800 @@ -5,7 +5,8 @@ # ident TS7800 -include "../mv/orion/std.ts7800" +include "std.arm" +include "../mv/orion/std.ts7800" options SOC_MV_ORION diff --git a/sys/arm/conf/VERSATILEPB b/sys/arm/conf/VERSATILEPB index c02d18c198190..d1fc77ab2c445 100644 --- a/sys/arm/conf/VERSATILEPB +++ b/sys/arm/conf/VERSATILEPB @@ -22,6 +22,7 @@ ident VERSATILEPB machine arm armv6 cpu CPU_ARM1176 +include "std.armv6" files "../versatile/files.versatile" makeoptions MODULES_OVERRIDE="" @@ -33,38 +34,7 @@ options PHYSADDR=0x00000000 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI # Process metadata passed from Linux boot loaders -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/VIRT b/sys/arm/conf/VIRT index c4f9405c550b8..58efec41f85ab 100644 --- a/sys/arm/conf/VIRT +++ b/sys/arm/conf/VIRT @@ -20,44 +20,12 @@ ident VIRT -include "../qemu/std.virt" +include "std.armv6" +include "../qemu/std.virt" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols diff --git a/sys/arm/conf/VYBRID b/sys/arm/conf/VYBRID index eda4815d76ecb..7e01756c1b39a 100644 --- a/sys/arm/conf/VYBRID +++ b/sys/arm/conf/VYBRID @@ -19,44 +19,14 @@ # $FreeBSD$ ident VYBRID -include "../freescale/vybrid/std.vybrid" +include "std.armv6" +include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem #options NANDFS # NAND Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support #options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/WANDBOARD-DUAL b/sys/arm/conf/WANDBOARD-DUAL index 66e2535a4b2b4..c3a2d4d5e5f9c 100644 --- a/sys/arm/conf/WANDBOARD-DUAL +++ b/sys/arm/conf/WANDBOARD-DUAL @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident WANDBOARD-DUAL # Flattened Device Tree diff --git a/sys/arm/conf/WANDBOARD-QUAD b/sys/arm/conf/WANDBOARD-QUAD index 830a445fc99c0..ac1e49220aea7 100644 --- a/sys/arm/conf/WANDBOARD-QUAD +++ b/sys/arm/conf/WANDBOARD-QUAD @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident WANDBOARD-QUAD # Flattened Device Tree diff --git a/sys/arm/conf/WANDBOARD-SOLO b/sys/arm/conf/WANDBOARD-SOLO index ad56365c6d060..0fed03d7aa790 100644 --- a/sys/arm/conf/WANDBOARD-SOLO +++ b/sys/arm/conf/WANDBOARD-SOLO @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "IMX6" +include "IMX6" ident WANDBOARD-SOLO nooptions SMP diff --git a/sys/arm/conf/ZEDBOARD b/sys/arm/conf/ZEDBOARD index 94148f4eb40f9..3c31b7452e06b 100644 --- a/sys/arm/conf/ZEDBOARD +++ b/sys/arm/conf/ZEDBOARD @@ -21,40 +21,11 @@ ident ZEDBOARD +include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current diff --git a/sys/arm/conf/std.arm b/sys/arm/conf/std.arm new file mode 100644 index 0000000000000..88675f095e83e --- /dev/null +++ b/sys/arm/conf/std.arm @@ -0,0 +1,5 @@ +# Standard kernel config items for all ARMv4/v5 systems. +# +# $FreeBSD$ + + diff --git a/sys/arm/conf/std.armv6 b/sys/arm/conf/std.armv6 new file mode 100644 index 0000000000000..c06ceae93009d --- /dev/null +++ b/sys/arm/conf/std.armv6 @@ -0,0 +1,38 @@ +# Standard kernel config items for all ARMv6/v7 systems. +# +# $FreeBSD$ + +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem +options GEOM_PART_GPT # GUID Partition Tables +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options GEOM_LABEL # Provides labelization +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options VFP # Enable floating point hardware support + +options ARM_NEW_PMAP # Use new pmap code. diff --git a/sys/arm/freescale/imx/imx6_anatop.c b/sys/arm/freescale/imx/imx6_anatop.c index a3845011395c6..16a09d3ab83be 100644 --- a/sys/arm/freescale/imx/imx6_anatop.c +++ b/sys/arm/freescale/imx/imx6_anatop.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include <arm/arm/mpcore_timervar.h> #include <arm/freescale/fsl_ocotpreg.h> #include <arm/freescale/fsl_ocotpvar.h> +#include <arm/freescale/imx/imx_ccmvar.h> #include <arm/freescale/imx/imx6_anatopreg.h> #include <arm/freescale/imx/imx6_anatopvar.h> @@ -116,12 +117,16 @@ static struct imx6_anatop_softc *imx6_anatop_sc; /* * Table of "operating points". * These are combinations of frequency and voltage blessed by Freescale. + * While the datasheet says the ARM voltage can be as low as 925mV at + * 396MHz, it also says that the ARM and SOC voltages can't differ by + * more than 200mV, and the minimum SOC voltage is 1150mV, so that + * dictates the 950mV entry in this table. */ static struct oppt { uint32_t mhz; uint32_t mv; } imx6_oppt_table[] = { -/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 396, 950}, { 792, 1150}, { 852, 1225}, { 996, 1225}, @@ -158,14 +163,15 @@ imx6_anatop_write_4(bus_size_t offset, uint32_t value) static void vdd_set(struct imx6_anatop_softc *sc, int mv) { - int newtarg, oldtarg; + int newtarg, newtargSoc, oldtarg; uint32_t delay, pmureg; static boolean_t init_done = false; /* * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM - * can't be more than 50mV above or 200mV below them. For now to keep - * things simple we set all three to the same value. + * can't be more than 50mV above or 200mV below them. We keep them the + * same except in the case of the lowest operating point, which is + * handled as a special case below. */ pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); @@ -180,19 +186,29 @@ vdd_set(struct imx6_anatop_softc *sc, int mv) newtarg = (mv - 700) / 25; /* + * The SOC voltage can't go below 1150mV, and thus because of the 200mV + * rule, the ARM voltage can't go below 950mV. The 950 is encoded in + * our oppt table, here we handle the SOC 1150 rule as a special case. + * (1150-700/25=18). + */ + newtargSoc = (newtarg < 18) ? 18 : newtarg; + + /* * The first time through the 3 voltages might not be equal so use a * long conservative delay. After that we need to delay 3uS for every - * 25mV step upward. No need to delay at all when lowering. + * 25mV step upward; we actually delay 6uS because empirically, it works + * and the 3uS per step recommended by the docs doesn't (3uS fails when + * going from 400->1200, but works for smaller changes). */ if (init_done) { if (newtarg == oldtarg) return; else if (newtarg > oldtarg) - delay = (newtarg - oldtarg) * 3; + delay = (newtarg - oldtarg) * 6; else delay = 0; } else { - delay = 700 / 25 * 3; + delay = (700 / 25) * 6; init_done = true; } @@ -205,7 +221,7 @@ vdd_set(struct imx6_anatop_softc *sc, int mv) pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; - pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + pmureg |= newtargSoc << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); @@ -213,24 +229,29 @@ vdd_set(struct imx6_anatop_softc *sc, int mv) } static inline uint32_t -cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t corediv, + uint32_t plldiv) { - return (sc->refosc_mhz * (div / 2)); + return ((sc->refosc_mhz * (plldiv / 2)) / (corediv + 1)); } -static inline uint32_t -cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +static inline void +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz, + uint32_t *corediv, uint32_t *plldiv) { - return (cpu_mhz / (sc->refosc_mhz / 2)); + *corediv = (cpu_mhz < 650) ? 1 : 0; + *plldiv = ((*corediv + 1) * cpu_mhz) / (sc->refosc_mhz / 2); } static inline uint32_t cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { + uint32_t corediv, plldiv; - return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); + cpufreq_mhz_to_div(sc, cpu_mhz, &corediv, &plldiv); + return (cpufreq_mhz_from_div(sc, corediv, plldiv)); } static struct oppt * @@ -256,7 +277,7 @@ cpufreq_nearest_oppt(struct imx6_anatop_softc *sc, uint32_t cpu_newmhz) static void cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t timeout, wrk32; + uint32_t corediv, plldiv, timeout, wrk32; /* If increasing the frequency, we must first increase the voltage. */ if (op->mhz > sc->cpu_curmhz) { @@ -272,6 +293,7 @@ cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. * - Turn off bypass mode; cpu should now be running at the new speed. */ + cpufreq_mhz_to_div(sc, op->mhz, &corediv, &plldiv); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, @@ -279,7 +301,7 @@ cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); + wrk32 |= plldiv; imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -290,6 +312,7 @@ cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + imx_ccm_set_cacrr(corediv); /* If lowering the frequency, it is now safe to lower the voltage. */ if (op->mhz < sc->cpu_curmhz) @@ -297,7 +320,7 @@ cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) sc->cpu_curmhz = op->mhz; /* Tell the mpcore timer that its frequency has changed. */ - arm_tmr_change_frequency( + arm_tmr_change_frequency( cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); } @@ -748,11 +771,12 @@ imx6_anatop_probe(device_t dev) uint32_t imx6_get_cpu_clock() { - uint32_t div; + uint32_t corediv, plldiv; - div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + corediv = imx_ccm_get_cacrr(); + plldiv = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, corediv, plldiv)); } static device_method_t imx6_anatop_methods[] = { diff --git a/sys/arm/freescale/imx/imx6_ccm.c b/sys/arm/freescale/imx/imx6_ccm.c index 8d7f14f130769..488c55ab2a2fc 100644 --- a/sys/arm/freescale/imx/imx6_ccm.c +++ b/sys/arm/freescale/imx/imx6_ccm.c @@ -320,6 +320,20 @@ imx_ccm_ahb_hz(void) return (132000000); } +uint32_t +imx_ccm_get_cacrr(void) +{ + + return (RD4(ccm_sc, CCM_CACCR)); +} + +void +imx_ccm_set_cacrr(uint32_t divisor) +{ + + WR4(ccm_sc, CCM_CACCR, divisor); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), diff --git a/sys/arm/freescale/imx/imx6_ccmreg.h b/sys/arm/freescale/imx/imx6_ccmreg.h index 31d92caa6d4ab..85dd372dacbd8 100644 --- a/sys/arm/freescale/imx/imx6_ccmreg.h +++ b/sys/arm/freescale/imx/imx6_ccmreg.h @@ -29,6 +29,7 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CACCR 0x010 #define CCM_CSCMR1 0x01C #define SSI1_CLK_SEL_S 10 #define SSI2_CLK_SEL_S 12 @@ -64,6 +65,5 @@ #define CCM_CCGR5 0x07C #define CCM_CCGR6 0x080 #define CCM_CMEOR 0x088 - #endif diff --git a/sys/arm/freescale/imx/imx_ccmvar.h b/sys/arm/freescale/imx/imx_ccmvar.h index f15943791c68e..91a3e45daddbf 100644 --- a/sys/arm/freescale/imx/imx_ccmvar.h +++ b/sys/arm/freescale/imx/imx_ccmvar.h @@ -53,4 +53,8 @@ void imx_ccm_usb_enable(device_t _usbdev); void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); +/* Routines to get and set the arm clock root divisor register. */ +uint32_t imx_ccm_get_cacrr(void); +void imx_ccm_set_cacrr(uint32_t _divisor); + #endif diff --git a/sys/arm/include/armreg.h b/sys/arm/include/armreg.h index 3163ba5bf46d2..935870373f797 100644 --- a/sys/arm/include/armreg.h +++ b/sys/arm/include/armreg.h @@ -346,6 +346,9 @@ #define CPUV7_CT_xSIZE_ASSOC(x) (((x) >> 3) & 0x3ff) /* associativity */ #define CPUV7_CT_xSIZE_SET(x) (((x) >> 13) & 0x7fff) /* num sets */ +#define CPUV7_L2CTLR_NPROC_SHIFT 24 +#define CPUV7_L2CTLR_NPROC(r) ((((r) >> CPUV7_L2CTLR_NPROC_SHIFT) & 3) + 1) + #define CPU_CLIDR_CTYPE(reg,x) (((reg) >> ((x) * 3)) & 0x7) #define CPU_CLIDR_LOUIS(reg) (((reg) >> 21) & 0x7) #define CPU_CLIDR_LOC(reg) (((reg) >> 24) & 0x7) diff --git a/sys/arm/include/cpu-v6.h b/sys/arm/include/cpu-v6.h index 6c226a344f281..b0d7a7f19d0a0 100644 --- a/sys/arm/include/cpu-v6.h +++ b/sys/arm/include/cpu-v6.h @@ -143,6 +143,13 @@ _RF0(cp15_ttbr_get, CP15_TTBR0(%0)) _RF0(cp15_dfar_get, CP15_DFAR(%0)) #if __ARM_ARCH >= 7 _RF0(cp15_ifar_get, CP15_IFAR(%0)) +_RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0)) +#endif +#if __ARM_ARCH >= 6 +_RF0(cp15_actlr_get, CP15_ACTLR(%0)) +_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)); +_RF0(cp15_par_get, CP15_PAR); +_RF0(cp15_sctlr_get, CP15_SCTLR(%0)) #endif /*CPU id registers */ diff --git a/sys/arm/include/pl310.h b/sys/arm/include/pl310.h index f7c75e9f9a542..fd75d44ad7a1d 100644 --- a/sys/arm/include/pl310.h +++ b/sys/arm/include/pl310.h @@ -133,7 +133,7 @@ #define PREFETCH_CTRL_DATA_PREFETCH (1 << 28) #define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29) #define PREFETCH_CTRL_DL (1 << 30) -#define PL310_POWER_CTRL 0xF60 +#define PL310_POWER_CTRL 0xF80 #define POWER_CTRL_ENABLE_GATING (1 << 0) #define POWER_CTRL_ENABLE_STANDBY (1 << 1) diff --git a/sys/arm/include/sysreg.h b/sys/arm/include/sysreg.h index f29991ade8bdb..fb1348736ece5 100644 --- a/sys/arm/include/sysreg.h +++ b/sys/arm/include/sysreg.h @@ -212,6 +212,7 @@ #if __ARM_ARCH == 6 && defined(CPU_ARM1176) #define CP15_PMCCNTR(rr) p15, 0, rr, c15, c12, 1 /* PM Cycle Count Register */ #elif __ARM_ARCH > 6 +#define CP15_L2CTLR(rr) p15, 1, rr, c9, c0, 2 /* L2 Control Register */ #define CP15_PMCR(rr) p15, 0, rr, c9, c12, 0 /* Performance Monitor Control Register */ #define CP15_PMCNTENSET(rr) p15, 0, rr, c9, c12, 1 /* PM Count Enable Set Register */ #define CP15_PMCNTENCLR(rr) p15, 0, rr, c9, c12, 2 /* PM Count Enable Clear Register */ diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index bc3833036a10f..d6c6d2b69f69a 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -148,6 +148,10 @@ nexus_attach(device_t dev) if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); + /* Add the ofwbus device */ + /* ARM64TODO: Alternatively add acpi */ + nexus_add_child(dev, 10, "ofwbus", 0); + /* * First, deal with the children we know about already */ diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index e61106340b4e7..a955bdf389052 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -33,6 +33,9 @@ FILESMODE_boot1.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index 88ca242dd0afa..d248927c2b907 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -6,6 +6,9 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index 5585f78e3129a..06e76a90a051d 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -38,6 +38,12 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 CFLAGS+= -DNO_PCI -DEFI +# make buildenv doesn't set DESTDIR, this means LIBSTAND +# will be wrong when crossbuilding. +.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) +LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH diff --git a/sys/boot/efi/loader/arch/arm64/Makefile.inc b/sys/boot/efi/loader/arch/arm64/Makefile.inc index e5064cc0fffe7..82d8cef1b2274 100644 --- a/sys/boot/efi/loader/arch/arm64/Makefile.inc +++ b/sys/boot/efi/loader/arch/arm64/Makefile.inc @@ -7,3 +7,5 @@ SRCS+= exec.c \ .PATH: ${.CURDIR}/../../arm64/libarm64 CFLAGS+=-I${.CURDIR}/../../arm64/libarm64 SRCS+= cache.c + +CFLAGS+= -msoft-float -mgeneral-regs-only diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c index 93c6059deea98..8044db5b01677 100644 --- a/sys/boot/efi/loader/main.c +++ b/sys/boot/efi/loader/main.c @@ -59,6 +59,7 @@ EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) @@ -287,6 +288,8 @@ command_configuration(int argc, char *argv[]) printf("Memory Type Information Table"); else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID))) printf("Debug Image Info Table"); + else if (!memcmp(guid, &fdtdtb, sizeof(EFI_GUID))) + printf("FDT Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); diff --git a/sys/boot/fdt/dts/arm/rpi2.dts b/sys/boot/fdt/dts/arm/rpi2.dts index 1c8c559b4daa2..e32cfb00ea39e 100644 --- a/sys/boot/fdt/dts/arm/rpi2.dts +++ b/sys/boot/fdt/dts/arm/rpi2.dts @@ -43,6 +43,24 @@ reg = <0xf00>; /* CPU ID=0xf00 */ clock-frequency = <800000000>; /* 800MHz */ }; + cpu@1 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf01>; /* CPU ID=0xf01 */ + clock-frequency = <800000000>; /* 800MHz */ + }; + cpu@2 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf02>; /* CPU ID=0xf02 */ + clock-frequency = <800000000>; /* 800MHz */ + }; + cpu@3 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf03>; /* CPU ID=0xf03 */ + clock-frequency = <800000000>; /* 800MHz */ + }; }; memory { diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index a9229674e2492..b5582e9961252 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -521,7 +521,7 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); - } else if (error == ENOSPC) { + } else if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ @@ -738,7 +738,7 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, ctl_scsi_path_string(io, path_str, sizeof(path_str)); printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); @@ -895,7 +895,7 @@ ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, * return the I/O to the user. */ if (error != 0) { - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c index d74c2cf88203b..cbccad359c3fb 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c @@ -2010,7 +2010,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t *tx) error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -2020,7 +2020,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t *tx) obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h index 3fb66c864ee93..c8e3105ff0b25 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h @@ -261,10 +261,6 @@ VTOZ(vnode_t *vp) } \ } -/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ -#define ZFS_ENTER_NOERROR(zfsvfs) \ - rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) - /* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 415db9edbe52e..5824828c7a078 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -1239,9 +1239,6 @@ zfs_domount(vfs_t *vfsp, char *osname) } vfs_mountedfrom(vfsp, osname); - /* Grab extra reference. */ - VERIFY(VFS_ROOT(vfsp, LK_EXCLUSIVE, &vp) == 0); - VOP_UNLOCK(vp, 0); if (!zfsvfs->z_issnap) zfsctl_create(zfsvfs); @@ -1819,7 +1816,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp) znode_t *rootzp; int error; - ZFS_ENTER_NOERROR(zfsvfs); + ZFS_ENTER(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) @@ -1994,7 +1991,7 @@ zfs_umount(vfs_t *vfsp, int fflag) /* * Flush all the files. */ - ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); + ret = vflush(vfsp, 0, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); if (ret != 0) { if (!zfsvfs->z_issnap) { zfsctl_create(zfsvfs); diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 8696b3664b3d6..67210ff59de4a 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -248,7 +248,7 @@ freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfss { struct statfs *buf, *sp; struct statfs32 stat32; - size_t count, size; + size_t count, size, copycount; int error; count = uap->bufsize / sizeof(struct statfs32); @@ -256,12 +256,13 @@ freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfss error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags); if (size > 0) { sp = buf; - while (count > 0 && error == 0) { + copycount = count; + while (copycount > 0 && error == 0) { copy_statfs(sp, &stat32); error = copyout(&stat32, uap->buf, sizeof(stat32)); sp++; uap->buf++; - count--; + copycount--; } free(buf, M_TEMP); } diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 92f41019b427b..1a67f5c7dd8d3 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -43,6 +43,7 @@ dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc | vt dev/nand/nfc_fsl.c optional nand mpc85xx +dev/nand/nfc_rb.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. dev/ofw/openfirm.c optional aim dev/ofw/openfirmio.c optional aim diff --git a/sys/conf/options b/sys/conf/options index b6987173e6fc7..6d2a0fa160dd8 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -692,6 +692,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h ACPI_DMAR opt_acpi.h +DEV_ACPI opt_acpi.h # ISA support DEV_ISA opt_isa.h diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 7796fbe39ef6c..21761919365ae 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -605,9 +605,11 @@ acpi_attach(device_t dev) if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) sc->acpi_handle_reboot = 1; +#if !ACPI_REDUCED_HARDWARE /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS != NULL && AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; +#endif /* Probe all supported sleep states. */ acpi_sleep_states[ACPI_STATE_S0] = TRUE; diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 03ef6861eb411..296e38f273a71 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -128,7 +128,8 @@ acpi_timer_identify(driver_t *driver, device_t parent) ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("timer") || (acpi_quirks & ACPI_Q_TIMER) || - acpi_timer_dev || acpi_timer_disabled) + acpi_timer_dev || acpi_timer_disabled || + AcpiGbl_FADT.PmTimerLength == 0) return_VOID; if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 1fa94f1393efb..6f63c6eef3639 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -81,16 +82,19 @@ static int mrsas_init_fw(struct mrsas_softc *sc); static int mrsas_setup_raidmap(struct mrsas_softc *sc); static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); static int mrsas_clear_intr(struct mrsas_softc *sc); -static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info); -static int +static int mrsas_get_ctrl_info(struct mrsas_softc *sc); +static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); +static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, + u_long cmd, caddr_t arg); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); -u_int8_t +u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd); +void mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc); int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); int mrsas_init_adapter(struct mrsas_softc *sc); int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); @@ -102,10 +106,10 @@ int mrsas_issue_dcmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_reset_ctrl(struct mrsas_softc *sc); int mrsas_wait_for_outstanding(struct mrsas_softc *sc); -int +int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size); void mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd); @@ -122,17 +126,17 @@ void mrsas_teardown_intr(struct mrsas_softc *sc); void mrsas_addr_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); void mrsas_kill_hba(struct mrsas_softc *sc); void mrsas_aen_handler(struct mrsas_softc *sc); -void +void mrsas_write_reg(struct mrsas_softc *sc, int offset, u_int32_t value); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); -void +void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); @@ -175,9 +179,9 @@ typedef struct mrsas_ident { } MRSAS_CTLR_ID; MRSAS_CTLR_ID device_table[] = { - {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "LSI Thunderbolt SAS Controller"}, - {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "LSI Invader SAS Controller"}, - {0x1000, MRSAS_FURY, 0xffff, 0xffff, "LSI Fury SAS Controller"}, + {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "AVAGO Thunderbolt SAS Controller"}, + {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "AVAGO Invader SAS Controller"}, + {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -272,6 +276,7 @@ mrsas_disable_intr(struct mrsas_softc *sc) u_int32_t mask = 0xFFFFFFFF; u_int32_t status; + sc->mask_interrupts = 1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); @@ -283,6 +288,7 @@ mrsas_enable_intr(struct mrsas_softc *sc) u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; u_int32_t status; + sc->mask_interrupts = 0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); @@ -352,7 +358,7 @@ mrsas_probe(device_t dev) if ((id = mrsas_find_ident(dev)) != NULL) { if (first_ctrl) { - printf("LSI MegaRAID SAS FreeBSD mrsas driver version: %s\n", + printf("AVAGO MegaRAID SAS FreeBSD mrsas driver version: %s\n", MRSAS_VERSION); first_ctrl = 0; } @@ -460,6 +466,11 @@ mrsas_get_tunables(struct mrsas_softc *sc) */ TUNABLE_INT_FETCH("hw.mrsas.debug_level", &sc->mrsas_debug); + /* + * Grab the global variables. + */ + TUNABLE_INT_FETCH("hw.mrsas.lb_pending_cmds", &sc->lb_pending_cmds); + /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mrsas.%d.debug_level", device_get_unit(sc->mrsas_dev)); @@ -1163,6 +1174,12 @@ mrsas_free_mem(struct mrsas_softc *sc) */ if (sc->mrsas_parent_tag != NULL) bus_dma_tag_destroy(sc->mrsas_parent_tag); + + /* + * Free ctrl_info memory + */ + if (sc->ctrl_info != NULL) + free(sc->ctrl_info, M_MRSAS); } /* @@ -1231,6 +1248,43 @@ mrsas_resume(device_t dev) return (0); } +/** + * mrsas_get_softc_instance: Find softc instance based on cmd type + * + * This function will return softc instance based on cmd type. + * In some case, application fire ioctl on required management instance and + * do not provide host_no. Use cdev->si_drv1 to get softc instance for those + * case, else get the softc instance from host_no provided by application in + * user data. + */ + +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg) +{ + struct mrsas_softc *sc = NULL; + struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; + + if (cmd == MRSAS_IOC_GET_PCI_INFO) { + sc = dev->si_drv1; + } else { + /* + * get the Host number & the softc from data sent by the + * Application + */ + sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; + if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { + if (sc == NULL) + mrsas_dprint(sc, MRSAS_FAULT, + "There is no Controller number %d .\n", user_ioc->host_no); + else + mrsas_dprint(sc, MRSAS_FAULT, + "Invalid Controller number %d .\n", user_ioc->host_no); + } + } + + return sc; +} + /* * mrsas_ioctl: IOCtl commands entry point. * @@ -1243,19 +1297,12 @@ mrsas_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, { struct mrsas_softc *sc; int ret = 0, i = 0; + MRSAS_DRV_PCI_INFORMATION *pciDrvInfo; - struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; - - /* get the Host number & the softc from data sent by the Application */ - sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; - - if ((mrsas_mgmt_info.max_index == user_ioc->host_no) || (sc == NULL)) { - printf("Please check the controller number\n"); - if (sc == NULL) - printf("There is NO such Host no. %d\n", user_ioc->host_no); - + sc = mrsas_get_softc_instance(dev, cmd, arg); + if (!sc) return ENOENT; - } + if (sc->remove_in_progress) { mrsas_dprint(sc, MRSAS_INFO, "Driver remove or shutdown called.\n"); @@ -1299,6 +1346,22 @@ do_ioctl: case MRSAS_IOC_SCAN_BUS: ret = mrsas_bus_scan(sc); break; + + case MRSAS_IOC_GET_PCI_INFO: + pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *) arg; + memset(pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); + pciDrvInfo->busNumber = pci_get_bus(sc->mrsas_dev); + pciDrvInfo->deviceNumber = pci_get_slot(sc->mrsas_dev); + pciDrvInfo->functionNumber = pci_get_function(sc->mrsas_dev); + pciDrvInfo->domainID = pci_get_domain(sc->mrsas_dev); + mrsas_dprint(sc, MRSAS_INFO, "pci bus no: %d," + "pci device no: %d, pci function no: %d," + "pci domain ID: %d\n", + pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, + pciDrvInfo->functionNumber, pciDrvInfo->domainID); + ret = 0; + break; + default: mrsas_dprint(sc, MRSAS_TRACE, "IOCTL command 0x%lx is not handled\n", cmd); ret = ENOENT; @@ -1328,8 +1391,10 @@ mrsas_poll(struct cdev *dev, int poll_events, struct thread *td) } if (revents == 0) { if (poll_events & (POLLIN | POLLRDNORM)) { + mtx_lock(&sc->aen_lock); sc->mrsas_poll_waiting = 1; selrecord(td, &sc->mrsas_select); + mtx_unlock(&sc->aen_lock); } } return revents; @@ -1387,6 +1452,9 @@ mrsas_isr(void *arg) struct mrsas_softc *sc = irq_context->sc; int status = 0; + if (sc->mask_interrupts) + return; + if (!sc->msix_vectors) { status = mrsas_clear_intr(sc); if (!status) @@ -1424,7 +1492,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; struct mrsas_mpt_cmd *cmd_mpt; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t arm, reply_descript_type; + u_int8_t reply_descript_type; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; @@ -1462,8 +1530,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { - arm = lbinfo->raid1DevHandle[0] == scsi_io_req->DevHandle ? 0 : 1; - mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[arm]); + mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ @@ -1608,8 +1675,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t ex static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, - evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, + chain_frame_size, evt_detail_size, count; /* * Allocate parent DMA tag @@ -1861,34 +1928,6 @@ mrsas_setup_raidmap(struct mrsas_softc *sc) { int i; - sc->drv_supported_vd_count = - MRSAS_MAX_LD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - sc->drv_supported_pd_count = - MRSAS_MAX_PD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - - if (sc->max256vdSupport) { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } else { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } - -#if VD_EXT_DEBUG - device_printf(sc->mrsas_dev, "FW supports: max256vdSupport = %s\n", - sc->max256vdSupport ? "YES" : "NO"); - device_printf(sc->mrsas_dev, "FW supports %dVDs %dPDs\n" - "DRIVER supports %dVDs %dPDs \n", - sc->fw_supported_vd_count, sc->fw_supported_pd_count, - sc->drv_supported_vd_count, sc->drv_supported_pd_count); -#endif - - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->drv_supported_vd_count - 1)); - for (i = 0; i < 2; i++) { sc->ld_drv_map[i] = (void *)malloc(sc->drv_map_sz, M_MRSAS, M_NOWAIT); @@ -1903,14 +1942,6 @@ mrsas_setup_raidmap(struct mrsas_softc *sc) } } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; - - for (int i = 0; i < 2; i++) { if (bus_dma_tag_create(sc->mrsas_parent_tag, 4, 0, @@ -1970,7 +2001,7 @@ ABORT: * get_pdlist, get_ld_list and max_sectors are currently not being used, it * is left here as placeholder. */ -static int +static int mrsas_init_fw(struct mrsas_softc *sc) { @@ -1978,7 +2009,6 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - struct mrsas_ctrl_info *ctrl_info; u_int32_t scratch_pad_2; int msix_enable = 0; int fw_msix_count = 0; @@ -2040,23 +2070,25 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); return (1); } + sc->ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); + if (!sc->ctrl_info) { + device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); + return (1); + } /* * Get the controller info from FW, so that the MAX VD support * availability can be decided. */ - ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); - if (!ctrl_info) - device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); - - if (mrsas_get_ctrl_info(sc, ctrl_info)) { + if (mrsas_get_ctrl_info(sc)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); + return (1); } - sc->max256vdSupport = - (u_int8_t)ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->secure_jbod_support = + (u_int8_t)sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; + + if (sc->secure_jbod_support) + device_printf(sc->mrsas_dev, "FW supports SED \n"); - if (ctrl_info->max_lds > 64) { - sc->max256vdSupport = 1; - } if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Set up RAID map failed.\n"); return (1); @@ -2080,9 +2112,9 @@ mrsas_init_fw(struct mrsas_softc *sc) * calculate max_sectors_1. So the number ended up as zero always. */ tmp_sectors = 0; - max_sectors_1 = (1 << ctrl_info->stripe_sz_ops.min) * - ctrl_info->max_strips_per_io; - max_sectors_2 = ctrl_info->max_request_size; + max_sectors_1 = (1 << sc->ctrl_info->stripe_sz_ops.min) * + sc->ctrl_info->max_strips_per_io; + max_sectors_2 = sc->ctrl_info->max_request_size; tmp_sectors = min(max_sectors_1, max_sectors_2); sc->max_sectors_per_req = sc->max_num_sge * MRSAS_PAGE_SIZE / 512; @@ -2090,9 +2122,9 @@ mrsas_init_fw(struct mrsas_softc *sc) sc->max_sectors_per_req = tmp_sectors; sc->disableOnlineCtrlReset = - ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; sc->UnevenSpanSupport = - ctrl_info->adapterOperations2.supportUnevenSpans; + sc->ctrl_info->adapterOperations2.supportUnevenSpans; if (sc->UnevenSpanSupport) { device_printf(sc->mrsas_dev, "FW supports: UnevenSpanSupport=%x\n\n", sc->UnevenSpanSupport); @@ -2102,9 +2134,6 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } - if (ctrl_info) - free(ctrl_info, M_MRSAS); - return (0); } @@ -2136,7 +2165,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) max_cmd = sc->max_fw_cmds; /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16); + sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); @@ -2281,7 +2310,9 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_ver_lo = (bus_addr_t)sc->verbuf_phys_addr; init_frame->driver_ver_hi = 0; } + init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb = 1; init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; + init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; init_frame->queue_info_new_phys_addr_lo = phys_addr; init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); @@ -2423,7 +2454,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) * This functions fires the command to Firmware by writing to the * inbound_low_queue_port and inbound_high_queue_port. */ -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { @@ -2703,7 +2734,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) /* Reset not supported, kill adapter */ mrsas_dprint(sc, MRSAS_OCR, "Reset not supported, killing adapter.\n"); mrsas_kill_hba(sc); - sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; retval = FAIL; goto out; } @@ -2788,10 +2818,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); - mrsas_enable_intr(sc); - sc->adprecovery = MRSAS_HBA_OPERATIONAL; - /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { mpt_cmd = sc->mpt_cmd_list[j]; @@ -2821,9 +2847,18 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); + if (mrsas_get_ctrl_info(sc)) { + mrsas_kill_hba(sc); + retval = FAIL; + goto out; + } if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); + mrsas_enable_intr(sc); + sc->adprecovery = MRSAS_HBA_OPERATIONAL; + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; @@ -2854,11 +2889,43 @@ out: void mrsas_kill_hba(struct mrsas_softc *sc) { + sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; + pause("mrsas_kill_hba", 1000); mrsas_dprint(sc, MRSAS_OCR, "%s\n", __func__); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_STOP_ADP); /* Flush */ mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)); + mrsas_complete_outstanding_ioctls(sc); +} + +/** + * mrsas_complete_outstanding_ioctls Complete pending IOCTLS after kill_hba + * input: Controller softc + * + * Returns void + */ +void +mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc) +{ + int i; + struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mfi_cmd *cmd_mfi; + u_int32_t count, MSIxIndex; + + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + for (i = 0; i < sc->max_fw_cmds; i++) { + cmd_mpt = sc->mpt_cmd_list[i]; + + if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { + cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; + if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, + cmd_mpt->io_request->RaidContext.status); + } + } + } } /* @@ -2945,8 +3012,7 @@ mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd) * supported by the FW. */ static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info) +mrsas_get_ctrl_info(struct mrsas_softc *sc) { int retcode = 0; struct mrsas_mfi_cmd *cmd; @@ -2979,16 +3045,60 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc, dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); if (!mrsas_issue_polled(sc, cmd)) - memcpy(ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); else retcode = 1; + mrsas_update_ext_vd_details(sc); + mrsas_free_ctlr_info_cmd(sc); mrsas_release_mfi_cmd(cmd); return (retcode); } /* + * mrsas_update_ext_vd_details : Update details w.r.t Extended VD + * input: + * sc - Controller's softc +*/ +static void +mrsas_update_ext_vd_details(struct mrsas_softc *sc) +{ + sc->max256vdSupport = + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ + if (sc->ctrl_info->max_lds > 64) + sc->max256vdSupport = 1; + + sc->drv_supported_vd_count = MRSAS_MAX_LD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + sc->drv_supported_pd_count = MRSAS_MAX_PD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + if (sc->max256vdSupport) { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } else { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } + + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->drv_supported_vd_count - 1)); + + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; +} + +/* * mrsas_alloc_ctlr_info_cmd: Allocates memory for controller info command * input: Adapter soft state * @@ -3763,7 +3873,7 @@ mrsas_get_ld_list(struct mrsas_softc *sc) * memory is initialized to all zeros upon successful loading of the dma * mapped memory. */ -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size) { @@ -3996,10 +4106,12 @@ mrsas_complete_aen(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) */ if ((!cmd->abort_aen) && (sc->remove_in_progress == 0)) { sc->mrsas_aen_triggered = 1; + mtx_lock(&sc->aen_lock); if (sc->mrsas_poll_waiting) { sc->mrsas_poll_waiting = 0; selwakeup(&sc->mrsas_select); } + mtx_unlock(&sc->aen_lock); } else cmd->abort_aen = 0; diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h index 37b6e952835c0..1cfe89e000536 100644 --- a/sys/dev/mrsas/mrsas.h +++ b/sys/dev/mrsas/mrsas.h @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Authors: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Authors: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -101,7 +102,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.705.10.02-fbsd" +#define MRSAS_VERSION "06.707.04.03-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 @@ -813,9 +814,8 @@ typedef struct _MR_DRV_RAID_MAP_ALL { typedef struct _LD_LOAD_BALANCE_INFO { u_int8_t loadBalanceFlag; u_int8_t reserved1; - u_int16_t raid1DevHandle[2]; - mrsas_atomic_t scsi_pending_cmds[2]; - u_int64_t last_accessed_block[2]; + mrsas_atomic_t scsi_pending_cmds[MAX_PHYSICAL_DEVICES]; + u_int64_t last_accessed_block[MAX_PHYSICAL_DEVICES]; } LD_LOAD_BALANCE_INFO, *PLD_LOAD_BALANCE_INFO; /* SPAN_SET is info caclulated from span info from Raid map per ld */ @@ -858,6 +858,9 @@ struct IO_REQUEST_INFO { u_int8_t start_span; u_int8_t reserved; u_int64_t start_row; + /* span[7:5], arm[4:0] */ + u_int8_t span_arm; + u_int8_t pd_after_lb; }; typedef struct _MR_LD_TARGET_SYNC { @@ -1315,6 +1318,13 @@ typedef enum _REGION_TYPE { #define MRSAS_REQ_STATE_TRAN 2 #define MRSAS_REQ_STATE_COMPLETE 3 +typedef enum _MR_SCSI_CMD_TYPE { + READ_WRITE_LDIO = 0, + NON_READ_WRITE_LDIO = 1, + READ_WRITE_SYSPDIO = 2, + NON_READ_WRITE_SYSPDIO = 3, +} MR_SCSI_CMD_TYPE; + enum mrsas_req_flags { MRSAS_DIR_UNKNOWN = 0x1, MRSAS_DIR_IN = 0x2, @@ -1350,6 +1360,7 @@ struct mrsas_mpt_cmd { u_int32_t sync_cmd_idx; u_int32_t index; u_int8_t flags; + u_int8_t pd_r1_lb; u_int8_t load_balance; bus_size_t length; u_int32_t error_code; @@ -1897,9 +1908,26 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ - u_int32_t resrved:5; + u_int32_t supportPersonalityChange:2; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportT10RebuildAssist:1; u_int32_t supportMaxExtLDs:1; - u_int32_t reserved1:26; + u_int32_t supportCrashDump:1; + u_int32_t supportSwZone:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportForceFlash:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t reserved:12; } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ @@ -1970,7 +1998,10 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; u_int32_t support_max_255lds:1; - u_int32_t reserved:28; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_core_affinity:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t reserved:25; } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2413,6 +2444,167 @@ struct mrsas_mgmt_info { int max_index; }; +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { + u_int16_t vendorID; + //(ro) + u_int16_t deviceID; + //(ro) + u_int16_t command; + //Device control + u_int16_t status; + u_int8_t revisionID; + //(ro) + u_int8_t progIf; + //(ro) + u_int8_t subClass; + //(ro) + u_int8_t baseClass; + //(ro) + u_int8_t cacheLineSize; + //(ro +) + u_int8_t latencyTimer; + //(ro +) + u_int8_t headerType; + //(ro) + u_int8_t bist; + //Built in self test + + union { + struct _MRSAS_DRV_PCI_HEADER_TYPE_0 { + u_int32_t baseAddresses[PCI_TYPE0_ADDRESSES]; + u_int32_t cis; + u_int16_t subVendorID; + u_int16_t subSystemID; + u_int32_t romBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t reserved2; + u_int8_t interruptLine; + u_int8_t interruptPin; + //(ro) + u_int8_t minimumGrant; + //(ro) + u_int8_t maximumLatency; + //(ro) + } type0; + + /* + * PCI to PCI Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_1 { + u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + u_int8_t ioBase; + u_int8_t ioLimit; + u_int16_t secondaryStatus; + u_int16_t memoryBase; + u_int16_t memoryLimit; + u_int16_t prefetchBase; + u_int16_t prefetchLimit; + u_int32_t prefetchBaseUpper32; + u_int32_t prefetchLimitUpper32; + u_int16_t ioBaseUpper16; + u_int16_t ioLimitUpper16; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t romBaseAddress; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type1; + + /* + * PCI to CARDBUS Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_2 { + u_int32_t socketRegistersBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved; + u_int16_t secondaryStatus; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + struct { + u_int32_t base; + u_int32_t limit; + } range [PCI_TYPE2_ADDRESSES - 1]; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type2; + } u; + +} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; + +#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes + +typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { + union { + struct { + u_int32_t linkSpeed:4; + u_int32_t linkWidth:6; + u_int32_t aspmSupport:2; + u_int32_t losExitLatency:3; + u_int32_t l1ExitLatency:3; + u_int32_t rsvdp:6; + u_int32_t portNumber:8; + } bits; + + u_int32_t asUlong; + } u; +} MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) + +typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { + union { + struct { + u_int16_t linkSpeed:4; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkTrainingError:1; + u_int16_t linkTraning:1; + u_int16_t slotClockConfig:1; + u_int16_t rsvdZ:3; + } bits; + + u_int16_t asUshort; + } u; + u_int16_t reserved; +} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) + + +typedef struct _MRSAS_DRV_PCI_CAPABILITIES { + MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; + MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; +} MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; + +#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) + +/* PCI information */ +typedef struct _MRSAS_DRV_PCI_INFORMATION { + u_int32_t busNumber; + u_int8_t deviceNumber; + u_int8_t functionNumber; + u_int8_t interruptVector; + u_int8_t reserved1; + MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; + MRSAS_DRV_PCI_CAPABILITIES capability; + u_int32_t domainID; + u_int8_t reserved2[28]; +} MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; + /******************************************************************* * per-instance data ********************************************************************/ @@ -2476,6 +2668,7 @@ struct mrsas_softc { int msix_vectors; int msix_enable; uint32_t msix_reg_offset[16]; + uint8_t mask_interrupts; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; @@ -2519,6 +2712,7 @@ struct mrsas_softc { bus_dmamap_t evt_detail_dmamap; struct mrsas_evt_detail *evt_detail_mem; bus_addr_t evt_detail_phys_addr; + struct mrsas_ctrl_info *ctrl_info; bus_dma_tag_t ctlr_info_tag; bus_dmamap_t ctlr_info_dmamap; void *ctlr_info_mem; @@ -2546,9 +2740,11 @@ struct mrsas_softc { struct task ev_task; u_int32_t CurLdCount; u_int64_t reset_flags; + int lb_pending_cmds; LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t secure_jbod_support; u_int8_t max256vdSupport; u_int16_t fw_supported_vd_count; u_int16_t fw_supported_pd_count; diff --git a/sys/dev/mrsas/mrsas_cam.c b/sys/dev/mrsas/mrsas_cam.c index 80ddc39e1635c..08f90025ab571 100644 --- a/sys/dev/mrsas/mrsas_cam.c +++ b/sys/dev/mrsas/mrsas_cam.c @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -57,17 +58,19 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ int mrsas_cam_attach(struct mrsas_softc *sc); -int mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb); +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); -int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb); +int mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); -int +int mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, struct cam_sim *sim); -int +int mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, u_int32_t device_id, MRSAS_RAID_SCSI_IO_REQUEST * io_request); @@ -77,10 +80,10 @@ void mrsas_cam_detach(struct mrsas_softc *sc); void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_unmap_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); -void +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, @@ -89,10 +92,10 @@ static void mrsas_freeze_simq(struct mrsas_mpt_cmd *cmd, struct cam_sim *sim); static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); -static void +static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static int32_t +static int32_t mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, union ccb *ccb); struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); @@ -112,9 +115,9 @@ MR_BuildRaidContext(struct mrsas_softc *sc, extern u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -extern u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +extern u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); @@ -315,7 +318,11 @@ mrsas_action(struct cam_sim *sim, union ccb *ccb) ccb->cpi.version_num = 1; ccb->cpi.hba_inquiry = 0; ccb->cpi.target_sprt = 0; +#if (__FreeBSD_version >= 902001) + ccb->cpi.hba_misc = PIM_UNMAPPED; +#else ccb->cpi.hba_misc = 0; +#endif ccb->cpi.hba_eng_cnt = 0; ccb->cpi.max_lun = MRSAS_SCSI_MAX_LUNS; ccb->cpi.unit_number = cam_sim_unit(sim); @@ -323,7 +330,7 @@ mrsas_action(struct cam_sim *sim, union ccb *ccb) ccb->cpi.initiator_id = MRSAS_SCSI_INITIATOR_ID; ccb->cpi.base_transfer_speed = 150000; strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(ccb->cpi.hba_vid, "LSI", HBA_IDLEN); + strncpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN); strncpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN); ccb->cpi.transport = XPORT_SPI; ccb->cpi.transport_version = 2; @@ -378,8 +385,13 @@ mrsas_scsiio_timeout(void *data) * on OCR enable/disable property of Controller from ocr_thread * context. */ +#if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif sc->do_timedout_reset = 1; if (sc->ocr_thread_active) wakeup(&sc->ocr_chan); @@ -425,8 +437,8 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, } else cmd->flags = MRSAS_DIR_NONE; /* no data */ - /* For FreeBSD 10.0 and higher */ -#if (__FreeBSD_version >= 1000000) +/* For FreeBSD 9.2 and higher */ +#if (__FreeBSD_version >= 902001) /* * XXX We don't yet support physical addresses here. */ @@ -455,6 +467,11 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, if (cmd->length) cmd->data = csio->data_ptr; break; + case CAM_DATA_BIO: + cmd->length = csio->dxfer_len; + if (cmd->length) + cmd->data = csio->data_ptr; + break; default: ccb->ccb_h.status = CAM_REQ_INVALID; goto done; @@ -499,7 +516,9 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, bcopy(csio->cdb_io.cdb_bytes, cmd->io_request->CDB.CDB32, csio->cdb_len); mtx_lock(&sc->raidmap_lock); - if (mrsas_ldio_inq(sim, ccb)) { + /* Check for IO type READ-WRITE targeted for Logical Volume */ + if (mrsas_find_io_type(sim, ccb) == READ_WRITE_LDIO) { + /* Build READ-WRITE IO for Logical Volume */ if (mrsas_build_ldio(sc, cmd, ccb)) { device_printf(sc->mrsas_dev, "Build LDIO failed.\n"); mtx_unlock(&sc->raidmap_lock); @@ -530,8 +549,13 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, /* * Start timer for IO timeout. Default timeout value is 90 second. */ - callout_reset_sbt(&cmd->cm_callout, SBT_1MS * sc->mrsas_io_timeout, 0, +#if (__FreeBSD_version >= 1000510) + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif mrsas_atomic_inc(&sc->fw_outstanding); if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) @@ -546,20 +570,17 @@ done: } /* - * mrsas_ldio_inq: Determines if IO is read/write or inquiry + * mrsas_find_io_type: Determines if IO is read/write or inquiry * input: pointer to CAM Control Block * * This function determines if the IO is read/write or inquiry. It returns a 1 * if the IO is read/write and 0 if it is inquiry. */ -int -mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb) +int +mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) { struct ccb_scsiio *csio = &(ccb->csio); - if (cam_sim_bus(sim) == 1) - return (0); - switch (csio->cdb_io.cdb_bytes[0]) { case READ_10: case WRITE_10: @@ -569,9 +590,11 @@ mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb) case WRITE_6: case READ_16: case WRITE_16: - return 1; + return (cam_sim_bus(sim) ? + READ_WRITE_SYSPDIO : READ_WRITE_LDIO); default: - return 0; + return (cam_sim_bus(sim) ? + NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); } } @@ -677,7 +700,7 @@ mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > MRSAS_MAX_SGL) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -824,9 +847,10 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, if ((sc->load_balance_info[device_id].loadBalanceFlag) && (io_info.isRead)) { io_info.devHandle = - mrsas_get_updated_dev_handle(&sc->load_balance_info[device_id], - &io_info); + mrsas_get_updated_dev_handle(sc, + &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; + cmd->pd_r1_lb = io_info.pd_after_lb; } else cmd->load_balance = 0; cmd->request_desc->SCSIIO.DevHandle = io_info.devHandle; @@ -876,30 +900,49 @@ mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, device_id = ccb_h->target_id; map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* Check if this is for system PD */ + /* + * Check if this is RW for system PD or + * it's a NON RW for sys PD and there is NO secure jbod FW support + */ if (cam_sim_bus(sim) == 1 && sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { - io_request->Function = 0; - io_request->DevHandle = map_ptr->raidMap.devHndlInfo[device_id]. - curDevHdl; - io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; - io_request->RaidContext.regLockFlags = 0; - io_request->RaidContext.regLockRowLBA = 0; - io_request->RaidContext.regLockLength = 0; - io_request->RaidContext.RAIDFlags = MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD - << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) - io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; - cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - cmd->request_desc->SCSIIO.DevHandle = + io_request->DevHandle = map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + io_request->RaidContext.RAIDFlags = + MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + if (sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { + /* system pd firmware path */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + } else { + /* system pd fast path */ + io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; + io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; + io_request->RaidContext.regLockFlags = 0; + io_request->RaidContext.regLockRowLBA = 0; + io_request->RaidContext.regLockLength = 0; + + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + + /* + * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH + * Because the NON RW cmds will now go via FW Queue + * and not the Exception queue + */ + if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; + } } else { + /* FW path for SysPD or LD Non-RW (SCSI management commands) */ io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = @@ -911,7 +954,7 @@ mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, io_request->LUN[1] = ccb_h->target_lun & 0xF; io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -934,20 +977,25 @@ mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, * is built in the callback. If the bus dmamap load is not successful, * cmd->error_code will contain the error code and a 1 is returned. */ -int -mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd) +int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb) { u_int32_t retcode = 0; struct cam_sim *sim; - int flag = BUS_DMA_NOWAIT; sim = xpt_path_sim(cmd->ccb_ptr->ccb_h.path); if (cmd->data != NULL) { - mtx_lock(&sc->io_lock); /* Map data buffer into bus space */ + mtx_lock(&sc->io_lock); +#if (__FreeBSD_version >= 902001) + retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb, + mrsas_data_load_cb, cmd, 0); +#else retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data, - cmd->length, mrsas_data_load_cb, cmd, flag); + cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); +#endif mtx_unlock(&sc->io_lock); if (retcode) device_printf(sc->mrsas_dev, "bus_dmamap_load(): retcode = %d\n", retcode); diff --git a/sys/dev/mrsas/mrsas_fp.c b/sys/dev/mrsas/mrsas_fp.c index cd0d57f30774f..7ae5662f15df3 100644 --- a/sys/dev/mrsas/mrsas_fp.c +++ b/sys/dev/mrsas/mrsas_fp.c @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -55,13 +56,13 @@ __FBSDID("$FreeBSD$"); */ u_int8_t MR_ValidateMapInfo(struct mrsas_softc *sc); u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count); -u_int8_t +mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +u_int8_t MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, MR_DRV_RAID_MAP_ALL * map); -u_int8_t +u_int8_t MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripRow, u_int16_t stripRef, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, @@ -70,32 +71,32 @@ u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int32_t mega_mod64(u_int64_t dividend, u_int32_t divisor); -u_int32_t +u_int32_t MR_GetSpanBlock(u_int32_t ld, u_int64_t row, u_int64_t *span_blk, MR_DRV_RAID_MAP_ALL * map, int *div_error); u_int64_t mega_div64_32(u_int64_t dividend, u_int32_t divisor); void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo); -void +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * map, PLD_LOAD_BALANCE_INFO lbInfo); +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, u_int32_t ld_block_size); -static u_int16_t +static u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); static u_int16_t MR_PdDevHandleGet(u_int32_t pd, MR_DRV_RAID_MAP_ALL * map); -static u_int16_t +static u_int16_t MR_ArPdGet(u_int32_t ar, u_int32_t arm, MR_DRV_RAID_MAP_ALL * map); static MR_LD_SPAN * MR_LdSpanPtrGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -static u_int8_t +static u_int8_t MR_LdDataArmGet(u_int32_t ld, u_int32_t armIdx, MR_DRV_RAID_MAP_ALL * map); static MR_SPAN_BLOCK_INFO * @@ -146,6 +147,8 @@ typedef u_int32_t REGION_LEN; #define FALSE 0 #define TRUE 1 +#define LB_PENDING_CMDS_DEFAULT 4 + /* * Related Macros @@ -376,10 +379,9 @@ MR_ValidateMapInfo(struct mrsas_softc *sc) return 1; } if (sc->UnevenSpanSupport) { - printf("Updating span set\n\n"); mr_update_span_set(drv_map, ldSpanInfo); } - mrsas_update_load_balance_params(drv_map, sc->load_balance_info); + mrsas_update_load_balance_params(sc, drv_map, sc->load_balance_info); return 0; } @@ -566,12 +568,12 @@ get_row_from_strip(struct mrsas_softc *sc, else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " "data width 0x%llx span offset 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set_Strip, (unsigned long long)span_set_Row, (unsigned long long)span_set->span_row_data_width, (unsigned long long)span_offset); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set->data_row_start + (unsigned long long)span_set_Row + (span_offset - 1)); return (span_set->data_row_start + span_set_Row + (span_offset - 1)); @@ -631,7 +633,7 @@ get_strip_from_row(struct mrsas_softc *sc, } } } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug - get_strip_from_row: returns invalid " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug - get_strip_from_row: returns invalid " "strip for ld=%x, row=%lx\n", ld, (long unsigned int)row); return -1; } @@ -679,13 +681,13 @@ get_arm_from_strip(struct mrsas_softc *sc, else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI PRL11: get_arm_from_strip: " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO PRL11: get_arm_from_strip: " "for ld=0x%x strip=0x%lx arm is 0x%x\n", ld, (long unsigned int)strip, (strip_offset - span_offset)); return (strip_offset - span_offset); } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: - get_arm_from_strip: returns invalid arm" + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: - get_arm_from_strip: returns invalid arm" " for ld=%x strip=%lx\n", ld, (long unsigned int)strip); return -1; @@ -723,9 +725,11 @@ get_arm(struct mrsas_softc *sc, u_int32_t ld, u_int8_t span, u_int64_t stripe, * This routine calculates the arm, span and block for the specified stripe and * reference in stripe using spanset * - * Inputs : Logical drive number - * stripRow: Stripe number - * stripRef: Reference in stripe + * Inputs : + * sc - HBA instance + * ld - Logical drive number + * stripRow: Stripe number + * stripRef: Reference in stripe * * Outputs : span - Span number block - Absolute Block * number in the physical disk @@ -785,6 +789,7 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripR *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } @@ -831,7 +836,7 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, else if (sc->UnevenSpanSupport) { io_info->IoforUnevenSpan = 1; } else { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," " but there is _NO_ UnevenSpanSupport\n", MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); return FALSE; @@ -858,13 +863,13 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, startlba_span = (u_int8_t)mr_spanset_get_span_block(sc, ld, start_row, pdBlock, map, &error_code); if (error_code == 1) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d. Send IO w/o region lock.\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d. Send IO w/o region lock.\n", __func__, __LINE__); return FALSE; } } if (startlba_span == SPAN_INVALID) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d for row 0x%llx," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d for row 0x%llx," "start strip %llx endSrip %llx\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, @@ -873,12 +878,12 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, } io_info->start_span = startlba_span; io_info->start_row = start_row; - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: Check Span number from %s %d for row 0x%llx, " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: Check Span number from %s %d for row 0x%llx, " " start strip 0x%llx endSrip 0x%llx span 0x%x\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, (unsigned long long)endStrip, startlba_span); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", (unsigned long long)start_row, (unsigned long long)endRow, startlba_span); } else { start_row = mega_div64_32(start_strip, raid->rowDataSize); @@ -1042,7 +1047,7 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * map, PLD_SPAN_INFO ldSpanInfo) span_row_width += MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize; #if SPAN_DEBUG - printf("LSI Debug span %x rowDataSize %x\n", count, + printf("AVAGO Debug span %x rowDataSize %x\n", count, MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize); #endif } @@ -1097,46 +1102,38 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * map, PLD_SPAN_INFO ldSpanInfo) /* * mrsas_update_load_balance_params: Update load balance parmas - * Inputs: map pointer - * Load balance info + * Inputs: + * sc - driver softc instance + * drv_map - driver RAID map + * lbInfo - Load balance info * * This function updates the load balance parameters for the LD config of a two * drive optimal RAID-1. */ -void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo) +void +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * drv_map, PLD_LOAD_BALANCE_INFO lbInfo) { int ldCount; u_int16_t ld; - u_int32_t pd, arRef; MR_LD_RAID *raid; - for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES; ldCount++) { - ld = MR_TargetIdToLdGet(ldCount, map); - if (ld >= MAX_LOGICAL_DRIVES) { + if (sc->lb_pending_cmds > 128 || sc->lb_pending_cmds < 1) + sc->lb_pending_cmds = LB_PENDING_CMDS_DEFAULT; + + for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) { + ld = MR_TargetIdToLdGet(ldCount, drv_map); + if (ld >= MAX_LOGICAL_DRIVES_EXT) { lbInfo[ldCount].loadBalanceFlag = 0; continue; } - raid = MR_LdRaidGet(ld, map); - - /* Two drive Optimal RAID 1 */ - if ((raid->level == 1) && (raid->rowSize == 2) && - (raid->spanDepth == 1) - && raid->ldState == MR_LD_STATE_OPTIMAL) { - lbInfo[ldCount].loadBalanceFlag = 1; - - /* Get the array on which this span is present */ - arRef = MR_LdSpanArrayGet(ld, 0, map); - - /* Get the PD */ - pd = MR_ArPdGet(arRef, 0, map); - /* Get dev handle from PD */ - lbInfo[ldCount].raid1DevHandle[0] = MR_PdDevHandleGet(pd, map); - pd = MR_ArPdGet(arRef, 1, map); - lbInfo[ldCount].raid1DevHandle[1] = MR_PdDevHandleGet(pd, map); - } else + raid = MR_LdRaidGet(ld, drv_map); + if ((raid->level != 1) || + (raid->ldState != MR_LD_STATE_OPTIMAL)) { lbInfo[ldCount].loadBalanceFlag = 0; + continue; + } + lbInfo[ldCount].loadBalanceFlag = 1; } } @@ -1152,7 +1149,7 @@ mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, * * Used to set the PD logical block address in CDB for FP IOs. */ -void +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, @@ -1299,6 +1296,7 @@ mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, } /* Fall through normal case, just load LBA here */ u_int8_t val = cdb[1] & 0xE0; + switch (cdb_len) { case 6: cdb[3] = (u_int8_t)(start_blk & 0xff); @@ -1332,57 +1330,94 @@ mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, } /* - * mrsas_get_best_arm: Determine the best spindle arm - * Inputs: Load balance info + * mrsas_get_best_arm_pd: Determine the best spindle arm + * Inputs: + * sc - HBA instance + * lbInfo - Load balance info + * io_info - IO request info * * This function determines and returns the best arm by looking at the * parameters of the last PD access. */ -u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count) +u_int8_t +mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int16_t pend0, pend1; + MR_LD_RAID *raid; + MR_DRV_RAID_MAP_ALL *drv_map; + u_int16_t pend0, pend1, ld; u_int64_t diff0, diff1; - u_int8_t bestArm; + u_int8_t bestArm, pd0, pd1, span, arm; + u_int32_t arRef, span_row_size; + + u_int64_t block = io_info->ldStartBlock; + u_int32_t count = io_info->numBlocks; + + span = ((io_info->span_arm & RAID_CTX_SPANARM_SPAN_MASK) + >> RAID_CTX_SPANARM_SPAN_SHIFT); + arm = (io_info->span_arm & RAID_CTX_SPANARM_ARM_MASK); + + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; + ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); + raid = MR_LdRaidGet(ld, drv_map); + span_row_size = sc->UnevenSpanSupport ? + SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; + + arRef = MR_LdSpanArrayGet(ld, span, drv_map); + pd0 = MR_ArPdGet(arRef, arm, drv_map); + pd1 = MR_ArPdGet(arRef, (arm + 1) >= span_row_size ? + (arm + 1 - span_row_size) : arm + 1, drv_map); /* get the pending cmds for the data and mirror arms */ - pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[0]); - pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[1]); + pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd0]); + pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd1]); /* Determine the disk whose head is nearer to the req. block */ - diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[0]); - diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[1]); - bestArm = (diff0 <= diff1 ? 0 : 1); + diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[pd0]); + diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[pd1]); + bestArm = (diff0 <= diff1 ? arm : arm ^ 1); - if ((bestArm == arm && pend0 > pend1 + 16) || (bestArm != arm && pend1 > pend0 + 16)) + if ((bestArm == arm && pend0 > pend1 + sc->lb_pending_cmds) || + (bestArm != arm && pend1 > pend0 + sc->lb_pending_cmds)) bestArm ^= 1; /* Update the last accessed block on the correct pd */ - lbInfo->last_accessed_block[bestArm] = block + count - 1; + lbInfo->last_accessed_block[bestArm == arm ? pd0 : pd1] = block + count - 1; + io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | bestArm; + io_info->pd_after_lb = (bestArm == arm) ? pd0 : pd1; +#if SPAN_DEBUG + if (arm != bestArm) + printf("AVAGO Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " + "io_info->span_arm 0x%x\n", + span, arm, bestArm, io_info->span_arm); +#endif - return bestArm; + return io_info->pd_after_lb; } /* * mrsas_get_updated_dev_handle: Get the update dev handle - * Inputs: Load balance info io_info pointer + * Inputs: + * sc - Adapter instance soft state + * lbInfo - Load balance info + * io_info - io_info pointer * * This function determines and returns the updated dev handle. */ -u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info) +u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int8_t arm, old_arm; + u_int8_t arm_pd; u_int16_t devHandle; + MR_DRV_RAID_MAP_ALL *drv_map; - old_arm = lbInfo->raid1DevHandle[0] == io_info->devHandle ? 0 : 1; + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; /* get best new arm */ - arm = mrsas_get_best_arm(lbInfo, old_arm, io_info->ldStartBlock, io_info->numBlocks); - devHandle = lbInfo->raid1DevHandle[arm]; - mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm]); + arm_pd = mrsas_get_best_arm_pd(sc, lbInfo, io_info); + devHandle = MR_PdDevHandleGet(arm_pd, drv_map); + mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm_pd]); return devHandle; } @@ -1471,6 +1506,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } diff --git a/sys/dev/mrsas/mrsas_ioctl.c b/sys/dev/mrsas/mrsas_ioctl.c index 8e2aead8e8a9a..3c4dbf917cad1 100644 --- a/sys/dev/mrsas/mrsas_ioctl.c +++ b/sys/dev/mrsas/mrsas_ioctl.c @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -238,7 +239,7 @@ mrsas_passthru(struct mrsas_softc *sc, void *arg, u_long ioctlCmd) } sense_ptr = (unsigned long *)((unsigned long)cmd->frame + user_ioc->sense_off); - sense_ptr = ioctl_sense_mem; + *sense_ptr = ioctl_sense_phys_addr; } /* * Set the sync_cmd flag so that the ISR knows not to complete this @@ -296,13 +297,14 @@ out: /* * Release sense buffer */ - if (ioctl_sense_phys_addr) - bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); - if (ioctl_sense_mem != NULL) - bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); - if (ioctl_sense_tag != NULL) - bus_dma_tag_destroy(ioctl_sense_tag); - + if (user_ioc->sense_len) { + if (ioctl_sense_phys_addr) + bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); + if (ioctl_sense_mem != NULL) + bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); + if (ioctl_sense_tag != NULL) + bus_dma_tag_destroy(ioctl_sense_tag); + } /* * Release data buffers */ diff --git a/sys/dev/mrsas/mrsas_ioctl.h b/sys/dev/mrsas/mrsas_ioctl.h index bf05a7d305327..c43fc6d4bf331 100644 --- a/sys/dev/mrsas/mrsas_ioctl.h +++ b/sys/dev/mrsas/mrsas_ioctl.h @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -64,6 +65,7 @@ __FBSDID("$FreeBSD$"); * into a somewhat unique, 32-bit value. */ +#define MRSAS_IOC_GET_PCI_INFO _IOR('M', 7, MRSAS_DRV_PCI_INFORMATION) #define MRSAS_IOC_FIRMWARE_PASS_THROUGH64 _IOWR('M', 1, struct mrsas_iocpacket) #ifdef COMPAT_FREEBSD32 #define MRSAS_IOC_FIRMWARE_PASS_THROUGH32 _IOWR('M', 1, struct mrsas_iocpacket32) diff --git a/sys/dev/mrsas/mrsas_linux.c b/sys/dev/mrsas/mrsas_linux.c index 8a3db0bbd8d9b..15f38c53e9001 100644 --- a/sys/dev/mrsas/mrsas_linux.c +++ b/sys/dev/mrsas/mrsas_linux.c @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Kashyap Desai, * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Kashyap Desai, - * Sibananda Sahu Support: freebsdraid@lsi.com + * Sibananda Sahu Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: <megaraidfbsd@lsi.com> Mail to: LSI Corporation, 1621 + * Send feedback to: <megaraidfbsd@avagotech.com> Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ diff --git a/sys/dev/nand/nfc_rb.c b/sys/dev/nand/nfc_rb.c new file mode 100644 index 0000000000000..64f888a2a157a --- /dev/null +++ b/sys/dev/nand/nfc_rb.c @@ -0,0 +1,275 @@ +/*- + * Copyright (C) 2015 Justin Hibbits + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* RouterBoard 600/800 NAND controller driver. */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/proc.h> +#include <sys/bus.h> +#include <sys/conf.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/malloc.h> +#include <sys/rman.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/time.h> + +#include <machine/bus.h> + +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> + +#include <dev/nand/nand.h> +#include <dev/nand/nandbus.h> +#include "nfc_if.h" +#include "gpio_if.h" + +#define RB_NAND_DATA (0x00) + +struct rb_nand_softc { + struct nand_softc nand_dev; + struct resource *sc_mem; + int rid; + device_t sc_gpio; + uint32_t sc_rdy_pin; + uint32_t sc_nce_pin; + uint32_t sc_cle_pin; + uint32_t sc_ale_pin; +}; + +static int rb_nand_attach(device_t); +static int rb_nand_probe(device_t); +static int rb_nand_send_command(device_t, uint8_t); +static int rb_nand_send_address(device_t, uint8_t); +static uint8_t rb_nand_read_byte(device_t); +static void rb_nand_read_buf(device_t, void *, uint32_t); +static void rb_nand_write_buf(device_t, void *, uint32_t); +static int rb_nand_select_cs(device_t, uint8_t); +static int rb_nand_read_rnb(device_t); + +static device_method_t rb_nand_methods[] = { + DEVMETHOD(device_probe, rb_nand_probe), + DEVMETHOD(device_attach, rb_nand_attach), + + DEVMETHOD(nfc_send_command, rb_nand_send_command), + DEVMETHOD(nfc_send_address, rb_nand_send_address), + DEVMETHOD(nfc_read_byte, rb_nand_read_byte), + DEVMETHOD(nfc_read_buf, rb_nand_read_buf), + DEVMETHOD(nfc_write_buf, rb_nand_write_buf), + DEVMETHOD(nfc_select_cs, rb_nand_select_cs), + DEVMETHOD(nfc_read_rnb, rb_nand_read_rnb), + + { 0, 0 }, +}; + +static driver_t rb_nand_driver = { + "nand", + rb_nand_methods, + sizeof(struct rb_nand_softc), +}; + +static devclass_t rb_nand_devclass; +DRIVER_MODULE(rb_nand, ofwbus, rb_nand_driver, rb_nand_devclass, 0, 0); + +#if 0 +static const struct nand_ecc_data rb_ecc = { + .eccsize = 6, + .eccmode = NAND_ECC_SOFT, + .eccbytes = 6, + .eccpositions = { 8, 9, 10, 13, 14, 15 }, +}; +#endif + +static int +rb_nand_probe(device_t dev) +{ + const char *device_type; + + device_type = ofw_bus_get_type(dev); + + if (!device_type || strcmp(device_type, "rb,nand")) + return (ENXIO); + + device_set_desc(dev, "RouterBoard 333/600/800 NAND controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rb_nand_attach(device_t dev) +{ + struct rb_nand_softc *sc; + phandle_t node; + uint32_t ale[2],cle[2],nce[2],rdy[2]; + int err; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + if (OF_getprop(node, "ale", ale, sizeof(ale)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "cle", cle, sizeof(cle)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "nce", nce, sizeof(nce)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "rdy", rdy, sizeof(rdy)) <= 0) { + return (ENXIO); + } + + if (ale[0] != cle[0] || ale[0] != nce[0] || ale[0] != rdy[0]) { + device_printf(dev, "GPIO handles for signals must match.\n"); + return (ENXIO); + } + sc->sc_ale_pin = ale[1]; + sc->sc_cle_pin = cle[1]; + sc->sc_nce_pin = nce[1]; + sc->sc_rdy_pin = rdy[1]; + + sc->sc_gpio = OF_device_from_xref(ale[0]); + if (sc->sc_gpio == NULL) { + device_printf(dev, "No GPIO resource found!\n"); + return (ENXIO); + } + + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->sc_mem == NULL) { + device_printf(dev, "could not allocate resources!\n"); + return (ENXIO); + } + + nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); + + err = nandbus_create(dev); + + return (err); +} + +static int +rb_nand_send_command(device_t dev, uint8_t command) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send command %x", command); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, command); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + return (0); +} + +static int +rb_nand_send_address(device_t dev, uint8_t addr) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send address %x", addr); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, addr); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + return (0); +} + +static uint8_t +rb_nand_read_byte(device_t dev) +{ + struct rb_nand_softc *sc; + uint8_t data; + + sc = device_get_softc(dev); + data = bus_read_1(sc->sc_mem, RB_NAND_DATA); + + nand_debug(NDBG_DRV,"rb_nand: read %x", data); + + return (data); +} + +static void +rb_nand_read_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + + sc = device_get_softc(dev); + + bus_read_region_1(sc->sc_mem, RB_NAND_DATA, buf, len); +} + +static void +rb_nand_write_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + int i; + uint8_t *b = (uint8_t*)buf; + + sc = device_get_softc(dev); + + for (i = 0; i < len; i++) { +#ifdef NAND_DEBUG + if (!(i % 16)) + printf("%s", i == 0 ? "rb_nand:\n" : "\n"); + printf(" %x", b[i]); + if (i == len - 1) + printf("\n"); +#endif + bus_write_1(sc->sc_mem, RB_NAND_DATA, b[i]); + } +} + +static int +rb_nand_select_cs(device_t dev, uint8_t cs) +{ + + if (cs > 0) + return (ENODEV); + + return (0); +} + +static int +rb_nand_read_rnb(device_t dev) +{ + struct rb_nand_softc *sc; + uint32_t rdy_bit; + + sc = device_get_softc(dev); + GPIO_PIN_GET(sc->sc_gpio, sc->sc_rdy_pin, &rdy_bit); + + return (rdy_bit); /* ready */ +} diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index 6a81b6e1a7d5e..670abff7e6f8c 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -69,7 +69,9 @@ struct ofwbus_softc { struct rman sc_mem_rman; }; +#ifndef __aarch64__ static device_identify_t ofwbus_identify; +#endif static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; @@ -78,7 +80,9 @@ static bus_release_resource_t ofwbus_release_resource; static device_method_t ofwbus_methods[] = { /* Device interface */ +#ifndef __aarch64__ DEVMETHOD(device_identify, ofwbus_identify), +#endif DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), @@ -97,6 +101,7 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); +#ifndef __aarch64__ static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -108,11 +113,17 @@ ofwbus_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } +#endif static int ofwbus_probe(device_t dev) { +#ifdef __aarch64__ + if (OF_peer(0) == 0) + return (ENXIO); +#endif + device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); } diff --git a/sys/dev/pccbb/pccbb_pci.c b/sys/dev/pccbb/pccbb_pci.c index 7dca418249fb1..a82afa271ed00 100644 --- a/sys/dev/pccbb/pccbb_pci.c +++ b/sys/dev/pccbb/pccbb_pci.c @@ -502,10 +502,26 @@ cbb_chipinit(struct cbb_softc *sc) * properly initialized. * * The TI125X parts have a different register. + * + * Note: Only the lower two nibbles matter. When set + * to 0, the MFUNC{0,1} pins are GPIO, which isn't + * going to work out too well because we specifically + * program these parts to parallel interrupt signalling + * elsewhere. We preserve the upper bits of this + * register since changing them have subtle side effects + * for different variants of the card and are + * extremely difficult to exaustively test. + * + * Also, the TI 1510/1520 changed the default for the MFUNC + * register from 0x0 to 0x1000 to enable IRQSER by default. + * We want to be careful to avoid overriding that, and the + * below test will do that. Should this check prove to be + * too permissive, we should just check against 0 and 0x1000 + * and not touch it otherwise. */ mux = pci_read_config(sc->dev, CBBR_MFUNC, 4); sysctrl = pci_read_config(sc->dev, CBBR_SYSCTRL, 4); - if (mux == 0) { + if ((mux & (CBBM_MFUNC_PIN0 | CBBM_MFUNC_PIN1)) == 0) { mux = (mux & ~CBBM_MFUNC_PIN0) | CBBM_MFUNC_PIN0_INTA; if ((sysctrl & CBBM_SYSCTRL_INTRTIE) == 0) @@ -518,7 +534,8 @@ cbb_chipinit(struct cbb_softc *sc) /* * Disable zoom video. Some machines initialize this * improperly and exerpience has shown that this helps - * prevent strange behavior. + * prevent strange behavior. We don't support zoom + * video anyway, so no harm can come from this. */ pci_write_config(sc->dev, CBBR_MMCTRL, 0, 4); break; diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index e0c5db767696a..3cfaef0ddec5a 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -523,6 +523,9 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), + + /* DYMO LabelManager Pnp */ + USB_QUIRK(DYMO, LABELMANAGERPNP, 0x0000, 0xffff, UQ_MSC_DYMO_EJECT), }; #undef USB_QUIRK_VP #undef USB_QUIRK @@ -592,6 +595,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", [UQ_SINGLE_CMD_MIDI] = "UQ_SINGLE_CMD_MIDI", + [UQ_MSC_DYMO_EJECT] = "UQ_MSC_DYMO_EJECT", }; /*------------------------------------------------------------------------* diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index c2e9501ee8993..7010916c42a38 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -108,6 +108,7 @@ enum { UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ UQ_AU_VENDOR_CLASS, /* audio device uses vendor and not audio class */ UQ_SINGLE_CMD_MIDI, /* at most one command per USB packet */ + UQ_MSC_DYMO_EJECT, /* ejects Dymo MSC device */ USB_QUIRK_MAX }; diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index cd4cc1e59f731..88b8961e47345 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(SIERRA, MC5727, 0), U3G_DEV(SIERRA, MC5727_2, 0), U3G_DEV(SIERRA, MC5728, 0), + U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index 01595207ac92e..c0dc79f18b11f 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -497,6 +497,7 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SCX8_USB_PHOENIX, 0), UFTDI_DEV(FTDI, SDMUSBQSS, 0), UFTDI_DEV(FTDI, SEMC_DSS20, 0), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index ae4ed3a4339be..46d08b5fedbf0 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -415,8 +415,9 @@ ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc) sc->sc_tty = tp; sc->sc_pps.ppscap = PPS_CAPTUREBOTH; - sc->sc_pps.mtx = sc->sc_mtx; - pps_init(&sc->sc_pps); + sc->sc_pps.driver_abi = PPS_ABI_VERSION; + sc->sc_pps.driver_mtx = sc->sc_mtx; + pps_init_abi(&sc->sc_pps); DPRINTF("ttycreate: %s\n", buf); diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index b3b46b3666913..5ffc07fe8592a 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1343,6 +1343,12 @@ usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index) */ if (iface_index == USB_IFACE_INDEX_ANY) { + if (usb_test_quirk(&uaa, UQ_MSC_DYMO_EJECT) != 0 && + usb_dymo_eject(udev, 0) == 0) { + /* success, mark the udev as disappearing */ + uaa.dev_state = UAA_DEV_EJECTING; + } + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); if (uaa.dev_state != UAA_DEV_READY) { diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c index c77afd03efef7..b99fd2918e351 100644 --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -181,6 +181,7 @@ static usb_callback_t bbb_data_rd_cs_callback; static usb_callback_t bbb_data_write_callback; static usb_callback_t bbb_data_wr_cs_callback; static usb_callback_t bbb_status_callback; +static usb_callback_t bbb_raw_write_callback; static void bbb_done(struct bbb_transfer *, int); static void bbb_transfer_start(struct bbb_transfer *, uint8_t); @@ -188,7 +189,7 @@ static void bbb_data_clear_stall_callback(struct usb_xfer *, uint8_t, uint8_t); static int bbb_command_start(struct bbb_transfer *, uint8_t, uint8_t, void *, size_t, void *, size_t, usb_timeout_t); -static struct bbb_transfer *bbb_attach(struct usb_device *, uint8_t); +static struct bbb_transfer *bbb_attach(struct usb_device *, uint8_t, uint8_t); static void bbb_detach(struct bbb_transfer *); static const struct usb_config bbb_config[ST_MAX] = { @@ -251,6 +252,19 @@ static const struct usb_config bbb_config[ST_MAX] = { }, }; +static const struct usb_config bbb_raw_config[1] = { + + [0] = { + .type = UE_BULK_INTR, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = SCSI_MAX_LEN, + .flags = {.ext_buffer = 1,.proxy_buffer = 1,}, + .callback = &bbb_raw_write_callback, + .timeout = 1 * USB_MS_HZ, /* 1 second */ + }, +}; + static void bbb_done(struct bbb_transfer *sc, int error) { @@ -471,6 +485,47 @@ bbb_status_callback(struct usb_xfer *xfer, usb_error_t error) } } +static void +bbb_raw_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct bbb_transfer *sc = usbd_xfer_softc(xfer); + usb_frlength_t max_bulk = usbd_xfer_max_len(xfer); + int actlen, sumlen; + + usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + sc->data_rem -= actlen; + sc->data_ptr += actlen; + sc->actlen += actlen; + + if (actlen < sumlen) { + /* short transfer */ + sc->data_rem = 0; + } + case USB_ST_SETUP: + DPRINTF("max_bulk=%d, data_rem=%d\n", + max_bulk, sc->data_rem); + + if (sc->data_rem == 0) { + bbb_done(sc, 0); + break; + } + if (max_bulk > sc->data_rem) { + max_bulk = sc->data_rem; + } + usbd_xfer_set_timeout(xfer, sc->data_timeout); + usbd_xfer_set_frame_data(xfer, 0, sc->data_ptr, max_bulk); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + bbb_done(sc, error); + break; + } +} + /*------------------------------------------------------------------------* * bbb_command_start - execute a SCSI command synchronously * @@ -506,13 +561,45 @@ bbb_command_start(struct bbb_transfer *sc, uint8_t dir, uint8_t lun, return (sc->error); } +/*------------------------------------------------------------------------* + * bbb_raw_write - write a raw BULK message synchronously + * + * Return values + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +static int +bbb_raw_write(struct bbb_transfer *sc, const void *data_ptr, size_t data_len, + usb_timeout_t data_timeout) +{ + sc->data_ptr = __DECONST(void *, data_ptr); + sc->data_len = data_len; + sc->data_rem = data_len; + sc->data_timeout = (data_timeout + USB_MS_HZ); + sc->actlen = 0; + sc->error = 0; + + DPRINTFN(1, "BULK DATA = %*D\n", (int)data_len, + (const char *)data_ptr, ":"); + + mtx_lock(&sc->mtx); + usbd_transfer_start(sc->xfer[0]); + while (usbd_transfer_pending(sc->xfer[0])) + cv_wait(&sc->cv, &sc->mtx); + mtx_unlock(&sc->mtx); + return (sc->error); +} + static struct bbb_transfer * -bbb_attach(struct usb_device *udev, uint8_t iface_index) +bbb_attach(struct usb_device *udev, uint8_t iface_index, + uint8_t bInterfaceClass) { struct usb_interface *iface; struct usb_interface_descriptor *id; + const struct usb_config *pconfig; struct bbb_transfer *sc; usb_error_t err; + int nconfig; #if USB_HAVE_MSCTEST_DETACH uint8_t do_unlock; @@ -535,22 +622,39 @@ bbb_attach(struct usb_device *udev, uint8_t iface_index) return (NULL); id = iface->idesc; - if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + if (id == NULL || id->bInterfaceClass != bInterfaceClass) return (NULL); - switch (id->bInterfaceSubClass) { - case UISUBCLASS_SCSI: - case UISUBCLASS_UFI: - case UISUBCLASS_SFF8020I: - case UISUBCLASS_SFF8070I: + switch (id->bInterfaceClass) { + case UICLASS_MASS: + switch (id->bInterfaceSubClass) { + case UISUBCLASS_SCSI: + case UISUBCLASS_UFI: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + break; + default: + return (NULL); + } + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_BBB_OLD: + case UIPROTO_MASS_BBB: + break; + default: + return (NULL); + } + pconfig = bbb_config; + nconfig = ST_MAX; break; - default: - return (NULL); - } - - switch (id->bInterfaceProtocol) { - case UIPROTO_MASS_BBB_OLD: - case UIPROTO_MASS_BBB: + case UICLASS_HID: + switch (id->bInterfaceSubClass) { + case 0: + break; + default: + return (NULL); + } + pconfig = bbb_raw_config; + nconfig = 1; break; default: return (NULL); @@ -560,22 +664,27 @@ bbb_attach(struct usb_device *udev, uint8_t iface_index) mtx_init(&sc->mtx, "USB autoinstall", NULL, MTX_DEF); cv_init(&sc->cv, "WBBB"); - err = usbd_transfer_setup(udev, &iface_index, sc->xfer, bbb_config, - ST_MAX, sc, &sc->mtx); + err = usbd_transfer_setup(udev, &iface_index, sc->xfer, pconfig, + nconfig, sc, &sc->mtx); if (err) { bbb_detach(sc); return (NULL); } - /* store pointer to DMA buffers */ - sc->buffer = usbd_xfer_get_frame_buffer( - sc->xfer[ST_DATA_RD], 0); - sc->buffer_size = - usbd_xfer_max_len(sc->xfer[ST_DATA_RD]); - sc->cbw = usbd_xfer_get_frame_buffer( - sc->xfer[ST_COMMAND], 0); - sc->csw = usbd_xfer_get_frame_buffer( - sc->xfer[ST_STATUS], 0); - + switch (id->bInterfaceClass) { + case UICLASS_MASS: + /* store pointer to DMA buffers */ + sc->buffer = usbd_xfer_get_frame_buffer( + sc->xfer[ST_DATA_RD], 0); + sc->buffer_size = + usbd_xfer_max_len(sc->xfer[ST_DATA_RD]); + sc->cbw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_COMMAND], 0); + sc->csw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_STATUS], 0); + break; + default: + break; + } return (sc); } @@ -604,7 +713,7 @@ usb_iface_is_cdrom(struct usb_device *udev, uint8_t iface_index) uint8_t sid_type; int err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (0); @@ -660,7 +769,7 @@ usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index) uint8_t sid_type; int err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (0); @@ -829,7 +938,7 @@ usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method) struct bbb_transfer *sc; usb_error_t err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -890,6 +999,21 @@ usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method) } usb_error_t +usb_dymo_eject(struct usb_device *udev, uint8_t iface_index) +{ + static const uint8_t data[3] = { 0x1b, 0x5a, 0x01 }; + struct bbb_transfer *sc; + usb_error_t err; + + sc = bbb_attach(udev, iface_index, UICLASS_HID); + if (sc == NULL) + return (USB_ERR_INVAL); + err = bbb_raw_write(sc, data, sizeof(data), USB_MS_HZ); + bbb_detach(sc); + return (err); +} + +usb_error_t usb_msc_read_10(struct usb_device *udev, uint8_t iface_index, uint32_t lba, uint32_t blocks, void *buffer) { @@ -908,7 +1032,7 @@ usb_msc_read_10(struct usb_device *udev, uint8_t iface_index, cmd[8] = blocks; cmd[9] = 0; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -939,7 +1063,7 @@ usb_msc_write_10(struct usb_device *udev, uint8_t iface_index, cmd[8] = blocks; cmd[9] = 0; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -958,7 +1082,7 @@ usb_msc_read_capacity(struct usb_device *udev, uint8_t iface_index, struct bbb_transfer *sc; usb_error_t err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); diff --git a/sys/dev/usb/usb_msctest.h b/sys/dev/usb/usb_msctest.h index dcc3cf7e8ccd5..d3f26c2b193c8 100644 --- a/sys/dev/usb/usb_msctest.h +++ b/sys/dev/usb/usb_msctest.h @@ -52,5 +52,7 @@ usb_error_t usb_msc_write_10(struct usb_device *udev, usb_error_t usb_msc_read_capacity(struct usb_device *udev, uint8_t iface_index, uint32_t *lba_last, uint32_t *block_size); +usb_error_t usb_dymo_eject(struct usb_device *udev, + uint8_t iface_index); #endif /* _USB_MSCTEST_H_ */ diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index d972bdc7650d6..f8ba5b5f2f6ec 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -452,6 +452,7 @@ vendor GLOBESPAN 0x0915 Globespan vendor CONCORDCAMERA 0x0919 Concord Camera vendor GARMIN 0x091e Garmin International vendor GOHUBS 0x0921 GoHubs +vendor DYMO 0x0922 DYMO vendor XEROX 0x0924 Xerox vendor BIOMETRIC 0x0929 American Biometric Company vendor TOSHIBA 0x0930 Toshiba @@ -1694,6 +1695,9 @@ product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Ter product DRESDENELEKTRONIK DE_RFNODE 0x001c deRFnode product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost +/* DYMO */ +product DYMO LABELMANAGERPNP 0x1001 DYMO LabelManager PnP + /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board product DYNASTREAM ANT2USB 0x1004 ANT2USB @@ -1872,6 +1876,7 @@ product FREECOM HDD 0xfc05 Classic SL Hard Drive product FSC E5400 0x1009 PrismGT USB 2.0 WLAN /* Future Technology Devices products */ +product FTDI SCX8_USB_PHOENIX 0x5259 SCx8 USB Phoenix interface product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial @@ -4029,6 +4034,7 @@ product SIERRA C22 0x6891 C22 product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 +product SIERRA MC7354 0x6820 MC7354 product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 9579c611a22eb..7b438c7024b99 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -152,11 +152,14 @@ static int wpi_alloc_fwmem(struct wpi_softc *); static void wpi_free_fwmem(struct wpi_softc *); static int wpi_alloc_rx_ring(struct wpi_softc *); static void wpi_update_rx_ring(struct wpi_softc *); +static void wpi_update_rx_ring_ps(struct wpi_softc *); static void wpi_reset_rx_ring(struct wpi_softc *); static void wpi_free_rx_ring(struct wpi_softc *); static int wpi_alloc_tx_ring(struct wpi_softc *, struct wpi_tx_ring *, int); static void wpi_update_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); +static void wpi_update_tx_ring_ps(struct wpi_softc *, + struct wpi_tx_ring *); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static int wpi_read_eeprom(struct wpi_softc *, @@ -171,9 +174,13 @@ static int wpi_setregdomain(struct ieee80211com *, struct ieee80211_channel[]); static int wpi_read_eeprom_group(struct wpi_softc *, int); static int wpi_add_node_entry_adhoc(struct wpi_softc *); -static void wpi_node_free(struct ieee80211_node *); static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); +static void wpi_node_free(struct ieee80211_node *); +static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, + int); +static void wpi_restore_node(void *, struct ieee80211_node *); +static void wpi_restore_node_table(struct wpi_softc *, struct wpi_vap *); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_calib_timeout(void *); static void wpi_rx_done(struct wpi_softc *, struct wpi_rx_desc *, @@ -228,6 +235,7 @@ static uint16_t wpi_get_active_dwell_time(struct wpi_softc *, static uint16_t wpi_limit_dwell(struct wpi_softc *, uint16_t); static uint16_t wpi_get_passive_dwell_time(struct wpi_softc *, struct ieee80211_channel *); +static uint32_t wpi_get_scan_pause_time(uint32_t, uint16_t); static int wpi_scan(struct wpi_softc *, struct ieee80211_channel *); static int wpi_auth(struct wpi_softc *, struct ieee80211vap *); static int wpi_config_beacon(struct wpi_vap *); @@ -516,11 +524,13 @@ wpi_attach(device_t dev) ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; ic->ic_set_channel = wpi_set_channel; - sc->sc_scan_curchan = ic->ic_scan_curchan; ic->ic_scan_curchan = wpi_scan_curchan; ic->ic_scan_mindwell = wpi_scan_mindwell; ic->ic_setregdomain = wpi_setregdomain; + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + wpi_radiotap_attach(sc); callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); @@ -609,7 +619,12 @@ wpi_init_beacon(struct wpi_vap *wvp) cmd->ofdm_mask = 0xff; cmd->cck_mask = 0x0f; cmd->lifetime = htole32(WPI_LIFETIME_INFINITE); - cmd->flags = htole32(WPI_TX_AUTO_SEQ | WPI_TX_INSERT_TSTAMP); + + /* + * XXX WPI_TX_AUTO_SEQ seems to be ignored - workaround this issue + * XXX by using WPI_TX_NEED_ACK instead (with some side effects). + */ + cmd->flags = htole32(WPI_TX_NEED_ACK | WPI_TX_INSERT_TSTAMP); bcn->code = WPI_CMD_SET_BEACON; bcn->ac = WPI_CMD_QUEUE_NUM; @@ -643,6 +658,8 @@ wpi_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, /* Override with driver methods. */ vap->iv_key_set = wpi_key_set; vap->iv_key_delete = wpi_key_delete; + wvp->wv_recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = wpi_recv_mgmt; wvp->wv_newstate = vap->iv_newstate; vap->iv_newstate = wpi_newstate; vap->iv_update_beacon = wpi_update_beacon; @@ -689,8 +706,6 @@ wpi_detach(device_t dev) if (ifp != NULL) { ic = ifp->if_l2com; - ieee80211_draintask(ic, &sc->sc_reinittask); - ieee80211_draintask(ic, &sc->sc_radiooff_task); ieee80211_draintask(ic, &sc->sc_radioon_task); ieee80211_draintask(ic, &sc->sc_start_task); @@ -1086,6 +1101,12 @@ fail: wpi_free_rx_ring(sc); static void wpi_update_rx_ring(struct wpi_softc *sc) { + WPI_WRITE(sc, WPI_FH_RX_WPTR, sc->rxq.cur & ~7); +} + +static void +wpi_update_rx_ring_ps(struct wpi_softc *sc) +{ struct wpi_rx_ring *ring = &sc->rxq; if (ring->update != 0) { @@ -1093,14 +1114,15 @@ wpi_update_rx_ring(struct wpi_softc *sc) return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s: wakeup request\n", __func__); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_FH_RX_WPTR, ring->cur & ~7); + } else { + wpi_update_rx_ring(sc); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -1244,19 +1266,27 @@ fail: wpi_free_tx_ring(sc, ring); static void wpi_update_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring) { + WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); +} + +static void +wpi_update_tx_ring_ps(struct wpi_softc *sc, struct wpi_tx_ring *ring) +{ + if (ring->update != 0) { /* Wait for INT_WAKEUP event. */ return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s (%d): requesting wakeup\n", __func__, ring->qid); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); + } else { + wpi_update_tx_ring(sc, ring); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -1276,6 +1306,10 @@ wpi_reset_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring) m_freem(data->m); data->m = NULL; } + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; + } } /* Clear TX descriptors. */ memset(ring->desc, 0, ring->desc_dma.size); @@ -1651,6 +1685,72 @@ wpi_node_free(struct ieee80211_node *ni) sc->sc_node_free(ni); } +static __inline int +wpi_check_bss_filter(struct wpi_softc *sc) +{ + return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; +} + +static void +wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi, + int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct wpi_vap *wvp = WPI_VAP(vap); + uint64_t ni_tstamp, rx_tstamp; + + wvp->wv_recv_mgmt(ni, m, subtype, rssi, nf); + + if (vap->iv_opmode == IEEE80211_M_IBSS && + vap->iv_state == IEEE80211_S_RUN && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { + ni_tstamp = le64toh(ni->ni_tstamp.tsf); + rx_tstamp = le64toh(sc->rx_tstamp); + + if (ni_tstamp >= rx_tstamp) { + DPRINTF(sc, WPI_DEBUG_STATE, + "ibss merge, tsf %ju tstamp %ju\n", + (uintmax_t)rx_tstamp, (uintmax_t)ni_tstamp); + (void) ieee80211_ibss_merge(ni); + } + } +} + +static void +wpi_restore_node(void *arg, struct ieee80211_node *ni) +{ + struct wpi_softc *sc = arg; + struct wpi_node *wn = WPI_NODE(ni); + int error; + + WPI_NT_LOCK(sc); + if (wn->id != WPI_ID_UNDEFINED) { + wn->id = WPI_ID_UNDEFINED; + if ((error = wpi_add_ibss_node(sc, ni)) != 0) { + device_printf(sc->sc_dev, + "%s: could not add IBSS node, error %d\n", + __func__, error); + } + } + WPI_NT_UNLOCK(sc); +} + +static void +wpi_restore_node_table(struct wpi_softc *sc, struct wpi_vap *wvp) +{ + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + /* Set group keys once. */ + WPI_NT_LOCK(sc); + wvp->wv_gtk = 0; + WPI_NT_UNLOCK(sc); + + ieee80211_iterate_nodes(&ic->ic_sta, wpi_restore_node, sc); + ieee80211_crypto_reload_keys(ic); +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1669,20 +1769,21 @@ wpi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); - if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN && nstate < IEEE80211_S_RUN) { if ((error = wpi_set_pslevel(sc, 0, 0, 1)) != 0) { device_printf(sc->sc_dev, "%s: could not set power saving level\n", __func__); return error; } + + wpi_set_led(sc, WPI_LED_LINK, 1, 0); } switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && - vap->iv_opmode != IEEE80211_M_STA) { + if (wpi_check_bss_filter(sc) != 0) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { device_printf(sc->sc_dev, @@ -1698,6 +1799,11 @@ wpi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) /* FALLTHROUGH */ case IEEE80211_S_AUTH: /* + * NB: do not optimize AUTH -> AUTH state transmission - + * this will break powersave with non-QoS AP! + */ + + /* * The node must be registered in the firmware before auth. * Also the associd must be cleared on RUN -> ASSOC * transitions. @@ -1711,13 +1817,36 @@ wpi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) case IEEE80211_S_RUN: /* - * RUN -> RUN transition; Just restart the timers. + * RUN -> RUN transition: + * STA mode: Just restart the timers. + * IBSS mode: Process IBSS merge. */ if (vap->iv_state == IEEE80211_S_RUN) { - WPI_RXON_LOCK(sc); - wpi_calib_timeout(sc); - WPI_RXON_UNLOCK(sc); - break; + if (vap->iv_opmode != IEEE80211_M_IBSS) { + WPI_RXON_LOCK(sc); + wpi_calib_timeout(sc); + WPI_RXON_UNLOCK(sc); + break; + } else { + /* + * Drop the BSS_FILTER bit + * (there is no another way to change bssid). + */ + WPI_RXON_LOCK(sc); + sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); + if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { + device_printf(sc->sc_dev, + "%s: could not send RXON\n", + __func__); + } + WPI_RXON_UNLOCK(sc); + + /* Restore all what was lost. */ + wpi_restore_node_table(sc, wvp); + + /* XXX set conditionally? */ + wpi_updateedca(ic); + } } /* @@ -1749,7 +1878,7 @@ wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; - if (!(sc->rxon.filter & htole32(WPI_FILTER_BSS))) + if (wpi_check_bss_filter(sc) == 0) return; wpi_power_calibration(sc); @@ -1843,7 +1972,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc, goto fail1; } /* Discard frames that are too short. */ - if (len < sizeof (*wh)) { + if (len < sizeof (struct ieee80211_frame_ack)) { DPRINTF(sc, WPI_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); goto fail1; @@ -1904,7 +2033,12 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc, m->m_flags |= M_WEP; } - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + if (len >= sizeof(struct ieee80211_frame_min)) + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + else + ni = NULL; + + sc->rx_tstamp = tail->tstamp; if (ieee80211_radiotap_active(ic)) { struct wpi_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -1957,7 +2091,7 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) struct ieee80211vap *vap; struct ieee80211com *ic; uint32_t status = le32toh(stat->status); - int ackfailcnt = stat->ackfailcnt / 2; /* wpi_mrr_setup() */ + int ackfailcnt = stat->ackfailcnt / WPI_NTRIES_DEFAULT; KASSERT(data->ni != NULL, ("no node")); KASSERT(data->m != NULL, ("no mbuf")); @@ -1966,7 +2100,7 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) DPRINTF(sc, WPI_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d btkillcnt %d rate %x duration %d " - "status %x\n", __func__, desc->qid, desc->idx, ackfailcnt, + "status %x\n", __func__, desc->qid, desc->idx, stat->ackfailcnt, stat->btkillcnt, stat->rate, le32toh(stat->duration), status); /* Unmap and free mbuf. */ @@ -1980,7 +2114,7 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) /* * Update rate control statistics for the node. */ - if ((status & 0xff) != 1) { + if (status & WPI_TX_STATUS_FAIL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); @@ -1990,7 +2124,7 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); } - ieee80211_tx_complete(ni, m, (status & 0xff) != 1); + ieee80211_tx_complete(ni, m, (status & WPI_TX_STATUS_FAIL) != 0); WPI_TXQ_STATE_LOCK(sc); ring->queued -= 1; @@ -2048,6 +2182,18 @@ wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) } wakeup(&ring->cmd[desc->idx]); + + if (desc->type == WPI_CMD_SET_POWER_MODE) { + WPI_TXQ_LOCK(sc); + if (sc->sc_flags & WPI_PS_PATH) { + sc->sc_update_rx_ring = wpi_update_rx_ring_ps; + sc->sc_update_tx_ring = wpi_update_tx_ring_ps; + } else { + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + } + WPI_TXQ_UNLOCK(sc); + } } static void @@ -2061,7 +2207,7 @@ wpi_notif_intr(struct wpi_softc *sc) bus_dmamap_sync(sc->shared_dma.tag, sc->shared_dma.map, BUS_DMASYNC_POSTREAD); - hw = le32toh(sc->shared->next); + hw = le32toh(sc->shared->next) & 0xfff; hw = (hw == 0) ? WPI_RX_RING_COUNT - 1 : hw - 1; while (sc->rxq.cur != hw) { @@ -2110,23 +2256,57 @@ wpi_notif_intr(struct wpi_softc *sc) { struct wpi_beacon_missed *miss = (struct wpi_beacon_missed *)(desc + 1); - uint32_t misses; + uint32_t expected, misses, received, threshold; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); + misses = le32toh(miss->consecutive); + expected = le32toh(miss->expected); + received = le32toh(miss->received); + threshold = MAX(2, vap->iv_bmissthreshold); - DPRINTF(sc, WPI_DEBUG_STATE, - "%s: beacons missed %d/%d\n", __func__, misses, - le32toh(miss->total)); + DPRINTF(sc, WPI_DEBUG_BMISS, + "%s: beacons missed %u(%u) (received %u/%u)\n", + __func__, misses, le32toh(miss->total), received, + expected); - if (vap->iv_state == IEEE80211_S_RUN && - (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - misses >= vap->iv_bmissthreshold) - ieee80211_beacon_miss(ic); + if (misses >= threshold || + (received == 0 && expected >= threshold)) { + WPI_RXON_LOCK(sc); + if (callout_pending(&sc->scan_timeout)) { + wpi_cmd(sc, WPI_CMD_SCAN_ABORT, NULL, + 0, 1); + } + WPI_RXON_UNLOCK(sc); + if (vap->iv_state == IEEE80211_S_RUN && + (ic->ic_flags & IEEE80211_F_SCAN) == 0) + ieee80211_beacon_miss(ic); + } break; } +#ifdef WPI_DEBUG + case WPI_BEACON_SENT: + { + struct wpi_tx_stat *stat = + (struct wpi_tx_stat *)(desc + 1); + uint64_t *tsf = (uint64_t *)(stat + 1); + uint32_t *mode = (uint32_t *)(tsf + 1); + + bus_dmamap_sync(sc->rxq.data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + + DPRINTF(sc, WPI_DEBUG_BEACON, + "beacon sent: rts %u, ack %u, btkill %u, rate %u, " + "duration %u, status %x, tsf %ju, mode %x\n", + stat->rtsfailcnt, stat->ackfailcnt, + stat->btkillcnt, stat->rate, le32toh(stat->duration), + le32toh(stat->status), *tsf, *mode); + + break; + } +#endif case WPI_UC_READY: { struct wpi_ucode_info *uc = @@ -2163,46 +2343,53 @@ wpi_notif_intr(struct wpi_softc *sc) WPI_NT_LOCK(sc); wpi_clear_node_table(sc); WPI_NT_UNLOCK(sc); - ieee80211_runtask(ic, &sc->sc_radiooff_task); + taskqueue_enqueue(sc->sc_tq, + &sc->sc_radiooff_task); return; } break; } +#ifdef WPI_DEBUG case WPI_START_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_start_scan *scan = (struct wpi_start_scan *)(desc + 1); DPRINTF(sc, WPI_DEBUG_SCAN, "%s: scanning channel %d status %x\n", __func__, scan->chan, le32toh(scan->status)); -#endif + break; } +#endif case WPI_STOP_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_stop_scan *scan = (struct wpi_stop_scan *)(desc + 1); + DPRINTF(sc, WPI_DEBUG_SCAN, "scan finished nchan=%d status=%d chan=%d\n", scan->nchan, scan->status, scan->chan); -#endif + WPI_RXON_LOCK(sc); callout_stop(&sc->scan_timeout); WPI_RXON_UNLOCK(sc); - ieee80211_scan_next(vap); + if (scan->status == WPI_SCAN_ABORTED) + ieee80211_cancel_scan(vap); + else + ieee80211_scan_next(vap); break; } } if (sc->rxq.cur % 8 == 0) { /* Tell the firmware what we have processed. */ - wpi_update_rx_ring(sc); + sc->sc_update_rx_ring(sc); } } } @@ -2233,9 +2420,8 @@ wpi_wakeup_intr(struct wpi_softc *sc) wpi_update_tx_ring(sc, ring); } } - WPI_TXQ_UNLOCK(sc); - WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + WPI_TXQ_UNLOCK(sc); } /* @@ -2245,8 +2431,7 @@ wpi_wakeup_intr(struct wpi_softc *sc) static void wpi_debug_registers(struct wpi_softc *sc) { -#define COUNTOF(array) (sizeof(array) / sizeof(array[0])) - int i; + size_t i; static const uint32_t csr_tbl[] = { WPI_HW_IF_CONFIG, WPI_INT, @@ -2273,7 +2458,7 @@ wpi_debug_registers(struct wpi_softc *sc) DPRINTF(sc, WPI_DEBUG_REGISTER,"%s","\n"); - for (i = 0; i < COUNTOF(csr_tbl); i++) { + for (i = 0; i < nitems(csr_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_csr_string(csr_tbl[i]), WPI_READ(sc, csr_tbl[i])); @@ -2283,7 +2468,7 @@ wpi_debug_registers(struct wpi_softc *sc) DPRINTF(sc, WPI_DEBUG_REGISTER, "\n\n"); if (wpi_nic_lock(sc) == 0) { - for (i = 0; i < COUNTOF(prph_tbl); i++) { + for (i = 0; i < nitems(prph_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_prph_string(prph_tbl[i]), wpi_prph_read(sc, prph_tbl[i])); @@ -2297,7 +2482,6 @@ wpi_debug_registers(struct wpi_softc *sc) DPRINTF(sc, WPI_DEBUG_REGISTER, "Cannot access internal registers.\n"); } -#undef COUNTOF } #endif @@ -2311,8 +2495,6 @@ wpi_fatal_intr(struct wpi_softc *sc) { struct wpi_fw_dump dump; uint32_t i, offset, count; - const uint32_t size_errmsg = - (sizeof (wpi_fw_errmsg) / sizeof ((wpi_fw_errmsg)[0])); /* Check that the error log address is valid. */ if (sc->errptr < WPI_FW_DATA_BASE || @@ -2342,7 +2524,7 @@ wpi_fatal_intr(struct wpi_softc *sc) sizeof (dump) / sizeof (uint32_t)); printf(" error type = \"%s\" (0x%08X)\n", - (dump.desc < size_errmsg) ? + (dump.desc < nitems(wpi_fw_errmsg)) ? wpi_fw_errmsg[dump.desc] : "UNKNOWN", dump.desc); printf(" error data = 0x%08X\n", @@ -2539,7 +2721,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) /* Kick TX ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); if (ring->qid < WPI_CMD_QUEUE_NUM) { /* Mark TX ring as full if we reach a certain threshold. */ @@ -2597,7 +2779,7 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m, struct ieee80211_node *ni) /* Select EDCA Access Category and TX ring for this frame. */ if (IEEE80211_QOS_HAS_SEQ(wh)) { - qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; tid = qos & IEEE80211_QOS_TID; } else { qos = 0; @@ -2658,6 +2840,8 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m, struct ieee80211_node *ni) flags |= WPI_TX_NEED_ACK; } + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) flags |= WPI_TX_MORE_FRAG; /* Cannot happen yet. */ @@ -2705,9 +2889,6 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m, struct ieee80211_node *ni) tx->id = wn->id; } - if (type != IEEE80211_FC0_TYPE_MGT) - tx->data_ntries = tp->maxretry; - if (k != NULL && !swcrypt) { switch (k->wk_cipher->ic_cipher) { case IEEE80211_CIPHER_AES_CCM: @@ -2729,6 +2910,7 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m, struct ieee80211_node *ni) tx->ofdm_mask = 0xff; tx->cck_mask = 0x0f; tx->rts_ntries = 7; + tx->data_ntries = tp->maxretry; tx_data.ni = ni; tx_data.m = m; @@ -2764,6 +2946,8 @@ wpi_tx_data_raw(struct wpi_softc *sc, struct mbuf *m, rate = params->ibp_rate0; flags = 0; + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) flags |= WPI_TX_NEED_ACK; if (params->ibp_flags & IEEE80211_BPF_RTS) @@ -3089,7 +3273,7 @@ wpi_cmd(struct wpi_softc *sc, int code, const void *buf, size_t size, /* Kick command ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); @@ -3125,8 +3309,8 @@ wpi_mrr_setup(struct wpi_softc *sc) /* Fallback to the immediate lower CCK rate (if any.) */ mrr.rates[i].next = (i == WPI_RIDX_CCK1) ? WPI_RIDX_CCK1 : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* OFDM rates (not used with 802.11b). */ for (i = WPI_RIDX_OFDM6; i <= WPI_RIDX_OFDM54; i++) { @@ -3138,8 +3322,8 @@ wpi_mrr_setup(struct wpi_softc *sc) ((ic->ic_curmode == IEEE80211_MODE_11A) ? WPI_RIDX_OFDM6 : WPI_RIDX_CCK2) : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* Setup MRR for control frames. */ mrr.which = htole32(WPI_MRR_CTL); @@ -3590,8 +3774,13 @@ wpi_set_pslevel(struct wpi_softc *sc, uint8_t dtim, int level, int async) pmgt = &wpi_pmgt[1][level]; memset(&cmd, 0, sizeof cmd); - if (level != 0) /* not CAM */ + WPI_TXQ_LOCK(sc); + if (level != 0) { /* not CAM */ cmd.flags |= htole16(WPI_PS_ALLOW_SLEEP); + sc->sc_flags |= WPI_PS_PATH; + } else + sc->sc_flags &= ~WPI_PS_PATH; + WPI_TXQ_UNLOCK(sc); /* Retrieve PCIe Active State Power Management (ASPM). */ reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1); if (!(reg & 0x1)) /* L0s Entry disabled. */ @@ -3644,7 +3833,7 @@ wpi_send_rxon(struct wpi_softc *sc, int assoc, int async) if (async) WPI_RXON_LOCK_ASSERT(sc); - if (assoc && (sc->rxon.filter & htole32(WPI_FILTER_BSS))) { + if (assoc && wpi_check_bss_filter(sc) != 0) { struct wpi_assoc rxon_assoc; rxon_assoc.flags = sc->rxon.flags; @@ -3710,7 +3899,7 @@ wpi_config(struct wpi_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - uint32_t flags; + struct ieee80211_channel *c = ic->ic_curchan; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3734,9 +3923,9 @@ wpi_config(struct wpi_softc *sc) IEEE80211_ADDR_COPY(sc->rxon.myaddr, vap->iv_myaddr); /* Set default channel. */ - sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_curchan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); sc->rxon.filter = WPI_FILTER_MULTICAST; @@ -3754,7 +3943,6 @@ wpi_config(struct wpi_softc *sc) sc->rxon.filter |= WPI_FILTER_ASSOC | WPI_FILTER_PROMISC; break; case IEEE80211_M_AHDEMO: - /* XXX workaround for passive channels selection */ sc->rxon.mode = WPI_MODE_HOSTAP; break; case IEEE80211_M_MONITOR: @@ -3770,6 +3958,14 @@ wpi_config(struct wpi_softc *sc) sc->rxon.cck_mask = 0x0f; /* not yet negotiated */ sc->rxon.ofdm_mask = 0xff; /* not yet negotiated */ + /* XXX Current configuration may be unusable. */ + if (IEEE80211_IS_CHAN_NOADHOC(c) && sc->rxon.mode == WPI_MODE_IBSS) { + device_printf(sc->sc_dev, + "%s: invalid channel (%d) selected for IBSS mode\n", + __func__, ieee80211_chan2ieee(ic, c)); + return EINVAL; + } + if ((error = wpi_send_rxon(sc, 0, 0)) != 0) { device_printf(sc->sc_dev, "%s: could not send RXON\n", __func__); @@ -3783,15 +3979,6 @@ wpi_config(struct wpi_softc *sc) return error; } - /* Disable beacon notifications (unused). */ - flags = WPI_STATISTICS_BEACON_DISABLE; - error = wpi_cmd(sc, WPI_CMD_GET_STATISTICS, &flags, sizeof flags, 1); - if (error != 0) { - device_printf(sc->sc_dev, - "could not disable beacon statistics, error %d\n", error); - return error; - } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); return 0; @@ -3813,7 +4000,7 @@ wpi_get_active_dwell_time(struct wpi_softc *sc, } /* - * Limit the total dwell time to 85% of the beacon interval. + * Limit the total dwell time. * * Returns the dwell time in milliseconds. */ @@ -3838,11 +4025,11 @@ wpi_limit_dwell(struct wpi_softc *sc, uint16_t dwell_time) if (bintval > 0) { DPRINTF(sc, WPI_DEBUG_SCAN, "%s: bintval=%d\n", __func__, bintval); - return (MIN(WPI_PASSIVE_DWELL_BASE, ((bintval * 85) / 100))); + return (MIN(dwell_time, bintval - WPI_CHANNEL_TUNE_TIME * 2)); } /* No association context? Default. */ - return (WPI_PASSIVE_DWELL_BASE); + return dwell_time; } static uint16_t @@ -3859,6 +4046,18 @@ wpi_get_passive_dwell_time(struct wpi_softc *sc, struct ieee80211_channel *c) return (wpi_limit_dwell(sc, passive)); } +static uint32_t +wpi_get_scan_pause_time(uint32_t time, uint16_t bintval) +{ + uint32_t mod = (time % bintval) * IEEE80211_DUR_TU; + uint32_t nbeacons = time / bintval; + + if (mod > WPI_PAUSE_MAX_TIME) + mod = WPI_PAUSE_MAX_TIME; + + return WPI_PAUSE_SCAN(nbeacons, mod); +} + /* * Send a scan request to the firmware. */ @@ -3877,7 +4076,7 @@ wpi_scan(struct wpi_softc *sc, struct ieee80211_channel *c) struct ieee80211_rateset *rs; uint16_t dwell_active, dwell_passive; uint8_t *buf, *frm; - int buflen, error, i, nssid; + int bgscan, bintval, buflen, error, i, nssid; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3888,10 +4087,16 @@ wpi_scan(struct wpi_softc *sc, struct ieee80211_channel *c) if (callout_pending(&sc->scan_timeout)) { device_printf(sc->sc_dev, "%s: called whilst scanning!\n", __func__); + error = EAGAIN; + goto fail; + } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, __func__); - - return (EAGAIN); + bgscan = wpi_check_bss_filter(sc); + bintval = vap->iv_bss->ni_intval; + if (bgscan != 0 && + bintval < WPI_QUIET_TIME_DEFAULT + WPI_CHANNEL_TUNE_TIME * 2) { + error = EOPNOTSUPP; + goto fail; } buf = malloc(WPI_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -3908,15 +4113,19 @@ wpi_scan(struct wpi_softc *sc, struct ieee80211_channel *c) * Move to the next channel if no packets are received within 10 msecs * after sending the probe request. */ - hdr->quiet_time = htole16(10); /* timeout in milliseconds */ - hdr->quiet_threshold = htole16(1); /* min # of packets */ - /* - * Max needs to be greater than active and passive and quiet! - * It's also in microseconds! - */ - hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); - hdr->pause_svc = htole32((4 << 24) | - (100 * IEEE80211_DUR_TU)); /* Hardcode for now */ + hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); + hdr->quiet_threshold = htole16(1); + + if (bgscan != 0) { + /* + * Max needs to be greater than active and passive and quiet! + * It's also in microseconds! + */ + hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); + hdr->pause_svc = htole32(wpi_get_scan_pause_time(100, + bintval)); + } + hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON); tx = (struct wpi_cmd_data *)(hdr + 1); @@ -3998,8 +4207,8 @@ wpi_scan(struct wpi_softc *sc, struct ieee80211_channel *c) dwell_passive = wpi_get_passive_dwell_time(sc, c); /* Make sure they're valid. */ - if (dwell_passive <= dwell_active) - dwell_passive = dwell_active + 1; + if (dwell_active > dwell_passive) + dwell_active = dwell_passive; chan->active = htole16(dwell_active); chan->passive = htole16(dwell_passive); @@ -4015,6 +4224,20 @@ wpi_scan(struct wpi_softc *sc, struct ieee80211_channel *c) chan->chan, IEEE80211_IS_CHAN_PASSIVE(c)); hdr->nchan++; + + if (hdr->nchan == 1 && sc->rxon.chan == chan->chan) { + /* XXX Force probe request transmission. */ + memcpy(chan + 1, chan, sizeof (struct wpi_scan_chan)); + + chan++; + + /* Reduce unnecessary delay. */ + chan->flags = 0; + chan->passive = chan->active = hdr->quiet_time; + + hdr->nchan++; + } + chan++; buflen = (uint8_t *)chan - buf; @@ -4044,6 +4267,7 @@ wpi_auth(struct wpi_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; WPI_RXON_LOCK(sc); @@ -4054,18 +4278,18 @@ wpi_auth(struct wpi_softc *sc, struct ieee80211vap *vap) sc->rxon.associd = 0; sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { @@ -4243,6 +4467,7 @@ wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -4254,7 +4479,7 @@ wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) } /* XXX kernel panic workaround */ - if (ni->ni_chan == IEEE80211_CHAN_ANYC) { + if (c == IEEE80211_CHAN_ANYC) { device_printf(sc->sc_dev, "%s: incomplete configuration\n", __func__); return EINVAL; @@ -4270,20 +4495,18 @@ wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) WPI_RXON_LOCK(sc); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); sc->rxon.associd = htole16(IEEE80211_NODE_AID(ni)); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); - /* Short preamble and slot time are negotiated when associating. */ - sc->rxon.flags &= ~htole32(WPI_RXON_SHPREAMBLE | WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { @@ -4619,7 +4842,7 @@ wpi_post_alive(struct wpi_softc *sc) /* NB: Runtime firmware must be up and running. */ if (!(wpi_prph_read(sc, WPI_APMG_RFKILL) & 1)) { - device_printf(sc->sc_dev, + device_printf(sc->sc_dev, "RF switch: radio disabled (%s)\n", __func__); wpi_nic_unlock(sc); return EPERM; /* :-) */ @@ -4943,7 +5166,7 @@ wpi_apm_stop_master(struct wpi_softc *sc) /* Stop busmaster DMA activity. */ WPI_SETBITS(sc, WPI_RESET, WPI_RESET_STOP_MASTER); - + if ((WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_PS_MASK) == WPI_GP_CNTRL_MAC_PS) return; /* Already asleep. */ @@ -5395,16 +5618,10 @@ wpi_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) int error; WPI_RXON_LOCK(sc); - if (sc->rxon.chan != ieee80211_chan2ieee(ic, ic->ic_curchan)) { - error = wpi_scan(sc, ic->ic_curchan); - WPI_RXON_UNLOCK(sc); - if (error != 0) - ieee80211_cancel_scan(vap); - } else { - WPI_RXON_UNLOCK(sc); - /* Send probe request when associated. */ - sc->sc_scan_curchan(ss, maxdwell); - } + error = wpi_scan(sc, ic->ic_curchan); + WPI_RXON_UNLOCK(sc); + if (error != 0) + ieee80211_cancel_scan(vap); } /** diff --git a/sys/dev/wpi/if_wpi_debug.h b/sys/dev/wpi/if_wpi_debug.h index 245bf59903cbf..6b78acebb11fd 100644 --- a/sys/dev/wpi/if_wpi_debug.h +++ b/sys/dev/wpi/if_wpi_debug.h @@ -43,6 +43,7 @@ enum { WPI_DEBUG_KEY = 0x00020000, /* node key management */ WPI_DEBUG_EDCA = 0x00040000, /* WME info */ WPI_DEBUG_REGISTER = 0x00080000, /* print chipset register */ + WPI_DEBUG_BMISS = 0x00100000, /* print number of missed beacons */ WPI_DEBUG_ANY = 0xffffffff }; @@ -85,12 +86,12 @@ static const char *wpi_cmd_str(int cmd) WPI_DESC(WPI_CMD_SET_LED); WPI_DESC(WPI_CMD_SET_POWER_MODE); WPI_DESC(WPI_CMD_SCAN); + WPI_DESC(WPI_CMD_SCAN_ABORT); WPI_DESC(WPI_CMD_SET_BEACON); WPI_DESC(WPI_CMD_TXPOWER); WPI_DESC(WPI_CMD_BT_COEX); default: - KASSERT(1, ("Unknown Command: %d\n", cmd)); return "UNKNOWN CMD"; } } @@ -98,7 +99,7 @@ static const char *wpi_cmd_str(int cmd) /* * Translate CSR code to string */ -static const char *wpi_get_csr_string(int csr) +static const char *wpi_get_csr_string(size_t csr) { switch (csr) { WPI_DESC(WPI_HW_IF_CONFIG); @@ -117,12 +118,12 @@ static const char *wpi_get_csr_string(int csr) WPI_DESC(WPI_ANA_PLL); WPI_DESC(WPI_DBG_HPET_MEM); default: - KASSERT(1, ("Unknown CSR: %d\n", csr)); + KASSERT(0, ("Unknown CSR: %d\n", csr)); return "UNKNOWN CSR"; } } -static const char *wpi_get_prph_string(int prph) +static const char *wpi_get_prph_string(size_t prph) { switch (prph) { WPI_DESC(WPI_APMG_CLK_CTRL); @@ -130,7 +131,7 @@ static const char *wpi_get_prph_string(int prph) WPI_DESC(WPI_APMG_PCI_STT); WPI_DESC(WPI_APMG_RFKILL); default: - KASSERT(1, ("Unknown register: %d\n", prph)); + KASSERT(0, ("Unknown register: %d\n", prph)); return "UNKNOWN PRPH"; } } diff --git a/sys/dev/wpi/if_wpireg.h b/sys/dev/wpi/if_wpireg.h index 7e60049a983a9..b0aa35c992d54 100644 --- a/sys/dev/wpi/if_wpireg.h +++ b/sys/dev/wpi/if_wpireg.h @@ -256,6 +256,26 @@ struct wpi_tx_stat { uint8_t rate; uint32_t duration; uint32_t status; +#define WPI_TX_STATUS_SUCCESS 0x01 +#define WPI_TX_STATUS_DIRECT_DONE 0x02 +#define WPI_TX_STATUS_FAIL 0x80 +#define WPI_TX_STATUS_FAIL_SHORT_LIMIT 0x82 +#define WPI_TX_STATUS_FAIL_LONG_LIMIT 0x83 +#define WPI_TX_STATUS_FAIL_FIFO_UNDERRUN 0x84 +#define WPI_TX_STATUS_FAIL_MGMNT_ABORT 0x85 +#define WPI_TX_STATUS_FAIL_NEXT_FRAG 0x86 +#define WPI_TX_STATUS_FAIL_LIFE_EXPIRE 0x87 +#define WPI_TX_STATUS_FAIL_NODE_PS 0x88 +#define WPI_TX_STATUS_FAIL_ABORTED 0x89 +#define WPI_TX_STATUS_FAIL_BT_RETRY 0x8a +#define WPI_TX_STATUS_FAIL_NODE_INVALID 0x8b +#define WPI_TX_STATUS_FAIL_FRAG_DROPPED 0x8c +#define WPI_TX_STATUS_FAIL_TID_DISABLE 0x8d +#define WPI_TX_STATUS_FAIL_FRAME_FLUSHED 0x8e +#define WPI_TX_STATUS_FAIL_INSUFFICIENT_CF_POLL 0x8f +#define WPI_TX_STATUS_FAIL_TX_LOCKED 0x90 +#define WPI_TX_STATUS_FAIL_NO_BEACON_ON_RADAR 0x91 + } __packed; struct wpi_rx_desc { @@ -332,6 +352,7 @@ struct wpi_tx_cmd { #define WPI_CMD_SET_LED 72 #define WPI_CMD_SET_POWER_MODE 119 #define WPI_CMD_SCAN 128 +#define WPI_CMD_SCAN_ABORT 129 #define WPI_CMD_SET_BEACON 145 #define WPI_CMD_TXPOWER 151 #define WPI_CMD_BT_COEX 155 @@ -547,6 +568,8 @@ struct wpi_mrr_setup { uint8_t plcp; uint8_t flags; uint8_t ntries; +#define WPI_NTRIES_DEFAULT 2 + uint8_t next; } __packed rates[WPI_RIDX_MAX + 1]; } __packed; @@ -589,12 +612,17 @@ struct wpi_scan_hdr { uint16_t len; uint8_t reserved1; uint8_t nchan; - uint16_t quiet_time; - uint16_t quiet_threshold; + uint16_t quiet_time; /* timeout in milliseconds */ +#define WPI_QUIET_TIME_DEFAULT 10 + + uint16_t quiet_threshold; /* min # of packets */ uint16_t crc_threshold; uint16_t reserved2; uint32_t max_svc; /* background scans */ uint32_t pause_svc; /* background scans */ +#define WPI_PAUSE_MAX_TIME ((1 << 20) - 1) +#define WPI_PAUSE_SCAN(nbeacons, time) ((nbeacons << 24) | time) + uint32_t flags; uint32_t filter; @@ -630,6 +658,7 @@ struct wpi_scan_chan { #define WPI_PASSIVE_DWELL_TIME_2GHZ ( 20) #define WPI_PASSIVE_DWELL_TIME_5GHZ ( 10) #define WPI_PASSIVE_DWELL_BASE (100) +#define WPI_CHANNEL_TUNE_TIME ( 6) /* Structure for command WPI_CMD_TXPOWER. */ struct wpi_cmd_txpower { @@ -697,6 +726,9 @@ struct wpi_start_scan { struct wpi_stop_scan { uint8_t nchan; uint8_t status; +#define WPI_SCAN_COMPLETED 1 +#define WPI_SCAN_ABORTED 2 + uint8_t reserved; uint8_t chan; uint64_t tsf; diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h index 7c748250438e2..7a65b721f6c47 100644 --- a/sys/dev/wpi/if_wpivar.h +++ b/sys/dev/wpi/if_wpivar.h @@ -121,17 +121,19 @@ struct wpi_buf { }; struct wpi_vap { - struct ieee80211vap wv_vap; + struct ieee80211vap wv_vap; - struct wpi_buf wv_bcbuf; - struct ieee80211_beacon_offsets wv_boff; - struct mtx wv_mtx; + struct wpi_buf wv_bcbuf; + struct ieee80211_beacon_offsets wv_boff; + struct mtx wv_mtx; - uint32_t wv_gtk; -#define WPI_VAP_KEY(kid) (1 << kid) + uint32_t wv_gtk; +#define WPI_VAP_KEY(kid) (1 << kid) - int (*wv_newstate)(struct ieee80211vap *, - enum ieee80211_state, int); + int (*wv_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); + void (*wv_recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, int, int); }; #define WPI_VAP(vap) ((struct wpi_vap *)(vap)) @@ -164,6 +166,9 @@ struct wpi_softc { struct ifnet *sc_ifp; int sc_debug; + int sc_flags; +#define WPI_PS_PATH (1 << 0) + struct mtx sc_mtx; struct mtx tx_mtx; @@ -177,6 +182,7 @@ struct wpi_softc { uint32_t txq_active; struct wpi_rx_ring rxq; + uint64_t rx_tstamp; /* TX Thermal Callibration. */ struct callout calib_to; @@ -210,8 +216,9 @@ struct wpi_softc { struct mtx nt_mtx; void (*sc_node_free)(struct ieee80211_node *); - void (*sc_scan_curchan)(struct ieee80211_scan_state *, - unsigned long); + void (*sc_update_rx_ring)(struct wpi_softc *); + void (*sc_update_tx_ring)(struct wpi_softc *, + struct wpi_tx_ring *); struct wpi_rx_radiotap_header sc_rxtap; struct wpi_tx_radiotap_header sc_txtap; diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 5073398c954c1..c340106ccb40f 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -138,6 +138,9 @@ static struct g_part_mbr_alias { { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, + { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, + { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, + { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, }; static int diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index c3dd792263ae6..2c7fe2e1764a5 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -943,7 +943,8 @@ fail: #endif racct_proc_exit(newproc); fail1: - crfree(proc_set_cred(newproc, NULL)); + crfree(newproc->p_ucred); + newproc->p_ucred = NULL; fail2: if (vm2 != NULL) vmspace_free(vm2); diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 6264c64e975ca..9dca0e80e5eaa 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1468,6 +1468,17 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD, * RFC 2783 PPS-API implementation. */ +/* + * Return true if the driver is aware of the abi version extensions in the + * pps_state structure, and it supports at least the given abi version number. + */ +static inline int +abi_aware(struct pps_state *pps, int vers) +{ + + return ((pps->kcmode & KCMODE_ABIFLAG) && pps->driver_abi >= vers); +} + static int pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) { @@ -1497,10 +1508,17 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - if (pps->mtx != NULL) - err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); - else + if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { + if (pps->flags & PPSFLAG_MTX_SPIN) { + err = msleep_spin(pps, pps->driver_mtx, + "ppsfch", timo); + } else { + err = msleep(pps, pps->driver_mtx, PCATCH, + "ppsfch", timo); + } + } else { err = tsleep(pps, PCATCH, "ppsfch", timo); + } if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { @@ -1590,7 +1608,8 @@ pps_ioctl(u_long cmd, caddr_t data, struct pps_state *pps) return (EINVAL); if (kapi->edge & ~pps->ppscap) return (EINVAL); - pps->kcmode = kapi->edge; + pps->kcmode = (kapi->edge & KCMODE_EDGEMASK) | + (pps->kcmode & KCMODE_ABIFLAG); return (0); #else return (EOPNOTSUPP); @@ -1611,6 +1630,18 @@ pps_init(struct pps_state *pps) #ifdef FFCLOCK pps->ppscap |= PPS_TSCLK_MASK; #endif + pps->kcmode &= ~KCMODE_ABIFLAG; +} + +void +pps_init_abi(struct pps_state *pps) +{ + + pps_init(pps); + if (pps->driver_abi > 0) { + pps->kcmode |= KCMODE_ABIFLAG; + pps->kernel_abi = PPS_ABI_VERSION; + } } void diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a1a79152f657c..b77d476f35b75 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -813,6 +813,7 @@ m_dup(struct mbuf *m, int how) } if ((n->m_flags & M_EXT) == 0) nsize = MHLEN; + n->m_flags &= ~M_RDONLY; } n->m_len = 0; diff --git a/sys/net/if_me.c b/sys/net/if_me.c index a00bdd22a429c..56fe4d55a1923 100644 --- a/sys/net/if_me.c +++ b/sys/net/if_me.c @@ -477,7 +477,7 @@ me_check_nesting(struct ifnet *ifp, struct mbuf *m) count = 1; mtag = NULL; - while ((mtag = m_tag_locate(m, MTAG_ME, 0, NULL)) != NULL) { + while ((mtag = m_tag_locate(m, MTAG_ME, 0, mtag)) != NULL) { if (*(struct ifnet **)(mtag + 1) == ifp) { log(LOG_NOTICE, "%s: loop detected\n", ifp->if_xname); return (EIO); diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index c1b4b518a2895..049d952970fad 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -229,6 +229,8 @@ adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) } #endif break; + case IEEE80211_S_RUN: /* IBSS merge */ + break; default: goto invalid; } @@ -369,7 +371,10 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) /* * Validate the bssid. */ - if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && + if (!(type == IEEE80211_FC0_TYPE_MGT && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_REQ)) && + !IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && !IEEE80211_ADDR_EQ(bssid, ifp->if_broadcastaddr)) { /* not interested in */ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, @@ -409,7 +414,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type)) { + if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index 711bac3482341..aa21f3b9e218f 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -355,8 +355,8 @@ wlan_##name##_modevent(module_t mod, int type, void *unused) \ case MOD_UNLOAD: \ case MOD_QUIESCE: \ if (nrefs) { \ - printf("wlan_##name: still in use (%u dynamic refs)\n",\ - nrefs); \ + printf("wlan_" #name ": still in use " \ + "(%u dynamic refs)\n", nrefs); \ return EBUSY; \ } \ if (type == MOD_UNLOAD) { \ diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 9fc4cd4d31570..c84f9a8e5685e 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -93,6 +93,8 @@ static void node_getmimoinfo(const struct ieee80211_node *, static void _ieee80211_free_node(struct ieee80211_node *); +static void node_reclaim(struct ieee80211_node_table *nt, + struct ieee80211_node *ni); static void ieee80211_node_table_init(struct ieee80211com *ic, struct ieee80211_node_table *nt, const char *name, int inact, int keymaxix); @@ -719,9 +721,15 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) IEEE80211_ADDR_EQ(obss->ni_macaddr, selbs->ni_macaddr)); vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */ if (obss != NULL) { + struct ieee80211_node_table *nt = obss->ni_table; + copy_bss(selbs, obss); ieee80211_node_decref(obss); /* iv_bss reference */ - ieee80211_free_node(obss); /* station table reference */ + + IEEE80211_NODE_LOCK(nt); + node_reclaim(nt, obss); /* station table reference */ + IEEE80211_NODE_UNLOCK(nt); + obss = NULL; /* NB: guard against later use */ } @@ -871,7 +879,7 @@ ieee80211_sta_leave(struct ieee80211_node *ni) void ieee80211_node_deauth(struct ieee80211_node *ni, int reason) { - /* NB: bump the refcnt to be sure temporay nodes are not reclaimed */ + /* NB: bump the refcnt to be sure temporary nodes are not reclaimed */ ieee80211_ref_node(ni); if (ni->ni_associd != 0) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason); @@ -1749,6 +1757,28 @@ _ieee80211_free_node(struct ieee80211_node *ni) ni->ni_ic->ic_node_free(ni); } +/* + * Clear any entry in the unicast key mapping table. + */ +static int +node_clear_keyixmap(struct ieee80211_node_table *nt, struct ieee80211_node *ni) +{ + ieee80211_keyix keyix; + + keyix = ni->ni_ucastkey.wk_rxkeyix; + if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && + nt->nt_keyixmap[keyix] == ni) { + IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); + nt->nt_keyixmap[keyix] = NULL; + ieee80211_node_decref(ni); + return 1; + } + + return 0; +} + void #ifdef IEEE80211_DEBUG_REFCNT ieee80211_free_node_debug(struct ieee80211_node *ni, const char *func, int line) @@ -1770,24 +1800,9 @@ ieee80211_free_node(struct ieee80211_node *ni) * Last reference, reclaim state. */ _ieee80211_free_node(ni); - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { - ieee80211_keyix keyix; - /* - * Check for a last reference in the key mapping table. - */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, - IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* XXX needed? */ + } else if (ieee80211_node_refcnt(ni) == 1) + if (node_clear_keyixmap(nt, ni)) _ieee80211_free_node(ni); - } - } IEEE80211_NODE_UNLOCK(nt); } else { if (ieee80211_node_dectestref(ni)) @@ -1855,7 +1870,6 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni) static void node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni) { - ieee80211_keyix keyix; IEEE80211_NODE_LOCK_ASSERT(nt); @@ -1870,15 +1884,7 @@ node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni) * table. We cannot depend on the mapping table entry * being cleared because the node may not be free'd. */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry %u\n", - __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* NB: don't need free */ - } + (void)node_clear_keyixmap(nt, ni); if (!ieee80211_node_dectestref(ni)) { /* * Other references are present, just remove the diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c index e6e16eda2d95a..d7f08e91537c0 100644 --- a/sys/netinet6/ip6_ipsec.c +++ b/sys/netinet6/ip6_ipsec.c @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_inet6.h" +#include "opt_sctp.h" #include "opt_ipsec.h" #include <sys/param.h> @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$"); #include <netinet/in_pcb.h> #include <netinet/ip_var.h> #include <netinet/ip_options.h> +#ifdef SCTP +#include <netinet/sctp_crc32.h> +#endif #include <machine/in_cksum.h> -#ifdef IPSEC #include <netipsec/ipsec.h> #include <netipsec/ipsec6.h> #include <netipsec/xform.h> @@ -71,16 +73,12 @@ __FBSDID("$FreeBSD$"); #else #define KEYDEBUG(lev,arg) #endif -#endif /*IPSEC*/ #include <netinet6/ip6_ipsec.h> #include <netinet6/ip6_var.h> extern struct protosw inet6sw[]; - -#ifdef INET6 -#ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; #else @@ -92,8 +90,6 @@ SYSCTL_DECL(_net_inet6_ipsec6); SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, filtertunnel, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_ipsec6_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); -#endif /* IPSEC */ -#endif /* INET6 */ /* * Check if we have to jump over firewall processing for this packet. @@ -103,16 +99,14 @@ SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, filtertunnel, int ip6_ipsec_filtertunnel(struct mbuf *m) { -#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip6_ipsec6_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) - return 1; -#endif - return 0; + return (1); + return (0); } /* @@ -125,11 +119,7 @@ int ip6_ipsec_fwd(struct mbuf *m) { -#ifdef IPSEC return (ipsec6_in_reject(m, NULL)); -#else - return (0); -#endif /* !IPSEC */ } /* @@ -143,7 +133,6 @@ int ip6_ipsec_input(struct mbuf *m, int nxt) { -#ifdef IPSEC /* * enforce IPsec policy checking if we are seeing last header. * note that we do not visit this with protocols with pcb layer @@ -151,7 +140,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) */ if ((inet6sw[ip6_protox[nxt]].pr_flags & PR_LASTHDR) != 0) return (ipsec6_in_reject(m, NULL)); -#endif /* IPSEC */ return (0); } @@ -164,7 +152,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *error) { -#ifdef IPSEC struct secpolicy *sp; /* @@ -257,9 +244,7 @@ reinjected: bad: if (sp != NULL) KEY_FREESP(&sp); - return 1; -#endif /* IPSEC */ - return 0; + return (1); } #if 0 diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index eda02d9c32938..d6679034a5767 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -2900,14 +2900,6 @@ ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) if (copym == NULL) return; } - -#ifdef DIAGNOSTIC - if (copym->m_len < sizeof(*ip6)) { - m_freem(copym); - return; - } -#endif - ip6 = mtod(copym, struct ip6_hdr *); /* * clear embedded scope identifiers if necessary. @@ -2915,7 +2907,11 @@ ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) */ in6_clearscope(&ip6->ip6_src); in6_clearscope(&ip6->ip6_dst); - + if (copym->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + copym->m_pkthdr.csum_flags |= CSUM_DATA_VALID_IPV6 | + CSUM_PSEUDO_HDR; + copym->m_pkthdr.csum_data = 0xffff; + } (void)if_simloop(ifp, copym, dst->sin6_family, 0); } diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c index ca4e0e4c3ea99..f9425415c3c42 100644 --- a/sys/netpfil/ipfw/ip_fw_table.c +++ b/sys/netpfil/ipfw/ip_fw_table.c @@ -597,19 +597,21 @@ restart: /* Pass stack buffer by default */ ta_buf_m = ta_buf; error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); - if (error != 0) - goto cleanup; IPFW_UH_WLOCK(ch); + del_toperation_state(ch, &ts); /* Drop reference we've used in first search */ tc->no.refcnt--; + /* Check prepare_batch_buffer() error */ + if (error != 0) + goto cleanup; + /* * Check if table swap has happened. * (so table algo might be changed). * Restart operation to achieve consistent behavior. */ - del_toperation_state(ch, &ts); if (ts.modified != 0) goto restart; diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index cb05ffa5462cb..5f49eb9e8d064 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -51,11 +51,13 @@ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ -#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ -#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ +#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ +#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ +#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ +#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ #define DOSPTYP_EFI 0xef /* EFI FAT parition */ #define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */ diff --git a/sys/sys/timepps.h b/sys/sys/timepps.h index ae4b84d17d77d..d472c804dc432 100644 --- a/sys/sys/timepps.h +++ b/sys/sys/timepps.h @@ -135,6 +135,13 @@ struct pps_kcbind_args { struct mtx; +#define KCMODE_EDGEMASK 0x03 +#define KCMODE_ABIFLAG 0x80000000 /* Internal use: abi-aware driver. */ + +#define PPS_ABI_VERSION 1 + +#define PPSFLAG_MTX_SPIN 0x01 /* Driver mtx is MTX_SPIN type. */ + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -142,9 +149,6 @@ struct pps_state { unsigned capgen; unsigned capcount; - /* pointer to mutex protecting this state, if any */ - struct mtx *mtx; - /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo; @@ -153,11 +157,19 @@ struct pps_state { int ppscap; struct timecounter *ppstc; unsigned ppscount[3]; + /* + * The following fields are valid if the driver calls pps_init_abi(). + */ + uint16_t driver_abi; /* Driver sets before pps_init_abi(). */ + uint16_t kernel_abi; /* Kernel sets during pps_init_abi(). */ + struct mtx *driver_mtx; /* Optional, valid if non-NULL. */ + uint32_t flags; }; void pps_capture(struct pps_state *pps); void pps_event(struct pps_state *pps, int event); void pps_init(struct pps_state *pps); +void pps_init_abi(struct pps_state *pps); int pps_ioctl(unsigned long cmd, caddr_t data, struct pps_state *pps); void hardpps(struct timespec *tsp, long nsec); diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 2878dc3b0b9bd..c59f81adae825 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -340,16 +340,21 @@ vnode_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, *before += poff; } if (after) { - int numafter; + /* + * The BMAP vop can report a partial block in the + * 'after', but must not report blocks after EOF. + * Assert the latter, and truncate 'after' in case + * of the former. + */ + KASSERT((reqblock + *after) * pagesperblock < + roundup2(object->size, pagesperblock), + ("%s: reqblock %jd after %d size %ju", __func__, + (intmax_t )reqblock, *after, + (uintmax_t )object->size)); *after *= pagesperblock; - numafter = pagesperblock - (poff + 1); - if (IDX_TO_OFF(pindex + numafter) > - object->un_pager.vnp.vnp_size) { - numafter = - OFF_TO_IDX(object->un_pager.vnp.vnp_size) - - pindex; - } - *after += numafter; + *after += pagesperblock - (poff + 1); + if (pindex + *after >= object->size) + *after = object->size - 1 - pindex; } } else { if (before) { diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 60f46fb68e597..a771fffaea570 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -82,6 +82,9 @@ #define EFER_LMA 0x000000400 /* Long mode active (R) */ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ #define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ +#define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ +#define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ +#define EFER_TCE 0x000008000 /* Translation Cache Extension */ /* * Intel Extended Features registers @@ -191,7 +194,7 @@ #define AMDID_MP 0x00080000 #define AMDID_NX 0x00100000 #define AMDID_EXT_MMX 0x00400000 -#define AMDID_FFXSR 0x01000000 +#define AMDID_FFXSR 0x02000000 #define AMDID_PAGE1GB 0x04000000 #define AMDID_RDTSCP 0x08000000 #define AMDID_LM 0x20000000 diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index a519580a7a674..4a2ba75127282 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1009,12 +1009,6 @@ OLD_FILES+=usr/bin/c++filt .endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus -.if ${MK_GCC} == no -OLD_FILES+=usr/bin/gperf -OLD_FILES+=usr/share/info/gperf.info.gz -OLD_FILES+=usr/share/man/man1/gperf.1.gz -OLD_FILES+=usr/share/man/man1/gperf.7.gz -.endif .endif .if ${MK_FMTREE} == no @@ -1729,6 +1723,7 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/bin/gcov OLD_FILES+=usr/bin/gcpp +OLD_FILES+=usr/bin/gperf .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_aes.h OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_pclmul.h @@ -1754,10 +1749,13 @@ OLD_FILES+=usr/share/info/cpp.info.gz OLD_FILES+=usr/share/info/cppinternals.info.gz OLD_FILES+=usr/share/info/gcc.info.gz OLD_FILES+=usr/share/info/gccint.info.gz +OLD_FILES+=usr/share/info/gperf.info.gz OLD_FILES+=usr/share/man/man1/g++.1.gz OLD_FILES+=usr/share/man/man1/gcc.1.gz OLD_FILES+=usr/share/man/man1/gcov.1.gz OLD_FILES+=usr/share/man/man1/gcpp.1.gz +OLD_FILES+=usr/share/man/man1/gperf.1.gz +OLD_FILES+=usr/share/man/man1/gperf.7.gz .endif .if ${MK_GCOV} == no diff --git a/usr.bin/checknr/checknr.1 b/usr.bin/checknr/checknr.1 index 8888fddc55834..a89706eb10cd9 100644 --- a/usr.bin/checknr/checknr.1 +++ b/usr.bin/checknr/checknr.1 @@ -28,7 +28,7 @@ .\" @(#)checknr.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 26, 2005 +.Dd May 5, 2015 .Dt CHECKNR 1 .Os .Sh NAME @@ -157,7 +157,3 @@ There is no way to define a 1 character macro name using .Pp Does not correctly recognize certain reasonable constructs, such as conditionals. -.Pp -Input lines are limited to -.Dv LINE_MAX -(2048) bytes in length. diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c index d3e5355b78b6f..06395b0063b03 100644 --- a/usr.bin/checknr/checknr.c +++ b/usr.bin/checknr/checknr.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); * structured typesetting. */ #include <err.h> +#define _WITH_GETLINE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -57,7 +58,7 @@ __FBSDID("$FreeBSD$"); #define MAXSTK 100 /* Stack size */ #define MAXBR 100 /* Max number of bracket pairs known */ -#define MAXCMDS 500 /* Max number of commands known */ +#define MAXCMDS 600 /* Max number of commands known */ static void addcmd(char *); static void addmac(const char *); @@ -133,6 +134,19 @@ static struct brstr { {"(q", ")q"}, {"(x", ")x"}, {"(z", ")z"}, + /* The -mdoc package */ + {"Ao", "Ac"}, + {"Bd", "Ed"}, + {"Bk", "Ek"}, + {"Bo", "Bc"}, + {"Do", "Dc"}, + {"Fo", "Fc"}, + {"Oo", "Oc"}, + {"Po", "Pc"}, + {"Qo", "Qc"}, + {"Rs", "Re"}, + {"So", "Sc"}, + {"Xo", "Xc"}, /* Things needed by preprocessors */ {"EQ", "EN"}, {"TS", "TE"}, @@ -146,37 +160,47 @@ static struct brstr { * Used so we can complain about unrecognized commands. */ static const char *knowncmds[MAXCMDS] = { -"$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", -"(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", -"+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", -"@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", -"AE", "AF", "AI", "AL", "AM", "AS", "AT", "AU", "AX", "B", "B1", "B2", -"BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", -"D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", -"EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", -"FQ", "FS", "FV", "FX", "H", "HC", "HD", "HM", "HO", "HU", "I", "ID", -"IE", "IH", "IM", "IP", "IX", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", -"LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", -"MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", -"P1", "PF", "PH", "PP", "PT", "PX", "PY", "QE", "QP", "QS", "R", "RA", -"RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", -"SG", "SH", "SK", "SM", "SP", "SY", "T&", "TA", "TB", "TC", "TD", "TE", -"TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", -"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", -"[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", -"][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", -"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", "cs", -"ct", "cu", "da", "de", "di", "dl", "dn", "ds", "dt", "dw", "dy", "ec", -"ef", "eh", "el", "em", "eo", "ep", "ev", "ex", "fc", "fi", "fl", "fo", -"fp", "ft", "fz", "hc", "he", "hl", "hp", "ht", "hw", "hx", "hy", "i", -"ie", "if", "ig", "in", "ip", "it", "ix", "lc", "lg", "li", "ll", "ln", -"lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", "n1", -"n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", -"of", "oh", "os", "pa", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", -"q", "r", "rb", "rd", "re", "rm", "rn", "ro", "rr", "rs", "rt", "sb", -"sc", "sh", "sk", "so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", -"ti", "tl", "tm", "tp", "tr", "u", "uf", "uh", "ul", "vs", "wh", "xp", -"yr", 0 +"$c", "$f", "$h", "$p", "$s", "%A", "%B", "%C", "%D", "%I", "%J", "%N", "%O", +"%P", "%Q", "%R", "%T", "%V", "(b", "(c", "(d", "(f", "(l", "(q", "(t", "(x", +"(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", "+c", "1C", +"1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", "@c", "@e", "@f", +"@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", "AE", "AF", "AI", "AL", +"AM", "AS", "AT", "AU", "AX", "Ac", "Ad", "An", "Ao", "Ap", "Aq", "Ar", "At", +"B", "B" , "B1", "B2", "BD", "BE", "BG", "BL", "BS", "BT", "BX", "Bc", "Bd", +"Bf", "Bk", "Bl", "Bo", "Bq", "Bsx", "Bx", "C1", "C2", "CD", "CM", "CT", "Cd", +"Cm", "D", "D" , "D1", "DA", "DE", "DF", "DL", "DS", "DT", "Db", "Dc", "Dd", +"Dl", "Do", "Dq", "Dt", "Dv", "EC", "EF", "EG", "EH", "EM", "EN", "EQ", "EX", +"Ec", "Ed", "Ef", "Ek", "El", "Em", "Eo", "Er", "Ev", "FA", "FD", "FE", "FG", +"FJ", "FK", "FL", "FN", "FO", "FQ", "FS", "FV", "FX", "Fa", "Fc", "Fd", "Fl", +"Fn", "Fo", "Ft", "Fx", "H", "H" , "HC", "HD", "HM", "HO", "HU", "I", "I" , +"ID", "IE", "IH", "IM", "IP", "IX", "IZ", "Ic", "In", "It", "KD", "KE", "KF", +"KQ", "KS", "LB", "LC", "LD", "LE", "LG", "LI", "LP", "Lb", "Li", "MC", "ME", +"MF", "MH", "ML", "MR", "MT", "ND", "NE", "NH", "NL", "NP", "NS", "Nd", "Nm", +"No", "Ns", "Nx", "OF", "OH", "OK", "OP", "Oc", "Oo", "Op", "Os", "Ot", "Ox", +"P", "P" , "P1", "PF", "PH", "PP", "PT", "PX", "PY", "Pa", "Pc", "Pf", "Po", +"Pp", "Pq", "QE", "QP", "QS", "Qc", "Ql", "Qo", "Qq", "R", "R" , "RA", "RC", +"RE", "RL", "RP", "RQ", "RS", "RT", "Re", "Rs", "S", "S" , "S0", "S2", "S3", +"SA", "SG", "SH", "SK", "SM", "SP", "SY", "Sc", "Sh", "Sm", "So", "Sq", "Ss", +"St", "Sx", "Sy", "T&", "TA", "TB", "TC", "TD", "TE", "TH", "TL", "TM", "TP", +"TQ", "TR", "TS", "TX", "Tn", "UL", "US", "UX", "Ud", "Ux", "VL", "Va", "Vt", +"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "Xc", "Xo", "Xr", "[", +"[" , "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "\\{", "\\}", +"]", "]" , "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", +"b", "b" , "ba", "bc", "bd", "bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", +"ce", "cf", "ch", "chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", +"ds", "dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", "evc", +"ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", "fp", "ft", "ftr", +"fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", "ht", "hw", "hx", "hy", +"hylang", "i", "i" , "ie", "if", "ig", "in", "ip", "it", "ix", "kern", +"kernafter", "kernbefore", "kernpair", "lc", "lc_ctype", "lg", "lhang", "li", +"ll", "ln", "lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", +"n1", "n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", +"of", "oh", "os", "pa", "papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", +"ps", "q", "q" , "r", "r" , "rb", "rd", "re", "recursionlimit", "return", +"rhang", "rm", "rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", +"so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +0 }; static int lineno; /* current line number in input file */ @@ -210,8 +234,18 @@ main(int argc, char **argv) for (i=0; br[i].opbr; i++) ; for (cp=argv[1]+3; cp[-1]; cp += 6) { - br[i].opbr = strncpy(malloc(3), cp, 2); - br[i].clbr = strncpy(malloc(3), cp+3, 2); + char *tmp; + + if (i >= MAXBR) + errx(1, "too many pairs"); + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp, 3); + br[i].opbr = tmp; + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp+3, 3); + br[i].clbr = tmp; addmac(br[i].opbr); /* knows pairs are also known cmds */ addmac(br[i].clbr); i++; @@ -250,7 +284,7 @@ main(int argc, char **argv) nfiles = argc - 1; if (nfiles > 0) { - for (i=1; i<argc; i++) { + for (i = 1; i < argc; i++) { cfilename = argv[i]; f = fopen(cfilename, "r"); if (f == NULL) @@ -279,12 +313,15 @@ static void process(FILE *f) { int i, n; - char mac[5]; /* The current macro or nroff command */ + char mac[64]; /* The current macro or nroff command */ + char *line; + size_t linecap; int pl; - static char line[256]; /* the current line */ + line = NULL; + linecap = 0; stktop = -1; - for (lineno = 1; fgets(line, sizeof line, f); lineno++) { + for (lineno = 1; getline(&line, &linecap, f) > 0; lineno++) { if (line[0] == '.') { /* * find and isolate the macro/command name. @@ -320,9 +357,9 @@ process(FILE *f) * At this point we process the line looking * for \s and \f. */ - for (i=0; line[i]; i++) - if (line[i]=='\\' && (i==0 || line[i-1]!='\\')) { - if (!sflag && line[++i]=='s') { + for (i = 0; line[i]; i++) + if (line[i] == '\\' && (i == 0 || line[i-1] != '\\')) { + if (!sflag && line[++i] == 's') { pl = line[++i]; if (isdigit(pl)) { n = pl - '0'; @@ -333,7 +370,8 @@ process(FILE *f) n = 10 * n + line[i] - '0'; i--; if (n == 0) { - if (stk[stktop].opno == SZ) { + if (stktop >= 0 && + stk[stktop].opno == SZ) { stktop--; } else { pe(lineno); @@ -345,10 +383,11 @@ process(FILE *f) stk[stktop].parm = n; stk[stktop].lno = lineno; } - } else if (!fflag && line[i]=='f') { + } else if (!fflag && line[i] == 'f') { n = line[++i]; if (n == 'P') { - if (stk[stktop].opno == FT) { + if (stktop >= 0 && + stk[stktop].opno == FT) { stktop--; } else { pe(lineno); @@ -363,11 +402,12 @@ process(FILE *f) } } } + free(line); /* * We've hit the end and look at all this stuff that hasn't been * matched yet! Complain, complain. */ - for (i=stktop; i>=0; i--) { + for (i = stktop; i >= 0; i--) { complain(i); } } @@ -395,7 +435,8 @@ prop(int i) break; default: printf("Bug: stk[%d].opno = %d = .%s, .%s", - i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr); + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); } } @@ -557,17 +598,20 @@ addmac(const char *mac) } /* binsrch sets slot as a side effect */ #ifdef DEBUG -printf("binsrch(%s) -> %d\n", mac, slot); + printf("binsrch(%s) -> %d\n", mac, slot); #endif loc = &knowncmds[slot]; src = &knowncmds[ncmds-1]; dest = src+1; while (dest > loc) *dest-- = *src--; - *loc = strcpy(malloc(3), mac); + if ((*loc = strdup(mac)) == NULL) + err(1, "strdup"); ncmds++; #ifdef DEBUG -printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds); + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); #endif } @@ -592,12 +636,12 @@ binsrch(const char *mac) if (d == 0) d = p[1] - mac[1]; if (d == 0) - return mid; + return (mid); if (d < 0) bot = mid + 1; else top = mid - 1; } slot = bot; /* place it would have gone */ - return -1; + return (-1); } diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 3b5a8474eaf84..a46fe65421b50 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -352,8 +352,6 @@ main(int argc, char *argv[]) limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); TAILQ_INIT(&trace_procs); drop_logged = 0; diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index f04c5310dd869..109ef2dabbe35 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -315,7 +315,7 @@ intpr(int interval, void (*pfunc)(char *), int af) for (ifa = ifap; ifa; ifa = ifa->ifa_next) { bool network = false, link = false; - char *name; + char *name, *xname, buf[IFNAMSIZ+1]; if (interface != NULL && strcmp(ifa->ifa_name, interface) != 0) continue; @@ -341,10 +341,20 @@ intpr(int interval, void (*pfunc)(char *), int af) xo_open_instance("interface"); + if ((ifa->ifa_flags & IFF_UP) == 0) { + xname = stpcpy(buf, name); + *xname++ = '*'; + *xname = '\0'; + xname = buf; + } else + xname = name; + if (Wflag) - xo_emit("{tk:name/%-7.7s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%7.7s}", + name, ifa->ifa_flags, xname); else - xo_emit("{tk:name/%-5.5s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%5.5s}", + name, ifa->ifa_flags, xname); #define IFA_MTU(ifa) (((struct if_data *)(ifa)->ifa_data)->ifi_mtu) show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa)); diff --git a/usr.bin/soelim/soelim.c b/usr.bin/soelim/soelim.c index 700ae576e2277..de6911f3c83c8 100644 --- a/usr.bin/soelim/soelim.c +++ b/usr.bin/soelim/soelim.c @@ -108,11 +108,12 @@ soelim_file(FILE *f, int flag) while (isspace(*walk)) walk++; - cp = walk + strlen(walk) - 1; - while (cp > walk && isspace(*cp)) { - *cp = 0; - cp--; - } + cp = walk; + while (*cp != '\0' && !isspace(*cp)) + cp++; + *cp = 0; + if (cp < line + linelen) + cp++; if (*walk == '\0') { printf("%s", line); @@ -122,6 +123,8 @@ soelim_file(FILE *f, int flag) free(line); return (1); } + if (*cp != '\0') + printf("%s", cp); } free(line); diff --git a/usr.bin/soelim/tests/Makefile b/usr.bin/soelim/tests/Makefile index 604e2f46c9f42..4d787cfadc35d 100644 --- a/usr.bin/soelim/tests/Makefile +++ b/usr.bin/soelim/tests/Makefile @@ -7,7 +7,9 @@ ATF_TESTS_SH= soelim FILES= nonexisting.in \ basic.in \ basic \ - basic.out + basic.out \ + basic-with-space.in \ + basic-with-space.out FILESDIR= ${TESTSDIR} .include <bsd.test.mk> diff --git a/usr.bin/soelim/tests/basic-with-space.in b/usr.bin/soelim/tests/basic-with-space.in new file mode 100644 index 0000000000000..971d681f6fa23 --- /dev/null +++ b/usr.bin/soelim/tests/basic-with-space.in @@ -0,0 +1,3 @@ +This is a test +.so basic something +end diff --git a/usr.bin/soelim/tests/basic-with-space.out b/usr.bin/soelim/tests/basic-with-space.out new file mode 100644 index 0000000000000..290b2c6e0543c --- /dev/null +++ b/usr.bin/soelim/tests/basic-with-space.out @@ -0,0 +1,4 @@ +This is a test +basic has been included +something +end diff --git a/usr.bin/soelim/tests/soelim.sh b/usr.bin/soelim/tests/soelim.sh index ea46618b5578e..69c92e4bab38b 100755 --- a/usr.bin/soelim/tests/soelim.sh +++ b/usr.bin/soelim/tests/soelim.sh @@ -87,6 +87,13 @@ files_body() -e empty \ -s exit:0 \ soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in + + atf_check \ + -o file:$(atf_get_srcdir)/basic-with-space.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in + } atf_init_test_cases() diff --git a/usr.bin/vgrind/Makefile b/usr.bin/vgrind/Makefile index 612e504ecb2bd..06d905239cb6e 100644 --- a/usr.bin/vgrind/Makefile +++ b/usr.bin/vgrind/Makefile @@ -11,7 +11,7 @@ FILESDIR= ${SHAREDIR}/misc FILESDIR_tmac.vgrind= ${SHAREDIR}/tmac MAN= vgrind.1 vgrindefs.5 -WARNS?= 2 +WARNS?= 3 BINDIR= /usr/libexec SCRIPTSDIR=/usr/bin diff --git a/usr.bin/vgrind/extern.h b/usr.bin/vgrind/extern.h index 6616ca94ef72c..812592f433597 100644 --- a/usr.bin/vgrind/extern.h +++ b/usr.bin/vgrind/extern.h @@ -31,9 +31,7 @@ * $FreeBSD$ */ -typedef int boolean; - -extern boolean _escaped; /* if last character was an escape */ +extern bool _escaped; /* if last character was an escape */ extern char *s_start; /* start of the current string */ extern char *l_acmbeg; /* string introducing a comment */ extern char *l_acmend; /* string ending a comment */ @@ -45,11 +43,11 @@ extern char *l_combeg; /* string introducing a comment */ extern char *l_comend; /* string ending a comment */ extern char l_escape; /* character used to escape characters */ extern char *l_keywds[]; /* keyword table address */ -extern boolean l_onecase; /* upper and lower case are equivalent */ +extern bool l_onecase; /* upper and lower case are equivalent */ extern char *l_prcbeg; /* regular expr for procedure begin */ extern char *l_strbeg; /* delimiter for string constant */ extern char *l_strend; /* delimiter for string constant */ -extern boolean l_toplex; /* procedures only defined at top lex level */ +extern bool l_toplex; /* procedures only defined at top lex level */ extern const char *language; /* the language indicator */ #include <sys/cdefs.h> diff --git a/usr.bin/vgrind/regexp.c b/usr.bin/vgrind/regexp.c index 2da447d9e374b..cd57835e54640 100644 --- a/usr.bin/vgrind/regexp.c +++ b/usr.bin/vgrind/regexp.c @@ -44,19 +44,16 @@ static const char sccsid[] = "@(#)regexp.c 8.1 (Berkeley) 6/6/93"; #include <ctype.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) -#define NIL 0 - static void expconv(void); -boolean _escaped; /* true if we are currently _escaped */ +bool _escaped; /* true if we are currently x_escaped */ char *s_start; /* start of string */ -boolean l_onecase; /* true if upper and lower equivalent */ +bool l_onecase; /* true if upper and lower equivalent */ #define makelower(c) (isupper((c)) ? tolower((c)) : (c)) @@ -66,9 +63,7 @@ boolean l_onecase; /* true if upper and lower equivalent */ */ int -STRNCMP(s1, s2, len) - register char *s1,*s2; - register int len; +STRNCMP(register char *s1, register char *s2, register int len) { if (l_onecase) { do @@ -147,18 +142,18 @@ STRNCMP(s1, s2, len) static char *ccre; /* pointer to current position in converted exp*/ static char *ure; /* pointer current position in unconverted exp */ +/* re: unconverted irregular expression */ char * -convexp(re) - char *re; /* unconverted irregular expression */ +convexp(char *re) { register char *cre; /* pointer to converted regular expression */ /* allocate room for the converted expression */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); if (*re == '\0') - return (NIL); - cre = malloc (4 * strlen(re) + 3); + return (NULL); + cre = malloc(4 * strlen(re) + 3); ccre = cre; ure = re; @@ -182,9 +177,9 @@ expconv() register int temp; /* let the conversion begin */ - acs = NIL; - cs = NIL; - while (*ure != NIL) { + acs = NULL; + cs = NULL; + while (*ure) { switch (c = *ure++) { case '\\': @@ -192,7 +187,7 @@ expconv() /* escaped characters are just characters */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -207,13 +202,13 @@ expconv() case 'd': case 'e': case 'p': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -226,13 +221,13 @@ expconv() /* just put the symbol in */ case '^': case '$': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -248,31 +243,31 @@ expconv() /* recurse and define a subexpression */ case '(': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = OPER; OSYM(cs) = '('; ccre = ONEXT(cs); - expconv (); + expconv(); OCNT(cs) = ccre - cs; /* offset to next symbol */ break; /* return from a recursion */ case ')': - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -284,7 +279,7 @@ expconv() /* the third byte will contain an offset to jump over the */ /* alternate match in case the first did not fail */ case '|': - if (acs != NIL && acs != cs) + if (acs != NULL && acs != cs) OCNT(ccre) = ccre - acs; /* make a back pointer */ else OCNT(ccre) = 0; @@ -298,7 +293,7 @@ expconv() /* if its not a metasymbol just build a scharacter string */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -309,13 +304,13 @@ expconv() break; } } - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } return; } @@ -344,21 +339,23 @@ expconv() * character matched. */ +/* + * s: string to check for a match in + * re: a converted irregular expression + * mstring: where to put whatever matches a \p + */ char * -expmatch (s, re, mstring) - register char *s; /* string to check for a match in */ - register char *re; /* a converted irregular expression */ - register char *mstring; /* where to put whatever matches a \p */ +expmatch (register char *s, register char *re, register char *mstring) { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ - boolean matched; /* a temporary boolean */ + bool matched; /* a temporary bool */ /* initial conditions */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); cs = re; - matched = FALSE; + matched = false; /* loop till expression string is exhausted (or at least pretty tired) */ while (*cs) { @@ -384,7 +381,7 @@ expmatch (s, re, mstring) } else { /* no match, error return */ - return (NIL); + return (NULL); } break; @@ -406,8 +403,8 @@ expmatch (s, re, mstring) /* this is a grouping, recurse */ case '(': - ptr = expmatch (s, ONEXT(cs), mstring); - if (ptr != NIL) { + ptr = expmatch(s, ONEXT(cs), mstring); + if (ptr != NULL) { /* the subexpression matched */ matched = 1; @@ -423,7 +420,7 @@ expmatch (s, re, mstring) } else { /* no match, error return */ - return (NIL); + return (NULL); } cs = OPTR(cs); break; @@ -443,35 +440,35 @@ expmatch (s, re, mstring) */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + ptr = expmatch(s1, MNEXT(cs), mstring); + if (ptr != NULL && s1 != s) { /* we have a match, remember the match */ strncpy (mstring, s, s1 - s); mstring[s1 - s] = '\0'; return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (!(isalnum(*s1) || *s1 == '_' || /* C++ destructor */ *s1 == '~' || /* C++ scope operator */ (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && - (s1++, TRUE)))) - return (NIL); + (s1++, true)))) + return (NULL); if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* try to match anything */ case 'a': @@ -482,31 +479,31 @@ expmatch (s, re, mstring) */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + ptr = expmatch(s1, MNEXT(cs), mstring); + if (ptr != NULL && s1 != s) { /* we have a match */ return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* fail if we are currently _escaped */ case 'e': if (_escaped) - return(NIL); + return(NULL); cs = MNEXT(cs); break; @@ -538,7 +535,7 @@ expmatch (s, re, mstring) } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for end of line */ @@ -562,7 +559,7 @@ expmatch (s, re, mstring) } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for start of line */ @@ -585,7 +582,7 @@ expmatch (s, re, mstring) } else /* no match, error return */ - return (NIL); + return (NULL); break; /* end of a subexpression, return success */ diff --git a/usr.bin/vgrind/vfontedpr.c b/usr.bin/vgrind/vfontedpr.c index 5baaec0b5f103..ec0b4e042eb41 100644 --- a/usr.bin/vgrind/vfontedpr.c +++ b/usr.bin/vgrind/vfontedpr.c @@ -47,14 +47,12 @@ static const char sccsid[] = "@(#)vfontedpr.c 8.1 (Berkeley) 6/6/93"; #include <err.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <time.h> #include "pathnames.h" #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) -#define NIL 0 #define STANDARD 0 #define ALTERNATE 1 @@ -70,8 +68,8 @@ static const char sccsid[] = "@(#)vfontedpr.c 8.1 (Berkeley) 6/6/93"; #define PSMAX 20 /* size of procedure name stacking */ static int iskw(char *); -static boolean isproc(char *); -static void putKcp(char *, char *, boolean); +static bool isproc(char *); +static void putKcp(char *, char *, bool); static void putScp(char *); static void putcp(int); static int tabs(char *, char *); @@ -81,13 +79,13 @@ static int width(char *, char *); * The state variables */ -static boolean filter = FALSE; /* act as a filter (like eqn) */ -static boolean inchr; /* in a string constant */ -static boolean incomm; /* in a comment of the primary type */ -static boolean idx = FALSE; /* form an index */ -static boolean instr; /* in a string constant */ -static boolean nokeyw = FALSE; /* no keywords being flagged */ -static boolean pass = FALSE; /* +static bool filter = false; /* act as a filter (like eqn) */ +static bool inchr; /* in a string constant */ +static bool incomm; /* in a comment of the primary type */ +static bool idx = false; /* form an index */ +static bool instr; /* in a string constant */ +static bool nokeyw = false; /* no keywords being flagged */ +static bool pass = false; /* * when acting as a filter, pass indicates * whether we are currently processing * input. @@ -100,7 +98,7 @@ static char * defsfile[2] = { _PATH_VGRINDEFS, 0 }; static int margin; static int plstack[PSMAX]; /* the procedure nesting level stack */ static char pname[BUFSIZ+1]; -static boolean prccont; /* continue last procedure */ +static bool prccont; /* continue last procedure */ static int psptr; /* the stack index of the current procedure */ static char pstack[PSMAX][PNAMELEN+1]; /* the procedure name stack */ @@ -122,15 +120,15 @@ char *l_nocom; /* regexp for non-comments */ char *l_prcbeg; /* regular expr for procedure begin */ char *l_strbeg; /* delimiter for string constant */ char *l_strend; /* delimiter for string constant */ -boolean l_toplex; /* procedures only defined at top lex level */ +bool l_toplex; /* procedures only defined at top lex level */ const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) +static char minus[] = "-"; +static char minusn[] = "-n"; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { const char *fname = ""; struct stat stbuf; @@ -160,9 +158,9 @@ main(argc, argv) /* act as a filter like eqn */ if (!strcmp(argv[0], "-f")) { - filter++; + filter = true; argv[0] = argv[argc-1]; - argv[argc-1] = strdup("-"); + argv[argc-1] = minus; continue; } @@ -174,13 +172,13 @@ main(argc, argv) /* build an index */ if (!strcmp(argv[0], "-x")) { - idx++; - argv[0] = strdup("-n"); + idx = true; + argv[0] = minusn; } /* indicate no keywords */ if (!strcmp(argv[0], "-n")) { - nokeyw++; + nokeyw = true; argc--, argv++; continue; } @@ -227,17 +225,17 @@ main(argc, argv) i = cgetent(&defs, defsfile, language); if (i == -1) { fprintf (stderr, "no entry for language %s\n", language); - exit (0); + exit(0); } else if (i == -2) { fprintf(stderr, "cannot find vgrindefs file %s\n", defsfile[0]); - exit (0); + exit(0); } else if (i == -3) { fprintf(stderr, "potential reference loop detected in vgrindefs file %s\n", defsfile[0]); exit(0); } if (cgetustr(defs, "kw", &cp) == -1) - nokeyw = TRUE; + nokeyw = true; else { char **cpp; @@ -250,7 +248,7 @@ main(argc, argv) while (*cp != ' ' && *cp != '\t' && *cp) cp++; } - *cpp = NIL; + *cpp = NULL; } cgetustr(defs, "pb", &cp); l_prcbeg = convexp(cp); @@ -282,10 +280,10 @@ main(argc, argv) /* initialize the program */ - incomm = FALSE; - instr = FALSE; - inchr = FALSE; - _escaped = FALSE; + incomm = false; + instr = false; + inchr = false; + _escaped = false; blklevel = 0; for (psptr=0; psptr<PSMAX; psptr++) { pstack[psptr][0] = '\0'; @@ -321,12 +319,12 @@ main(argc, argv) if (buf[0] == '.') { printf("%s", buf); if (!strncmp (buf+1, "vS", 2)) - pass = TRUE; + pass = true; if (!strncmp (buf+1, "vE", 2)) - pass = FALSE; + pass = false; continue; } - prccont = FALSE; + prccont = false; if (!filter || pass) putScp(buf); else @@ -349,8 +347,7 @@ main(argc, argv) #define isidchr(c) (isalnum(c) || (c) == '_') static void -putScp(os) - char *os; +putScp(char *os) { register char *s = os; /* pointer to unmatched string */ char dummy[BUFSIZ]; /* dummy to be used by expmatch */ @@ -363,7 +360,7 @@ putScp(os) char *nocomptr; /* end of a non-comment delimiter */ s_start = os; /* remember the start for expmatch */ - _escaped = FALSE; + _escaped = false; if (nokeyw || incomm || instr) goto skip; if (isproc(s)) { @@ -382,82 +379,82 @@ skip: /* check for string, comment, blockstart, etc */ if (!incomm && !instr && !inchr) { - blkeptr = expmatch (s, l_blkend, dummy); - blksptr = expmatch (s, l_blkbeg, dummy); - comptr = expmatch (s, l_combeg, dummy); - acmptr = expmatch (s, l_acmbeg, dummy); - strptr = expmatch (s, l_strbeg, dummy); - chrptr = expmatch (s, l_chrbeg, dummy); + blkeptr = expmatch(s, l_blkend, dummy); + blksptr = expmatch(s, l_blkbeg, dummy); + comptr = expmatch(s, l_combeg, dummy); + acmptr = expmatch(s, l_acmbeg, dummy); + strptr = expmatch(s, l_strbeg, dummy); + chrptr = expmatch(s, l_chrbeg, dummy); nocomptr = expmatch (s, l_nocom, dummy); /* start of non-comment? */ - if (nocomptr != NIL) - if ((nocomptr <= comptr || comptr == NIL) - && (nocomptr <= acmptr || acmptr == NIL)) { + if (nocomptr != NULL) + if ((nocomptr <= comptr || comptr == NULL) + && (nocomptr <= acmptr || acmptr == NULL)) { /* continue after non-comment */ - putKcp (s, nocomptr-1, FALSE); + putKcp (s, nocomptr-1, false); s = nocomptr; continue; } /* start of a comment? */ - if (comptr != NIL) - if ((comptr < strptr || strptr == NIL) - && (comptr < acmptr || acmptr == NIL) - && (comptr < chrptr || chrptr == NIL) - && (comptr < blksptr || blksptr == NIL) - && (comptr < blkeptr || blkeptr == NIL)) { - putKcp (s, comptr-1, FALSE); + if (comptr != NULL) + if ((comptr < strptr || strptr == NULL) + && (comptr < acmptr || acmptr == NULL) + && (comptr < chrptr || chrptr == NULL) + && (comptr < blksptr || blksptr == NULL) + && (comptr < blkeptr || blkeptr == NULL)) { + putKcp(s, comptr-1, false); s = comptr; - incomm = TRUE; + incomm = true; comtype = STANDARD; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } /* start of a comment? */ - if (acmptr != NIL) - if ((acmptr < strptr || strptr == NIL) - && (acmptr < chrptr || chrptr == NIL) - && (acmptr < blksptr || blksptr == NIL) - && (acmptr < blkeptr || blkeptr == NIL)) { - putKcp (s, acmptr-1, FALSE); + if (acmptr != NULL) + if ((acmptr < strptr || strptr == NULL) + && (acmptr < chrptr || chrptr == NULL) + && (acmptr < blksptr || blksptr == NULL) + && (acmptr < blkeptr || blkeptr == NULL)) { + putKcp(s, acmptr-1, false); s = acmptr; - incomm = TRUE; + incomm = true; comtype = ALTERNATE; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } /* start of a string? */ - if (strptr != NIL) - if ((strptr < chrptr || chrptr == NIL) - && (strptr < blksptr || blksptr == NIL) - && (strptr < blkeptr || blkeptr == NIL)) { - putKcp (s, strptr-1, FALSE); + if (strptr != NULL) + if ((strptr < chrptr || chrptr == NULL) + && (strptr < blksptr || blksptr == NULL) + && (strptr < blkeptr || blkeptr == NULL)) { + putKcp(s, strptr-1, false); s = strptr; - instr = TRUE; + instr = true; continue; } /* start of a character string? */ - if (chrptr != NIL) - if ((chrptr < blksptr || blksptr == NIL) - && (chrptr < blkeptr || blkeptr == NIL)) { - putKcp (s, chrptr-1, FALSE); + if (chrptr != NULL) + if ((chrptr < blksptr || blksptr == NULL) + && (chrptr < blkeptr || blkeptr == NULL)) { + putKcp(s, chrptr-1, false); s = chrptr; - inchr = TRUE; + inchr = true; continue; } /* end of a lexical block */ - if (blkeptr != NIL) { - if (blkeptr < blksptr || blksptr == NIL) { - putKcp (s, blkeptr - 1, FALSE); + if (blkeptr != NULL) { + if (blkeptr < blksptr || blksptr == NULL) { + putKcp(s, blkeptr - 1, false); s = blkeptr; if (blklevel > 0 /* sanity */) blklevel--; @@ -465,13 +462,13 @@ skip: /* end of current procedure */ if (s != os) - ps ("\\c"); - ps ("\\c\n'-F\n"); + ps("\\c"); + ps("\\c\n'-F\n"); blklevel = plstack[psptr]; /* see if we should print the last proc name */ if (--psptr >= 0) - prccont = TRUE; + prccont = true; else psptr = -1; } @@ -480,8 +477,8 @@ skip: } /* start of a lexical block */ - if (blksptr != NIL) { - putKcp (s, blksptr - 1, FALSE); + if (blksptr != NULL) { + putKcp(s, blksptr - 1, false); s = blksptr; blklevel++; continue; @@ -489,64 +486,66 @@ skip: /* check for end of comment */ } else if (incomm) { - comptr = expmatch (s, l_comend, dummy); - acmptr = expmatch (s, l_acmend, dummy); - if (((comtype == STANDARD) && (comptr != NIL)) || - ((comtype == ALTERNATE) && (acmptr != NIL))) { + comptr = expmatch(s, l_comend, dummy); + acmptr = expmatch(s, l_acmend, dummy); + if (((comtype == STANDARD) && (comptr != NULL)) || + ((comtype == ALTERNATE) && (acmptr != NULL))) { if (comtype == STANDARD) { - putKcp (s, comptr-1, TRUE); + putKcp(s, comptr-1, true); s = comptr; } else { - putKcp (s, acmptr-1, TRUE); + putKcp(s, acmptr-1, true); s = acmptr; } - incomm = FALSE; + incomm = false; ps("\\c\n'-C\n"); continue; } else { - putKcp (s, s + strlen(s) -1, TRUE); + putKcp(s, s + strlen(s) -1, true); s = s + strlen(s); continue; } /* check for end of string */ } else if (instr) { - if ((strptr = expmatch (s, l_strend, dummy)) != NIL) { - putKcp (s, strptr-1, TRUE); + if ((strptr = expmatch(s, l_strend, dummy)) != NULL) { + putKcp(s, strptr-1, true); s = strptr; - instr = FALSE; + instr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } /* check for end of character string */ } else if (inchr) { - if ((chrptr = expmatch (s, l_chrend, dummy)) != NIL) { - putKcp (s, chrptr-1, TRUE); + if ((chrptr = expmatch(s, l_chrend, dummy)) != NULL) { + putKcp(s, chrptr-1, true); s = chrptr; - inchr = FALSE; + inchr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } } /* print out the line */ - putKcp (s, s + strlen(s) -1, FALSE); + putKcp(s, s + strlen(s) -1, false); s = s + strlen(s); } while (*s); } +/* + * start: start of string to write + * end: end of string to write + * force: true if we should force nokeyw + */ static void -putKcp (start, end, force) - char *start; /* start of string to write */ - char *end; /* end of string to write */ - boolean force; /* true if we should force nokeyw */ +putKcp(char *start, char *end, bool force) { int i; int xfld = 0; @@ -587,22 +586,20 @@ putKcp (start, end, force) } } - putcp ((unsigned char)*start++); + putcp((unsigned char)*start++); } } static int -tabs(s, os) - char *s, *os; +tabs(char *s, char *os) { return (width(s, os) / 8); } static int -width(s, os) - register char *s, *os; +width(register char *s, register char *os) { register int i = 0; @@ -622,8 +619,7 @@ width(s, os) } static void -putcp(c) - register int c; +putcp(register int c) { switch(c) { @@ -689,16 +685,15 @@ putcp(c) /* * look for a process beginning on this line */ -static boolean -isproc(s) - char *s; +static bool +isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) - if (expmatch (s, l_prcbeg, pname) != NIL) { - return (TRUE); + if (expmatch(s, l_prcbeg, pname) != NULL) { + return (true); } - return (FALSE); + return (false); } @@ -706,8 +701,7 @@ isproc(s) */ static int -iskw(s) - register char *s; +iskw(register char *s) { register char **ss = l_keywds; register int i = 1; @@ -720,4 +714,3 @@ iskw(s) return (i); return (0); } - diff --git a/usr.bin/vgrind/vgrindefs.c b/usr.bin/vgrind/vgrindefs.c index b811c2c21d90e..c48a0483b0ca9 100644 --- a/usr.bin/vgrind/vgrindefs.c +++ b/usr.bin/vgrind/vgrindefs.c @@ -55,30 +55,30 @@ __FBSDID("$FreeBSD$"); static char *tbuf; static char *filename; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); -char *tgetstr(); -char *tdecode(); -char *getenv(); + +static int tnchktc(void); +static int tnamatch(char *); +static char *tskip(register char *); +static char *tdecode(register char *, char **); /* * Get an entry for terminal name in buffer bp, * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -tgetent(bp, name, file) - char *bp, *name, *file; +int +tgetent(char *bp, char *name, char *file) { register char *cp; register int c; register int i = 0, cnt = 0; char ibuf[BUFSIZ]; - char *cp2; int tf; tbuf = bp; tf = 0; filename = file; - tf = open(filename, 0); + tf = open(filename, O_RDONLY); if (tf < 0) return (-1); for (;;) { @@ -125,7 +125,8 @@ tgetent(bp, name, file) * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ -tnchktc() +static int +tnchktc(void) { register char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -143,7 +144,7 @@ tnchktc() /* p now points to beginning of last field */ if (p[0] != 't' || p[1] != 'c') return(1); - strcpy(tcname,p+3); + strlcpy(tcname, p+3, 16); q = tcname; while (q && *q != ':') q++; @@ -161,7 +162,7 @@ tnchktc() write(STDERR_FILENO, "Vgrind entry too long\n", 23); q[BUFSIZ - (p-tbuf)] = 0; } - strcpy(p, q+1); + strlcpy(p, q+1, BUFSIZ - (p - holdtbuf)); tbuf = holdtbuf; return(1); } @@ -172,8 +173,8 @@ tnchktc() * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -tnamatch(np) - char *np; +static int +tnamatch(char *np) { register char *Np, *Bp; @@ -199,8 +200,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - register char *bp; +tskip(register char *bp) { while (*bp && *bp != ':') @@ -218,8 +218,8 @@ tskip(bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -tgetnum(id) - char *id; +int +tgetnum(char *id) { register int i, base; register char *bp = tbuf; @@ -251,8 +251,8 @@ tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -tgetflag(id) - char *id; +int +tgetflag(char *id) { register char *bp = tbuf; @@ -278,8 +278,7 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { register char *bp = tbuf; @@ -303,13 +302,10 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(register char *str, char **area) { register char *cp; register int c; - int i; cp = *area; while (c = *str++) { diff --git a/usr.sbin/bhyve/inout.c b/usr.sbin/bhyve/inout.c index 402b953be8825..929bb3c5b839c 100644 --- a/usr.sbin/bhyve/inout.c +++ b/usr.sbin/bhyve/inout.c @@ -107,7 +107,7 @@ emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) uint32_t eax, val; inout_func_t handler; void *arg; - int error, retval; + int error, fault, retval; enum vm_reg_name idxreg; uint64_t gla, index, iterations, count; struct vm_inout_str *vis; @@ -163,11 +163,11 @@ emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) } error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, - bytes, prot, iov, nitems(iov)); - if (error == -1) { + bytes, prot, iov, nitems(iov), &fault); + if (error) { retval = -1; /* Unrecoverable error */ break; - } else if (error == 1) { + } else if (fault) { retval = 0; /* Resume guest to handle fault */ break; } diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 2d057894bc28e..35a085930acf9 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -135,11 +135,13 @@ struct ahci_port { char ident[20 + 1]; int atapi; int reset; + int waitforclear; int mult_sectors; uint8_t xfermode; uint8_t err_cfis[20]; uint8_t sense_key; uint8_t asc; + u_int ccs; uint32_t pending; uint32_t clb; @@ -204,6 +206,8 @@ struct pci_ahci_softc { }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) +static void ahci_handle_port(struct ahci_port *p); + static inline void lba_to_msf(uint8_t *buf, int lba) { lba += 150; @@ -285,8 +289,10 @@ ahci_write_fis(struct ahci_port *p, enum sata_fis_type ft, uint8_t *fis) WPRINTF("unsupported fis type %d\n", ft); return; } - if (fis[2] & ATA_S_ERROR) + if (fis[2] & ATA_S_ERROR) { + p->waitforclear = 1; irq |= AHCI_P_IX_TFE; + } memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; @@ -406,9 +412,11 @@ ahci_check_stopped(struct ahci_port *p) */ if (!(p->cmd & AHCI_P_CMD_ST)) { if (p->pending == 0) { + p->ccs = 0; p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); p->ci = 0; p->sact = 0; + p->waitforclear = 0; } } } @@ -783,6 +791,8 @@ next: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); p->pending &= ~(1 << slot); ahci_check_stopped(p); + if (!first) + ahci_handle_port(p); return; } goto next; @@ -1754,20 +1764,23 @@ ahci_handle_slot(struct ahci_port *p, int slot) static void ahci_handle_port(struct ahci_port *p) { - int i; if (!(p->cmd & AHCI_P_CMD_ST)) return; /* * Search for any new commands to issue ignoring those that - * are already in-flight. + * are already in-flight. Stop if device is busy or in error. */ - for (i = 0; (i < 32) && p->ci; i++) { - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ)) != 0) + break; + if (p->waitforclear) + break; + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { p->cmd &= ~AHCI_P_CMD_CCS_MASK; - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; - ahci_handle_slot(p, i); + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; + ahci_handle_slot(p, p->ccs); } } } @@ -1844,6 +1857,7 @@ ata_ioreq_cb(struct blockif_req *br, int err) p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); @@ -1905,6 +1919,7 @@ atapi_ioreq_cb(struct blockif_req *br, int err) p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); @@ -2001,7 +2016,7 @@ pci_ahci_port_write(struct pci_ahci_softc *sc, uint64_t offset, uint64_t value) } if (value & AHCI_P_CMD_CLO) { - p->tfd = 0; + p->tfd &= ~(ATA_S_BUSY | ATA_S_DRQ); p->cmd &= ~AHCI_P_CMD_CLO; } @@ -2078,7 +2093,7 @@ pci_ahci_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, struct pci_ahci_softc *sc = pi->pi_arg; assert(baridx == 5); - assert(size == 4); + assert((offset % 4) == 0 && size == 4); pthread_mutex_lock(&sc->mtx); @@ -2167,24 +2182,29 @@ pci_ahci_port_read(struct pci_ahci_softc *sc, uint64_t offset) static uint64_t pci_ahci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, - uint64_t offset, int size) + uint64_t regoff, int size) { struct pci_ahci_softc *sc = pi->pi_arg; + uint64_t offset; uint32_t value; assert(baridx == 5); - assert(size == 4); + assert(size == 1 || size == 2 || size == 4); + assert((regoff & (size - 1)) == 0); pthread_mutex_lock(&sc->mtx); + offset = regoff & ~0x3; /* round down to a multiple of 4 bytes */ if (offset < AHCI_OFFSET) value = pci_ahci_host_read(sc, offset); else if (offset < AHCI_OFFSET + sc->ports * AHCI_STEP) value = pci_ahci_port_read(sc, offset); else { value = 0; - WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"\n", offset); + WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"\n", + regoff); } + value >>= 8 * (regoff & 0x3); pthread_mutex_unlock(&sc->mtx); diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c index 7227488000516..1a029d5631e74 100644 --- a/usr.sbin/bhyve/pci_virtio_net.c +++ b/usr.sbin/bhyve/pci_virtio_net.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include <sys/select.h> #include <sys/uio.h> #include <sys/ioctl.h> +#include <machine/atomic.h> #include <net/ethernet.h> #include <errno.h> @@ -453,7 +454,7 @@ pci_vtnet_tx_thread(void *param) { struct pci_vtnet_softc *sc = param; struct vqueue_info *vq; - int have_work, error; + int error; vq = &sc->vsc_queues[VTNET_TXQ]; @@ -467,20 +468,16 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ - do { + while (sc->resetting || !vq_has_descs(vq)) { vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; - if (sc->resetting) - have_work = 0; - else - have_work = vq_has_descs(vq); + mb(); + if (!sc->resetting && vq_has_descs(vq)) + break; - if (!have_work) { - sc->tx_in_progress = 0; - error = pthread_cond_wait(&sc->tx_cond, - &sc->tx_mtx); - assert(error == 0); - } - } while (!have_work); + sc->tx_in_progress = 0; + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + } vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); diff --git a/usr.sbin/bhyve/task_switch.c b/usr.sbin/bhyve/task_switch.c index ba6a9d26b0dfc..69dfaae268013 100644 --- a/usr.sbin/bhyve/task_switch.c +++ b/usr.sbin/bhyve/task_switch.c @@ -202,7 +202,8 @@ desc_table_limit_check(struct vmctx *ctx, int vcpu, uint16_t sel) */ static int desc_table_rw(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc, bool doread) + uint16_t sel, struct user_segment_descriptor *desc, bool doread, + int *faultptr) { struct iovec iov[2]; uint64_t base; @@ -215,28 +216,30 @@ desc_table_rw(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, assert(limit >= SEL_LIMIT(sel)); error = vm_copy_setup(ctx, vcpu, paging, base + SEL_START(sel), - sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov)); - if (error == 0) { - if (doread) - vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); - else - vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); - } - return (error); + sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov), + faultptr); + if (error || *faultptr) + return (error); + + if (doread) + vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); + else + vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); + return (0); } static int desc_table_read(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, true)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, true, faultptr)); } static int desc_table_write(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, false)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, false, faultptr)); } /* @@ -248,7 +251,7 @@ desc_table_write(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, */ static int read_tss_descriptor(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { struct vm_guest_paging sup_paging; int error; @@ -267,7 +270,7 @@ read_tss_descriptor(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc); + error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc, faultptr); return (error); } @@ -301,14 +304,10 @@ ldt_desc(int sd_type) /* * Validate the descriptor 'seg_desc' associated with 'segment'. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int validate_seg_desc(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - int segment, struct seg_desc *seg_desc) + int segment, struct seg_desc *seg_desc, int *faultptr) { struct vm_guest_paging sup_paging; struct user_segment_descriptor usd; @@ -369,8 +368,8 @@ validate_seg_desc(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, /* Read the descriptor from the GDT/LDT */ sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd); - if (error) + error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd, faultptr); + if (error || *faultptr) return (error); /* Verify that the descriptor type is compatible with the segment */ @@ -476,14 +475,10 @@ update_seg_desc(struct vmctx *ctx, int vcpu, int reg, struct seg_desc *sd) /* * Update the vcpu registers to reflect the state of the new task. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t ot_sel, struct tss32 *tss, struct iovec *iov) + uint16_t ot_sel, struct tss32 *tss, struct iovec *iov, int *faultptr) { struct seg_desc seg_desc, seg_desc2; uint64_t *pdpte, maxphyaddr, reserved; @@ -565,8 +560,9 @@ tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, vm_copyout(ctx, vcpu, tss, iov, sizeof(*tss)); /* Validate segment descriptors */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_LDTR, &seg_desc); @@ -579,33 +575,40 @@ tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, * VM-entry checks so the guest can handle any exception injected * during task switch emulation. */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2); - if (error) + + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_CS, &seg_desc); update_seg_desc(ctx, vcpu, VM_REG_GUEST_SS, &seg_desc2); ts->paging.cpl = tss->tss_cs & SEL_RPL_MASK; - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_DS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_ES, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_FS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_GS, &seg_desc); @@ -616,14 +619,10 @@ tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, * Push an error code on the stack of the new task. This is needed if the * task switch was triggered by a hardware exception that causes an error * code to be saved (e.g. #PF). - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - int task_type, uint32_t errcode) + int task_type, uint32_t errcode, int *faultptr) { struct iovec iov[2]; struct seg_desc seg_desc; @@ -632,6 +631,8 @@ push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, uint32_t esp; uint16_t stacksel; + *faultptr = 0; + cr0 = GETREG(ctx, vcpu, VM_REG_GUEST_CR0); rflags = GETREG(ctx, vcpu, VM_REG_GUEST_RFLAGS); stacksel = GETREG(ctx, vcpu, VM_REG_GUEST_SS); @@ -666,17 +667,19 @@ push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, if (vie_calculate_gla(paging->cpu_mode, VM_REG_GUEST_SS, &seg_desc, esp, bytes, stacksize, PROT_WRITE, &gla)) { sel_exception(ctx, vcpu, IDT_SS, stacksel, 1); - return (1); + *faultptr = 1; + return (0); } if (vie_alignment_check(paging->cpl, bytes, cr0, rflags, gla)) { vm_inject_ac(ctx, vcpu, 1); - return (1); + *faultptr = 1; + return (0); } error = vm_copy_setup(ctx, vcpu, paging, gla, bytes, PROT_WRITE, - iov, nitems(iov)); - if (error) + iov, nitems(iov), faultptr); + if (error || *faultptr) return (error); vm_copyout(ctx, vcpu, &errcode, iov, bytes); @@ -687,16 +690,13 @@ push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, /* * Evaluate return value from helper functions and potentially return to * the VM run loop. - * 0: success - * +1: an exception was injected into the guest vcpu - * -1: unrecoverable/programming error */ -#define CHKERR(x) \ +#define CHKERR(error,fault) \ do { \ - assert(((x) == 0) || ((x) == 1) || ((x) == -1)); \ - if ((x) == -1) \ + assert((error == 0) || (error == EFAULT)); \ + if (error) \ return (VMEXIT_ABORT); \ - else if ((x) == 1) \ + else if (fault) \ return (VMEXIT_CONTINUE); \ } while (0) @@ -711,7 +711,7 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) struct iovec nt_iov[2], ot_iov[2]; uint64_t cr0, ot_base; uint32_t eip, ot_lim, access; - int error, ext, minlimit, nt_type, ot_type, vcpu; + int error, ext, fault, minlimit, nt_type, ot_type, vcpu; enum task_switch_reason reason; uint16_t nt_sel, ot_sel; @@ -739,8 +739,9 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) sup_paging.cpl = 0; /* implicit supervisor mode */ /* Fetch the new TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc, + &fault); + CHKERR(error, fault); nt = usd_to_seg_desc(&nt_desc); @@ -792,8 +793,8 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) /* Fetch the new TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, - PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, nt_iov, &newtss, minlimit + 1); /* Get the old TSS selector from the guest's task register */ @@ -818,13 +819,14 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) assert(ot_type == SDT_SYS386BSY || ot_type == SDT_SYS286BSY); /* Fetch the old TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc, + &fault); + CHKERR(error, fault); /* Get the old TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, - PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, ot_iov, &oldtss, minlimit + 1); /* @@ -834,8 +836,8 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) if (reason == TSR_IRET || reason == TSR_JMP) { ot_desc.sd_type &= ~0x2; error = desc_table_write(ctx, vcpu, &sup_paging, ot_sel, - &ot_desc); - CHKERR(error); + &ot_desc, &fault); + CHKERR(error, fault); } if (nt_type == SDT_SYS286BSY || nt_type == SDT_SYS286TSS) { @@ -853,8 +855,8 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) if (reason != TSR_IRET) { nt_desc.sd_type |= 0x2; error = desc_table_write(ctx, vcpu, &sup_paging, nt_sel, - &nt_desc); - CHKERR(error); + &nt_desc, &fault); + CHKERR(error, fault); } /* Update task register to point at the new TSS */ @@ -877,8 +879,9 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) assert(error == 0); /* Load processor state from new TSS */ - error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov); - CHKERR(error); + error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov, + &fault); + CHKERR(error, fault); /* * Section "Interrupt Tasks" in Intel SDM, Vol 3: if an exception @@ -889,8 +892,8 @@ vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) assert(task_switch->ext); assert(task_switch->reason == TSR_IDT_GATE); error = push_errcode(ctx, vcpu, &task_switch->paging, nt_type, - task_switch->errcode); - CHKERR(error); + task_switch->errcode, &fault); + CHKERR(error, fault); } /* diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index eb90b8ce441c0..7fa5cd3b7a9f3 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -287,10 +287,12 @@ msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" msg_swap_encrypt="Encrypt Swap?" msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot" +msg_swap_invalid="The selected swap size (%s) is invalid. Enter a number optionally followed by units. Example: 2G" msg_swap_mirror="Mirror Swap?" msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" +msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" @@ -1557,10 +1559,26 @@ while :; do ;; ?" $msg_swap_size") # Prompt the user to input/change the swap size for each disk - f_dialog_input input \ - "$msg_please_enter_amount_of_swap_space" \ - "$ZFSBOOT_SWAP_SIZE" && - ZFSBOOT_SWAP_SIZE="${input:-0}" + while :; do + f_dialog_input input \ + "$msg_please_enter_amount_of_swap_space" \ + "$ZFSBOOT_SWAP_SIZE" && + ZFSBOOT_SWAP_SIZE="${input:-0}" + if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize + then + if [ $swapsize -ne 0 -a $swapsize -lt 104857600 ]; then + f_show_err "$msg_swap_toosmall" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + else + break; + fi + else + f_show_err "$msg_swap_invalid" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + fi + done ;; ?" $msg_swap_mirror") # Toggle the variable referenced both by the menu and later diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h index b771834c18415..8bcf6e65387fe 100644 --- a/usr.sbin/ntp/config.h +++ b/usr.sbin/ntp/config.h @@ -1418,7 +1418,7 @@ #define PACKAGE_NAME "ntp" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "ntp 4.2.8p1" +#define PACKAGE_STRING "ntp 4.2.8p2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "ntp" @@ -1427,7 +1427,7 @@ #define PACKAGE_URL "http://www.ntp.org./" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.2.8p1" +#define PACKAGE_VERSION "4.2.8p2" /* data dir */ #define PERLLIBDIR "/usr/local/share/ntp/lib" @@ -1469,13 +1469,21 @@ /* #undef SCO5_CLOCK */ /* The size of `char*', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_CHARP 8 +#else +#define SIZEOF_CHARP 4 +#endif /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 @@ -1490,7 +1498,11 @@ #define SIZEOF_SIGNED_CHAR 1 /* The size of `time_t', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_TIME_T 8 +#else +#define SIZEOF_TIME_T 4 +#endif /* Does SIOCGIFCONF return size in the buffer? */ /* #undef SIZE_RETURNED_IN_BUFFER */ @@ -1516,7 +1528,15 @@ /* #undef STRERROR_R_CHAR_P */ /* canonical system (cpu-vendor-os) of where we should run */ -#define STR_SYSTEM "amd64-portbld-freebsd10.1" +#if defined(__alpha__) +#define STR_SYSTEM "alpha-undermydesk-freebsd" +#elif defined(__sparc64__) +#define STR_SYSTEM "sparc64-undermydesk-freebsd" +#elif defined(__amd64__) +#define STR_SYSTEM "amd64-undermydesk-freebsd" +#else +#define STR_SYSTEM "i386-undermydesk-freebsd" +#endif /* Does Xettimeofday take 1 arg? */ /* #undef SYSV_TIMEOFDAY */ @@ -1570,7 +1590,7 @@ typedef unsigned int uintptr_t; /* #undef USE_UDP_SIGPOLL */ /* Version number of package */ -#define VERSION "4.2.8p1" +#define VERSION "4.2.8p2" /* vsnprintf expands "%m" to strerror(errno) */ /* #undef VSNPRINTF_PERCENT_M */ diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver index bc0e935c52e9b..f34267d20efb6 100755 --- a/usr.sbin/ntp/scripts/mkver +++ b/usr.sbin/ntp/scripts/mkver @@ -6,7 +6,7 @@ PROG=${1-UNKNOWN} ConfStr="$PROG" -ConfStr="$ConfStr 4.2.8p1" +ConfStr="$ConfStr 4.2.8p2" case "$CSET" in '') ;; |
